mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge remote-tracking branch 'refs/remotes/origin/dev'
This commit is contained in:
commit
10f14aee8e
@ -23,6 +23,7 @@
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaImageCompareReporter.h"
|
||||
#include "RiaImageFileCompare.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaProjectModifier.h"
|
||||
#include "RiaSocketServer.h"
|
||||
@ -119,6 +120,7 @@
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
@ -337,10 +339,16 @@ bool RiaApplication::loadProject(const QString& projectFileName, ProjectLoadActi
|
||||
|
||||
closeProject();
|
||||
|
||||
RI_LOG_INFO_QSTR(QString("Starting to open project file : '%1'").arg(projectFileName));
|
||||
|
||||
// Open the project file and read the serialized data.
|
||||
// Will initialize itself.
|
||||
|
||||
if (!QFile::exists(projectFileName)) return false;
|
||||
if (!QFile::exists(projectFileName))
|
||||
{
|
||||
RI_LOG_ERROR_QSTR(QString("File does not exist : '%1'").arg(projectFileName));
|
||||
return false;
|
||||
}
|
||||
|
||||
m_project->fileName = projectFileName;
|
||||
m_project->readFile();
|
||||
@ -543,6 +551,8 @@ bool RiaApplication::loadProject(const QString& projectFileName, ProjectLoadActi
|
||||
// Execute command objects, and release the mutex when the queue is empty
|
||||
executeCommandObjects();
|
||||
|
||||
RI_LOG_INFO_QSTR(QString("Completed open of project file : '%1'").arg(projectFileName));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -600,12 +610,14 @@ void RiaApplication::loadAndUpdatePlotData()
|
||||
}
|
||||
}
|
||||
|
||||
plotProgress.setNextProgressIncrement(flowColl->plotCount());
|
||||
|
||||
if (flowColl)
|
||||
{
|
||||
flowColl->loadDataAndUpdate();
|
||||
|
||||
plotProgress.setNextProgressIncrement(flowColl->plotCount());
|
||||
}
|
||||
|
||||
plotProgress.incrementProgress();
|
||||
|
||||
}
|
||||
|
249
ApplicationCode/Application/RiaLogging.cpp
Normal file
249
ApplicationCode/Application/RiaLogging.cpp
Normal file
@ -0,0 +1,249 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4668)
|
||||
#include <windows.h>
|
||||
#pragma warning (pop)
|
||||
#else
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaDefaultConsoleLogger : public RiaLogger
|
||||
{
|
||||
public:
|
||||
RiaDefaultConsoleLogger();
|
||||
|
||||
virtual int level() const;
|
||||
virtual void setLevel(int logLevel);
|
||||
virtual void error( const char* message, const char* fileName, int lineNumber);
|
||||
virtual void warning(const char* message, const char* fileName, int lineNumber);
|
||||
virtual void info( const char* message, const char* fileName, int lineNumber);
|
||||
virtual void debug( const char* message, const char* fileName, int lineNumber);
|
||||
|
||||
private:
|
||||
static void writeMessageToConsole(const char* prefix, const char* message, const char* fileName, int lineNumber);
|
||||
static void writeToConsole(const std::string& str);
|
||||
|
||||
private:
|
||||
int m_logLevel;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefaultConsoleLogger::RiaDefaultConsoleLogger()
|
||||
: m_logLevel(RI_LL_WARNING)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiaDefaultConsoleLogger::level() const
|
||||
{
|
||||
return m_logLevel;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaDefaultConsoleLogger::setLevel(int logLevel)
|
||||
{
|
||||
m_logLevel = logLevel;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaDefaultConsoleLogger::error(const char* message, const char* fileName, int lineNumber)
|
||||
{
|
||||
writeMessageToConsole("ERROR: ", message, fileName, lineNumber);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaDefaultConsoleLogger::warning(const char* message, const char*, int)
|
||||
{
|
||||
writeMessageToConsole("warn: ", message, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaDefaultConsoleLogger::info(const char* message, const char*, int)
|
||||
{
|
||||
writeMessageToConsole("info: ", message, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaDefaultConsoleLogger::debug(const char* message, const char*, int)
|
||||
{
|
||||
writeMessageToConsole("debug: ", message, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaDefaultConsoleLogger::writeMessageToConsole(const char* prefix, const char* message, const char* fileName, int lineNumber)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
||||
// VF_ASSERT(prefix);
|
||||
oss << prefix;
|
||||
|
||||
if (message)
|
||||
{
|
||||
oss << message << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << "<no message>" << std::endl;
|
||||
}
|
||||
|
||||
if (fileName)
|
||||
{
|
||||
oss << " -file " << RiaLogger::shortFileName(fileName) << ", line " << lineNumber << std::endl;
|
||||
}
|
||||
|
||||
writeToConsole(oss.str());
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaDefaultConsoleLogger::writeToConsole(const std::string& str)
|
||||
{
|
||||
#ifdef WIN32
|
||||
AllocConsole();
|
||||
HANDLE hStdOutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (hStdOutputHandle)
|
||||
{
|
||||
DWORD stringLength = static_cast<DWORD>(str.length());
|
||||
|
||||
unsigned long iDum = 0;
|
||||
WriteConsoleA(hStdOutputHandle, str.c_str(), stringLength, &iDum, NULL);
|
||||
}
|
||||
#else
|
||||
fputs(str.c_str(), stderr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const char* RiaLogger::shortFileName(const char* fileName)
|
||||
{
|
||||
// VF_ASSERT(fileName);
|
||||
|
||||
const char* ptrToLastSlash = strrchr(fileName, '/');
|
||||
|
||||
#ifdef WIN32
|
||||
const char* ptrToLastBwdSlash = strrchr(fileName, '\\');
|
||||
if (ptrToLastBwdSlash > ptrToLastSlash)
|
||||
{
|
||||
ptrToLastSlash = ptrToLastBwdSlash;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ptrToLastSlash)
|
||||
{
|
||||
return ptrToLastSlash + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
RiaLogger* RiaLogging::sm_logger = new RiaDefaultConsoleLogger;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaLogger* RiaLogging::loggerInstance()
|
||||
{
|
||||
return sm_logger;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::setLoggerInstance(RiaLogger* loggerInstance)
|
||||
{
|
||||
// Only delete if we're currently using our own default impl
|
||||
if (dynamic_cast<RiaDefaultConsoleLogger*>(sm_logger))
|
||||
{
|
||||
delete sm_logger;
|
||||
}
|
||||
|
||||
// VF_ASSERT(loggerInstance);
|
||||
sm_logger = loggerInstance;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaLogging::deleteLoggerInstance()
|
||||
{
|
||||
delete sm_logger;
|
||||
sm_logger = NULL;
|
||||
}
|
||||
|
89
ApplicationCode/Application/RiaLogging.h
Normal file
89
ApplicationCode/Application/RiaLogging.h
Normal file
@ -0,0 +1,89 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
enum RILogLevel
|
||||
{
|
||||
RI_LL_ERROR = 1,
|
||||
RI_LL_WARNING = 2,
|
||||
RI_LL_INFO = 3,
|
||||
RI_LL_DEBUG = 4
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
// Logger interface for the application
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaLogger
|
||||
{
|
||||
public:
|
||||
virtual ~RiaLogger() {}
|
||||
|
||||
virtual int level() const = 0;
|
||||
virtual void setLevel(int logLevel) = 0;
|
||||
|
||||
virtual void error( const char* message, const char* fileName, int lineNumber) = 0;
|
||||
virtual void warning(const char* message, const char* fileName, int lineNumber) = 0;
|
||||
virtual void info( const char* message, const char* fileName, int lineNumber) = 0;
|
||||
virtual void debug( const char* message, const char* fileName, int lineNumber) = 0;
|
||||
|
||||
protected:
|
||||
static const char* shortFileName(const char* fileName);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaLogging
|
||||
{
|
||||
public:
|
||||
static RiaLogger* loggerInstance();
|
||||
static void setLoggerInstance(RiaLogger* loggerInstance);
|
||||
static void deleteLoggerInstance();
|
||||
|
||||
private:
|
||||
static RiaLogger* sm_logger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Helper macros for writing log messages
|
||||
#define RI_LOG_ERROR_2(theLogger, theMessage) if ((theLogger)->level() >= RI_LL_ERROR) { (theLogger)->error((theMessage), __FILE__, __LINE__); }
|
||||
#define RI_LOG_WARNING_2(theLogger, theMessage) if ((theLogger)->level() >= RI_LL_WARNING) { (theLogger)->warning((theMessage), __FILE__, __LINE__); }
|
||||
#define RI_LOG_INFO_2(theLogger, theMessage) if ((theLogger)->level() >= RI_LL_INFO) { (theLogger)->info((theMessage), __FILE__, __LINE__); }
|
||||
#define RI_LOG_DEBUG_2(theLogger, theMessage) if ((theLogger)->level() >= RI_LL_DEBUG) { (theLogger)->debug((theMessage), __FILE__, __LINE__); }
|
||||
|
||||
#define RI_LOG_ERROR(theMessage) RI_LOG_ERROR_2( RiaLogging::loggerInstance(), theMessage)
|
||||
#define RI_LOG_ERROR_QSTR(theMessage) RI_LOG_ERROR_2( RiaLogging::loggerInstance(), (theMessage).toLatin1().constData())
|
||||
#define RI_LOG_WARNING(theMessage) RI_LOG_WARNING_2( RiaLogging::loggerInstance(), theMessage)
|
||||
#define RI_LOG_WARNING_QSTR(theMessage) RI_LOG_WARNING_2( RiaLogging::loggerInstance(), (theMessage).toLatin1().constData())
|
||||
#define RI_LOG_INFO(theMessage) RI_LOG_INFO_2( RiaLogging::loggerInstance(), theMessage)
|
||||
#define RI_LOG_INFO_QSTR(theMessage) RI_LOG_INFO_2( RiaLogging::loggerInstance(), (theMessage).toLatin1().constData())
|
||||
#define RI_LOG_DEBUG(theMessage) RI_LOG_DEBUG_2( RiaLogging::loggerInstance(), theMessage)
|
||||
#define RI_LOG_DEBUG_QSTR(theMessage) RI_LOG_DEBUG_2( RiaLogging::loggerInstance(), (theMessage).toLatin1().constData())
|
@ -80,6 +80,8 @@ set( APPLICATION_FILES
|
||||
Application/RiaProjectModifier.cpp
|
||||
Application/RiaRegressionTest.cpp
|
||||
Application/RiaColorTables.cpp
|
||||
Application/RiaLogging.h
|
||||
Application/RiaLogging.cpp
|
||||
)
|
||||
|
||||
set( SOCKET_INTERFACE_FILES
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "RimCaseCollection.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimMimeData.h"
|
||||
#include "RimOilField.h"
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "RimCaseCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
|
@ -19,13 +19,16 @@
|
||||
|
||||
#include "RicExportToLasFileFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RicExportToLasFileResampleUi.h"
|
||||
#include "RigLasFileExporter.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigLasFileExporter.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
|
@ -45,7 +45,7 @@ bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot = NULL;
|
||||
selection[0]->firstAncestorOrThisOfType(wellLogPlot);
|
||||
if (wellLogPlot->trackCount() > 1)
|
||||
if (wellLogPlot && wellLogPlot->trackCount() > 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -22,6 +22,10 @@
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimView.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
@ -29,9 +33,8 @@
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
|
@ -56,9 +56,11 @@
|
||||
#include "cvfShaderSourceProvider.h"
|
||||
#include "cvfShaderSourceRepository.h"
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfTransform.h"
|
||||
#include "cvfUniform.h"
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -29,10 +29,13 @@
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFault.h"
|
||||
#include "RimFaultCollection.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
|
||||
#include "RivFaultGeometryGenerator.h"
|
||||
#include "RivNNCGeometryGenerator.h"
|
||||
#include "RivPartPriority.h"
|
||||
#include "RivResultToTextureMapper.h"
|
||||
#include "RivScalarMapperUtils.h"
|
||||
|
@ -18,15 +18,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfArray.h"
|
||||
|
||||
#include "RigGridBase.h"
|
||||
#include "RimFault.h"
|
||||
#include "RivFaultGeometryGenerator.h"
|
||||
#include "cvfColor4.h"
|
||||
#include "RivNNCGeometryGenerator.h"
|
||||
#include "cvfEffect.h"
|
||||
#include "cafEffectGenerator.h"
|
||||
|
||||
namespace cvf
|
||||
@ -40,6 +36,12 @@ namespace cvf
|
||||
class RimEclipseCellColors;
|
||||
class RimCellEdgeColors;
|
||||
class RimFaultCollection;
|
||||
class RigGridBase;
|
||||
class RimFaultCollection;
|
||||
class RimFault;
|
||||
class RivFaultGeometryGenerator;
|
||||
class RivNNCGeometryGenerator;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
@ -54,17 +54,19 @@
|
||||
#include "cvfMath.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfRenderState_FF.h"
|
||||
#include "cvfRenderStateBlending.h"
|
||||
#include "cvfRenderStatePolygonOffset.h"
|
||||
#include "cvfRenderState_FF.h"
|
||||
#include "cvfShaderProgram.h"
|
||||
#include "cvfShaderProgramGenerator.h"
|
||||
#include "cvfShaderSourceProvider.h"
|
||||
#include "cvfShaderSourceRepository.h"
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfTransform.h"
|
||||
#include "cvfUniform.h"
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseFaultColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFault.h"
|
||||
#include "RimFaultCollection.h"
|
||||
|
||||
#include "RivFaultPartMgr.h"
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmFieldCvfMat4d.h"
|
||||
|
||||
#include "cvfTransform.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -18,11 +18,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Transform;
|
||||
|
@ -903,7 +903,7 @@ void RivReservoirViewPartMgr::updateFaultCellEdgeResultColor(RivCellSetEnum geom
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::cref<cvf::UByteArray> RivReservoirViewPartMgr::cellVisibility(RivCellSetEnum geometryType, size_t gridIndex, size_t timeStepIndex) const
|
||||
const cvf::UByteArray* RivReservoirViewPartMgr::cellVisibility(RivCellSetEnum geometryType, size_t gridIndex, size_t timeStepIndex) const
|
||||
{
|
||||
RivReservoirPartMgr * pmgr = (const_cast<RivReservoirViewPartMgr*>(this))->reservoirPartManager( geometryType, timeStepIndex );
|
||||
return pmgr->cellVisibility(gridIndex).p();
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
|
||||
void clearGeometryCache();
|
||||
void scheduleGeometryRegen(RivCellSetEnum geometryType);
|
||||
cvf::cref<cvf::UByteArray> cellVisibility(RivCellSetEnum geometryType, size_t gridIndex, size_t frameIndex) const;
|
||||
const cvf::UByteArray* cellVisibility(RivCellSetEnum geometryType, size_t gridIndex, size_t frameIndex) const;
|
||||
|
||||
void appendStaticGeometryPartsToModel (cvf::ModelBasicList* model, RivCellSetEnum geometryType, const std::vector<size_t>& gridIndices);
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex, const std::vector<size_t>& gridIndices);
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmFieldCvfMat4d.h"
|
||||
|
@ -18,10 +18,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfVector3.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
@ -46,6 +47,7 @@
|
||||
#include "cvfGeometryBuilderFaceList.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfTransform.h"
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
|
@ -18,14 +18,17 @@
|
||||
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
|
||||
#include "qwt_plot.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
|
||||
|
||||
|
@ -295,7 +295,7 @@ bool RimCellRangeFilter::isRangeFilterControlled()
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
bool isRangeFilterControlled = false;
|
||||
if (rimView->viewController() && rimView->viewController()->isRangeFiltersControlled())
|
||||
if (rimView && rimView->viewController() && rimView->viewController()->isRangeFiltersControlled())
|
||||
{
|
||||
isRangeFilterControlled = true;
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimCellRangeFilter.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
@ -147,6 +148,7 @@ void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews(RimCellRa
|
||||
{
|
||||
RimView* view = NULL;
|
||||
firstAncestorOrThisOfType(view);
|
||||
if (!view) return;
|
||||
|
||||
if (view->isMasterView())
|
||||
{
|
||||
|
@ -18,14 +18,22 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimCellRangeFilter.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
class RigActiveCellInfo;
|
||||
class RigFemPartCollection;
|
||||
class RigGridBase;
|
||||
class RimView;
|
||||
class RimCellRangeFilter;
|
||||
class RimEclipseView;
|
||||
class RigMainGrid;
|
||||
|
||||
namespace cvf {
|
||||
class CellRangeFilter;
|
||||
class StructGridInterface;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
@ -20,19 +20,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
class QString;
|
||||
|
||||
@ -41,6 +39,7 @@ class RigGridBase;
|
||||
class RimCaseCollection;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimReservoirCellResultsStorage;
|
||||
class RimEclipseView;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@ -68,8 +67,8 @@ public:
|
||||
bool openReserviorCase();
|
||||
virtual bool openEclipseGridFile() = 0;
|
||||
|
||||
RigEclipseCaseData* reservoirData();
|
||||
const RigEclipseCaseData* reservoirData() const;
|
||||
RigEclipseCaseData* reservoirData();
|
||||
const RigEclipseCaseData* reservoirData() const;
|
||||
|
||||
RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel);
|
||||
|
||||
@ -107,7 +106,7 @@ protected:
|
||||
void setReservoirData(RigEclipseCaseData* eclipseCase);
|
||||
|
||||
private:
|
||||
cvf::ref<RigEclipseCaseData> m_rigEclipseCase;
|
||||
cvf::ref<RigEclipseCaseData> m_rigEclipseCase;
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RimReservoirCellResultsStorage*> m_matrixModelResults;
|
||||
|
@ -242,10 +242,14 @@ bool RimEclipsePropertyFilter::isPropertyFilterControlled()
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
bool isPropertyFilterControlled = false;
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
|
||||
if (rimView)
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isPropertyFilterControlled;
|
||||
|
@ -142,11 +142,14 @@ void RimEclipsePropertyFilterCollection::updateIconState()
|
||||
|
||||
RimEclipseView* view = NULL;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
RimViewController* viewController = view->viewController();
|
||||
if (viewController && (viewController->isPropertyFilterOveridden()
|
||||
|| viewController->isVisibleCellsOveridden()))
|
||||
if (view)
|
||||
{
|
||||
activeIcon = false;
|
||||
RimViewController* viewController = view->viewController();
|
||||
if (viewController && (viewController->isPropertyFilterOveridden()
|
||||
|| viewController->isVisibleCellsOveridden()))
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
|
@ -593,10 +593,14 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
|
||||
{
|
||||
CVF_ASSERT(m_resultType() == RimDefines::FLOW_DIAGNOSTICS);
|
||||
|
||||
size_t timeStep = 0;
|
||||
|
||||
RimView* rimView = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
|
||||
size_t timeStep = rimView->currentTimeStep();
|
||||
if (rimView)
|
||||
{
|
||||
timeStep = rimView->currentTimeStep();
|
||||
}
|
||||
|
||||
std::set<std::string> selTracerNames;
|
||||
if (m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION)
|
||||
|
@ -20,14 +20,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimDefines.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafAppEnum.h"
|
||||
#include "cvfCollection.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimDefines.h"
|
||||
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimEclipseResultDefinition;
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimStimPlanColors.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
#include "RimViewController.h"
|
||||
@ -63,6 +64,7 @@
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "RivReservoirPipesPartMgr.h"
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
#include "RivReservoirWellSpheresPartMgr.h"
|
||||
#include "RivSingleCellPartGenerator.h"
|
||||
#include "RivTernarySaturationOverlayItem.h"
|
||||
@ -1186,6 +1188,14 @@ void RimEclipseView::syncronizeWellsWithResults()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RivReservoirViewPartMgr* RimEclipseView::reservoirGridPartManager() const
|
||||
{
|
||||
return m_reservoirGridPartManager.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1317,6 +1327,14 @@ void RimEclipseView::updateDisplayModelForWellResults()
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RivCellSetEnum>& RimEclipseView::visibleGridParts() const
|
||||
{
|
||||
return m_visibleGridParts;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1565,7 +1583,7 @@ void RimEclipseView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalV
|
||||
|
||||
for (size_t gpIdx = 0; gpIdx < m_visibleGridParts.size(); ++gpIdx)
|
||||
{
|
||||
cvf::cref<cvf::UByteArray> visibility = m_reservoirGridPartManager->cellVisibility(m_visibleGridParts[gpIdx], gridIdx, m_currentTimeStep);
|
||||
const cvf::UByteArray* visibility = m_reservoirGridPartManager->cellVisibility(m_visibleGridParts[gpIdx], gridIdx, m_currentTimeStep);
|
||||
|
||||
for (int lcIdx = 0; lcIdx < gridCellCount; ++ lcIdx)
|
||||
{
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmFieldCvfMat4d.h"
|
||||
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
#include "RimView.h"
|
||||
|
||||
class RigActiveCellInfo;
|
||||
@ -60,6 +59,8 @@ class RiuViewer;
|
||||
class RivIntersectionPartMgr;
|
||||
class RivReservoirPipesPartMgr;
|
||||
class RivReservoirWellSpheresPartMgr;
|
||||
class RivIntersectionPartMgr;
|
||||
class RivReservoirViewPartMgr;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@ -133,8 +134,8 @@ public:
|
||||
void schedulePipeGeometryRegen();
|
||||
void updateDisplayModelForWellResults();
|
||||
|
||||
const std::vector<RivCellSetEnum>& visibleGridParts() const { return m_visibleGridParts;}
|
||||
cvf::cref<RivReservoirViewPartMgr> reservoirGridPartManager() const { return m_reservoirGridPartManager.p(); }
|
||||
const std::vector<RivCellSetEnum>& visibleGridParts() const;
|
||||
const RivReservoirViewPartMgr* reservoirGridPartManager() const;
|
||||
|
||||
// Does this belong here, really ?
|
||||
void calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleCells, RigGridBase * grid);
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cvfMath.h"
|
||||
@ -188,7 +190,7 @@ bool RimEclipseWell::intersectsWellCellsFilteredCells(const RigWellResultFrame &
|
||||
if (!reservoirView) return false;
|
||||
|
||||
const std::vector<RivCellSetEnum>& visGridParts = reservoirView->visibleGridParts();
|
||||
cvf::cref<RivReservoirViewPartMgr> rvMan = reservoirView->reservoirGridPartManager();
|
||||
const RivReservoirViewPartMgr* rvMan = reservoirView->reservoirGridPartManager();
|
||||
|
||||
|
||||
for (const RivCellSetEnum& visGridPart : visGridParts)
|
||||
@ -211,7 +213,7 @@ bool RimEclipseWell::intersectsWellCellsFilteredCells(const RigWellResultFrame &
|
||||
|
||||
if (gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
cvf::cref<cvf::UByteArray> cellVisibility = rvMan->cellVisibility(visGridPart, gridIndex, frameIndex);
|
||||
const cvf::UByteArray* cellVisibility = rvMan->cellVisibility(visGridPart, gridIndex, frameIndex);
|
||||
if (gridCellIndex < cellVisibility->size() && (*cellVisibility)[gridCellIndex])
|
||||
{
|
||||
return true;
|
||||
@ -231,7 +233,7 @@ bool RimEclipseWell::intersectsWellCellsFilteredCells(const RigWellResultFrame &
|
||||
gridIndex = wellResultPoint.m_gridIndex;
|
||||
gridCellIndex = wellResultPoint.m_gridCellIndex;
|
||||
|
||||
cvf::cref<cvf::UByteArray> cellVisibility = rvMan->cellVisibility(visGridPart, gridIndex, frameIndex);
|
||||
const cvf::UByteArray* cellVisibility = rvMan->cellVisibility(visGridPart, gridIndex, frameIndex);
|
||||
if (gridCellIndex < cellVisibility->size() && (*cellVisibility)[gridCellIndex])
|
||||
{
|
||||
return true;
|
||||
|
@ -27,11 +27,15 @@
|
||||
#include "cafPdmChildField.h"
|
||||
|
||||
// Include to make Pdm work for cvf::Color
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
class RigSingleWellResultsData;
|
||||
class RigWellResultFrame;
|
||||
struct RigWellResultPoint;
|
||||
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
class RimSimWellFractureCollection;
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimDefines.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFault.h"
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
@ -55,14 +55,17 @@ void RimGeoMechCellColors::updateIconState()
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
RimViewController* viewController = rimView->viewController();
|
||||
if (viewController && viewController->isResultColorControlled())
|
||||
if (rimView)
|
||||
{
|
||||
updateUiIconFromState(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
updateUiIconFromState(true);
|
||||
RimViewController* viewController = rimView->viewController();
|
||||
if (viewController && viewController->isResultColorControlled())
|
||||
{
|
||||
updateUiIconFromState(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
updateUiIconFromState(true);
|
||||
}
|
||||
}
|
||||
|
||||
uiCapability()->updateConnectedEditors();
|
||||
|
@ -190,15 +190,18 @@ void RimGeoMechPropertyFilter::updateReadOnlyStateOfAllFields()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechPropertyFilter::isPropertyFilterControlled()
|
||||
{
|
||||
bool isPropertyFilterControlled = false;
|
||||
|
||||
RimView* rimView = NULL;
|
||||
firstAncestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
bool isPropertyFilterControlled = false;
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
if (rimView)
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isPropertyFilterControlled;
|
||||
|
@ -144,11 +144,14 @@ void RimGeoMechPropertyFilterCollection::updateIconState()
|
||||
|
||||
RimGeoMechView* view = NULL;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
RimViewController* viewController = view->viewController();
|
||||
if (viewController && ( viewController->isPropertyFilterOveridden()
|
||||
|| viewController->isVisibleCellsOveridden()))
|
||||
if (view)
|
||||
{
|
||||
activeIcon = false;
|
||||
RimViewController* viewController = view->viewController();
|
||||
if (viewController && ( viewController->isPropertyFilterOveridden()
|
||||
|| viewController->isVisibleCellsOveridden()))
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfScene.h"
|
||||
#include "cvfTransform.h"
|
||||
#include "cvfViewport.h"
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigSimulationWellCenterLineCalculator.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
@ -42,6 +43,7 @@
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
#include "cvfPlane.h"
|
||||
|
||||
|
||||
namespace caf {
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "RigCell.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimCellRangeFilter.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
|
@ -19,8 +19,9 @@
|
||||
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
|
@ -20,7 +20,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "RimPlotCurve.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "cvfObject.h"
|
||||
|
||||
class RigWellLogCurveData;
|
||||
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigGeoMechWellLogExtractor.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
|
@ -19,14 +19,16 @@
|
||||
|
||||
#include "RimWellLogFileCurve.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimOilField.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RiuWellLogTrack.h"
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
@ -80,7 +82,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate()
|
||||
firstAncestorOrThisOfType(wellLogPlot);
|
||||
CVF_ASSERT(wellLogPlot);
|
||||
|
||||
if (wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
|
||||
if (wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
|
||||
{
|
||||
if (RiaApplication::instance()->preferences()->showLasCurveWithoutTvdWarning())
|
||||
{
|
||||
|
@ -20,13 +20,15 @@
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RigStatisticsCalculator.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
|
||||
#include "RiuWellLogTrack.h"
|
||||
#include "RiuWellLogPlot.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuWellLogPlot.h"
|
||||
#include "RiuWellLogTrack.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
#include "cvfMath.h"
|
||||
@ -34,7 +36,6 @@
|
||||
#include "qwt_scale_engine.h"
|
||||
|
||||
#include <math.h>
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
|
||||
#define RI_LOGPLOTTRACK_MINX_DEFAULT -10.0
|
||||
#define RI_LOGPLOTTRACK_MAXX_DEFAULT 100.0
|
||||
|
@ -22,12 +22,15 @@
|
||||
|
||||
#include "RifJsonEncodeDecode.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
@ -159,6 +162,14 @@ void RimWellPath::setSurveyType(QString surveyType)
|
||||
wellPathColor = cvf::Color3f(0.0f, 0.333f, 0.999f);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWellPath* RimWellPath::wellPathGeometry()
|
||||
{
|
||||
return m_wellPath.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -222,6 +233,14 @@ bool RimWellPath::readWellPathFile(QString* errorMessage, RifWellPathAsciiFileRe
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::setWellPathGeometry(RigWellPath* wellPathModel)
|
||||
{
|
||||
m_wellPath = wellPathModel;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Read JSON file containing well path data
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,9 +20,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
@ -32,10 +29,14 @@
|
||||
// Include to make Pdm work for cvf::Color
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
#include "cvfObject.h"
|
||||
|
||||
class RifWellPathAsciiFileReader;
|
||||
class RigWellPath;
|
||||
class RimProject;
|
||||
class RivWellPathPartMgr;
|
||||
class RimWellLogFile;
|
||||
class RivWellPathPartMgr;
|
||||
|
||||
class RimWellPathFractureCollection;
|
||||
|
||||
//==================================================================================================
|
||||
@ -70,10 +71,11 @@ public:
|
||||
|
||||
caf::PdmChildField<RimWellLogFile*> m_wellLogFile;
|
||||
|
||||
RigWellPath* wellPathGeometry();
|
||||
caf::PdmChildField<RimWellPathFractureCollection*> fractureCollection;
|
||||
|
||||
|
||||
RigWellPath* wellPathGeometry() { return m_wellPath.p(); }
|
||||
|
||||
RivWellPathPartMgr* partMgr();
|
||||
|
||||
bool readWellPathFile(QString * errorMessage, RifWellPathAsciiFileReader* asciiReader);
|
||||
@ -84,7 +86,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
void setWellPathGeometry(RigWellPath* wellPathModel) { m_wellPath = wellPathModel; }
|
||||
void setWellPathGeometry(RigWellPath* wellPathModel);
|
||||
void readJsonWellPathFile();
|
||||
void readAsciiWellPathFile(RifWellPathAsciiFileReader* asciiReader);
|
||||
QString surveyType() { return m_surveyType; }
|
||||
|
@ -23,13 +23,16 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RivWellPathCollectionPartMgr.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RivWellPathCollectionPartMgr.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
|
@ -16,14 +16,17 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "RimPlotCurve.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include <set>
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RimPlotCurve.h"
|
||||
|
||||
class RimSummaryCurve;
|
||||
class RimSummaryCase;
|
||||
class RifEclipseSummaryAddress;
|
||||
|
||||
class RimSummaryCurveAppearanceCalculator
|
||||
{
|
||||
|
@ -435,7 +435,10 @@ void RimSummaryCurveFilter::updatePlotAxisForCurves()
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfType(plot);
|
||||
plot->updateAxes();
|
||||
if (plot)
|
||||
{
|
||||
plot->updateAxes();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmPtrArrayField.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "RimDefines.h"
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
|
||||
|
@ -311,6 +311,7 @@ void RimSummaryTimeAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* c
|
||||
{
|
||||
RimSummaryPlot* rimSummaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimSummaryPlot);
|
||||
if (!rimSummaryPlot) return;
|
||||
|
||||
if (changedField == &m_visibleDateRangeMax)
|
||||
{
|
||||
|
@ -155,33 +155,37 @@ bool RimSummaryYAxisProperties::isActive() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryYAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
RimSummaryPlot* rimSummaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimSummaryPlot);
|
||||
|
||||
if (changedField == &isAutoTitle)
|
||||
{
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
else if (changedField == &visibleRangeMax)
|
||||
{
|
||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMax = oldValue.toDouble();
|
||||
|
||||
rimSummaryPlot->disableAutoZoom();
|
||||
}
|
||||
else if (changedField == &visibleRangeMin)
|
||||
{
|
||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMin = oldValue.toDouble();
|
||||
|
||||
rimSummaryPlot->disableAutoZoom();
|
||||
}
|
||||
|
||||
if (changedField == &isLogarithmicScaleEnabled)
|
||||
RimSummaryPlot* rimSummaryPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimSummaryPlot);
|
||||
if (rimSummaryPlot)
|
||||
{
|
||||
rimSummaryPlot->loadDataAndUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
rimSummaryPlot->updateAxes();
|
||||
if (changedField == &visibleRangeMax)
|
||||
{
|
||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMax = oldValue.toDouble();
|
||||
|
||||
rimSummaryPlot->disableAutoZoom();
|
||||
}
|
||||
else if (changedField == &visibleRangeMin)
|
||||
{
|
||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMin = oldValue.toDouble();
|
||||
|
||||
rimSummaryPlot->disableAutoZoom();
|
||||
}
|
||||
|
||||
if (changedField == &isLogarithmicScaleEnabled)
|
||||
{
|
||||
rimSummaryPlot->loadDataAndUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
rimSummaryPlot->updateAxes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#include "RigWellLogFile.h"
|
||||
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "well.hpp"
|
||||
|
@ -17,10 +17,15 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuMessagePanel.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
|
||||
|
||||
RiaApplication app(argc, argv);
|
||||
|
||||
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
|
||||
@ -39,11 +44,19 @@ int main(int argc, char *argv[])
|
||||
window.loadWinGeoAndDockToolBarLayout();
|
||||
window.showWindow();
|
||||
|
||||
RiaLogging::setLoggerInstance(new RiuMessagePanelLogger(window.messagePanel()));
|
||||
RiaLogging::loggerInstance()->setLevel(RI_LL_DEBUG);
|
||||
|
||||
if (app.parseArguments())
|
||||
{
|
||||
return app.exec();
|
||||
int exitCode = app.exec();
|
||||
RiaLogging::deleteLoggerInstance();
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
RiaLogging::deleteLoggerInstance();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -31,12 +31,12 @@
|
||||
#include "RigResultModifier.h"
|
||||
#include "RigResultModifierFactory.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseInputProperty.h"
|
||||
#include "RimEclipseInputPropertyCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
@ -40,6 +40,7 @@ ${CEE_CURRENT_LIST_DIR}RiuFemTimeHistoryResultAccessor.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuNightchartsWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuMessagePanel.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -78,6 +79,7 @@ ${CEE_CURRENT_LIST_DIR}RiuFemTimeHistoryResultAccessor.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuNightchartsWidget.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuMessagePanel.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
@ -106,6 +108,7 @@ ${CEE_CURRENT_LIST_DIR}RiuQwtScalePicker.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuNightchartsWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuMessagePanel.h
|
||||
)
|
||||
|
||||
list(APPEND QT_UI_FILES
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#include "RiuDragDrop.h"
|
||||
#include "RiuMdiSubWindow.h"
|
||||
#include "RiuMessagePanel.h"
|
||||
#include "RiuProcessMonitor.h"
|
||||
#include "RiuProjectPropertyView.h"
|
||||
#include "RiuPropertyViewTabWidget.h"
|
||||
@ -587,6 +588,15 @@ void RiuMainWindow::createDockPanels()
|
||||
addDockWidget(Qt::BottomDockWidgetArea, dockPanel);
|
||||
}
|
||||
|
||||
{
|
||||
QDockWidget* dockWidget = new QDockWidget("Messages", this);
|
||||
dockWidget->setObjectName("dockMessages");
|
||||
m_messagePanel = new RiuMessagePanel(dockWidget);
|
||||
dockWidget->setWidget(m_messagePanel);
|
||||
addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
|
||||
dockWidget->hide();
|
||||
}
|
||||
|
||||
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
||||
setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
|
||||
}
|
||||
@ -801,6 +811,14 @@ RiuResultQwtPlot* RiuMainWindow::resultPlot()
|
||||
return m_resultQwtPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMessagePanel* RiuMainWindow::messagePanel()
|
||||
{
|
||||
return m_messagePanel;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -37,17 +37,20 @@ class QSpinBox;
|
||||
class QUndoView;
|
||||
|
||||
class RimCase;
|
||||
|
||||
class RiuMessagePanel;
|
||||
class RiuProcessMonitor;
|
||||
class RiuResultInfoPanel;
|
||||
class RiuViewer;
|
||||
class RiuResultQwtPlot;
|
||||
class RiuViewer;
|
||||
|
||||
struct RimMdiWindowGeometry;
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmUiTreeView;
|
||||
class AnimationToolBar;
|
||||
class PdmObject;
|
||||
class PdmObject;
|
||||
class PdmUiPropertyView;
|
||||
class PdmUiItem;
|
||||
}
|
||||
@ -109,7 +112,8 @@ public:
|
||||
QMdiSubWindow* findMdiSubWindow(QWidget* viewer);
|
||||
QList<QMdiSubWindow*> subWindowList(QMdiArea::WindowOrder order);
|
||||
|
||||
RiuResultQwtPlot* resultPlot();
|
||||
RiuResultQwtPlot* resultPlot();
|
||||
RiuMessagePanel* messagePanel();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent* event);
|
||||
@ -158,6 +162,7 @@ private:
|
||||
RiuViewer* m_mainViewer;
|
||||
RiuResultInfoPanel* m_resultInfoPanel;
|
||||
RiuProcessMonitor* m_processMonitor;
|
||||
QPointer<RiuMessagePanel> m_messagePanel;
|
||||
|
||||
RiuResultQwtPlot* m_resultQwtPlot;
|
||||
|
||||
|
213
ApplicationCode/UserInterface/RiuMessagePanel.cpp
Normal file
213
ApplicationCode/UserInterface/RiuMessagePanel.cpp
Normal file
@ -0,0 +1,213 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuMessagePanel.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QMenu>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMessagePanel::RiuMessagePanel(QDockWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
|
||||
m_textEdit = new QPlainTextEdit;
|
||||
m_textEdit->setReadOnly(true);
|
||||
m_textEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
|
||||
m_textEdit->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
connect(m_textEdit, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(slotShowContextMenu(const QPoint&)));
|
||||
|
||||
layout->addWidget(m_textEdit);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanel::addMessage(RILogLevel messageLevel, const QString& msg, const QString& srcInfo)
|
||||
{
|
||||
QColor clr(Qt::black);
|
||||
if (messageLevel == RI_LL_ERROR) clr = Qt::red;
|
||||
else if (messageLevel == RI_LL_WARNING) clr = QColor(220,100,10);
|
||||
else if (messageLevel == RI_LL_DEBUG) clr = QColor(100,100,200);
|
||||
|
||||
QTextCharFormat form = m_textEdit->currentCharFormat();
|
||||
form.setForeground(clr);
|
||||
form.setFontWeight(messageLevel == RI_LL_ERROR ? QFont::DemiBold : QFont::Normal);
|
||||
form.setFontItalic(messageLevel == RI_LL_DEBUG ? true : false);
|
||||
m_textEdit->setCurrentCharFormat(form);
|
||||
m_textEdit->appendPlainText(msg);
|
||||
|
||||
if (!srcInfo.isEmpty())
|
||||
{
|
||||
form.setForeground(clr);
|
||||
form.setFontWeight(QFont::Normal);
|
||||
form.setFontItalic(true);
|
||||
m_textEdit->setCurrentCharFormat(form);
|
||||
m_textEdit->appendPlainText(" " + srcInfo);
|
||||
}
|
||||
|
||||
m_textEdit->moveCursor(QTextCursor::End);
|
||||
m_textEdit->ensureCursorVisible();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuMessagePanel::sizeHint() const
|
||||
{
|
||||
return QSize(20, 20);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanel::slotShowContextMenu(const QPoint& pos)
|
||||
{
|
||||
QMenu* menu = m_textEdit->createStandardContextMenu();
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addAction("Clear All &Messages", this, SLOT(slotClearMessages()));
|
||||
|
||||
menu->exec(m_textEdit->mapToGlobal(pos));
|
||||
|
||||
delete menu;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanel::slotClearMessages()
|
||||
{
|
||||
m_textEdit->clear();
|
||||
RI_LOG_INFO("Message window cleared.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMessagePanelLogger::RiuMessagePanelLogger(RiuMessagePanel* messagePanel)
|
||||
: m_messagePanel(messagePanel),
|
||||
m_logLevel(RI_LL_WARNING)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiuMessagePanelLogger::level() const
|
||||
{
|
||||
return m_logLevel;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanelLogger::setLevel(int logLevel)
|
||||
{
|
||||
m_logLevel = logLevel;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanelLogger::error(const char* message, const char* fileName, int lineNumber)
|
||||
{
|
||||
writeToMessagePanel(RI_LL_ERROR, message, fileName, lineNumber);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanelLogger::warning(const char* message, const char* fileName, int lineNumber)
|
||||
{
|
||||
writeToMessagePanel(RI_LL_WARNING, message, fileName, lineNumber);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanelLogger::info(const char* message, const char* fileName, int lineNumber)
|
||||
{
|
||||
writeToMessagePanel(RI_LL_INFO, message, fileName, lineNumber);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanelLogger::debug(const char* message, const char* fileName, int lineNumber)
|
||||
{
|
||||
writeToMessagePanel(RI_LL_DEBUG, message, fileName, lineNumber);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanelLogger::writeToMessagePanel(RILogLevel messageLevel, const char* message, const char* fileName, int lineNumber)
|
||||
{
|
||||
if (messageLevel > m_logLevel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_messagePanel)
|
||||
{
|
||||
QString codeLocation;
|
||||
if (messageLevel == RI_LL_ERROR)
|
||||
{
|
||||
codeLocation = QString("(file %1, line %2)").arg(RiaLogger::shortFileName(fileName)).arg(lineNumber);
|
||||
}
|
||||
|
||||
m_messagePanel->addMessage(messageLevel, message, codeLocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
80
ApplicationCode/UserInterface/RiuMessagePanel.h
Normal file
80
ApplicationCode/UserInterface/RiuMessagePanel.h
Normal file
@ -0,0 +1,80 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
class QDockWidget;
|
||||
class QPlainTextEdit;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuMessagePanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RiuMessagePanel(QDockWidget* parent);
|
||||
|
||||
void addMessage(RILogLevel messageLevel, const QString& msg, const QString& srcInfo);
|
||||
virtual QSize sizeHint () const;
|
||||
|
||||
private slots:
|
||||
void slotShowContextMenu(const QPoint& pos);
|
||||
void slotClearMessages();
|
||||
|
||||
private:
|
||||
QPointer<QPlainTextEdit> m_textEdit;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuMessagePanelLogger : public RiaLogger
|
||||
{
|
||||
public:
|
||||
RiuMessagePanelLogger(RiuMessagePanel* messagePanel);
|
||||
|
||||
virtual int level() const override;
|
||||
virtual void setLevel(int logLevel) override;
|
||||
|
||||
virtual void error( const char* message, const char* fileName, int lineNumber) override;
|
||||
virtual void warning(const char* message, const char* fileName, int lineNumber) override;
|
||||
virtual void info( const char* message, const char* fileName, int lineNumber) override;
|
||||
virtual void debug( const char* message, const char* fileName, int lineNumber) override;
|
||||
|
||||
private:
|
||||
void writeToMessagePanel(RILogLevel messageLevel, const char* message, const char* fileName, int lineNumber);
|
||||
|
||||
private:
|
||||
QPointer<RiuMessagePanel> m_messagePanel;
|
||||
int m_logLevel;
|
||||
};
|
||||
|
@ -78,6 +78,7 @@
|
||||
#include "cvfOverlayAxisCross.h"
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfTransform.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
|
@ -20,10 +20,9 @@
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
#include "RimOilFieldEntry.h"
|
||||
|
||||
|
||||
class RimOilFieldEntry;
|
||||
|
||||
|
||||
class RimOilRegionEntry : public caf::PdmObject
|
||||
|
@ -17,6 +17,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellPathImport.h"
|
||||
|
||||
#include "RimOilFieldEntry.h"
|
||||
#include "RimOilRegionEntry.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
@ -21,9 +21,9 @@
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafAppEnum.h"
|
||||
#include "RimOilRegionEntry.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
class RimOilRegionEntry;
|
||||
|
||||
|
||||
class RimWellPathImport : public caf::PdmObject
|
||||
|
@ -19,6 +19,9 @@
|
||||
#include "RiuWellImportWizard.h"
|
||||
|
||||
#include "RifJsonEncodeDecode.h"
|
||||
|
||||
#include "RimOilFieldEntry.h"
|
||||
#include "RimOilRegionEntry.h"
|
||||
#include "RimWellPathImport.h"
|
||||
|
||||
#include "cafPdmDocument.h"
|
||||
|
60
doc/rim_rig_relationships.plantuml
Normal file
60
doc/rim_rig_relationships.plantuml
Normal file
@ -0,0 +1,60 @@
|
||||
@startuml
|
||||
left to right direction
|
||||
RimCase <|-- RimEclipseCase
|
||||
RimCase <|-- RimGeoMechCase
|
||||
|
||||
RimEclipseCase <|--- RimEclipseInputCase
|
||||
RimEclipseCase <|--- RimEclipseInputCaseOpm
|
||||
RimEclipseCase <|--- RimEclipseResultCase
|
||||
RimEclipseCase <|--- RimEclipseStatisticsCase
|
||||
|
||||
class RimEclipseInputCase {
|
||||
Based on ASCII input files
|
||||
}
|
||||
|
||||
class RimEclipseInputCaseOpm {
|
||||
Based on ASCII input files using OPM parser
|
||||
}
|
||||
|
||||
class RimEclipseResultCase {
|
||||
Based on binary files (EGRID, UNSMRY, ..)
|
||||
}
|
||||
|
||||
class RimEclipseStatisticsCase {
|
||||
Case derived from statistics computations of multiple cases
|
||||
}
|
||||
|
||||
RimCase *-- "N" RimView
|
||||
|
||||
|
||||
class RimEclipseCase {
|
||||
RigEclipseCaseData* reservoirData()
|
||||
RimReservoirCellResultsStorage* results()
|
||||
-- private --
|
||||
matrixResults RimReservoirCellResultsStorage
|
||||
fractureResults RimReservoirCellResultsStorage
|
||||
}
|
||||
|
||||
RimEclipseCase *-- RigEclipseCaseData
|
||||
RimEclipseCase *-- RimReservoirCellResultsStorage
|
||||
|
||||
class RigEclipseCaseData {
|
||||
RigMainGrid* mainGrid()
|
||||
RigCaseCellResultsData* results()
|
||||
RigActiveCellInfo* activeCellInfo()
|
||||
RigFormationNames* activeFormationNames()
|
||||
RigSingleWellResultsData* findWellResult()
|
||||
RigCell& cellFromWellResultCell()
|
||||
}
|
||||
|
||||
RigEclipseCaseData *-- RigCaseCellResultsData
|
||||
|
||||
|
||||
RimReservoirCellResultsStorage o-- RigCaseCellResultsData
|
||||
|
||||
class RimReservoirCellResultsStorage {
|
||||
RigCaseCellResultsData* cellResults()
|
||||
}
|
||||
|
||||
|
||||
@enduml
|
@ -1,35 +1,28 @@
|
||||
@startuml
|
||||
|
||||
class RimViewWindow {
|
||||
RimMdiWindowController mdiWindowGeometry()
|
||||
}
|
||||
|
||||
note top of RimViewWindow : Updated 2017-02-24
|
||||
|
||||
class RimView {
|
||||
RimViewGeometry* viewGeometry()
|
||||
}
|
||||
|
||||
class Rim3dView {
|
||||
RimViewWindow <|-- RimView
|
||||
|
||||
package plots {
|
||||
RimViewWindow <|-- RimSummaryPlot
|
||||
RimViewWindow <|-- RimTotalWellAllocationPlot
|
||||
RimViewWindow <|-- RimWellAllocationPlot
|
||||
RimViewWindow <|-- RimWellLogPlot
|
||||
}
|
||||
|
||||
class RimPlotView {
|
||||
}
|
||||
RimViewWindow *-- RimMdiWindowController
|
||||
|
||||
RimView <|-- RimEclipseView
|
||||
RimView <|-- RimGeoMechView
|
||||
|
||||
|
||||
RimView <|-- RimPlotView
|
||||
RimView <|-- Rim3dView
|
||||
|
||||
|
||||
RimView *-- RimViewGeometry
|
||||
|
||||
RimPlotView <|-- RimWellLogPlot
|
||||
RimPlotView <|-- RimSummaryPlot
|
||||
|
||||
Rim3dView <|-- RimEclipseView
|
||||
Rim3dView <|-- RimGeoMechView
|
||||
|
||||
class RimWindow {
|
||||
}
|
||||
|
||||
RimViewGeometry --> RimWindow
|
||||
|
||||
class RimViewGeometry {
|
||||
PtrField<RimWindow> window
|
||||
}
|
||||
|
||||
@enduml
|
||||
|
Loading…
Reference in New Issue
Block a user