mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'dev' into hdf-prototype
This commit is contained in:
@@ -88,6 +88,9 @@ ${CEE_CURRENT_LIST_DIR}RimMdiWindowController.h
|
||||
${CEE_CURRENT_LIST_DIR}RimPropertyFilter.h
|
||||
${CEE_CURRENT_LIST_DIR}RimNamedObject.h
|
||||
${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.h
|
||||
${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.h
|
||||
${CEE_CURRENT_LIST_DIR}RimPickingTopologyItem.h
|
||||
${CEE_CURRENT_LIST_DIR}RimEclipseTopologyItem.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -174,6 +177,9 @@ ${CEE_CURRENT_LIST_DIR}RimMdiWindowController.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimPropertyFilter.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimNamedObject.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimPickingTopologyItem.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimEclipseTopologyItem.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -35,20 +35,22 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimFlowDiagSolution, "FlowDiagSolution");
|
||||
|
||||
#define CROSS_FLOW_ENDING "-XF"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool hasCrossFlowEnding(const QString& tracerName)
|
||||
bool RimFlowDiagSolution::hasCrossFlowEnding(const QString& tracerName)
|
||||
{
|
||||
return tracerName.endsWith("-Xf");
|
||||
return tracerName.endsWith(CROSS_FLOW_ENDING);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString removeCrossFlowEnding(const QString& tracerName)
|
||||
QString RimFlowDiagSolution::removeCrossFlowEnding(const QString& tracerName)
|
||||
{
|
||||
if (tracerName.endsWith("-Xf"))
|
||||
if (tracerName.endsWith(CROSS_FLOW_ENDING))
|
||||
{
|
||||
return tracerName.left(tracerName.size() - 3);
|
||||
}
|
||||
@@ -61,9 +63,9 @@ QString removeCrossFlowEnding(const QString& tracerName)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString addCrossFlowEnding(const QString& wellName)
|
||||
QString RimFlowDiagSolution::addCrossFlowEnding(const QString& wellName)
|
||||
{
|
||||
return wellName + "-Xf";
|
||||
return wellName + CROSS_FLOW_ENDING;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -103,9 +105,9 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults()
|
||||
RimEclipseResultCase* eclCase;
|
||||
this->firstAncestorOrThisOfType(eclCase);
|
||||
|
||||
CVF_ASSERT(eclCase && eclCase->reservoirData() );
|
||||
CVF_ASSERT(eclCase && eclCase->eclipseCaseData() );
|
||||
|
||||
timeStepCount = eclCase->reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount();
|
||||
timeStepCount = eclCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount();
|
||||
|
||||
}
|
||||
|
||||
@@ -127,7 +129,7 @@ std::vector<QString> RimFlowDiagSolution::tracerNames() const
|
||||
|
||||
if (eclCase)
|
||||
{
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->eclipseCaseData()->wellResults();
|
||||
|
||||
for (size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx)
|
||||
{
|
||||
@@ -167,9 +169,9 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
|
||||
|
||||
if ( eclCase )
|
||||
{
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
|
||||
RigMainGrid* mainGrid = eclCase->reservoirData()->mainGrid();
|
||||
RigActiveCellInfo* activeCellInfo = eclCase->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); //Todo: Must come from the results definition
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->eclipseCaseData()->wellResults();
|
||||
RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid();
|
||||
RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); //Todo: Must come from the results definition
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
|
||||
{
|
||||
@@ -179,10 +181,10 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
|
||||
bool isInjectorWell = ( wellResFrame.m_productionType != RigWellResultFrame::PRODUCER
|
||||
&& wellResFrame.m_productionType != RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE);
|
||||
|
||||
std::string wellname = wellResults[wIdx]->m_wellName.toStdString();
|
||||
std::string wellName = wellResults[wIdx]->m_wellName.toStdString();
|
||||
std::string wellNameXf = addCrossFlowEnding(wellResults[wIdx]->m_wellName).toStdString();
|
||||
|
||||
std::vector<int>& tracerCells = tracersWithCells[wellname];
|
||||
std::vector<int>& tracerCells = tracersWithCells[wellName];
|
||||
std::vector<int>& tracerCellsCrossFlow = tracersWithCells[wellNameXf];
|
||||
|
||||
for (const RigWellResultBranch& wBr: wellResFrame.m_wellResultBranches)
|
||||
@@ -208,6 +210,9 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tracerCells.empty()) tracersWithCells.erase(wellName);
|
||||
if (tracerCellsCrossFlow.empty()) tracersWithCells.erase(wellNameXf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +229,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(c
|
||||
|
||||
TracerStatusType tracerStatus = UNDEFINED;
|
||||
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->eclipseCaseData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
|
||||
{
|
||||
@@ -270,7 +275,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
||||
RimEclipseResultCase* eclCase;
|
||||
this->firstAncestorOrThisOfTypeAsserted(eclCase);
|
||||
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->eclipseCaseData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
|
||||
{
|
||||
@@ -334,7 +339,7 @@ cvf::Color3f RimFlowDiagSolution::tracerColor(const QString& tracerName) const
|
||||
// If we do not find a well color, use index in well result data to be able to get variation of tracer colors
|
||||
// This can be the case if we do not have any views at all
|
||||
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->eclipseCaseData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@ class RimFlowDiagSolution : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
|
||||
RimFlowDiagSolution();
|
||||
virtual ~RimFlowDiagSolution();
|
||||
|
||||
@@ -59,6 +60,9 @@ public:
|
||||
TracerStatusType tracerStatusInTimeStep(const QString& tracerName, size_t timeStepIndex) const;
|
||||
cvf::Color3f tracerColor(const QString& tracerName) const;
|
||||
|
||||
static bool hasCrossFlowEnding(const QString& tracerName);
|
||||
static QString removeCrossFlowEnding(const QString& tracerName);
|
||||
static QString addCrossFlowEnding(const QString& wellName);
|
||||
private:
|
||||
std::map<std::string, std::vector<int> > allTracerActiveCellIndices(size_t timeStepIndex, bool useInjectors) const;
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ namespace caf
|
||||
template<>
|
||||
void AppEnum<RimWellAllocationPlot::FlowType>::setUp()
|
||||
{
|
||||
addItem(RimWellAllocationPlot::ACCUMULATED, "ACCUMULATED", "Well Flow");
|
||||
addItem(RimWellAllocationPlot::INFLOW, "INFLOW", "In Flow");
|
||||
addItem(RimWellAllocationPlot::ACCUMULATED, "ACCUMULATED", "Accumulated");
|
||||
addItem(RimWellAllocationPlot::INFLOW, "INFLOW", "Inflow Rates");
|
||||
setDefault(RimWellAllocationPlot::ACCUMULATED);
|
||||
|
||||
}
|
||||
@@ -179,7 +179,7 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
|
||||
if (!m_case) return;
|
||||
|
||||
const RigSingleWellResultsData* wellResults = m_case->reservoirData()->findWellResult(m_wellName);
|
||||
const RigSingleWellResultsData* wellResults = m_case->eclipseCaseData()->findWellResult(m_wellName);
|
||||
|
||||
if (!wellResults) return;
|
||||
|
||||
@@ -188,7 +188,7 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
std::vector< std::vector <cvf::Vec3d> > pipeBranchesCLCoords;
|
||||
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
||||
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(m_case->reservoirData(),
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(m_case->eclipseCaseData(),
|
||||
wellResults,
|
||||
m_timeStep,
|
||||
true,
|
||||
@@ -207,7 +207,7 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
{
|
||||
bool isProducer = ( wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::PRODUCER
|
||||
|| wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE );
|
||||
RigEclCellIndexCalculator cellIdxCalc(m_case->reservoirData()->mainGrid(), m_case->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS));
|
||||
RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS));
|
||||
wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords,
|
||||
pipeBranchesCellIds,
|
||||
tracerFractionCellValues,
|
||||
@@ -225,12 +225,6 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
}
|
||||
}
|
||||
|
||||
m_contributingTracerNames.clear();
|
||||
if (wfCalculator)
|
||||
{
|
||||
m_contributingTracerNames = wfCalculator->tracerNames();
|
||||
}
|
||||
|
||||
auto depthType = accumulatedWellFlowPlot()->depthType();
|
||||
|
||||
if ( depthType == RimWellLogPlot::MEASURED_DEPTH ) return;
|
||||
@@ -364,7 +358,7 @@ std::map<QString, const std::vector<double> *> RimWellAllocationPlot::findReleva
|
||||
{
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_CELL_FRACTION_RESNAME, tracerName.toStdString());
|
||||
const std::vector<double>* tracerCellFractions = m_flowDiagSolution->flowDiagResults()->resultValues(resAddr, m_timeStep);
|
||||
tracerCellFractionValues[tracerName] = tracerCellFractions;
|
||||
if (tracerCellFractions) tracerCellFractionValues[tracerName] = tracerCellFractions;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -377,7 +371,7 @@ std::map<QString, const std::vector<double> *> RimWellAllocationPlot::findReleva
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTrack)
|
||||
{
|
||||
RigEclipseCaseData::UnitsType unitSet = m_case->reservoirData()->unitsType();
|
||||
RigEclipseCaseData::UnitsType unitSet = m_case->eclipseCaseData()->unitsType();
|
||||
QString unitText;
|
||||
switch ( unitSet )
|
||||
{
|
||||
@@ -448,7 +442,7 @@ QString RimWellAllocationPlot::wellStatusTextForTimeStep(const QString& wellName
|
||||
|
||||
if (eclipseResultCase)
|
||||
{
|
||||
const RigSingleWellResultsData* wellResults = eclipseResultCase->reservoirData()->findWellResult(wellName);
|
||||
const RigSingleWellResultsData* wellResults = eclipseResultCase->eclipseCaseData()->findWellResult(wellName);
|
||||
|
||||
if (wellResults)
|
||||
{
|
||||
@@ -541,9 +535,9 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationPlot::calculateValueOptions(const
|
||||
if (fieldNeedingOptions == &m_wellName)
|
||||
{
|
||||
std::set<QString> sortedWellNames;
|
||||
if ( m_case && m_case->reservoirData() )
|
||||
if ( m_case && m_case->eclipseCaseData() )
|
||||
{
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellRes = m_case->reservoirData()->wellResults();
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellRes = m_case->eclipseCaseData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellRes.size(); ++wIdx )
|
||||
{
|
||||
@@ -566,7 +560,7 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationPlot::calculateValueOptions(const
|
||||
{
|
||||
QStringList timeStepNames;
|
||||
|
||||
if (m_case && m_case->reservoirData())
|
||||
if (m_case && m_case->eclipseCaseData())
|
||||
{
|
||||
timeStepNames = m_case->timeStepStrings();
|
||||
}
|
||||
@@ -616,14 +610,6 @@ QString RimWellAllocationPlot::wellName() const
|
||||
return m_wellName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<QString> RimWellAllocationPlot::contributingTracerNames() const
|
||||
{
|
||||
return m_contributingTracerNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,7 +72,6 @@ public:
|
||||
int timeStep();
|
||||
|
||||
QString wellName() const;
|
||||
const std::vector<QString> contributingTracerNames() const;
|
||||
|
||||
void removeFromMdiAreaAndDeleteViewWidget();
|
||||
|
||||
@@ -125,6 +124,4 @@ private:
|
||||
caf::PdmChildField<RimWellLogPlot*> m_accumulatedWellFlowPlot;
|
||||
caf::PdmChildField<RimTotalWellAllocationPlot*> m_totalWellAllocationPlot;
|
||||
caf::PdmChildField<RimWellAllocationPlotLegend*> m_wellAllocationPlotLegend;
|
||||
|
||||
std::vector<QString> m_contributingTracerNames;
|
||||
};
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include "cvfMath.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@@ -152,10 +155,10 @@ void RimWellFlowRateCurve::updateCurveAppearance()
|
||||
void RimWellFlowRateCurve::updateStackedPlotData()
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAncestorOrThisOfType(wellLogPlot);
|
||||
firstAncestorOrThisOfTypeAsserted(wellLogPlot);
|
||||
|
||||
RimWellLogTrack* wellLogTrack;
|
||||
firstAncestorOrThisOfType(wellLogTrack);
|
||||
firstAncestorOrThisOfTypeAsserted(wellLogTrack);
|
||||
|
||||
bool isFirstTrack = (wellLogTrack == wellLogPlot->trackByIndex(0));
|
||||
|
||||
@@ -186,6 +189,29 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
||||
depthValues.insert(depthValues.begin(), depthValues[0]);
|
||||
stackedValues.insert(stackedValues.begin(), 0.0);
|
||||
polyLineStartStopIndices.front().second += 1;
|
||||
|
||||
if (wellLogPlot->trackCount() > 1 && isFirstTrack)
|
||||
{
|
||||
// Add a dummy negative depth value to make the contribution
|
||||
// from other branches connected to well head visible
|
||||
|
||||
double availableMinDepth;
|
||||
double availableMaxDepth;
|
||||
wellLogPlot->availableDepthRange(&availableMinDepth, &availableMaxDepth);
|
||||
|
||||
double depthSpan = 0.1 * cvf::Math::abs(availableMinDepth - availableMaxDepth);
|
||||
|
||||
// Round off value to floored decade
|
||||
double logDecValue = log10(depthSpan);
|
||||
logDecValue = cvf::Math::floor(logDecValue);
|
||||
depthSpan = pow(10.0, logDecValue);
|
||||
|
||||
double dummyNegativeDepthValue = depthValues.back() - depthSpan;
|
||||
|
||||
depthValues.push_back(dummyNegativeDepthValue);
|
||||
stackedValues.push_back(stackedValues.back());
|
||||
polyLineStartStopIndices.front().second += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Add a dummy point for the zeroth connection to make the "end" distribution show better.
|
||||
@@ -233,10 +259,11 @@ RimWellAllocationPlot* RimWellFlowRateCurve::wellAllocationPlot() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellFlowRateCurve::setFlowValuesPrDepthValue(const QString& tracerName, const std::vector<double>& connectionNumbers, const std::vector<double>& flowRates)
|
||||
void RimWellFlowRateCurve::setFlowValuesPrDepthValue(const QString& tracerName, const std::vector<double>& depthValues, const std::vector<double>& flowRates)
|
||||
{
|
||||
m_curveData = new RigWellLogCurveData;
|
||||
m_curveData->setValuesAndMD(flowRates, connectionNumbers, RimDefines::UNIT_NONE, false);
|
||||
|
||||
m_curveData->setValuesAndMD(flowRates, depthValues, RimDefines::UNIT_NONE, false);
|
||||
|
||||
m_tracerName = tracerName;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
RimWellFlowRateCurve();
|
||||
virtual ~RimWellFlowRateCurve();
|
||||
|
||||
void setFlowValuesPrDepthValue(const QString& tracerName , const std::vector<double>& connectionNumbers, const std::vector<double>& flowRates);
|
||||
void setFlowValuesPrDepthValue(const QString& tracerName , const std::vector<double>& depthValues, const std::vector<double>& flowRates);
|
||||
void updateStackedPlotData();
|
||||
|
||||
virtual QString wellName() const override;
|
||||
|
||||
@@ -207,7 +207,7 @@ void Rim3dOverlayInfoConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
}
|
||||
statGroup->add(&m_statisticsCellRange);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -346,8 +346,8 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
{
|
||||
caseName = eclipseView->eclipseCase()->caseUserDescription();
|
||||
totCellCount = QString::number(eclipseView->mainGrid()->globalCellArray().size());
|
||||
size_t mxActCellCount = eclipseView->eclipseCase()->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount();
|
||||
size_t frActCellCount = eclipseView->eclipseCase()->reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount();
|
||||
size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount();
|
||||
size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount();
|
||||
if (frActCellCount > 0) activeCellCountText += "Matrix : ";
|
||||
activeCellCountText += QString::number(mxActCellCount);
|
||||
if (frActCellCount > 0) activeCellCountText += " Fracture : " + QString::number(frActCellCount);
|
||||
|
||||
@@ -262,7 +262,7 @@ void RimCellEdgeColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
|
||||
if (isUsingSingleVariable())
|
||||
{
|
||||
m_singleVarEdgeResultColors->defineUiOrdering(uiConfigName,uiOrdering );
|
||||
m_singleVarEdgeResultColors->uiOrdering(uiConfigName,uiOrdering );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -273,7 +273,7 @@ void RimCellEdgeColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
uiOrdering.add(&useZVariable);
|
||||
}
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -282,7 +282,7 @@ void RimCellEdgeColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
void RimCellEdgeColors::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
uiTreeOrdering.add(legendConfig());
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -296,8 +296,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicNewSummaryCurveFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicCopyReferencesToClipboardFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
||||
}
|
||||
else if(dynamic_cast<RimSummaryCurveFilter*>(uiItem))
|
||||
{
|
||||
@@ -307,8 +305,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicNewSummaryCurveFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicCopyReferencesToClipboardFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimSummaryCase*>(uiItem))
|
||||
{
|
||||
@@ -380,7 +376,11 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
// is aware of multiple selected items, move the command to this list
|
||||
// without using dyncamic_cast.
|
||||
|
||||
commandIds << "RicPasteTimeHistoryCurveFeature";
|
||||
commandIds << "RicCopyReferencesToClipboardFeature";
|
||||
|
||||
commandIds << "RicShowPlotDataFeature";
|
||||
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
||||
|
||||
// Work in progress -- End
|
||||
|
||||
@@ -397,12 +397,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
commandIds << "RicExecuteScriptForCasesFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimSummaryCurve*>(uiItem) ||
|
||||
dynamic_cast<RimSummaryCurveFilter*>(uiItem) )
|
||||
{
|
||||
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
||||
|
||||
}
|
||||
else if (dynamic_cast<RimSummaryPlot*>(uiItem))
|
||||
{
|
||||
commandIds << "RicAsciiExportSummaryPlotFeature";
|
||||
@@ -488,15 +482,29 @@ void RimContextCommandBuilder::appendCommandsToMenu(const QStringList& commandId
|
||||
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
|
||||
for (int i = 0; i < commandIds.size(); i++)
|
||||
{
|
||||
caf::CmdFeature* feature = commandManager->getCommandFeature(commandIds[i].toStdString());
|
||||
CVF_ASSERT(feature);
|
||||
|
||||
if (feature->canFeatureBeExecuted())
|
||||
if (commandIds[i] == "Separator")
|
||||
{
|
||||
QAction* act = commandManager->action(commandIds[i]);
|
||||
CVF_ASSERT(act);
|
||||
menu->addSeparator();
|
||||
}
|
||||
else
|
||||
{
|
||||
caf::CmdFeature* feature = commandManager->getCommandFeature(commandIds[i].toStdString());
|
||||
CVF_ASSERT(feature);
|
||||
|
||||
menu->addAction(act);
|
||||
if (feature->canFeatureBeExecuted())
|
||||
{
|
||||
QAction* act = commandManager->action(commandIds[i]);
|
||||
CVF_ASSERT(act);
|
||||
|
||||
for (QAction* existingAct : menu->actions())
|
||||
{
|
||||
// If action exist, continue to make sure the action is positioned at the first
|
||||
// location of a command ID
|
||||
if (existingAct == act) continue;
|
||||
}
|
||||
|
||||
menu->addAction(act);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,22 +105,22 @@ RimEclipseCase::~RimEclipseCase()
|
||||
RimWellLogPlotCollection* plotCollection = project->mainPlotCollection()->wellLogPlotCollection();
|
||||
if (plotCollection)
|
||||
{
|
||||
plotCollection->removeExtractors(this->reservoirData());
|
||||
plotCollection->removeExtractors(this->eclipseCaseData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this->reservoirData())
|
||||
if (this->eclipseCaseData())
|
||||
{
|
||||
// At this point, we assume that memory should be released
|
||||
CVF_ASSERT(this->reservoirData()->refCount() == 1);
|
||||
CVF_ASSERT(this->eclipseCaseData()->refCount() == 1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseCaseData* RimEclipseCase::reservoirData()
|
||||
RigEclipseCaseData* RimEclipseCase::eclipseCaseData()
|
||||
{
|
||||
return m_rigEclipseCase.p();
|
||||
}
|
||||
@@ -128,7 +128,7 @@ RigEclipseCaseData* RimEclipseCase::reservoirData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigEclipseCaseData* RimEclipseCase::reservoirData() const
|
||||
const RigEclipseCaseData* RimEclipseCase::eclipseCaseData() const
|
||||
{
|
||||
return m_rigEclipseCase.p();
|
||||
}
|
||||
@@ -255,7 +255,7 @@ void RimEclipseCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
if (changedField == &releaseResultMemory)
|
||||
{
|
||||
if (this->reservoirData())
|
||||
if (this->eclipseCaseData())
|
||||
{
|
||||
for (size_t i = 0; i < reservoirViews().size(); i++)
|
||||
{
|
||||
@@ -277,13 +277,13 @@ void RimEclipseCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
reservoirView->createDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
RigCaseCellResultsData* matrixModelResults = reservoirData()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
if (matrixModelResults)
|
||||
{
|
||||
matrixModelResults->clearAllResults();
|
||||
}
|
||||
|
||||
RigCaseCellResultsData* fractureModelResults = reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
if (fractureModelResults)
|
||||
{
|
||||
fractureModelResults->clearAllResults();
|
||||
@@ -294,7 +294,7 @@ void RimEclipseCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
}
|
||||
else if (changedField == &flipXAxis || changedField == &flipYAxis)
|
||||
{
|
||||
RigEclipseCaseData* rigEclipseCase = reservoirData();
|
||||
RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||
if (rigEclipseCase)
|
||||
{
|
||||
rigEclipseCase->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
@@ -306,7 +306,7 @@ void RimEclipseCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
RimEclipseView* reservoirView = reservoirViews()[i];
|
||||
|
||||
reservoirView->scheduleReservoirGridGeometryRegen();
|
||||
reservoirView->schedulePipeGeometryRegen();
|
||||
reservoirView->scheduleSimWellGeometryRegen();
|
||||
reservoirView->createDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
@@ -323,7 +323,7 @@ void RimEclipseCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::updateFormationNamesData()
|
||||
{
|
||||
RigEclipseCaseData* rigEclipseCase = reservoirData();
|
||||
RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||
if(rigEclipseCase)
|
||||
{
|
||||
if(activeFormationNames())
|
||||
@@ -381,7 +381,7 @@ void RimEclipseCase::updateFormationNamesData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::computeCachedData()
|
||||
{
|
||||
RigEclipseCaseData* rigEclipseCase = reservoirData();
|
||||
RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||
if (rigEclipseCase)
|
||||
{
|
||||
caf::ProgressInfo pInf(30, "");
|
||||
@@ -428,12 +428,12 @@ RimCaseCollection* RimEclipseCase::parentCaseCollection()
|
||||
void RimEclipseCase::setReservoirData(RigEclipseCaseData* eclipseCase)
|
||||
{
|
||||
m_rigEclipseCase = eclipseCase;
|
||||
if (this->reservoirData())
|
||||
if (this->eclipseCaseData())
|
||||
{
|
||||
m_fractureModelResults()->setCellResults(reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS));
|
||||
m_matrixModelResults()->setCellResults(reservoirData()->results(RifReaderInterface::MATRIX_RESULTS));
|
||||
m_fractureModelResults()->setMainGrid(this->reservoirData()->mainGrid());
|
||||
m_matrixModelResults()->setMainGrid(this->reservoirData()->mainGrid());
|
||||
m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS));
|
||||
m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS));
|
||||
m_fractureModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid());
|
||||
m_matrixModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -511,7 +511,7 @@ bool RimEclipseCase::openReserviorCase()
|
||||
{
|
||||
// If read already, return
|
||||
|
||||
if (this->reservoirData() != NULL) return true;
|
||||
if (this->eclipseCaseData() != NULL) return true;
|
||||
|
||||
if (!openEclipseGridFile())
|
||||
{
|
||||
@@ -528,7 +528,7 @@ bool RimEclipseCase::openReserviorCase()
|
||||
size_t combinedTransResIdx = results->cellResults()->findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName());
|
||||
if (combinedTransResIdx != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
reservoirData()->mainGrid()->nncData()->setCombTransmisibilityScalarResultIndex(combinedTransResIdx);
|
||||
eclipseCaseData()->mainGrid()->nncData()->setCombTransmisibilityScalarResultIndex(combinedTransResIdx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ public:
|
||||
bool openReserviorCase();
|
||||
virtual bool openEclipseGridFile() = 0;
|
||||
|
||||
RigEclipseCaseData* reservoirData();
|
||||
const RigEclipseCaseData* reservoirData() const;
|
||||
RigEclipseCaseData* eclipseCaseData();
|
||||
const RigEclipseCaseData* eclipseCaseData() const;
|
||||
|
||||
RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ RimIdenticalGridCaseGroup* RimEclipseCaseCollection::createIdenticalCaseGroupFro
|
||||
{
|
||||
CVF_ASSERT(mainCase);
|
||||
|
||||
RigEclipseCaseData* rigEclipseCase = mainCase->reservoirData();
|
||||
RigEclipseCaseData* rigEclipseCase = mainCase->eclipseCaseData();
|
||||
RigMainGrid* equalGrid = registerCaseInGridCollection(rigEclipseCase);
|
||||
CVF_ASSERT(equalGrid);
|
||||
|
||||
@@ -101,7 +101,7 @@ void RimEclipseCaseCollection::moveEclipseCaseIntoCaseGroup(RimEclipseCase* rimR
|
||||
{
|
||||
CVF_ASSERT(rimReservoir);
|
||||
|
||||
RigEclipseCaseData* rigEclipseCase = rimReservoir->reservoirData();
|
||||
RigEclipseCaseData* rigEclipseCase = rimReservoir->eclipseCaseData();
|
||||
RigMainGrid* equalGrid = registerCaseInGridCollection(rigEclipseCase);
|
||||
CVF_ASSERT(equalGrid);
|
||||
|
||||
@@ -139,7 +139,7 @@ void RimEclipseCaseCollection::moveEclipseCaseIntoCaseGroup(RimEclipseCase* rimR
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCaseCollection::removeCaseFromAllGroups(RimEclipseCase* reservoir)
|
||||
{
|
||||
m_gridCollection->removeCase(reservoir->reservoirData());
|
||||
m_gridCollection->removeCase(reservoir->eclipseCaseData());
|
||||
|
||||
for (size_t i = 0; i < caseGroups.size(); i++)
|
||||
{
|
||||
@@ -188,7 +188,7 @@ void RimEclipseCaseCollection::insertCaseInCaseGroup(RimIdenticalGridCaseGroup*
|
||||
{
|
||||
CVF_ASSERT(rimReservoir);
|
||||
|
||||
RigEclipseCaseData* rigEclipseCase = rimReservoir->reservoirData();
|
||||
RigEclipseCaseData* rigEclipseCase = rimReservoir->eclipseCaseData();
|
||||
registerCaseInGridCollection(rigEclipseCase);
|
||||
|
||||
caseGroup->addCase(rimReservoir);
|
||||
|
||||
@@ -194,7 +194,7 @@ void RimEclipseCellColors::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOr
|
||||
uiTreeOrdering.add(m_legendConfigPtrField());
|
||||
}
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -241,6 +241,33 @@ RimEclipseView* RimEclipseCellColors::reservoirView()
|
||||
return m_reservoirView;
|
||||
}
|
||||
|
||||
bool operator<(const cvf::Color3ub first, const cvf::Color3ub second)
|
||||
{
|
||||
if (first.r() != second.r()) return first.r() < second.r();
|
||||
if (first.g() != second.g()) return first.g() < second.g();
|
||||
if (first.b() != second.b()) return first.b() < second.b();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class TupleCompare
|
||||
{
|
||||
public :
|
||||
bool operator() (const std::tuple<QString, int, cvf::Color3ub>& t1, const std::tuple<QString, int, cvf::Color3ub>& t2) const
|
||||
{
|
||||
using namespace std;
|
||||
if (get<0>(t1) != get<0>(t2)) return get<0>(t1) < get<0>(t2);
|
||||
if (get<1>(t1) != get<1>(t2)) return get<1>(t1) < get<1>(t2);
|
||||
if (get<2>(t1) != get<2>(t2)) return get<2>(t1) < get<2>(t2);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -282,32 +309,28 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
|
||||
|
||||
if (this->hasCategoryResult())
|
||||
{
|
||||
std::vector<std::tuple<QString, int, cvf::Color3ub>> categories;
|
||||
std::set<std::tuple<QString, int, cvf::Color3ub>, TupleCompare > categories;
|
||||
//std::set<std::tuple<QString, int, cvf::Color3ub> > categories;
|
||||
|
||||
std::vector<QString> tracerNames = this->flowDiagSolution()->tracerNames();
|
||||
|
||||
// Loop through the wells to get same ordering as the wells in tree view
|
||||
for (size_t i = 0; i < m_reservoirView->wellCollection()->wells().size(); i++)
|
||||
int tracerIndex = 0;
|
||||
for (const auto& tracerName : tracerNames)
|
||||
{
|
||||
size_t reverseIndex = m_reservoirView->wellCollection()->wells().size() - i - 1;
|
||||
RimEclipseWell* well = m_reservoirView->wellCollection()->findWell(RimFlowDiagSolution::removeCrossFlowEnding(tracerName));
|
||||
cvf::Color3ub color(cvf::Color3::GRAY);
|
||||
if (well) color = cvf::Color3ub(well->wellPipeColor());
|
||||
|
||||
RimEclipseWell* well = m_reservoirView->wellCollection()->wells()[reverseIndex];
|
||||
QString wellName = well->name();
|
||||
|
||||
auto tracer = std::find(begin(tracerNames), end(tracerNames), wellName);
|
||||
if (tracer != end(tracerNames))
|
||||
{
|
||||
// The category value is defined as the index of the tracer name in the tracer name vector
|
||||
size_t categoryValue = std::distance(begin(tracerNames), tracer);
|
||||
|
||||
cvf::Color3ub color(cvf::Color3::SEA_GREEN);
|
||||
color = cvf::Color3ub(well->wellPipeColor());
|
||||
|
||||
categories.push_back(std::make_tuple(wellName, static_cast<int>(categoryValue), color));
|
||||
}
|
||||
categories.insert(std::make_tuple(tracerName, tracerIndex, color));
|
||||
++tracerIndex;
|
||||
}
|
||||
|
||||
this->legendConfig()->setCategoryItems(categories);
|
||||
std::vector<std::tuple<QString, int, cvf::Color3ub>> reverseCategories;
|
||||
for (auto tupIt = categories.rbegin(); tupIt != categories.rend(); ++tupIt)
|
||||
{
|
||||
reverseCategories.push_back(*tupIt);
|
||||
}
|
||||
|
||||
this->legendConfig()->setCategoryItems(reverseCategories);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -317,7 +340,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
|
||||
CVF_ASSERT(rimEclipseCase);
|
||||
if (!rimEclipseCase) return;
|
||||
|
||||
RigEclipseCaseData* eclipseCase = rimEclipseCase->reservoirData();
|
||||
RigEclipseCaseData* eclipseCase = rimEclipseCase->eclipseCaseData();
|
||||
CVF_ASSERT(eclipseCase);
|
||||
if (!eclipseCase) return;
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ caf::PdmFieldHandle* RimEclipseFaultColors::objectToggleField()
|
||||
void RimEclipseFaultColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
|
||||
m_customFaultResultColors->defineUiOrdering(uiConfigName, *group1);
|
||||
m_customFaultResultColors->uiOrdering(uiConfigName, *group1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -82,8 +82,8 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
|
||||
reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->computeDerivedData();
|
||||
reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->computeDerivedData();
|
||||
eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->computeDerivedData();
|
||||
eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->computeDerivedData();
|
||||
|
||||
QFileInfo gridFileName(fileNames[0]);
|
||||
QString caseName = gridFileName.completeBaseName();
|
||||
@@ -94,19 +94,19 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->reservoirData() == NULL)
|
||||
if (this->eclipseCaseData() == NULL)
|
||||
{
|
||||
this->setReservoirData(new RigEclipseCaseData);
|
||||
}
|
||||
|
||||
// First find and read the grid data
|
||||
if (this->reservoirData()->mainGrid()->gridPointDimensions() == cvf::Vec3st(0,0,0))
|
||||
if (this->eclipseCaseData()->mainGrid()->gridPointDimensions() == cvf::Vec3st(0,0,0))
|
||||
{
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
|
||||
for (int i = 0; i < fileNames.size(); i++)
|
||||
{
|
||||
if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->reservoirData(), prefs->readerSettings->importFaults()))
|
||||
if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->eclipseCaseData(), prefs->readerSettings->importFaults()))
|
||||
{
|
||||
m_gridFileName = fileNames[i];
|
||||
|
||||
@@ -115,7 +115,7 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
|
||||
this->caseUserDescription = caseName;
|
||||
|
||||
this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
|
||||
computeCachedData();
|
||||
|
||||
@@ -124,7 +124,7 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
if (this->reservoirData()->mainGrid()->gridPointDimensions() == cvf::Vec3st(0,0,0))
|
||||
if (this->eclipseCaseData()->mainGrid()->gridPointDimensions() == cvf::Vec3st(0,0,0))
|
||||
{
|
||||
return ; // No grid present
|
||||
}
|
||||
@@ -152,7 +152,7 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
for (int i = 0; i < filesToRead.size(); i++)
|
||||
{
|
||||
QString propertyFileName = filesToRead[i];
|
||||
std::map<QString, QString> readProperties = RifEclipseInputFileTools::readProperties(propertyFileName, this->reservoirData());
|
||||
std::map<QString, QString> readProperties = RifEclipseInputFileTools::readProperties(propertyFileName, this->eclipseCaseData());
|
||||
|
||||
std::map<QString, QString>::iterator it;
|
||||
for (it = readProperties.begin(); it != readProperties.end(); ++it)
|
||||
@@ -179,7 +179,7 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
bool RimEclipseInputCase::openEclipseGridFile()
|
||||
{
|
||||
// Early exit if reservoir data is created
|
||||
if (this->reservoirData() == NULL)
|
||||
if (this->eclipseCaseData() == NULL)
|
||||
{
|
||||
cvf::ref<RifReaderInterface> readerInterface;
|
||||
|
||||
@@ -202,13 +202,13 @@ bool RimEclipseInputCase::openEclipseGridFile()
|
||||
this->setReservoirData( eclipseCase.p() );
|
||||
}
|
||||
|
||||
CVF_ASSERT(this->reservoirData());
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
CVF_ASSERT(readerInterface.notNull());
|
||||
|
||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
|
||||
this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
|
||||
computeCachedData();
|
||||
loadAndSyncronizeInputProperties();
|
||||
@@ -237,8 +237,8 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
|
||||
{
|
||||
// Make sure we actually have reservoir data
|
||||
|
||||
CVF_ASSERT(this->reservoirData());
|
||||
CVF_ASSERT(this->reservoirData()->mainGrid()->gridPointDimensions() != cvf::Vec3st(0,0,0));
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
CVF_ASSERT(this->eclipseCaseData()->mainGrid()->gridPointDimensions() != cvf::Vec3st(0,0,0));
|
||||
|
||||
// Then read the properties from all the files referenced by the InputReservoir
|
||||
|
||||
@@ -287,7 +287,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
|
||||
ipsUsingThisFile[ipIdx]->resolvedState = RimEclipseInputProperty::KEYWORD_NOT_IN_FILE;
|
||||
if (fileKeywordSet.count(kw))
|
||||
{
|
||||
if (RifEclipseInputFileTools::readProperty(filenames[i], this->reservoirData(), kw, ipsUsingThisFile[ipIdx]->resultName ))
|
||||
if (RifEclipseInputFileTools::readProperty(filenames[i], this->eclipseCaseData(), kw, ipsUsingThisFile[ipIdx]->resultName ))
|
||||
{
|
||||
ipsUsingThisFile[ipIdx]->resolvedState = RimEclipseInputProperty::RESOLVED;
|
||||
}
|
||||
@@ -304,8 +304,8 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
|
||||
for (const QString fileKeyword : fileKeywordSet)
|
||||
{
|
||||
{
|
||||
QString resultName = this->reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeyword);
|
||||
if (RifEclipseInputFileTools::readProperty(filenames[i], this->reservoirData(), fileKeyword, resultName))
|
||||
QString resultName = this->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeyword);
|
||||
if (RifEclipseInputFileTools::readProperty(filenames[i], this->eclipseCaseData(), fileKeyword, resultName))
|
||||
{
|
||||
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
|
||||
inputProperty->resultName = resultName;
|
||||
|
||||
@@ -99,8 +99,8 @@ void RimEclipseInputCaseOpm::appendPropertiesFromStandaloneFiles(const QStringLi
|
||||
if (fileKeywordSet.count(knownKeyword) > 0)
|
||||
{
|
||||
QString qtKnownKeyword = QString::fromStdString(knownKeyword);
|
||||
QString resultName = this->reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(qtKnownKeyword);
|
||||
if (propertyReader.copyPropertyToCaseData(knownKeyword, this->reservoirData(), resultName))
|
||||
QString resultName = this->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(qtKnownKeyword);
|
||||
if (propertyReader.copyPropertyToCaseData(knownKeyword, this->eclipseCaseData(), resultName))
|
||||
{
|
||||
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
|
||||
inputProperty->resultName = resultName;
|
||||
@@ -160,18 +160,18 @@ void RimEclipseInputCaseOpm::updateFilePathsFromProjectPath(const QString& newPr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseInputCaseOpm::importEclipseGridAndProperties(const QString& fileName)
|
||||
{
|
||||
if (this->reservoirData() == NULL)
|
||||
if (this->eclipseCaseData() == NULL)
|
||||
{
|
||||
this->setReservoirData(new RigEclipseCaseData);
|
||||
|
||||
RifReaderOpmParserInput::importGridPropertiesFaults(fileName, reservoirData());
|
||||
RifReaderOpmParserInput::importGridPropertiesFaults(fileName, eclipseCaseData());
|
||||
|
||||
if (this->reservoirData()->mainGrid() == NULL)
|
||||
if (this->eclipseCaseData()->mainGrid() == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
|
||||
computeCachedData();
|
||||
|
||||
@@ -194,8 +194,8 @@ void RimEclipseInputCaseOpm::loadAndSyncronizeInputProperties()
|
||||
{
|
||||
// Make sure we actually have reservoir data
|
||||
|
||||
CVF_ASSERT(this->reservoirData());
|
||||
CVF_ASSERT(this->reservoirData()->mainGrid()->gridPointDimensions() != cvf::Vec3st(0, 0, 0));
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
CVF_ASSERT(this->eclipseCaseData()->mainGrid()->gridPointDimensions() != cvf::Vec3st(0, 0, 0));
|
||||
|
||||
// Then read the properties from all the files referenced by the InputReservoir
|
||||
|
||||
@@ -226,7 +226,7 @@ void RimEclipseInputCaseOpm::loadAndSyncronizeInputProperties()
|
||||
inputProperty->resolvedState = RimEclipseInputProperty::KEYWORD_NOT_IN_FILE;
|
||||
if (fileKeywordSet.count(kw.toStdString()))
|
||||
{
|
||||
if (propertyReader.copyPropertyToCaseData(kw.toStdString(), this->reservoirData(), inputProperty->resultName))
|
||||
if (propertyReader.copyPropertyToCaseData(kw.toStdString(), this->eclipseCaseData(), inputProperty->resultName))
|
||||
{
|
||||
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
|
||||
}
|
||||
@@ -242,8 +242,8 @@ void RimEclipseInputCaseOpm::loadAndSyncronizeInputProperties()
|
||||
if (fileKeywordSet.count(knownKeyword) > 0)
|
||||
{
|
||||
QString qtKnownKeyword = QString::fromStdString(knownKeyword);
|
||||
QString resultName = this->reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(qtKnownKeyword);
|
||||
if (propertyReader.copyPropertyToCaseData(knownKeyword, this->reservoirData(), resultName))
|
||||
QString resultName = this->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(qtKnownKeyword);
|
||||
if (propertyReader.copyPropertyToCaseData(knownKeyword, this->eclipseCaseData(), resultName))
|
||||
{
|
||||
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
|
||||
inputProperty->resultName = resultName;
|
||||
|
||||
@@ -91,7 +91,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change
|
||||
QString oldName = oldValue.toString();
|
||||
QString newName = newValue.toString();
|
||||
|
||||
RigCaseCellResultsData* matrixResults = rimCase->reservoirData()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
if (matrixResults)
|
||||
{
|
||||
if (matrixResults->updateResultName(RimDefines::INPUT_PROPERTY, oldName, newName))
|
||||
@@ -100,7 +100,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change
|
||||
}
|
||||
}
|
||||
|
||||
RigCaseCellResultsData* fracResults = rimCase->reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
if (fracResults)
|
||||
{
|
||||
if (fracResults->updateResultName(RimDefines::INPUT_PROPERTY, oldName, newName))
|
||||
|
||||
@@ -22,12 +22,14 @@
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
#include "RigFormationNames.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimViewController.h"
|
||||
|
||||
@@ -37,8 +39,8 @@
|
||||
|
||||
#include "cvfAssert.h"
|
||||
#include "cvfMath.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
|
||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||
|
||||
|
||||
namespace caf
|
||||
@@ -74,6 +76,11 @@ RimEclipsePropertyFilter::RimEclipsePropertyFilter()
|
||||
resultDefinition.uiCapability()->setUiHidden(true);
|
||||
resultDefinition.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_rangeLabelText, "Dummy_keyword", QString("Range Type"), "Range Type", "", "", "");
|
||||
m_rangeLabelText.xmlCapability()->setIOReadable(false);
|
||||
m_rangeLabelText.xmlCapability()->setIOWritable(false);
|
||||
m_rangeLabelText.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitField(&m_lowerBound, "LowerBound", 0.0, "Min", "", "", "");
|
||||
m_lowerBound.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
|
||||
@@ -124,7 +131,6 @@ bool RimEclipsePropertyFilter::isCategorySelectionActive() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
|
||||
if ( &m_lowerBound == changedField
|
||||
|| &m_upperBound == changedField
|
||||
|| &obsoleteField_evaluationRegion == changedField
|
||||
@@ -146,7 +152,10 @@ void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipsePropertyFilterCollection* RimEclipsePropertyFilter::parentContainer()
|
||||
{
|
||||
return dynamic_cast<RimEclipsePropertyFilterCollection*>(this->parentField()->ownerObject());
|
||||
RimEclipsePropertyFilterCollection* propFilterColl = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(propFilterColl);
|
||||
|
||||
return propFilterColl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -163,7 +172,6 @@ void RimEclipsePropertyFilter::setToDefaultValues()
|
||||
|
||||
m_selectedCategoryValues = m_categoryValues;
|
||||
m_useCategorySelection = true;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -176,10 +184,12 @@ void RimEclipsePropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
|
||||
// Fields declared in RimResultDefinition
|
||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
|
||||
resultDefinition->defineUiOrdering(uiConfigName, *group1);
|
||||
resultDefinition->uiOrdering(uiConfigName, *group1);
|
||||
|
||||
// Fields declared in RimCellFilter
|
||||
uiOrdering.add(&filterMode);
|
||||
|
||||
uiOrdering.add(&m_rangeLabelText);
|
||||
|
||||
if (resultDefinition->hasCategoryResult())
|
||||
{
|
||||
@@ -196,9 +206,10 @@ void RimEclipsePropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
uiOrdering.add(&m_upperBound);
|
||||
}
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
|
||||
updateReadOnlyStateOfAllFields();
|
||||
updateRangeLabel();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -226,9 +237,26 @@ void RimEclipsePropertyFilter::updateReadOnlyStateOfAllFields()
|
||||
objFields.push_back(&(resultDefinition->m_porosityModelUiField));
|
||||
objFields.push_back(&(resultDefinition->m_resultVariableUiField));
|
||||
|
||||
for (size_t i = 0; i < objFields.size(); i++)
|
||||
for (auto f : objFields)
|
||||
{
|
||||
objFields[i]->uiCapability()->setUiReadOnly(readOnlyState);
|
||||
if (f == &m_rangeLabelText) continue;
|
||||
|
||||
f->uiCapability()->setUiReadOnly(readOnlyState);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::updateRangeLabel()
|
||||
{
|
||||
if (resultDefinition->resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
m_rangeLabelText = "Current Timestep";
|
||||
}
|
||||
else
|
||||
{
|
||||
m_rangeLabelText = "All Timesteps";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,19 +265,15 @@ void RimEclipsePropertyFilter::updateReadOnlyStateOfAllFields()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipsePropertyFilter::isPropertyFilterControlled()
|
||||
{
|
||||
RimView* rimView = NULL;
|
||||
firstAncestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
RimView* rimView = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(rimView);
|
||||
|
||||
bool isPropertyFilterControlled = false;
|
||||
|
||||
if (rimView)
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
{
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
}
|
||||
isPropertyFilterControlled = true;
|
||||
}
|
||||
|
||||
return isPropertyFilterControlled;
|
||||
@@ -293,8 +317,8 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
{
|
||||
CVF_ASSERT(parentContainer());
|
||||
|
||||
double min = 0.0;
|
||||
double max = 0.0;
|
||||
double min = HUGE_VAL;
|
||||
double max = -HUGE_VAL;
|
||||
|
||||
clearCategories();
|
||||
|
||||
@@ -309,7 +333,7 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
if ( resultDefinition->flowDiagSolution() )
|
||||
{
|
||||
RigFlowDiagResults* results = resultDefinition->flowDiagSolution()->flowDiagResults();
|
||||
results->minMaxScalarValues(resAddr, timeStep, &max, &max);
|
||||
results->minMaxScalarValues(resAddr, timeStep, &min, &max);
|
||||
|
||||
if ( resultDefinition->hasCategoryResult() )
|
||||
{
|
||||
@@ -335,10 +359,10 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
}
|
||||
else
|
||||
{
|
||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->reservoirData());
|
||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->reservoirData()->activeFormationNames());
|
||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData());
|
||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames());
|
||||
|
||||
const std::vector<QString>& fnVector = parentContainer()->reservoirView()->eclipseCase()->reservoirData()->activeFormationNames()->formationNames();
|
||||
const std::vector<QString>& fnVector = parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames()->formationNames();
|
||||
setCategoryNames(fnVector);
|
||||
}
|
||||
}
|
||||
@@ -352,6 +376,88 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
m_upperBound.uiCapability()->setUiName(QString("Max (%1)").arg(max));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::updateFromCurrentTimeStep()
|
||||
{
|
||||
// Update range for flow diagnostics values when time step changes
|
||||
// Range for flow is always current time step, not computed across all time steps
|
||||
// If upper/lower slider is set to available extrema, the filter values will be
|
||||
// updated with the min/max values for the current time step
|
||||
//
|
||||
// If the user manually has set a filter value, this value is left untouched
|
||||
|
||||
if (resultDefinition->resultType() != RimDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double threshold = 1e-6;
|
||||
bool followMin = false;
|
||||
if (fabs(m_lowerBound - m_minimumResultValue) < threshold || m_minimumResultValue == HUGE_VAL)
|
||||
{
|
||||
followMin = true;
|
||||
}
|
||||
|
||||
bool followMax = false;
|
||||
if (fabs(m_upperBound - m_maximumResultValue) < threshold || m_maximumResultValue == -HUGE_VAL)
|
||||
{
|
||||
followMax = true;
|
||||
}
|
||||
|
||||
double min = HUGE_VAL;
|
||||
double max = -HUGE_VAL;
|
||||
|
||||
clearCategories();
|
||||
|
||||
RimView* view = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(view);
|
||||
|
||||
int timeStep = view->currentTimeStep();
|
||||
RigFlowDiagResultAddress resAddr = resultDefinition->flowDiagResAddress();
|
||||
if (resultDefinition->flowDiagSolution())
|
||||
{
|
||||
RigFlowDiagResults* results = resultDefinition->flowDiagSolution()->flowDiagResults();
|
||||
results->minMaxScalarValues(resAddr, timeStep, &min, &max);
|
||||
|
||||
if (resultDefinition->hasCategoryResult())
|
||||
{
|
||||
setCategoryNames(resultDefinition->flowDiagSolution()->tracerNames());
|
||||
}
|
||||
}
|
||||
|
||||
if (min == HUGE_VAL && max == -HUGE_VAL)
|
||||
{
|
||||
m_lowerBound.uiCapability()->setUiName(QString("Min (inf)"));
|
||||
m_upperBound.uiCapability()->setUiName(QString("Max (inf)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_maximumResultValue = max;
|
||||
m_minimumResultValue = min;
|
||||
|
||||
if (followMin)
|
||||
{
|
||||
m_lowerBound = min;
|
||||
}
|
||||
|
||||
if (followMax)
|
||||
{
|
||||
m_upperBound = m_maximumResultValue;
|
||||
}
|
||||
|
||||
m_lowerBound.uiCapability()->setUiName(QString("Min (%1)").arg(min));
|
||||
m_upperBound.uiCapability()->setUiName(QString("Max (%1)").arg(max));
|
||||
}
|
||||
|
||||
m_lowerBound.uiCapability()->updateConnectedEditors();
|
||||
m_upperBound.uiCapability()->updateConnectedEditors();
|
||||
|
||||
updateFilterName();
|
||||
this->name.uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -407,4 +513,3 @@ void RimEclipsePropertyFilter::initAfterRead()
|
||||
resultDefinition->setEclipseCase(parentContainer()->reservoirView()->eclipseCase());
|
||||
updateIconState();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,15 +49,14 @@ public:
|
||||
void rangeValues(double* lower, double* upper) const;
|
||||
bool isCategorySelectionActive() const;
|
||||
|
||||
RimEclipsePropertyFilterCollection* parentContainer();
|
||||
void setToDefaultValues();
|
||||
void updateFilterName();
|
||||
void computeResultValueRange();
|
||||
void updateFromCurrentTimeStep();
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual void initAfterRead();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName);
|
||||
@@ -70,9 +69,13 @@ private:
|
||||
|
||||
void updateActiveState();
|
||||
void updateReadOnlyStateOfAllFields();
|
||||
void updateRangeLabel();
|
||||
bool isPropertyFilterControlled();
|
||||
|
||||
RimEclipsePropertyFilterCollection* parentContainer();
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_rangeLabelText;
|
||||
caf::PdmField<double> m_lowerBound;
|
||||
caf::PdmField<double> m_upperBound;
|
||||
|
||||
|
||||
@@ -167,3 +167,14 @@ void RimEclipsePropertyFilterCollection::updateIconState()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilterCollection::updateFromCurrentTimeStep()
|
||||
{
|
||||
for (RimEclipsePropertyFilter* cellFilter : propertyFilters())
|
||||
{
|
||||
cellFilter->updateFromCurrentTimeStep();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
void loadAndInitializePropertyFilters();
|
||||
|
||||
void updateIconState();
|
||||
void updateFromCurrentTimeStep();
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
|
||||
@@ -124,7 +124,7 @@ bool RimEclipseResultCase::openEclipseGridFile()
|
||||
|
||||
progInfo.incrementProgress();
|
||||
|
||||
CVF_ASSERT(this->reservoirData());
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
CVF_ASSERT(readerInterface.notNull());
|
||||
|
||||
progInfo.setProgressDescription("Computing Case Cache");
|
||||
@@ -133,7 +133,7 @@ bool RimEclipseResultCase::openEclipseGridFile()
|
||||
m_gridAndWellDataIsReadFromFile = true;
|
||||
m_activeCellInfoIsReadFromFile = true;
|
||||
|
||||
if (reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes())
|
||||
if (eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes())
|
||||
{
|
||||
m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this);
|
||||
|
||||
@@ -177,15 +177,12 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl
|
||||
CVF_ASSERT(mainEclipseCase && mainEclipseCase->mainGrid());
|
||||
eclipseCase->setMainGrid(mainEclipseCase->mainGrid());
|
||||
|
||||
size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T;
|
||||
mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount);
|
||||
if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T)
|
||||
std::vector<QDateTime> timeStepDates = mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates();
|
||||
if (timeStepDates.size() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<QDateTime> timeStepDates = mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(scalarIndexWithMaxTimeStepCount);
|
||||
|
||||
cvf::ref<RifReaderEclipseOutput> readerEclipseOutput = new RifReaderEclipseOutput;
|
||||
if (!readerEclipseOutput->openAndReadActiveCellData(caseFileName(), timeStepDates, eclipseCase.p()))
|
||||
{
|
||||
@@ -202,10 +199,10 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl
|
||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
|
||||
CVF_ASSERT(this->reservoirData());
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
CVF_ASSERT(readerInterface.notNull());
|
||||
|
||||
reservoirData()->computeActiveCellBoundingBoxes();
|
||||
eclipseCaseData()->computeActiveCellBoundingBoxes();
|
||||
|
||||
m_activeCellInfoIsReadFromFile = true;
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimPlotCurve.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimView.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "cafPdmUiListEditor.h"
|
||||
|
||||
@@ -242,7 +242,7 @@ void RimEclipseResultDefinition::updateAnyFieldHasChanged()
|
||||
cellColors->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RimWellLogCurve* curve = nullptr;
|
||||
RimPlotCurve* curve = nullptr;
|
||||
this->firstAncestorOrThisOfType(curve);
|
||||
if (curve)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ void RimEclipseResultDefinition::loadDataAndUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
RimWellLogCurve* curve = nullptr;
|
||||
RimPlotCurve* curve = nullptr;
|
||||
this->firstAncestorOrThisOfType(curve);
|
||||
if (curve)
|
||||
{
|
||||
@@ -359,9 +359,9 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
|
||||
|
||||
bool hasFlowDiagFluxes = false;
|
||||
RimEclipseResultCase* eclResCase = dynamic_cast<RimEclipseResultCase*>(m_eclipseCase.p());
|
||||
if ( eclResCase && eclResCase->reservoirData() )
|
||||
if ( eclResCase && eclResCase->eclipseCaseData() )
|
||||
{
|
||||
hasFlowDiagFluxes = eclResCase->reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes();
|
||||
hasFlowDiagFluxes = eclResCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes();
|
||||
}
|
||||
|
||||
// Do not include flow diag results if not available
|
||||
@@ -521,7 +521,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
|
||||
|
||||
// Remove Per Cell Face options
|
||||
{
|
||||
RimWellLogCurve* curve = nullptr;
|
||||
RimPlotCurve* curve = nullptr;
|
||||
this->firstAncestorOrThisOfType(curve);
|
||||
|
||||
RimEclipsePropertyFilter* propFilter = nullptr;
|
||||
@@ -886,8 +886,8 @@ bool RimEclipseResultDefinition::hasCategoryResult() const
|
||||
{
|
||||
if (this->m_resultType() == RimDefines::FORMATION_NAMES
|
||||
&& m_eclipseCase
|
||||
&& m_eclipseCase->reservoirData()
|
||||
&& m_eclipseCase->reservoirData()->activeFormationNames() ) return true;
|
||||
&& m_eclipseCase->eclipseCaseData()
|
||||
&& m_eclipseCase->eclipseCaseData()->activeFormationNames() ) return true;
|
||||
|
||||
if (this->m_resultType() == RimDefines::FLOW_DIAGNOSTICS
|
||||
&& m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME) return true;
|
||||
@@ -904,9 +904,9 @@ bool RimEclipseResultDefinition::hasCategoryResult() const
|
||||
bool RimEclipseResultDefinition::hasDualPorFractureResult()
|
||||
{
|
||||
if ( m_eclipseCase
|
||||
&& m_eclipseCase->reservoirData()
|
||||
&& m_eclipseCase->reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)
|
||||
&& m_eclipseCase->reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount() > 0 )
|
||||
&& m_eclipseCase->eclipseCaseData()
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -945,7 +945,7 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
}
|
||||
uiOrdering.add(&m_resultVariableUiField);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -93,6 +93,7 @@ public:
|
||||
|
||||
void setTofAndSelectTracer(const QString& tracerName);
|
||||
|
||||
|
||||
protected:
|
||||
virtual void updateLegendCategorySettings() {};
|
||||
|
||||
|
||||
@@ -131,9 +131,9 @@ RimEclipseStatisticsCase::~RimEclipseStatisticsCase()
|
||||
void RimEclipseStatisticsCase::setMainGrid(RigMainGrid* mainGrid)
|
||||
{
|
||||
CVF_ASSERT(mainGrid);
|
||||
CVF_ASSERT(this->reservoirData());
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
|
||||
reservoirData()->setMainGrid(mainGrid);
|
||||
eclipseCaseData()->setMainGrid(mainGrid);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -141,7 +141,7 @@ void RimEclipseStatisticsCase::setMainGrid(RigMainGrid* mainGrid)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseStatisticsCase::openEclipseGridFile()
|
||||
{
|
||||
if (this->reservoirData()) return true;
|
||||
if (this->eclipseCaseData()) return true;
|
||||
|
||||
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData;
|
||||
|
||||
@@ -190,7 +190,7 @@ void RimEclipseStatisticsCase::populateResultSelectionAfterLoadingGrid()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseStatisticsCase::computeStatistics()
|
||||
{
|
||||
if (this->reservoirData() == NULL)
|
||||
if (this->eclipseCaseData() == NULL)
|
||||
{
|
||||
openEclipseGridFile();
|
||||
}
|
||||
@@ -228,7 +228,7 @@ void RimEclipseStatisticsCase::computeStatistics()
|
||||
timeStepIndices.push_back(i);
|
||||
}
|
||||
|
||||
RigEclipseCaseData* resultCase = reservoirData();
|
||||
RigEclipseCaseData* resultCase = eclipseCaseData();
|
||||
|
||||
QList<RimEclipseStatisticsCaseEvaluator::ResSpec > resultSpecification;
|
||||
|
||||
@@ -390,12 +390,12 @@ QList<caf::PdmOptionItemInfo> RimEclipseStatisticsCase::calculateValueOptions(co
|
||||
if (useOptionsOnly) *useOptionsOnly = true;
|
||||
|
||||
RimIdenticalGridCaseGroup* idgcg = caseGroup();
|
||||
if (!(caseGroup() && caseGroup()->mainCase() && caseGroup()->mainCase()->reservoirData()))
|
||||
if (!(caseGroup() && caseGroup()->mainCase() && caseGroup()->mainCase()->eclipseCaseData()))
|
||||
{
|
||||
return options;
|
||||
}
|
||||
|
||||
RigEclipseCaseData* caseData = idgcg->mainCase()->reservoirData();
|
||||
RigEclipseCaseData* caseData = idgcg->mainCase()->eclipseCaseData();
|
||||
|
||||
if (&m_selectedDynamicProperties == fieldNeedingOptions)
|
||||
{
|
||||
@@ -486,9 +486,9 @@ void RimEclipseStatisticsCase::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
sourceResultCase->openEclipseGridFile();
|
||||
|
||||
// Propagate well info to statistics case
|
||||
if (sourceResultCase->reservoirData())
|
||||
if (sourceResultCase->eclipseCaseData())
|
||||
{
|
||||
const cvf::Collection<RigSingleWellResultsData>& sourceCaseWellResults = sourceResultCase->reservoirData()->wellResults();
|
||||
const cvf::Collection<RigSingleWellResultsData>& sourceCaseWellResults = sourceResultCase->eclipseCaseData()->wellResults();
|
||||
setWellResultsAndUpdateViews(sourceCaseWellResults);
|
||||
}
|
||||
}
|
||||
@@ -505,7 +505,7 @@ void RimEclipseStatisticsCase::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseStatisticsCase::setWellResultsAndUpdateViews(const cvf::Collection<RigSingleWellResultsData>& sourceCaseWellResults)
|
||||
{
|
||||
this->reservoirData()->setWellResults(sourceCaseWellResults);
|
||||
this->eclipseCaseData()->setWellResults(sourceCaseWellResults);
|
||||
|
||||
caf::ProgressInfo progInfo(reservoirViews().size() + 1, "Updating Well Data for Views");
|
||||
|
||||
@@ -637,9 +637,9 @@ void RimEclipseStatisticsCase::updatePercentileUiVisibility()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseStatisticsCase::hasComputedStatistics() const
|
||||
{
|
||||
if ( reservoirData()
|
||||
&& ( reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->resultCount()
|
||||
|| reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS)->resultCount()))
|
||||
if ( eclipseCaseData()
|
||||
&& ( eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->resultCount()
|
||||
|| eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)->resultCount()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -677,14 +677,14 @@ void RimEclipseStatisticsCase::updateConnectedEditorsAndReservoirViews()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseStatisticsCase::clearComputedStatistics()
|
||||
{
|
||||
if (reservoirData() && reservoirData()->results(RifReaderInterface::MATRIX_RESULTS))
|
||||
if (eclipseCaseData() && eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS))
|
||||
{
|
||||
reservoirData()->results(RifReaderInterface::MATRIX_RESULTS)->clearAllResults();
|
||||
eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->clearAllResults();
|
||||
}
|
||||
|
||||
if (reservoirData() && reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS))
|
||||
if (eclipseCaseData() && eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS))
|
||||
{
|
||||
reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS)->clearAllResults();
|
||||
eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)->clearAllResults();
|
||||
}
|
||||
|
||||
updateConnectedEditorsAndReservoirViews();
|
||||
@@ -711,12 +711,12 @@ void RimEclipseStatisticsCase::computeStatisticsAndUpdateViews()
|
||||
void RimEclipseStatisticsCase::populateResultSelection()
|
||||
{
|
||||
RimIdenticalGridCaseGroup* idgcg = caseGroup();
|
||||
if (!(caseGroup() && caseGroup()->mainCase() && caseGroup()->mainCase()->reservoirData()))
|
||||
if (!(caseGroup() && caseGroup()->mainCase() && caseGroup()->mainCase()->eclipseCaseData()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RigEclipseCaseData* caseData = idgcg->mainCase()->reservoirData();
|
||||
RigEclipseCaseData* caseData = idgcg->mainCase()->eclipseCaseData();
|
||||
|
||||
if (m_selectedDynamicProperties().size() == 0)
|
||||
{
|
||||
|
||||
@@ -163,7 +163,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
|
||||
// Trigger loading of dataset
|
||||
sourceCase->results(poroModel)->findOrLoadScalarResultForTimeStep(resultType, resultName, dataAccessTimeStepIndex);
|
||||
|
||||
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromNameAndType(sourceCase->reservoirData(), gridIdx, poroModel, dataAccessTimeStepIndex, resultName, resultType);
|
||||
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromNameAndType(sourceCase->eclipseCaseData(), gridIdx, poroModel, dataAccessTimeStepIndex, resultName, resultType);
|
||||
if (resultAccessor.notNull())
|
||||
{
|
||||
sourceDataAccessList.push_back(resultAccessor.p());
|
||||
@@ -329,7 +329,7 @@ RimEclipseStatisticsCaseEvaluator::RimEclipseStatisticsCaseEvaluator(const std::
|
||||
{
|
||||
if (sourceCases.size() > 0)
|
||||
{
|
||||
m_reservoirCellCount = sourceCases[0]->reservoirData()->mainGrid()->globalCellArray().size();
|
||||
m_reservoirCellCount = sourceCases[0]->eclipseCaseData()->mainGrid()->globalCellArray().size();
|
||||
}
|
||||
|
||||
CVF_ASSERT(m_destinationCase);
|
||||
|
||||
111
ApplicationCode/ProjectDataModel/RimEclipseTopologyItem.cpp
Normal file
111
ApplicationCode/ProjectDataModel/RimEclipseTopologyItem.cpp
Normal file
@@ -0,0 +1,111 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimEclipseTopologyItem.h"
|
||||
|
||||
#include "RigTimeHistoryResultAccessor.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
|
||||
#include "RiuSelectionManager.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEclipseTopologyItem, "RimEclipseTopologyItem");
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseTopologyItem::RimEclipseTopologyItem()
|
||||
{
|
||||
CAF_PDM_InitObject("Eclipse Topoloty Item", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "EclipseCase", "Eclipse Case", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_gridIndex, "m_gridIndex", "m_gridIndex", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_cellIndex, "m_cellIndex", "m_cellIndex", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_localIntersectionPoint, "m_localIntersectionPoint", "m_localIntersectionPoint", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseTopologyItem::~RimEclipseTopologyItem()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseTopologyItem::setFromSelectionItem(const RiuEclipseSelectionItem* selectionItem)
|
||||
{
|
||||
m_gridIndex = selectionItem->m_gridIndex;
|
||||
m_cellIndex = selectionItem->m_cellIndex;
|
||||
m_localIntersectionPoint = selectionItem->m_localIntersectionPoint;
|
||||
|
||||
m_eclipseCase = selectionItem->m_view->eclipseCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimEclipseTopologyItem::topologyText() const
|
||||
{
|
||||
QString text;
|
||||
|
||||
if (m_eclipseCase)
|
||||
{
|
||||
text += m_eclipseCase->caseUserDescription();
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "No case";
|
||||
}
|
||||
|
||||
text += ", ";
|
||||
text += QString("Grid index %1").arg(m_gridIndex);
|
||||
text += ", ";
|
||||
text += RigTimeHistoryResultAccessor::topologyText(m_eclipseCase->eclipseCaseData(), m_gridIndex, m_cellIndex);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseCase* RimEclipseTopologyItem::eclipseCase() const
|
||||
{
|
||||
return m_eclipseCase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimEclipseTopologyItem::gridIndex() const
|
||||
{
|
||||
return m_gridIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimEclipseTopologyItem::cellIndex() const
|
||||
{
|
||||
return m_cellIndex;
|
||||
}
|
||||
56
ApplicationCode/ProjectDataModel/RimEclipseTopologyItem.h
Normal file
56
ApplicationCode/ProjectDataModel/RimEclipseTopologyItem.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimPickingTopologyItem.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
class RimEclipseCase;
|
||||
class RiuEclipseSelectionItem;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimEclipseTopologyItem : public RimPickingTopologyItem
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimEclipseTopologyItem();
|
||||
virtual ~RimEclipseTopologyItem() override;
|
||||
|
||||
void setFromSelectionItem(const RiuEclipseSelectionItem* selectionItem);
|
||||
|
||||
virtual QString topologyText() const override;
|
||||
|
||||
RimEclipseCase* eclipseCase() const;
|
||||
size_t gridIndex() const;
|
||||
size_t cellIndex() const;
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
|
||||
|
||||
caf::PdmField<size_t> m_gridIndex;
|
||||
caf::PdmField<size_t> m_cellIndex;
|
||||
caf::PdmField<cvf::Vec3d> m_localIntersectionPoint;
|
||||
};
|
||||
|
||||
@@ -61,9 +61,8 @@
|
||||
#include "RiuSelectionManager.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "RivReservoirPipesPartMgr.h"
|
||||
#include "RivReservoirSimWellsPartMgr.h"
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
#include "RivReservoirWellSpheresPartMgr.h"
|
||||
#include "RivSingleCellPartGenerator.h"
|
||||
#include "RivTernarySaturationOverlayItem.h"
|
||||
#include "RivWellPathCollectionPartMgr.h"
|
||||
@@ -137,10 +136,9 @@ RimEclipseView::RimEclipseView()
|
||||
this->faultResultSettings()->setReservoirView(this);
|
||||
|
||||
m_reservoirGridPartManager = new RivReservoirViewPartMgr(this);
|
||||
m_pipesPartManager = new RivReservoirPipesPartMgr(this);
|
||||
m_wellSpheresPartManager = new RivReservoirWellSpheresPartMgr(this);
|
||||
m_simWellsPartManager = new RivReservoirSimWellsPartMgr(this);
|
||||
|
||||
m_reservoir = NULL;
|
||||
m_eclipseCase = NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -158,7 +156,7 @@ RimEclipseView::~RimEclipseView()
|
||||
|
||||
m_reservoirGridPartManager->clearGeometryCache();
|
||||
|
||||
m_reservoir = NULL;
|
||||
m_eclipseCase = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +226,7 @@ void RimEclipseView::updateScaleTransform()
|
||||
scale(2, 2) = scaleZ();
|
||||
|
||||
this->scaleTransform()->setLocalTransform(scale);
|
||||
m_pipesPartManager->setScaleTransform(this->scaleTransform());
|
||||
m_simWellsPartManager->setScaleTransform(this->scaleTransform());
|
||||
|
||||
if (m_viewer) m_viewer->updateCachedValuesInScene();
|
||||
}
|
||||
@@ -250,7 +248,7 @@ void RimEclipseView::createDisplayModel()
|
||||
RiuMainWindow::instance()->setResultInfo(QString("RimReservoirView::createDisplayModel() ") + QString::number(callCount++));
|
||||
#endif
|
||||
|
||||
if (!(m_reservoir && m_reservoir->reservoirData())) return;
|
||||
if (!(m_eclipseCase && m_eclipseCase->eclipseCaseData())) return;
|
||||
|
||||
// Define a vector containing time step indices to produce geometry for.
|
||||
// First entry in this vector is used to define the geometry only result mode with no results.
|
||||
@@ -473,6 +471,8 @@ void RimEclipseView::createDisplayModel()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::updateCurrentTimeStep()
|
||||
{
|
||||
m_propertyFilterCollection()->updateFromCurrentTimeStep();
|
||||
|
||||
updateLegends(); // To make sure the scalar mappers are set up correctly
|
||||
|
||||
std::vector<RivCellSetEnum> geometriesToRecolor;
|
||||
@@ -613,26 +613,23 @@ void RimEclipseView::updateCurrentTimeStep()
|
||||
crossSectionCollection->applySingleColorEffect();
|
||||
}
|
||||
|
||||
// Simulation Well pipes
|
||||
// Simulation Wells
|
||||
if (m_viewer)
|
||||
{
|
||||
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
|
||||
if (frameScene)
|
||||
{
|
||||
// Simulation Well pipes
|
||||
cvf::ref<cvf::ModelBasicList> simWellModelBasicList = new cvf::ModelBasicList;
|
||||
simWellModelBasicList->setName("SimWellPipeMod");
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> wellPipeModelBasicList = new cvf::ModelBasicList;
|
||||
wellPipeModelBasicList->setName("SimWellPipeMod");
|
||||
m_simWellsPartManager->appendDynamicGeometryPartsToModel(simWellModelBasicList.p(), m_currentTimeStep);
|
||||
|
||||
m_pipesPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
m_wellSpheresPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
simWellModelBasicList->updateBoundingBoxesRecursive();
|
||||
|
||||
wellPipeModelBasicList->updateBoundingBoxesRecursive();
|
||||
this->removeModelByName(frameScene, simWellModelBasicList->name());
|
||||
frameScene->addModel(simWellModelBasicList.p());
|
||||
|
||||
this->removeModelByName(frameScene, wellPipeModelBasicList->name());
|
||||
frameScene->addModel(wellPipeModelBasicList.p());
|
||||
|
||||
m_pipesPartManager->updatePipeResultColor(m_currentTimeStep);
|
||||
m_simWellsPartManager->updatePipeResultColor(m_currentTimeStep);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,13 +647,13 @@ void RimEclipseView::loadDataAndUpdate()
|
||||
{
|
||||
updateScaleTransform();
|
||||
|
||||
if (m_reservoir)
|
||||
if (m_eclipseCase)
|
||||
{
|
||||
if (!m_reservoir->openReserviorCase())
|
||||
if (!m_eclipseCase->openReserviorCase())
|
||||
{
|
||||
QMessageBox::warning(RiuMainWindow::instance(),
|
||||
"Error when opening project file",
|
||||
"Could not open the Eclipse Grid file: \n"+ m_reservoir->gridFileName());
|
||||
"Could not open the Eclipse Grid file: \n"+ m_eclipseCase->gridFileName());
|
||||
this->setEclipseCase( NULL);
|
||||
return;
|
||||
}
|
||||
@@ -678,8 +675,7 @@ void RimEclipseView::loadDataAndUpdate()
|
||||
this->faultCollection()->syncronizeFaults();
|
||||
|
||||
m_reservoirGridPartManager->clearGeometryCache();
|
||||
m_pipesPartManager->clearGeometryCache();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
m_simWellsPartManager->clearGeometryCache();
|
||||
|
||||
syncronizeWellsWithResults();
|
||||
|
||||
@@ -813,11 +809,11 @@ void RimEclipseView::updateDisplayModelVisibility()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimReservoirCellResultsStorage* RimEclipseView::currentGridCellResults()
|
||||
{
|
||||
if (m_reservoir)
|
||||
if (m_eclipseCase)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult->porosityModel());
|
||||
|
||||
return m_reservoir->results(porosityModel);
|
||||
return m_eclipseCase->results(porosityModel);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -828,13 +824,13 @@ RimReservoirCellResultsStorage* RimEclipseView::currentGridCellResults()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigActiveCellInfo* RimEclipseView::currentActiveCellInfo()
|
||||
{
|
||||
if (m_reservoir &&
|
||||
m_reservoir->reservoirData()
|
||||
if (m_eclipseCase &&
|
||||
m_eclipseCase->eclipseCaseData()
|
||||
)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult->porosityModel());
|
||||
|
||||
return m_reservoir->reservoirData()->activeCellInfo(porosityModel);
|
||||
return m_eclipseCase->eclipseCaseData()->activeCellInfo(porosityModel);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -871,10 +867,9 @@ void RimEclipseView::scheduleReservoirGridGeometryRegen()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::schedulePipeGeometryRegen()
|
||||
void RimEclipseView::scheduleSimWellGeometryRegen()
|
||||
{
|
||||
m_pipesPartManager->scheduleGeometryRegen();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
m_simWellsPartManager->scheduleGeometryRegen();
|
||||
}
|
||||
|
||||
|
||||
@@ -887,9 +882,9 @@ void RimEclipseView::indicesToVisibleGrids(std::vector<size_t>* gridIndices)
|
||||
|
||||
// Create vector of grid indices to render
|
||||
std::vector<RigGridBase*> grids;
|
||||
if (this->m_reservoir && this->m_reservoir->reservoirData() )
|
||||
if (this->m_eclipseCase && this->m_eclipseCase->eclipseCaseData() )
|
||||
{
|
||||
this->m_reservoir->reservoirData()->allGrids(&grids);
|
||||
this->m_eclipseCase->eclipseCaseData()->allGrids(&grids);
|
||||
}
|
||||
|
||||
size_t i;
|
||||
@@ -912,12 +907,12 @@ void RimEclipseView::updateLegends()
|
||||
m_viewer->removeAllColorLegends();
|
||||
}
|
||||
|
||||
if (!m_reservoir || !m_viewer || !m_reservoir->reservoirData() )
|
||||
if (!m_eclipseCase || !m_viewer || !m_eclipseCase->eclipseCaseData() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RigEclipseCaseData* eclipseCase = m_reservoir->reservoirData();
|
||||
RigEclipseCaseData* eclipseCase = m_eclipseCase->eclipseCaseData();
|
||||
CVF_ASSERT(eclipseCase);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||
@@ -1049,7 +1044,7 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::setEclipseCase(RimEclipseCase* reservoir)
|
||||
{
|
||||
m_reservoir = reservoir;
|
||||
m_eclipseCase = reservoir;
|
||||
cellResult()->setEclipseCase(reservoir);
|
||||
faultResultSettings()->customFaultResult()->setEclipseCase(reservoir);
|
||||
|
||||
@@ -1061,7 +1056,7 @@ void RimEclipseView::setEclipseCase(RimEclipseCase* reservoir)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseCase* RimEclipseView::eclipseCase() const
|
||||
{
|
||||
return m_reservoir;
|
||||
return m_eclipseCase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1079,9 +1074,9 @@ RimEclipseCase* RimEclipseView::eclipseCase() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::syncronizeWellsWithResults()
|
||||
{
|
||||
if (!(m_reservoir && m_reservoir->reservoirData()) ) return;
|
||||
if (!(m_eclipseCase && m_eclipseCase->eclipseCaseData()) ) return;
|
||||
|
||||
cvf::Collection<RigSingleWellResultsData> wellResults = m_reservoir->reservoirData()->wellResults();
|
||||
cvf::Collection<RigSingleWellResultsData> wellResults = m_eclipseCase->eclipseCaseData()->wellResults();
|
||||
|
||||
|
||||
std::vector<caf::PdmPointer<RimEclipseWell> > newWells;
|
||||
@@ -1262,8 +1257,7 @@ void RimEclipseView::calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleC
|
||||
void RimEclipseView::updateDisplayModelForWellResults()
|
||||
{
|
||||
m_reservoirGridPartManager->clearGeometryCache();
|
||||
m_pipesPartManager->clearGeometryCache();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
m_simWellsPartManager->clearGeometryCache();
|
||||
|
||||
syncronizeWellsWithResults();
|
||||
|
||||
@@ -1328,7 +1322,7 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
uiTreeOrdering.add(m_rangeFilterCollection());
|
||||
uiTreeOrdering.add(m_propertyFilterCollection());
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1454,9 +1448,9 @@ RimCase* RimEclipseView::ownerCase()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigMainGrid* RimEclipseView::mainGrid() const
|
||||
{
|
||||
if (eclipseCase() && eclipseCase()->reservoirData())
|
||||
if (eclipseCase() && eclipseCase()->eclipseCaseData())
|
||||
{
|
||||
return eclipseCase()->reservoirData()->mainGrid();
|
||||
return eclipseCase()->eclipseCaseData()->mainGrid();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -1508,7 +1502,7 @@ void RimEclipseView::setOverridePropertyFilterCollection(RimEclipsePropertyFilte
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility)
|
||||
{
|
||||
size_t gridCount = this->eclipseCase()->reservoirData()->gridCount();
|
||||
size_t gridCount = this->eclipseCase()->eclipseCaseData()->gridCount();
|
||||
size_t cellCount = this->mainGrid()->globalCellArray().size();
|
||||
|
||||
totalVisibility->resize(cellCount);
|
||||
@@ -1516,7 +1510,7 @@ void RimEclipseView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalV
|
||||
|
||||
for (size_t gridIdx = 0; gridIdx < gridCount; ++gridIdx)
|
||||
{
|
||||
RigGridBase * grid = this->eclipseCase()->reservoirData()->grid(gridIdx);
|
||||
RigGridBase * grid = this->eclipseCase()->eclipseCaseData()->grid(gridIdx);
|
||||
int gridCellCount = static_cast<int>(grid->cellCount());
|
||||
|
||||
for (size_t gpIdx = 0; gpIdx < m_visibleGridParts.size(); ++gpIdx)
|
||||
@@ -1556,9 +1550,9 @@ void RimEclipseView::createPartCollectionFromSelection(cvf::Collection<cvf::Part
|
||||
if (eclipseSelItem && eclipseSelItem->m_view == this)
|
||||
{
|
||||
CVF_ASSERT(eclipseSelItem->m_view->eclipseCase());
|
||||
CVF_ASSERT(eclipseSelItem->m_view->eclipseCase()->reservoirData());
|
||||
CVF_ASSERT(eclipseSelItem->m_view->eclipseCase()->eclipseCaseData());
|
||||
|
||||
RivSingleCellPartGenerator partGen(eclipseSelItem->m_view->eclipseCase()->reservoirData(), eclipseSelItem->m_gridIndex, eclipseSelItem->m_cellIndex);
|
||||
RivSingleCellPartGenerator partGen(eclipseSelItem->m_view->eclipseCase()->eclipseCaseData(), eclipseSelItem->m_gridIndex, eclipseSelItem->m_cellIndex);
|
||||
|
||||
cvf::ref<cvf::Part> part = partGen.createPart(eclipseSelItem->m_color);
|
||||
part->setTransform(this->scaleTransform());
|
||||
|
||||
@@ -54,8 +54,7 @@ class RimReservoirCellResultsStorage;
|
||||
class RimEclipseCellColors;
|
||||
class RimEclipseWellCollection;
|
||||
class RiuViewer;
|
||||
class RivReservoirPipesPartMgr;
|
||||
class RivReservoirWellSpheresPartMgr;
|
||||
class RivReservoirSimWellsPartMgr;
|
||||
class RivIntersectionPartMgr;
|
||||
class RivReservoirViewPartMgr;
|
||||
|
||||
@@ -88,12 +87,12 @@ public:
|
||||
|
||||
// Fields containing child objects :
|
||||
|
||||
caf::PdmChildField<RimEclipseCellColors*> cellResult;
|
||||
caf::PdmChildField<RimCellEdgeColors*> cellEdgeResult;
|
||||
caf::PdmChildField<RimEclipseFaultColors*> faultResultSettings;
|
||||
|
||||
caf::PdmChildField<RimEclipseWellCollection*> wellCollection;
|
||||
caf::PdmChildField<RimFaultCollection*> faultCollection;
|
||||
caf::PdmChildField<RimEclipseCellColors*> cellResult;
|
||||
caf::PdmChildField<RimCellEdgeColors*> cellEdgeResult;
|
||||
caf::PdmChildField<RimEclipseFaultColors*> faultResultSettings;
|
||||
|
||||
caf::PdmChildField<RimEclipseWellCollection*> wellCollection;
|
||||
caf::PdmChildField<RimFaultCollection*> faultCollection;
|
||||
|
||||
// Fields
|
||||
|
||||
@@ -125,7 +124,7 @@ public:
|
||||
|
||||
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType);
|
||||
void scheduleReservoirGridGeometryRegen();
|
||||
void schedulePipeGeometryRegen();
|
||||
void scheduleSimWellGeometryRegen();
|
||||
void updateDisplayModelForWellResults();
|
||||
|
||||
const std::vector<RivCellSetEnum>& visibleGridParts() const;
|
||||
@@ -177,11 +176,10 @@ private:
|
||||
caf::PdmChildField<RimEclipsePropertyFilterCollection*> m_propertyFilterCollection;
|
||||
caf::PdmPointer<RimEclipsePropertyFilterCollection> m_overridePropertyFilterCollection;
|
||||
|
||||
caf::PdmPointer<RimEclipseCase> m_reservoir;
|
||||
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
||||
|
||||
cvf::ref<RivReservoirViewPartMgr> m_reservoirGridPartManager;
|
||||
cvf::ref<RivReservoirPipesPartMgr> m_pipesPartManager;
|
||||
cvf::ref<RivReservoirWellSpheresPartMgr> m_wellSpheresPartManager;
|
||||
cvf::ref<RivReservoirSimWellsPartMgr> m_simWellsPartManager;
|
||||
|
||||
std::vector<RivCellSetEnum> m_visibleGridParts;
|
||||
};
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
#include "RivReservoirViewPartMgr.h"
|
||||
|
||||
#include "cvfMath.h"
|
||||
#include "RigCell.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEclipseWell, "Well");
|
||||
|
||||
@@ -107,7 +112,7 @@ void RimEclipseWell::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
if (reservoirView)
|
||||
{
|
||||
reservoirView->schedulePipeGeometryRegen();
|
||||
reservoirView->scheduleSimWellGeometryRegen();
|
||||
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
@@ -155,6 +160,81 @@ void RimEclipseWell::calculateWellPipeDynamicCenterLine(size_t timeStepIdx,
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeDynamicCenterline(this, timeStepIdx, pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseWell::wellHeadTopBottomPosition(size_t frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom)
|
||||
{
|
||||
|
||||
RimEclipseView* m_rimReservoirView;
|
||||
firstAncestorOrThisOfTypeAsserted(m_rimReservoirView);
|
||||
|
||||
RigEclipseCaseData* rigReservoir = m_rimReservoirView->eclipseCase()->eclipseCaseData();
|
||||
|
||||
if (!this->wellResults()->hasWellResult(frameIndex)) return;
|
||||
|
||||
const RigWellResultFrame& wellResultFrame = this->wellResults()->wellResultFrame(frameIndex);
|
||||
const RigCell& whCell = rigReservoir->cellFromWellResultCell(wellResultFrame.m_wellHead);
|
||||
|
||||
// Match this position with pipe start position in RivWellPipesPartMgr::calculateWellPipeCenterline()
|
||||
|
||||
(*bottom) = whCell.faceCenter(cvf::StructGridInterface::NEG_K);
|
||||
|
||||
// Compute well head based on the z position of the top of the K column the well head is part of
|
||||
(*top) = (*bottom);
|
||||
if ( m_rimReservoirView->wellCollection()->wellHeadPosition() == RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN )
|
||||
{
|
||||
// Position well head at top active cell of IJ-column
|
||||
|
||||
size_t i, j, k;
|
||||
rigReservoir->mainGrid()->ijkFromCellIndex(whCell.mainGridCellIndex(), &i, &j, &k);
|
||||
|
||||
size_t kIndexWellHeadCell = k;
|
||||
k = 0;
|
||||
|
||||
size_t topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, k);
|
||||
while ( k < kIndexWellHeadCell && !m_rimReservoirView->currentActiveCellInfo()->isActive(topActiveCellIndex) )
|
||||
{
|
||||
k++;
|
||||
topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, k);
|
||||
}
|
||||
|
||||
const RigCell& topActiveCell = rigReservoir->mainGrid()->cell(topActiveCellIndex);
|
||||
cvf::Vec3d topCellPos = topActiveCell.faceCenter(cvf::StructGridInterface::NEG_K);
|
||||
|
||||
// Modify position if top active cell is closer to sea than well head
|
||||
if ( kIndexWellHeadCell > k )
|
||||
{
|
||||
top->z() = topCellPos.z();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Position well head at top of active cells bounding box
|
||||
|
||||
cvf::Vec3d activeCellsBoundingBoxMax = m_rimReservoirView->currentActiveCellInfo()->geometryBoundingBox().max();
|
||||
|
||||
top->z() = activeCellsBoundingBoxMax.z();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimEclipseWell::pipeRadius()
|
||||
{
|
||||
RimEclipseView* reservoirView;
|
||||
firstAncestorOrThisOfTypeAsserted(reservoirView);
|
||||
|
||||
RigEclipseCaseData* rigReservoir = reservoirView->eclipseCase()->eclipseCaseData();
|
||||
|
||||
double characteristicCellSize = rigReservoir->mainGrid()->characteristicIJCellSize();
|
||||
|
||||
double pipeRadius = reservoirView->wellCollection()->pipeScaleFactor() * this->pipeScaleFactor() * characteristicCellSize;
|
||||
|
||||
return pipeRadius;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -273,7 +353,7 @@ void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
|
||||
showWellCellFence.uiCapability()->setUiReadOnly(!showWellCells());
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -69,6 +69,8 @@ public:
|
||||
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds);
|
||||
|
||||
void wellHeadTopBottomPosition(size_t frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom);
|
||||
double pipeRadius();
|
||||
caf::PdmField<bool> showWell;
|
||||
|
||||
caf::PdmField<QString> name;
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiCheckBoxTristateEditor.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
|
||||
|
||||
namespace caf
|
||||
@@ -198,6 +199,8 @@ RimEclipseWellCollection::RimEclipseWellCollection()
|
||||
CAF_PDM_InitField(&obsoleteField_showWellLabel, "ShowWellLabel", true, "Show Well Label", "", "", "");
|
||||
CAF_PDM_InitField(&obsoleteField_showWellCellFence, "ShowWellFences", false, "Show Well Cell Fence", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_showWellCommunicationLines, "ShowWellCommunicationLines", false, "Show Communication Lines", "", "", "");
|
||||
|
||||
obsoleteField_showWellHead.uiCapability()->setUiHidden(true);
|
||||
obsoleteField_showWellLabel.uiCapability()->setUiHidden(true);
|
||||
obsoleteField_showWellCellFence.uiCapability()->setUiHidden(true);
|
||||
@@ -392,7 +395,7 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
|| &m_showWellSpheres == changedField
|
||||
|| &showConnectionStatusColors == changedField)
|
||||
{
|
||||
m_reservoirView->schedulePipeGeometryRegen();
|
||||
m_reservoirView->scheduleSimWellGeometryRegen();
|
||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else if ( &pipeCrossSectionVertexCount == changedField
|
||||
@@ -405,13 +408,13 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
|| &wellPipeCoordType == changedField
|
||||
|| &m_showWellPipe == changedField)
|
||||
{
|
||||
m_reservoirView->schedulePipeGeometryRegen();
|
||||
m_reservoirView->scheduleSimWellGeometryRegen();
|
||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else if (&showWellsIntersectingVisibleCells == changedField)
|
||||
{
|
||||
m_reservoirView->scheduleGeometryRegen(VISIBLE_WELL_CELLS);
|
||||
m_reservoirView->schedulePipeGeometryRegen();
|
||||
m_reservoirView->scheduleSimWellGeometryRegen();
|
||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
@@ -446,6 +449,11 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
{
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
}
|
||||
|
||||
if (&m_showWellCommunicationLines == changedField)
|
||||
{
|
||||
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -454,15 +462,19 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
void RimEclipseWellCollection::assignDefaultWellColors()
|
||||
{
|
||||
const caf::ColorTable& colorTable = RiaColorTables::wellsPaletteColors();
|
||||
cvf::Color3ubArray catColors = colorTable.color3ubArray();
|
||||
cvf::Color3ubArray interpolatedCatColors = caf::ColorTable::interpolateColorArray(catColors, wells.size());
|
||||
cvf::Color3ubArray wellColors = colorTable.color3ubArray();
|
||||
cvf::Color3ubArray interpolatedWellColors = wellColors;
|
||||
if (wells.size() > 1)
|
||||
{
|
||||
interpolatedWellColors = caf::ColorTable::interpolateColorArray(wellColors, wells.size());
|
||||
}
|
||||
|
||||
for (size_t wIdx = 0; wIdx < wells.size(); ++wIdx)
|
||||
{
|
||||
RimEclipseWell* well = wells[wIdx];
|
||||
if (well)
|
||||
{
|
||||
cvf::Color3f col = cvf::Color3f(interpolatedCatColors[wIdx]);
|
||||
cvf::Color3f col = cvf::Color3f(interpolatedWellColors[wIdx]);
|
||||
|
||||
well->wellPipeColor = col;
|
||||
well->updateConnectedEditors();
|
||||
@@ -539,6 +551,10 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
filterGroup->add(&m_showWellCellFence);
|
||||
filterGroup->add(&wellCellFenceType);
|
||||
|
||||
RimEclipseResultCase* ownerCase;
|
||||
firstAncestorOrThisOfTypeAsserted(ownerCase);
|
||||
m_showWellCommunicationLines.uiCapability()->setUiHidden(!ownerCase->flowDiagSolverInterface());
|
||||
|
||||
m_showWellCellFence.uiCapability()->setUiReadOnly(!showWellCells());
|
||||
wellCellFenceType.uiCapability()->setUiReadOnly(!showWellCells());
|
||||
}
|
||||
|
||||
@@ -98,6 +98,8 @@ public:
|
||||
void setShowWellCellsState(bool enable);
|
||||
bool showWellCells();
|
||||
|
||||
bool showWellCommunicationLines() { return m_showWellCommunicationLines();}
|
||||
|
||||
caf::PdmField<WellFenceEnum> wellCellFenceType;
|
||||
caf::PdmField<double> wellCellTransparencyLevel;
|
||||
|
||||
@@ -155,6 +157,8 @@ private:
|
||||
caf::PdmField<caf::Tristate> m_showWellCells;
|
||||
caf::PdmField<caf::Tristate> m_showWellCellFence;
|
||||
|
||||
caf::PdmField<bool> m_showWellCommunicationLines;
|
||||
|
||||
// Obsolete fields
|
||||
caf::PdmField<WellVisibilityEnum> obsoleteField_wellPipeVisibility;
|
||||
caf::PdmField<WellCellsRangeFilterEnum> obsoleteField_wellCellsToRangeFilterMode;
|
||||
|
||||
@@ -133,7 +133,7 @@ void RimGeoMechPropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
uiOrdering.add(&name);
|
||||
|
||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
|
||||
resultDefinition->defineUiOrdering(uiConfigName, *group1);
|
||||
resultDefinition->uiOrdering(uiConfigName, *group1);
|
||||
|
||||
uiOrdering.add(&isActive);
|
||||
uiOrdering.add(&filterMode);
|
||||
@@ -150,7 +150,7 @@ void RimGeoMechPropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
|
||||
updateReadOnlyStateOfAllFields();
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechPropertyFilter.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimPlotCurve.h"
|
||||
#include "RimViewLinker.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "cafPdmUiListEditor.h"
|
||||
|
||||
@@ -119,7 +119,7 @@ void RimGeoMechResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
if (m_isTimeLapseResultUiField())
|
||||
timeLapseGr->add(&m_timeLapseBaseTimestepUiField);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -206,12 +206,11 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
|
||||
// Get the possible property filter owner
|
||||
RimGeoMechPropertyFilter* propFilter = dynamic_cast<RimGeoMechPropertyFilter*>(this->parentField()->ownerObject());
|
||||
RimView* view = NULL;
|
||||
RimView* view = nullptr;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
RimWellLogCurve* curve = NULL;
|
||||
RimPlotCurve* curve = nullptr;
|
||||
this->firstAncestorOrThisOfType(curve);
|
||||
|
||||
|
||||
if (&m_resultVariableUiField == changedField)
|
||||
{
|
||||
QStringList fieldComponentNames = m_resultVariableUiField().split(QRegExp("\\s+"));
|
||||
|
||||
@@ -63,8 +63,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void updateLegendCategorySettings() {};
|
||||
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -72,7 +71,6 @@ private:
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool * useOptionsOnly);
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue);
|
||||
|
||||
@@ -641,7 +641,7 @@ void RimGeoMechView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
uiTreeOrdering.add(m_rangeFilterCollection());
|
||||
uiTreeOrdering.add(m_propertyFilterCollection());
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
601
ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp
Normal file
601
ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp
Normal file
@@ -0,0 +1,601 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimGridTimeHistoryCurve.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigTimeHistoryResultAccessor.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEclipseTopologyItem.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechTopologyItem.h"
|
||||
#include "RimGeoMechResultDefinition.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryTimeAxisProperties.h"
|
||||
|
||||
#include "RiuFemTimeHistoryResultAccessor.h"
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuSelectionManager.h"
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimGridTimeHistoryCurve, "TimeHistoryCurve");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridTimeHistoryCurve::RimGridTimeHistoryCurve()
|
||||
{
|
||||
CAF_PDM_InitObject("Grid Time History Curve", ":/SummaryCurve16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_topologyText, "TopologyText", "Topology Reference", "", "", "");
|
||||
m_topologyText.registerGetMethod(this, &RimGridTimeHistoryCurve::topologyText);
|
||||
m_topologyText.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_eclipseResultDefinition, "EclipseResultDefinition", "Eclipse Result definition", "", "", "");
|
||||
m_eclipseResultDefinition.uiCapability()->setUiHidden(true);
|
||||
m_eclipseResultDefinition.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_geoMechResultDefinition, "GeoMechResultDefinition", "GeoMech Result definition", "", "", "");
|
||||
m_geoMechResultDefinition.uiCapability()->setUiHidden(true);
|
||||
m_geoMechResultDefinition.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_pickingTopologyItem, "PickingTopologyItem", "Picking Topology Item", "", "", "");
|
||||
m_pickingTopologyItem.uiCapability()->setUiTreeHidden(true);
|
||||
m_pickingTopologyItem.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_plotAxis, "PlotAxis", caf::AppEnum< RimDefines::PlotAxis >(RimDefines::PLOT_AXIS_LEFT), "Axis", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridTimeHistoryCurve::~RimGridTimeHistoryCurve()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::setFromSelectionItem(const RiuSelectionItem* selectionItem)
|
||||
{
|
||||
if (m_pickingTopologyItem())
|
||||
{
|
||||
delete m_pickingTopologyItem();
|
||||
}
|
||||
|
||||
if (m_eclipseResultDefinition())
|
||||
{
|
||||
delete m_eclipseResultDefinition();
|
||||
}
|
||||
|
||||
if (m_geoMechResultDefinition())
|
||||
{
|
||||
delete m_geoMechResultDefinition();
|
||||
}
|
||||
|
||||
const RiuEclipseSelectionItem* eclSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>(selectionItem);
|
||||
if (eclSelectionItem)
|
||||
{
|
||||
RimEclipseTopologyItem* topologyItem = new RimEclipseTopologyItem;
|
||||
m_pickingTopologyItem = topologyItem;
|
||||
|
||||
topologyItem->setFromSelectionItem(eclSelectionItem);
|
||||
|
||||
if (eclSelectionItem->m_view)
|
||||
{
|
||||
m_eclipseResultDefinition = new RimEclipseResultDefinition;
|
||||
m_eclipseResultDefinition->simpleCopy(eclSelectionItem->m_view->cellResult());
|
||||
}
|
||||
}
|
||||
|
||||
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(selectionItem);
|
||||
if (geoMechSelectionItem)
|
||||
{
|
||||
RimGeoMechTopologyItem* topologyItem = new RimGeoMechTopologyItem;
|
||||
m_pickingTopologyItem = topologyItem;
|
||||
|
||||
topologyItem->setFromSelectionItem(geoMechSelectionItem);
|
||||
|
||||
if (geoMechSelectionItem->m_view)
|
||||
{
|
||||
m_geoMechResultDefinition = new RimGeoMechResultDefinition;
|
||||
m_geoMechResultDefinition->setGeoMechCase(geoMechSelectionItem->m_view->geoMechCase());
|
||||
m_geoMechResultDefinition->setResultAddress(geoMechSelectionItem->m_view->cellResultResultDefinition()->resultAddress());
|
||||
}
|
||||
}
|
||||
|
||||
updateResultDefinitionFromCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimDefines::PlotAxis RimGridTimeHistoryCurve::yAxis() const
|
||||
{
|
||||
return m_plotAxis();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::setYAxis(RimDefines::PlotAxis plotAxis)
|
||||
{
|
||||
m_plotAxis = plotAxis;
|
||||
|
||||
updateQwtPlotAxis();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimGridTimeHistoryCurve::yValues() const
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
RimEclipseTopologyItem* eclTopItem = eclipseTopologyItem();
|
||||
if (eclTopItem && eclTopItem->eclipseCase())
|
||||
{
|
||||
size_t cellIndex = eclTopItem->cellIndex();
|
||||
size_t gridIndex = eclTopItem->gridIndex();
|
||||
|
||||
CVF_ASSERT(m_eclipseResultDefinition());
|
||||
m_eclipseResultDefinition->loadResult();
|
||||
|
||||
RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults();
|
||||
RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults();
|
||||
|
||||
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
|
||||
|
||||
values = RigTimeHistoryResultAccessor::timeHistoryValues(eclTopItem->eclipseCase()->eclipseCaseData(), m_eclipseResultDefinition(), gridIndex, cellIndex, timeStepDates.size());
|
||||
}
|
||||
|
||||
if (geoMechTopologyItem() && geoMechTopologyItem()->geoMechCase())
|
||||
{
|
||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor = femTimeHistoryResultAccessor();
|
||||
|
||||
if (timeHistResultAccessor)
|
||||
{
|
||||
values = timeHistResultAccessor->timeHistoryValues();
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridTimeHistoryCurve::quantityName() const
|
||||
{
|
||||
RimEclipseTopologyItem* eclTopItem = eclipseTopologyItem();
|
||||
if (eclTopItem)
|
||||
{
|
||||
CVF_ASSERT(m_eclipseResultDefinition());
|
||||
|
||||
return m_eclipseResultDefinition->resultVariableUiName();
|
||||
}
|
||||
|
||||
if (geoMechTopologyItem())
|
||||
{
|
||||
CVF_ASSERT(m_geoMechResultDefinition());
|
||||
|
||||
RimGeoMechTopologyItem* geoMechTopItem = geoMechTopologyItem();
|
||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor = femTimeHistoryResultAccessor();
|
||||
|
||||
QString text;
|
||||
|
||||
caf::AppEnum<RigFemResultPosEnum> resPosAppEnum = m_geoMechResultDefinition()->resultPositionType();
|
||||
text.append(resPosAppEnum.uiText() + ", ");
|
||||
text.append(m_geoMechResultDefinition()->resultFieldUiName() + ", ");
|
||||
text.append(m_geoMechResultDefinition()->resultComponentUiName() + " ");
|
||||
|
||||
if (resPosAppEnum == RIG_ELEMENT_NODAL_FACE)
|
||||
{
|
||||
if (geoMechTopItem->m_elementFace >= 0)
|
||||
{
|
||||
text.append(", " + caf::AppEnum<cvf::StructGridInterface::FaceType>::textFromIndex(geoMechTopItem->m_elementFace));
|
||||
}
|
||||
else
|
||||
{
|
||||
text.append(", from N[" + QString::number(timeHistResultAccessor->closestNodeId()) + "] transformed onto intersection");
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridTimeHistoryCurve::caseName() const
|
||||
{
|
||||
RimEclipseTopologyItem* eclTopItem = eclipseTopologyItem();
|
||||
if (eclTopItem && eclTopItem->eclipseCase())
|
||||
{
|
||||
return eclTopItem->eclipseCase()->caseUserDescription();
|
||||
}
|
||||
|
||||
RimGeoMechTopologyItem* geoMechTopItem = geoMechTopologyItem();
|
||||
if (geoMechTopItem && geoMechTopItem->geoMechCase())
|
||||
{
|
||||
return geoMechTopItem->geoMechCase()->caseUserDescription();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridTimeHistoryCurve::createCurveAutoName()
|
||||
{
|
||||
QString text;
|
||||
|
||||
text += quantityName();
|
||||
|
||||
QString topoText = topologyText();
|
||||
|
||||
if (!topoText.isEmpty())
|
||||
{
|
||||
text += ", ";
|
||||
text += topoText;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::updateZoomInParentPlot()
|
||||
{
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfType(plot);
|
||||
|
||||
plot->updateZoomInQwt();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::onLoadDataAndUpdate()
|
||||
{
|
||||
this->RimPlotCurve::updateCurvePresentation();
|
||||
|
||||
if (isCurveVisible())
|
||||
{
|
||||
std::vector<time_t> dateTimes;
|
||||
std::vector<double> values;
|
||||
|
||||
RimEclipseTopologyItem* eclTopItem = eclipseTopologyItem();
|
||||
if (eclTopItem && eclTopItem->eclipseCase())
|
||||
{
|
||||
m_eclipseResultDefinition->loadResult();
|
||||
}
|
||||
|
||||
RimGeoMechTopologyItem* geoMechTopItem = geoMechTopologyItem();
|
||||
if (geoMechTopItem && geoMechTopItem->geoMechCase())
|
||||
{
|
||||
m_geoMechResultDefinition->loadResult();
|
||||
}
|
||||
|
||||
dateTimes = timeStepValues();
|
||||
values = yValues();
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfType(plot);
|
||||
bool isLogCurve = plot->isLogarithmicScaleEnabled(this->yAxis());
|
||||
|
||||
if (dateTimes.size() > 0 && dateTimes.size() == values.size())
|
||||
{
|
||||
if (plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE)
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromTimeTAndValues(dateTimes, values, isLogCurve);
|
||||
}
|
||||
else
|
||||
{
|
||||
double timeScale = plot->timeAxisProperties()->fromTimeTToDisplayUnitScale();
|
||||
|
||||
std::vector<double> times;
|
||||
if (dateTimes.size())
|
||||
{
|
||||
time_t startDate = dateTimes[0];
|
||||
for (time_t& date : dateTimes)
|
||||
{
|
||||
times.push_back(timeScale*(date - startDate));
|
||||
}
|
||||
}
|
||||
|
||||
m_qwtPlotCurve->setSamplesFromTimeAndValues(times, values, isLogCurve);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromTimeTAndValues(std::vector<time_t>(), std::vector<double>(), isLogCurve);
|
||||
}
|
||||
|
||||
updateZoomInParentPlot();
|
||||
|
||||
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
||||
|
||||
updateQwtPlotAxis();
|
||||
plot->updateAxes();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<time_t> RimGridTimeHistoryCurve::timeStepValues() const
|
||||
{
|
||||
std::vector<time_t> dateTimes;
|
||||
|
||||
RimEclipseTopologyItem* eclTopItem = eclipseTopologyItem();
|
||||
if (eclTopItem && eclTopItem->eclipseCase())
|
||||
{
|
||||
RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults();
|
||||
RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults();
|
||||
|
||||
std::vector<QDateTime> timeStepDates = cellResultsData->timeStepDates();
|
||||
|
||||
for (QDateTime dt : timeStepDates)
|
||||
{
|
||||
dateTimes.push_back(dt.toTime_t());
|
||||
}
|
||||
}
|
||||
|
||||
RimGeoMechTopologyItem* geoMechTopItem = geoMechTopologyItem();
|
||||
if (geoMechTopItem && geoMechTopItem->geoMechCase())
|
||||
{
|
||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor = femTimeHistoryResultAccessor();
|
||||
if (timeHistResultAccessor)
|
||||
{
|
||||
std::vector<double> values = timeHistResultAccessor->timeHistoryValues();
|
||||
|
||||
QStringList stepNames = geoMechTopItem->geoMechCase()->timeStepStrings();
|
||||
std::vector<QDateTime> dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames);
|
||||
if (dates.size() == values.size())
|
||||
{
|
||||
for (QDateTime dt : dates)
|
||||
{
|
||||
dateTimes.push_back(dt.toTime_t());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < values.size(); i++)
|
||||
{
|
||||
dateTimes.push_back(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dateTimes;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
RimPlotCurve::updateOptionSensitivity();
|
||||
|
||||
uiOrdering.add(&m_topologyText);
|
||||
|
||||
// Fields declared in RimResultDefinition
|
||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
|
||||
if (eclipseTopologyItem())
|
||||
{
|
||||
CVF_ASSERT(m_eclipseResultDefinition());
|
||||
m_eclipseResultDefinition->uiOrdering(uiConfigName, *group1);
|
||||
}
|
||||
|
||||
if (geoMechTopologyItem())
|
||||
{
|
||||
CVF_ASSERT(m_geoMechResultDefinition());
|
||||
m_geoMechResultDefinition->uiOrdering(uiConfigName, *group1);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_plotAxis);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::initAfterRead()
|
||||
{
|
||||
updateResultDefinitionFromCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &m_plotAxis)
|
||||
{
|
||||
updateQwtPlotAxis();
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(plot);
|
||||
|
||||
plot->updateAxes();
|
||||
}
|
||||
else
|
||||
{
|
||||
RimPlotCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigMainGrid* RimGridTimeHistoryCurve::mainGrid()
|
||||
{
|
||||
if (eclipseTopologyItem() && eclipseTopologyItem()->eclipseCase() && eclipseTopologyItem()->eclipseCase()->eclipseCaseData())
|
||||
{
|
||||
return eclipseTopologyItem()->eclipseCase()->eclipseCaseData()->mainGrid();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseTopologyItem* RimGridTimeHistoryCurve::eclipseTopologyItem() const
|
||||
{
|
||||
RimPickingTopologyItem* pickItem = m_pickingTopologyItem();
|
||||
|
||||
return dynamic_cast<RimEclipseTopologyItem*>(pickItem);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechTopologyItem* RimGridTimeHistoryCurve::geoMechTopologyItem() const
|
||||
{
|
||||
RimPickingTopologyItem* pickItem = m_pickingTopologyItem();
|
||||
|
||||
return dynamic_cast<RimGeoMechTopologyItem*>(pickItem);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::updateResultDefinitionFromCase()
|
||||
{
|
||||
if (eclipseTopologyItem())
|
||||
{
|
||||
CVF_ASSERT(m_eclipseResultDefinition());
|
||||
|
||||
m_eclipseResultDefinition->setEclipseCase(eclipseTopologyItem()->eclipseCase());
|
||||
}
|
||||
|
||||
if (geoMechTopologyItem())
|
||||
{
|
||||
CVF_ASSERT(m_geoMechResultDefinition());
|
||||
|
||||
m_geoMechResultDefinition->setGeoMechCase(geoMechTopologyItem()->geoMechCase());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridTimeHistoryCurve::topologyText() const
|
||||
{
|
||||
QString text;
|
||||
|
||||
if (eclipseTopologyItem() && m_pickingTopologyItem())
|
||||
{
|
||||
text = m_pickingTopologyItem->topologyText();
|
||||
}
|
||||
else if (geoMechTopologyItem())
|
||||
{
|
||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor = femTimeHistoryResultAccessor();
|
||||
if (timeHistResultAccessor)
|
||||
{
|
||||
text = timeHistResultAccessor->topologyText();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "No topology";
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::updateQwtPlotAxis()
|
||||
{
|
||||
if (m_qwtPlotCurve)
|
||||
{
|
||||
if (this->yAxis() == RimDefines::PLOT_AXIS_LEFT)
|
||||
{
|
||||
m_qwtPlotCurve->setYAxis(QwtPlot::yLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setYAxis(QwtPlot::yRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> RimGridTimeHistoryCurve::femTimeHistoryResultAccessor() const
|
||||
{
|
||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor;
|
||||
|
||||
if ( geoMechTopologyItem()
|
||||
&& geoMechTopologyItem()->geoMechCase()
|
||||
&& geoMechTopologyItem()->geoMechCase()->geoMechData())
|
||||
{
|
||||
RimGeoMechTopologyItem* geoMechTopItem = geoMechTopologyItem();
|
||||
if (geoMechTopItem->m_hasIntersectionTriangle)
|
||||
{
|
||||
std::array<cvf::Vec3f, 3> intersectionTriangle;
|
||||
intersectionTriangle[0] = cvf::Vec3f(geoMechTopItem->m_intersectionTriangle_0());
|
||||
intersectionTriangle[1] = cvf::Vec3f(geoMechTopItem->m_intersectionTriangle_1());
|
||||
intersectionTriangle[2] = cvf::Vec3f(geoMechTopItem->m_intersectionTriangle_2());
|
||||
|
||||
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
||||
new RiuFemTimeHistoryResultAccessor(geoMechTopItem->geoMechCase()->geoMechData(),
|
||||
m_geoMechResultDefinition()->resultAddress(),
|
||||
geoMechTopItem->m_gridIndex,
|
||||
static_cast<int>(geoMechTopItem->m_cellIndex),
|
||||
geoMechTopItem->m_elementFace,
|
||||
geoMechTopItem->m_localIntersectionPoint,
|
||||
intersectionTriangle));
|
||||
}
|
||||
else
|
||||
{
|
||||
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
||||
new RiuFemTimeHistoryResultAccessor(geoMechTopItem->geoMechCase()->geoMechData(),
|
||||
m_geoMechResultDefinition()->resultAddress(),
|
||||
geoMechTopItem->m_gridIndex,
|
||||
static_cast<int>(geoMechTopItem->m_cellIndex),
|
||||
geoMechTopItem->m_elementFace,
|
||||
geoMechTopItem->m_localIntersectionPoint));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return timeHistResultAccessor;
|
||||
}
|
||||
92
ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.h
Normal file
92
ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimPlotCurve.h"
|
||||
|
||||
#include "RimDefines.h"
|
||||
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmProxyValueField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class RigMainGrid;
|
||||
class RimEclipseCase;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimEclipseTopologyItem;
|
||||
class RimGeoMechResultDefinition;
|
||||
class RimGeoMechTopologyItem;
|
||||
class RimPickingTopologyItem;
|
||||
class RiuFemTimeHistoryResultAccessor;
|
||||
class RiuSelectionItem;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimGridTimeHistoryCurve : public RimPlotCurve
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
|
||||
public:
|
||||
RimGridTimeHistoryCurve();
|
||||
virtual ~RimGridTimeHistoryCurve();
|
||||
|
||||
void setFromSelectionItem(const RiuSelectionItem* selectionItem);
|
||||
RimDefines::PlotAxis yAxis() const;
|
||||
void setYAxis(RimDefines::PlotAxis plotAxis);
|
||||
|
||||
std::vector<double> yValues() const;
|
||||
std::vector<time_t> timeStepValues() const;
|
||||
|
||||
QString quantityName() const;
|
||||
QString caseName() const;
|
||||
|
||||
protected:
|
||||
virtual QString createCurveAutoName() override;
|
||||
virtual void updateZoomInParentPlot() override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void initAfterRead() override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
RigMainGrid* mainGrid();
|
||||
RimEclipseTopologyItem* eclipseTopologyItem() const;
|
||||
RimGeoMechTopologyItem* geoMechTopologyItem() const;
|
||||
void updateResultDefinitionFromCase();
|
||||
QString topologyText() const;
|
||||
void updateQwtPlotAxis();
|
||||
|
||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> femTimeHistoryResultAccessor() const;
|
||||
|
||||
private:
|
||||
caf::PdmProxyValueField<QString> m_topologyText;
|
||||
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_eclipseResultDefinition;
|
||||
caf::PdmChildField<RimGeoMechResultDefinition*> m_geoMechResultDefinition;
|
||||
|
||||
caf::PdmChildField<RimPickingTopologyItem*> m_pickingTopologyItem;
|
||||
caf::PdmField< caf::AppEnum< RimDefines::PlotAxis > > m_plotAxis;
|
||||
};
|
||||
|
||||
@@ -102,11 +102,11 @@ void RimIdenticalGridCaseGroup::addCase(RimEclipseCase* reservoir)
|
||||
|
||||
if (!m_mainGrid)
|
||||
{
|
||||
m_mainGrid = reservoir->reservoirData()->mainGrid();
|
||||
m_mainGrid = reservoir->eclipseCaseData()->mainGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
reservoir->reservoirData()->setMainGrid(m_mainGrid);
|
||||
reservoir->eclipseCaseData()->setMainGrid(m_mainGrid);
|
||||
}
|
||||
|
||||
caseCollection()->reservoirs().push_back(reservoir);
|
||||
@@ -181,7 +181,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
return;
|
||||
}
|
||||
|
||||
RigEclipseCaseData* rigCaseData = mainCase->reservoirData();
|
||||
RigEclipseCaseData* rigCaseData = mainCase->eclipseCaseData();
|
||||
CVF_ASSERT(rigCaseData);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS;
|
||||
@@ -285,7 +285,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
rimReservoir->reservoirData()->computeActiveCellBoundingBoxes();
|
||||
rimReservoir->eclipseCaseData()->computeActiveCellBoundingBoxes();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,7 +331,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells()
|
||||
|
||||
if (activeM[gridLocalCellIndex] == 0)
|
||||
{
|
||||
if (caseCollection->reservoirs[caseIdx]->reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->isActive(reservoirCellIndex))
|
||||
if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->isActive(reservoirCellIndex))
|
||||
{
|
||||
activeM[gridLocalCellIndex] = 1;
|
||||
}
|
||||
@@ -339,7 +339,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells()
|
||||
|
||||
if (activeF[gridLocalCellIndex] == 0)
|
||||
{
|
||||
if (caseCollection->reservoirs[caseIdx]->reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->isActive(reservoirCellIndex))
|
||||
if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->isActive(reservoirCellIndex))
|
||||
{
|
||||
activeF[gridLocalCellIndex] = 1;
|
||||
}
|
||||
@@ -400,13 +400,13 @@ void RimIdenticalGridCaseGroup::updateMainGridAndActiveCellsForStatisticsCases()
|
||||
{
|
||||
RimEclipseCase* rimStaticsCase = statisticsCaseCollection->reservoirs[i];
|
||||
|
||||
if (rimStaticsCase->reservoirData())
|
||||
if (rimStaticsCase->eclipseCaseData())
|
||||
{
|
||||
rimStaticsCase->reservoirData()->setMainGrid(this->mainGrid());
|
||||
rimStaticsCase->eclipseCaseData()->setMainGrid(this->mainGrid());
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
rimStaticsCase->reservoirData()->computeActiveCellBoundingBoxes();
|
||||
rimStaticsCase->eclipseCaseData()->computeActiveCellBoundingBoxes();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,7 +521,7 @@ RimEclipseCase* RimIdenticalGridCaseGroup::mainCase()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimIdenticalGridCaseGroup::canCaseBeAdded(RimEclipseCase* reservoir) const
|
||||
{
|
||||
CVF_ASSERT(reservoir && reservoir->reservoirData() && reservoir->reservoirData()->mainGrid());
|
||||
CVF_ASSERT(reservoir && reservoir->eclipseCaseData() && reservoir->eclipseCaseData()->mainGrid());
|
||||
|
||||
if (!m_mainGrid)
|
||||
{
|
||||
@@ -529,7 +529,7 @@ bool RimIdenticalGridCaseGroup::canCaseBeAdded(RimEclipseCase* reservoir) const
|
||||
return true;
|
||||
}
|
||||
|
||||
RigMainGrid* incomingMainGrid = reservoir->reservoirData()->mainGrid();
|
||||
RigMainGrid* incomingMainGrid = reservoir->eclipseCaseData()->mainGrid();
|
||||
|
||||
if (RigGridManager::isEqual(m_mainGrid, incomingMainGrid))
|
||||
{
|
||||
|
||||
@@ -228,7 +228,7 @@ void RimIntersection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
updateWellExtentDefaultValue();
|
||||
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -626,20 +626,22 @@ void RimLegendConfig::setCategoryItems(const std::vector< std::tuple<QString, in
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimLegendConfig::categoryNameFromCategoryValue(int categoryValue) const
|
||||
QString RimLegendConfig::categoryNameFromCategoryValue(double categoryResultValue) const
|
||||
{
|
||||
if (categoryResultValue == HUGE_VAL) return "Undefined";
|
||||
|
||||
if (m_categoryNames.size() > 0)
|
||||
{
|
||||
for (size_t categoryIndex = 0; categoryIndex < m_categories.size(); categoryIndex++)
|
||||
{
|
||||
if (categoryValue == m_categories[categoryIndex])
|
||||
if (categoryResultValue == m_categories[categoryIndex])
|
||||
{
|
||||
return cvfqt::Utils::toQString(m_categoryNames[categoryIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QString("%1").arg(categoryValue);
|
||||
return QString("%1").arg(categoryResultValue);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
void setIntegerCategories(const std::vector<int>& categories);
|
||||
void setNamedCategoriesInverse(const std::vector<QString>& categoryNames);
|
||||
void setCategoryItems(const std::vector<std::tuple<QString, int, cvf::Color3ub>>& categories);
|
||||
QString categoryNameFromCategoryValue(int categoryValue) const;
|
||||
QString categoryNameFromCategoryValue(double categoryResultValue) const;
|
||||
|
||||
void setTitle(const cvf::String& title);
|
||||
|
||||
|
||||
38
ApplicationCode/ProjectDataModel/RimPickingTopologyItem.cpp
Normal file
38
ApplicationCode/ProjectDataModel/RimPickingTopologyItem.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimPickingTopologyItem.h"
|
||||
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimPickingTopologyItem, "RimPickingTopologyItem");
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPickingTopologyItem::RimPickingTopologyItem()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPickingTopologyItem::~RimPickingTopologyItem()
|
||||
{
|
||||
|
||||
}
|
||||
32
ApplicationCode/ProjectDataModel/RimPickingTopologyItem.h
Normal file
32
ApplicationCode/ProjectDataModel/RimPickingTopologyItem.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafPdmObject.h"
|
||||
|
||||
class RimPickingTopologyItem : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimPickingTopologyItem();
|
||||
virtual ~RimPickingTopologyItem();
|
||||
|
||||
virtual QString topologyText() const = 0;
|
||||
};
|
||||
|
||||
@@ -137,7 +137,6 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con
|
||||
m_customCurveName = createCurveAutoName();
|
||||
}
|
||||
|
||||
updateOptionSensitivity();
|
||||
updateCurveName();
|
||||
}
|
||||
|
||||
@@ -241,15 +240,6 @@ bool RimPlotCurve::isCurveVisible() const
|
||||
return m_showCurve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::initAfterRead()
|
||||
{
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -96,7 +96,6 @@ protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual void initAfterRead();
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -640,11 +640,11 @@ void RimProject::computeUtmAreaOfInterest()
|
||||
{
|
||||
RimEclipseCase* rimCase = dynamic_cast<RimEclipseCase*>(cases[i]);
|
||||
|
||||
if (rimCase && rimCase->reservoirData())
|
||||
if (rimCase && rimCase->eclipseCaseData())
|
||||
{
|
||||
for (size_t gridIdx = 0; gridIdx < rimCase->reservoirData()->gridCount(); gridIdx++ )
|
||||
for (size_t gridIdx = 0; gridIdx < rimCase->eclipseCaseData()->gridCount(); gridIdx++ )
|
||||
{
|
||||
RigGridBase* rigGrid = rimCase->reservoirData()->grid(gridIdx);
|
||||
RigGridBase* rigGrid = rimCase->eclipseCaseData()->grid(gridIdx);
|
||||
|
||||
projectBB.add(rigGrid->boundingBox());
|
||||
}
|
||||
@@ -838,6 +838,6 @@ void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QS
|
||||
uiTreeOrdering.add(scriptCollection());
|
||||
}
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1516,9 +1516,9 @@ double RimReservoirCellResultsStorage::darchysValue()
|
||||
RimEclipseCase* rimCase = NULL;
|
||||
this->firstAncestorOrThisOfType(rimCase);
|
||||
|
||||
if (rimCase && rimCase->reservoirData())
|
||||
if (rimCase && rimCase->eclipseCaseData())
|
||||
{
|
||||
RigEclipseCaseData::UnitsType unitsType = rimCase->reservoirData()->unitsType();
|
||||
RigEclipseCaseData::UnitsType unitsType = rimCase->eclipseCaseData()->unitsType();
|
||||
|
||||
if (unitsType == RigEclipseCaseData::UNITS_FIELD)
|
||||
{
|
||||
|
||||
@@ -321,7 +321,7 @@ void RimTernaryLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
group->add(&ternaryRangeSummary);
|
||||
}
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -298,14 +298,8 @@ void RimView::scheduleCreateDisplayModelAndRedraw()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimView::setCurrentTimeStepAndUpdate(int frameIndex)
|
||||
{
|
||||
m_currentTimeStep = frameIndex;
|
||||
clampCurrentTimestep();
|
||||
setCurrentTimeStep(frameIndex);
|
||||
|
||||
this->hasUserRequestedAnimation = true;
|
||||
if (this->propertyFilterCollection() && this->propertyFilterCollection()->hasActiveDynamicFilters())
|
||||
{
|
||||
m_currentReservoirCellVisibility = NULL;
|
||||
}
|
||||
this->updateCurrentTimeStep();
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ QList<caf::PdmOptionItemInfo> RimViewController::calculateValueOptions(const caf
|
||||
void RimViewController::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
updateDisplayNameAndIcon();
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -862,7 +862,7 @@ bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
|
||||
if (eclipseView && geomView)
|
||||
{
|
||||
if (eclipseView->eclipseCase()->reservoirData() && geomView->geoMechCase() && geomView->geoMechCase()->geoMechData())
|
||||
if (eclipseView->eclipseCase()->eclipseCaseData() && geomView->geoMechCase() && geomView->geoMechCase()->geoMechData())
|
||||
{
|
||||
RigMainGrid* eclGrid = eclipseView->mainGrid();
|
||||
RigFemPart* femPart = geomView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
|
||||
@@ -62,7 +62,7 @@ void RimViewLinkerCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTre
|
||||
childObject->addViewControllers(uiTreeOrdering);
|
||||
}
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -95,8 +95,6 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve()
|
||||
CAF_PDM_InitField(&m_addWellNameToCurveName, "AddWellNameToCurveName", true, " Well Name", "", "", "");
|
||||
CAF_PDM_InitField(&m_addTimestepToCurveName, "AddTimestepToCurveName", false, " Timestep", "", "", "");
|
||||
CAF_PDM_InitField(&m_addDateToCurveName, "AddDateToCurveName", true, " Date", "", "", "");
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -253,7 +251,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
||||
|
||||
m_eclipseResultDefinition->loadResult();
|
||||
|
||||
cvf::ref<RigResultAccessor> resAcc = RigResultAccessorFactory::createFromResultDefinition(eclipseCase->reservoirData(),
|
||||
cvf::ref<RigResultAccessor> resAcc = RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(),
|
||||
0,
|
||||
m_timeStep,
|
||||
m_eclipseResultDefinition);
|
||||
@@ -263,7 +261,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
||||
eclExtractor->curveData(resAcc.p(), &values);
|
||||
}
|
||||
|
||||
RigEclipseCaseData::UnitsType eclipseUnitsType = eclipseCase->reservoirData()->unitsType();
|
||||
RigEclipseCaseData::UnitsType eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
|
||||
if (eclipseUnitsType == RigEclipseCaseData::UNITS_FIELD)
|
||||
{
|
||||
// See https://github.com/OPM/ResInsight/issues/538
|
||||
@@ -375,6 +373,8 @@ QList<caf::PdmOptionItemInfo> RimWellLogExtractionCurve::calculateValueOptions(c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogExtractionCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
RimPlotCurve::updateOptionSensitivity();
|
||||
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
|
||||
|
||||
curveDataGroup->add(&m_wellPath);
|
||||
@@ -420,7 +420,7 @@ void RimWellLogExtractionCurve::defineUiOrdering(QString uiConfigName, caf::PdmU
|
||||
}
|
||||
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -442,7 +442,7 @@ void RimWellLogExtractionCurve::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogExtractionCurve::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -507,9 +507,9 @@ QString RimWellLogExtractionCurve::createCurveAutoName()
|
||||
if (eclipseCase)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel());
|
||||
if (eclipseCase->reservoirData())
|
||||
if (eclipseCase->eclipseCaseData())
|
||||
{
|
||||
maxTimeStep = eclipseCase->reservoirData()->results(porosityModel)->maxTimeStepCount();
|
||||
maxTimeStep = eclipseCase->eclipseCaseData()->results(porosityModel)->maxTimeStepCount();
|
||||
}
|
||||
}
|
||||
else if (geomCase)
|
||||
@@ -605,7 +605,7 @@ QString RimWellLogExtractionCurve::wellDate() const
|
||||
if (eclipseCase)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel());
|
||||
if (eclipseCase->reservoirData())
|
||||
if (eclipseCase->eclipseCaseData())
|
||||
{
|
||||
timeStepNames = eclipseCase->timeStepStrings();
|
||||
}
|
||||
|
||||
@@ -56,8 +56,6 @@ RimWellLogFileCurve::RimWellLogFileCurve()
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellLogChannnelName, "CurveWellLogChannel", "Well Log Channel", "", "", "");
|
||||
|
||||
m_wellPath = NULL;
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -171,6 +169,8 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogFileCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
RimPlotCurve::updateOptionSensitivity();
|
||||
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data");
|
||||
curveDataGroup->add(&m_wellPath);
|
||||
curveDataGroup->add(&m_wellLogChannnelName);
|
||||
@@ -190,7 +190,7 @@ void RimWellLogFileCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogFileCurve::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -422,9 +422,9 @@ QString RimWellLogPlot::asciiDataForPlotExport() const
|
||||
}
|
||||
|
||||
|
||||
for (int i = curveDepths.size() -1; i >= 0; i--)
|
||||
for (int i = static_cast<int>(curveDepths.size()) - 1; i >= 0; i--)
|
||||
{
|
||||
if (i == curveDepths.size() - 1)
|
||||
if (i == static_cast<int>(curveDepths.size()) - 1)
|
||||
{
|
||||
if (depthType() == CONNECTION_NUMBER) out += "Connection";
|
||||
else if (depthType() == MEASURED_DEPTH) out += "MD ";
|
||||
@@ -483,7 +483,7 @@ void RimWellLogPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
|
||||
uiOrdering.add(&m_showTrackLegends);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -57,12 +57,12 @@ RimWellLogPlotCollection::~RimWellLogPlotCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor(RimWellPath* wellPath, RimEclipseCase* eclCase)
|
||||
{
|
||||
if (!(wellPath && eclCase && wellPath->wellPathGeometry() && eclCase->reservoirData()))
|
||||
if (!(wellPath && eclCase && wellPath->wellPathGeometry() && eclCase->eclipseCaseData()))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RigEclipseCaseData* eclCaseData = eclCase->reservoirData();
|
||||
RigEclipseCaseData* eclCaseData = eclCase->eclipseCaseData();
|
||||
RigWellPath* wellPathGeom = wellPath->wellPathGeometry();
|
||||
for (size_t exIdx = 0; exIdx < m_extractors.size(); ++exIdx)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,8 @@ CAF_PDM_SOURCE_INIT(RimGridSummaryCase,"GridSummaryCase");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridSummaryCase::RimGridSummaryCase()
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "Associated3DCase", "Main View", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "Associated3DCase", "Eclipse Case", "", "", "");
|
||||
m_eclipseCase.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_eclipseGridFileName, "Associated3DCaseGridFileName", "Grid File Name", "", "", "");
|
||||
m_eclipseGridFileName.registerGetMethod(this, &RimGridSummaryCase::eclipseGridFileName);
|
||||
|
||||
@@ -181,7 +181,6 @@ RimSummaryCurve::RimSummaryCurve()
|
||||
|
||||
m_symbolSkipPixelDistance = 10.0f;
|
||||
m_curveThickness = 2;
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -435,12 +434,14 @@ void RimSummaryCurve::onLoadDataAndUpdate()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
RimPlotCurve::updateOptionSensitivity();
|
||||
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Summary Vector");
|
||||
curveDataGroup->add(&m_summaryCase);
|
||||
curveDataGroup->add(&m_selectedVariableDisplayField);
|
||||
|
||||
caf::PdmUiGroup* curveVarSelectionGroup = curveDataGroup->addNewGroup("Vector Selection");
|
||||
m_summaryFilter->defineUiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
m_summaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
|
||||
curveVarSelectionGroup->add(&m_uiFilterResultSelection);
|
||||
|
||||
@@ -456,12 +457,12 @@ void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
if (m_isUsingAutoName)
|
||||
{
|
||||
caf::PdmUiGroup* autoNameGroup = appearanceGroup->addNewGroup("Auto Name Config");
|
||||
m_curveNameConfig->defineUiOrdering(uiConfigName, *autoNameGroup);
|
||||
m_curveNameConfig->uiOrdering(uiConfigName, *autoNameGroup);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_plotAxis);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true); // For now.
|
||||
uiOrdering.skipRemainingFields(); // For now.
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -279,6 +279,8 @@ void RimSummaryCurveAutoName::defineUiOrdering(QString uiConfigName, caf::PdmUiO
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_showAdvancedProperties);
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -78,8 +78,7 @@ RimSummaryCurveFilter::RimSummaryCurveFilter()
|
||||
m_summaryFilter.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_summaryFilter.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_summaryFilterObject = std::unique_ptr<RimSummaryFilter>(new RimSummaryFilter);
|
||||
m_summaryFilter = m_summaryFilterObject.get();
|
||||
m_summaryFilter = new RimSummaryFilter;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_uiFilterResultMultiSelection, "FilterResultSelection", "Filter Result", "", "Ctrl-A : Select All", "");
|
||||
m_uiFilterResultMultiSelection.xmlCapability()->setIOWritable(false);
|
||||
@@ -118,8 +117,7 @@ RimSummaryCurveFilter::RimSummaryCurveFilter()
|
||||
m_curveNameConfig.uiCapability()->setUiHidden(true);
|
||||
m_curveNameConfig.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
m_curveNameConfigObject = std::unique_ptr<RimSummaryCurveAutoName>(new RimSummaryCurveAutoName);
|
||||
m_curveNameConfig = m_curveNameConfigObject.get();
|
||||
m_curveNameConfig = new RimSummaryCurveAutoName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -196,7 +194,7 @@ void RimSummaryCurveFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd
|
||||
|
||||
caf::PdmUiGroup* curveVarSelectionGroup = curveDataGroup->addNewGroup("Vector Selection");
|
||||
|
||||
m_summaryFilter->defineUiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
m_summaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
|
||||
curveVarSelectionGroup->add(&m_uiFilterResultMultiSelection);
|
||||
|
||||
@@ -221,13 +219,13 @@ void RimSummaryCurveFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* autoNameGroup = uiOrdering.addNewGroup("Curve Name Configuration");
|
||||
m_curveNameConfig->defineUiOrdering(uiConfigName, *autoNameGroup);
|
||||
m_curveNameConfig->uiOrdering(uiConfigName, *autoNameGroup);
|
||||
|
||||
uiOrdering.add(&m_plotAxis);
|
||||
uiOrdering.add(&m_autoApplyChangesToPlot);
|
||||
uiOrdering.add(&m_applyButtonField);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
#include "RimDefines.h"
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QwtPlot;
|
||||
class QwtPlotCurve;
|
||||
class RifReaderEclipseSummary;
|
||||
@@ -46,7 +43,6 @@ class RiuLineSegmentQwtPlotCurve;
|
||||
class RimSummaryCurveAutoName;
|
||||
|
||||
|
||||
|
||||
Q_DECLARE_METATYPE(RifEclipseSummaryAddress);
|
||||
|
||||
//==================================================================================================
|
||||
@@ -132,9 +128,5 @@ private:
|
||||
caf::PdmField< AppearanceTypeAppEnum > m_regionAppearanceType;
|
||||
|
||||
std::vector< caf::PdmPointer<RimSummaryCase> > m_selectionCache;
|
||||
|
||||
// Internal objects managed by unique_ptr
|
||||
std::unique_ptr<RimSummaryFilter> m_summaryFilterObject;
|
||||
std::unique_ptr<RimSummaryCurveAutoName> m_curveNameConfigObject;
|
||||
};
|
||||
|
||||
|
||||
@@ -97,12 +97,12 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotYAxisFormater::RimSummaryPlotYAxisFormater(RimSummaryYAxisProperties* axisProperties,
|
||||
const std::vector<RimSummaryCurve*>& curves,
|
||||
const std::vector<RimSummaryCurveFilter*>& curveFilters)
|
||||
RimSummaryPlotYAxisFormatter::RimSummaryPlotYAxisFormatter(RimSummaryYAxisProperties* axisProperties,
|
||||
const std::vector<RimSummaryCurve*>& curves,
|
||||
const std::set<QString>& timeHistoryCurveQuantities)
|
||||
: m_axisProperties(axisProperties),
|
||||
m_singleCurves(curves),
|
||||
m_curveFilters(curveFilters)
|
||||
m_timeHistoryCurveQuantities(timeHistoryCurveQuantities)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ RimSummaryPlotYAxisFormater::RimSummaryPlotYAxisFormater(RimSummaryYAxisProperti
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotYAxisFormater::applyYAxisPropertiesToPlot(RiuSummaryQwtPlot* qwtPlot)
|
||||
void RimSummaryPlotYAxisFormatter::applyYAxisPropertiesToPlot(RiuSummaryQwtPlot* qwtPlot)
|
||||
{
|
||||
if (!qwtPlot) return;
|
||||
|
||||
@@ -189,34 +189,18 @@ void RimSummaryPlotYAxisFormater::applyYAxisPropertiesToPlot(RiuSummaryQwtPlot*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryPlotYAxisFormater::autoAxisTitle() const
|
||||
QString RimSummaryPlotYAxisFormatter::autoAxisTitle() const
|
||||
{
|
||||
std::map<std::string, std::set<std::string> > unitToQuantityNameMap;
|
||||
|
||||
for ( RimSummaryCurve* rimCurve : m_singleCurves )
|
||||
{
|
||||
if ( rimCurve->isCurveVisible() && rimCurve->yAxis() == this->m_axisProperties->plotAxisType() )
|
||||
if ( rimCurve->yAxis() == this->m_axisProperties->plotAxisType() )
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitName()].insert(rimCurve->summaryAddress().quantityName());
|
||||
}
|
||||
}
|
||||
|
||||
for ( RimSummaryCurveFilter* curveFilter : m_curveFilters )
|
||||
{
|
||||
if ( curveFilter->isCurvesVisible() )
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curveFilterCurves = curveFilter->curves();
|
||||
|
||||
for ( RimSummaryCurve* rimCurve : curveFilterCurves )
|
||||
{
|
||||
if ( rimCurve->isCurveVisible() && rimCurve->yAxis() == this->m_axisProperties->plotAxisType() )
|
||||
{
|
||||
unitToQuantityNameMap[rimCurve->unitName()].insert(rimCurve->summaryAddress().quantityName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString assembledYAxisText;
|
||||
|
||||
for ( auto unitIt : unitToQuantityNameMap )
|
||||
@@ -228,6 +212,19 @@ QString RimSummaryPlotYAxisFormater::autoAxisTitle() const
|
||||
assembledYAxisText += "[" + QString::fromStdString(unitIt.first) + "] ";
|
||||
}
|
||||
|
||||
if (m_timeHistoryCurveQuantities.size() > 0)
|
||||
{
|
||||
if (!assembledYAxisText.isEmpty())
|
||||
{
|
||||
assembledYAxisText += " : ";
|
||||
}
|
||||
|
||||
for (auto timeQuantity : m_timeHistoryCurveQuantities)
|
||||
{
|
||||
assembledYAxisText += timeQuantity + " ";
|
||||
}
|
||||
}
|
||||
|
||||
return assembledYAxisText;
|
||||
}
|
||||
|
||||
@@ -241,9 +238,12 @@ QString RimSummaryPlotYAxisFormater::autoAxisTitle() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotYAxisRangeCalculator::RimSummaryPlotYAxisRangeCalculator(RimSummaryYAxisProperties* axisProperties, const std::vector<RimSummaryCurve*>& curves)
|
||||
: m_axisProperties(axisProperties),
|
||||
m_singleCurves(curves)
|
||||
RimSummaryPlotYAxisRangeCalculator::RimSummaryPlotYAxisRangeCalculator(
|
||||
const std::vector<QwtPlotCurve*>& qwtCurves,
|
||||
const std::vector<double>& yValuesForAllCurves)
|
||||
:
|
||||
m_singleCurves(qwtCurves),
|
||||
m_yValuesForAllCurves(yValuesForAllCurves)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -255,12 +255,12 @@ void RimSummaryPlotYAxisRangeCalculator::computeYRange(double* min, double* max)
|
||||
double minValue = HUGE_VAL;
|
||||
double maxValue = -HUGE_VAL;
|
||||
|
||||
for (RimSummaryCurve* curve : m_singleCurves)
|
||||
for (QwtPlotCurve* curve : m_singleCurves)
|
||||
{
|
||||
double minCurveValue = HUGE_VAL;
|
||||
double maxCurveValue = -HUGE_VAL;
|
||||
|
||||
if (curve->isCurveVisible() && curveValueRangeY(curve->qwtPlotCurve(), &minCurveValue, &maxCurveValue))
|
||||
if (curveValueRangeY(curve, &minCurveValue, &maxCurveValue))
|
||||
{
|
||||
if (minCurveValue < minValue)
|
||||
{
|
||||
@@ -280,26 +280,17 @@ void RimSummaryPlotYAxisRangeCalculator::computeYRange(double* min, double* max)
|
||||
maxValue = RimDefines::maximumDefaultValuePlot();
|
||||
}
|
||||
|
||||
if (m_axisProperties->isLogarithmicScaleEnabled)
|
||||
// For logarithmic auto scaling, compute positive curve value closest to zero and use
|
||||
// this value as the plot visible minimum
|
||||
|
||||
double pos = HUGE_VAL;
|
||||
double neg = -HUGE_VAL;
|
||||
|
||||
RigStatisticsCalculator::posNegClosestToZero(m_yValuesForAllCurves, pos, neg);
|
||||
|
||||
if (pos != HUGE_VAL)
|
||||
{
|
||||
// For logarithmic auto scaling, compute positive curve value closest to zero and use
|
||||
// this value as the plot visible minimum
|
||||
|
||||
double pos = HUGE_VAL;
|
||||
double neg = -HUGE_VAL;
|
||||
|
||||
for (RimSummaryCurve* curve : m_singleCurves)
|
||||
{
|
||||
if (curve->isCurveVisible())
|
||||
{
|
||||
RigStatisticsCalculator::posNegClosestToZero(curve->yValues(), pos, neg);
|
||||
}
|
||||
}
|
||||
|
||||
if (pos != HUGE_VAL)
|
||||
{
|
||||
minValue = pos;
|
||||
}
|
||||
minValue = pos;
|
||||
}
|
||||
|
||||
*min = minValue;
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
class RimSummaryCurve;
|
||||
class RimSummaryCurveFilter;
|
||||
class RimSummaryYAxisProperties;
|
||||
@@ -29,12 +30,12 @@ class RiuSummaryQwtPlot;
|
||||
|
||||
class QwtPlotCurve;
|
||||
|
||||
class RimSummaryPlotYAxisFormater
|
||||
class RimSummaryPlotYAxisFormatter
|
||||
{
|
||||
public:
|
||||
RimSummaryPlotYAxisFormater(RimSummaryYAxisProperties* axisProperties,
|
||||
RimSummaryPlotYAxisFormatter(RimSummaryYAxisProperties* axisProperties,
|
||||
const std::vector<RimSummaryCurve*>& curves,
|
||||
const std::vector<RimSummaryCurveFilter*>& curveFilters);
|
||||
const std::set<QString>& timeHistoryCurveQuantities);
|
||||
|
||||
void applyYAxisPropertiesToPlot(RiuSummaryQwtPlot* qwtPlot);
|
||||
|
||||
@@ -43,16 +44,16 @@ private:
|
||||
|
||||
private:
|
||||
RimSummaryYAxisProperties* m_axisProperties;
|
||||
std::vector<RimSummaryCurve*> m_singleCurves;
|
||||
std::vector<RimSummaryCurveFilter*> m_curveFilters;
|
||||
const std::vector<RimSummaryCurve*> m_singleCurves;
|
||||
const std::set<QString> m_timeHistoryCurveQuantities;
|
||||
};
|
||||
|
||||
|
||||
class RimSummaryPlotYAxisRangeCalculator
|
||||
{
|
||||
public:
|
||||
RimSummaryPlotYAxisRangeCalculator(RimSummaryYAxisProperties* axisProperties,
|
||||
const std::vector<RimSummaryCurve*>& curves);
|
||||
RimSummaryPlotYAxisRangeCalculator( const std::vector<QwtPlotCurve*>& qwtCurves,
|
||||
const std::vector<double>& yValuesForAllCurves);
|
||||
|
||||
void computeYRange(double* min, double* max) const;
|
||||
|
||||
@@ -60,7 +61,7 @@ private:
|
||||
bool curveValueRangeY(const QwtPlotCurve* qwtCurve, double* min, double* max) const;
|
||||
|
||||
private:
|
||||
RimSummaryYAxisProperties* m_axisProperties;
|
||||
std::vector<RimSummaryCurve*> m_singleCurves;
|
||||
const std::vector<QwtPlotCurve*> m_singleCurves;
|
||||
const std::vector<double> m_yValuesForAllCurves;
|
||||
};
|
||||
|
||||
|
||||
@@ -446,6 +446,8 @@ void RimSummaryFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimGridTimeHistoryCurve.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
@@ -59,28 +60,28 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
CAF_PDM_InitFieldNoDefault(&m_curveFilters, "SummaryCurveFilters", "", "", "", "");
|
||||
m_curveFilters.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_curves, "SummaryCurves", "", "", "", "");
|
||||
m_curves.uiCapability()->setUiTreeHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_summaryCurves, "SummaryCurves", "", "", "", "");
|
||||
m_summaryCurves.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_gridTimeHistoryCurves, "GridTimeHistoryCurves", "", "", "", "");
|
||||
m_gridTimeHistoryCurves.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_leftYAxisProperties, "LeftYAxisProperties", "Left Y Axis", "", "", "");
|
||||
m_leftYAxisProperties.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
m_leftYAxisPropertiesObject = std::unique_ptr<RimSummaryYAxisProperties>(new RimSummaryYAxisProperties);
|
||||
m_leftYAxisPropertiesObject->setNameAndAxis("Left Y-Axis", QwtPlot::yLeft);
|
||||
m_leftYAxisProperties = m_leftYAxisPropertiesObject.get();
|
||||
m_leftYAxisProperties = new RimSummaryYAxisProperties;
|
||||
m_leftYAxisProperties->setNameAndAxis("Left Y-Axis", QwtPlot::yLeft);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_rightYAxisProperties, "RightYAxisProperties", "Right Y Axis", "", "", "");
|
||||
m_rightYAxisProperties.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
m_rightYAxisPropertiesObject = std::unique_ptr<RimSummaryYAxisProperties>(new RimSummaryYAxisProperties);
|
||||
m_rightYAxisPropertiesObject->setNameAndAxis("Right Y-Axis", QwtPlot::yRight);
|
||||
m_rightYAxisProperties = m_rightYAxisPropertiesObject.get();
|
||||
m_rightYAxisProperties = new RimSummaryYAxisProperties;
|
||||
m_rightYAxisProperties->setNameAndAxis("Right Y-Axis", QwtPlot::yRight);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_timeAxisProperties, "TimeAxisProperties", "Time Axis", "", "", "");
|
||||
m_timeAxisProperties.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
m_timeAxisPropertiesObject = std::unique_ptr<RimSummaryTimeAxisProperties>(new RimSummaryTimeAxisProperties);
|
||||
m_timeAxisProperties = m_timeAxisPropertiesObject.get();
|
||||
m_timeAxisProperties = new RimSummaryTimeAxisProperties;
|
||||
|
||||
CAF_PDM_InitField(&m_isAutoZoom, "AutoZoom", true, "Auto Zoom", "", "", "");
|
||||
m_isAutoZoom.uiCapability()->setUiHidden(true);
|
||||
@@ -97,7 +98,7 @@ RimSummaryPlot::~RimSummaryPlot()
|
||||
|
||||
deleteViewWidget();
|
||||
|
||||
m_curves.deleteAllChildObjects();
|
||||
m_summaryCurves.deleteAllChildObjects();
|
||||
m_curveFilters.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
@@ -119,14 +120,7 @@ void RimSummaryPlot::updateAxes()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlot::isLogarithmicScaleEnabled(RimDefines::PlotAxis plotAxis) const
|
||||
{
|
||||
if (plotAxis == RimDefines::PLOT_AXIS_LEFT)
|
||||
{
|
||||
return m_leftYAxisProperties->isLogarithmicScaleEnabled();
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_rightYAxisProperties->isLogarithmicScaleEnabled();
|
||||
}
|
||||
return yAxisPropertiesForAxis(plotAxis)->isLogarithmicScaleEnabled();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -181,9 +175,9 @@ time_t RimSummaryPlot::firstTimeStepOfFirstCurve()
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
while (firstCurve == nullptr && i < m_curves.size())
|
||||
while (firstCurve == nullptr && i < m_summaryCurves.size())
|
||||
{
|
||||
firstCurve = m_curves[i];
|
||||
firstCurve = m_summaryCurves[i];
|
||||
++i;
|
||||
}
|
||||
|
||||
@@ -209,83 +203,157 @@ QString RimSummaryPlot::asciiDataForPlotExport() const
|
||||
{
|
||||
QString out;
|
||||
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
this->descendantsIncludingThisOfType(curves);
|
||||
|
||||
std::vector<QString> caseNames;
|
||||
std::vector<std::vector<time_t> > timeSteps;
|
||||
|
||||
std::vector<std::vector<std::vector<double> > > allCurveData;
|
||||
std::vector<std::vector<QString > > allCurveNames;
|
||||
//Vectors containing cases - curves - data points/curve name
|
||||
|
||||
for (RimSummaryCurve* curve : curves)
|
||||
{
|
||||
if (!curve->isCurveVisible()) continue;
|
||||
QString curveCaseName = curve->summaryCase()->caseName();
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
this->descendantsIncludingThisOfType(curves);
|
||||
|
||||
int casePosInList = -1;
|
||||
for (int i = 0; i < caseNames.size(); i++)
|
||||
std::vector<QString> caseNames;
|
||||
std::vector<std::vector<time_t> > timeSteps;
|
||||
|
||||
std::vector<std::vector<std::vector<double> > > allCurveData;
|
||||
std::vector<std::vector<QString > > allCurveNames;
|
||||
//Vectors containing cases - curves - data points/curve name
|
||||
|
||||
for (RimSummaryCurve* curve : curves)
|
||||
{
|
||||
if (curveCaseName == caseNames[i]) casePosInList = i;
|
||||
}
|
||||
if (!curve->isCurveVisible()) continue;
|
||||
QString curveCaseName = curve->summaryCase()->caseName();
|
||||
|
||||
if (casePosInList < 0)
|
||||
{
|
||||
caseNames.push_back(curveCaseName);
|
||||
|
||||
std::vector<time_t> curveTimeSteps = curve->timeSteps();
|
||||
timeSteps.push_back(curveTimeSteps);
|
||||
|
||||
std::vector<std::vector<double> > curveDataForCase;
|
||||
std::vector<double> curveYData = curve->yValues();
|
||||
curveDataForCase.push_back(curveYData);
|
||||
allCurveData.push_back(curveDataForCase);
|
||||
|
||||
std::vector<QString> curveNamesForCase;
|
||||
curveNamesForCase.push_back(curve->curveName());
|
||||
allCurveNames.push_back(curveNamesForCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> curveYData = curve->yValues();
|
||||
allCurveData[casePosInList].push_back(curveYData);
|
||||
|
||||
QString curveName = curve->curveName();
|
||||
allCurveNames[casePosInList].push_back(curveName);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < timeSteps.size(); i++) //cases
|
||||
{
|
||||
out += "\n\n";
|
||||
out += "Case: " + caseNames[i];
|
||||
out += "\n";
|
||||
|
||||
for (int j = 0; j < timeSteps[i].size(); j++) //time steps & data points
|
||||
{
|
||||
if (j == 0)
|
||||
size_t casePosInList = cvf::UNDEFINED_SIZE_T;
|
||||
for (size_t i = 0; i < caseNames.size(); i++)
|
||||
{
|
||||
out += "Date and time";
|
||||
for (int k = 0; k < allCurveNames[i].size(); k++) // curves
|
||||
if (curveCaseName == caseNames[i]) casePosInList = i;
|
||||
}
|
||||
|
||||
if (casePosInList == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
caseNames.push_back(curveCaseName);
|
||||
|
||||
std::vector<time_t> curveTimeSteps = curve->timeSteps();
|
||||
timeSteps.push_back(curveTimeSteps);
|
||||
|
||||
std::vector<std::vector<double> > curveDataForCase;
|
||||
std::vector<double> curveYData = curve->yValues();
|
||||
curveDataForCase.push_back(curveYData);
|
||||
allCurveData.push_back(curveDataForCase);
|
||||
|
||||
std::vector<QString> curveNamesForCase;
|
||||
curveNamesForCase.push_back(curve->curveName());
|
||||
allCurveNames.push_back(curveNamesForCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> curveYData = curve->yValues();
|
||||
allCurveData[casePosInList].push_back(curveYData);
|
||||
|
||||
QString curveName = curve->curveName();
|
||||
allCurveNames[casePosInList].push_back(curveName);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < timeSteps.size(); i++) //cases
|
||||
{
|
||||
out += "\n\n";
|
||||
out += "Case: " + caseNames[i];
|
||||
out += "\n";
|
||||
|
||||
for (size_t j = 0; j < timeSteps[i].size(); j++) //time steps & data points
|
||||
{
|
||||
if (j == 0)
|
||||
{
|
||||
out += "\t" + (allCurveNames[i][k]);
|
||||
out += "Date and time";
|
||||
for (size_t k = 0; k < allCurveNames[i].size(); k++) // curves
|
||||
{
|
||||
out += "\t" + (allCurveNames[i][k]);
|
||||
}
|
||||
}
|
||||
out += "\n";
|
||||
out += QDateTime::fromTime_t(timeSteps[i][j]).toUTC().toString("yyyy-MM-dd hh:mm:ss ");
|
||||
|
||||
for (size_t k = 0; k < allCurveData[i].size(); k++) // curves
|
||||
{
|
||||
out += "\t" + QString::number(allCurveData[i][k][j], 'g', 6);
|
||||
}
|
||||
}
|
||||
out += "\n";
|
||||
out += QDateTime::fromTime_t(timeSteps[i][j]).toUTC().toString("yyyy-MM-dd hh:mm:ss ");
|
||||
}
|
||||
}
|
||||
|
||||
for (int k = 0; k < allCurveData[i].size(); k++) // curves
|
||||
|
||||
{
|
||||
std::vector<QString> caseNames;
|
||||
std::vector<std::vector<time_t> > timeSteps;
|
||||
|
||||
std::vector<std::vector<std::vector<double> > > allCurveData;
|
||||
std::vector<std::vector<QString > > allCurveNames;
|
||||
//Vectors containing cases - curves - data points/curve name
|
||||
|
||||
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||
{
|
||||
if (!curve->isCurveVisible()) continue;
|
||||
QString curveCaseName = curve->caseName();
|
||||
|
||||
size_t casePosInList = cvf::UNDEFINED_SIZE_T;
|
||||
for (size_t i = 0; i < caseNames.size(); i++)
|
||||
{
|
||||
out += "\t" + QString::number(allCurveData[i][k][j], 'g', 6);
|
||||
if (curveCaseName == caseNames[i]) casePosInList = i;
|
||||
}
|
||||
|
||||
if (casePosInList == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
caseNames.push_back(curveCaseName);
|
||||
|
||||
std::vector<time_t> curveTimeSteps = curve->timeStepValues();
|
||||
timeSteps.push_back(curveTimeSteps);
|
||||
|
||||
std::vector<std::vector<double> > curveDataForCase;
|
||||
std::vector<double> curveYData = curve->yValues();
|
||||
curveDataForCase.push_back(curveYData);
|
||||
allCurveData.push_back(curveDataForCase);
|
||||
|
||||
std::vector<QString> curveNamesForCase;
|
||||
curveNamesForCase.push_back(curve->curveName());
|
||||
allCurveNames.push_back(curveNamesForCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> curveYData = curve->yValues();
|
||||
allCurveData[casePosInList].push_back(curveYData);
|
||||
|
||||
QString curveName = curve->curveName();
|
||||
allCurveNames[casePosInList].push_back(curveName);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < timeSteps.size(); i++) //cases
|
||||
{
|
||||
out += "\n\n";
|
||||
out += "Case: " + caseNames[i];
|
||||
out += "\n";
|
||||
|
||||
for (size_t j = 0; j < timeSteps[i].size(); j++) //time steps & data points
|
||||
{
|
||||
if (j == 0)
|
||||
{
|
||||
out += "Date and time";
|
||||
for (size_t k = 0; k < allCurveNames[i].size(); k++) // curves
|
||||
{
|
||||
out += "\t" + (allCurveNames[i][k]);
|
||||
}
|
||||
}
|
||||
out += "\n";
|
||||
out += QDateTime::fromTime_t(timeSteps[i][j]).toUTC().toString("yyyy-MM-dd hh:mm:ss ");
|
||||
|
||||
for (size_t k = 0; k < allCurveData[i].size(); k++) // curves
|
||||
{
|
||||
out += "\t" + QString::number(allCurveData[i][k][j], 'g', 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -294,62 +362,103 @@ void RimSummaryPlot::updateAxis(RimDefines::PlotAxis plotAxis)
|
||||
if (!m_qwtPlot) return;
|
||||
|
||||
QwtPlot::Axis qwtAxis = QwtPlot::yLeft;
|
||||
RimSummaryYAxisProperties* yAxisProperties = nullptr;
|
||||
if (plotAxis == RimDefines::PLOT_AXIS_LEFT)
|
||||
{
|
||||
qwtAxis = QwtPlot::yLeft;
|
||||
yAxisProperties = m_leftYAxisProperties();
|
||||
}
|
||||
else
|
||||
{
|
||||
qwtAxis = QwtPlot::yRight;
|
||||
yAxisProperties = m_rightYAxisProperties();
|
||||
}
|
||||
|
||||
if (!yAxisProperties->isActive())
|
||||
RimSummaryYAxisProperties* yAxisProperties = yAxisPropertiesForAxis(plotAxis);
|
||||
if (yAxisProperties->isActive() && hasVisibleCurvesForAxis(plotAxis))
|
||||
{
|
||||
m_qwtPlot->enableAxis(qwtAxis, false);
|
||||
m_qwtPlot->enableAxis(qwtAxis, true);
|
||||
|
||||
std::set<QString> timeHistoryQuantities;
|
||||
|
||||
for (auto c : visibleTimeHistoryCurvesForAxis(plotAxis))
|
||||
{
|
||||
timeHistoryQuantities.insert(c->quantityName());
|
||||
}
|
||||
|
||||
RimSummaryPlotYAxisFormatter calc(yAxisProperties, visibleSummaryCurvesForAxis(plotAxis), timeHistoryQuantities);
|
||||
calc.applyYAxisPropertiesToPlot(m_qwtPlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasVisibleCurvesForAxis(plotAxis))
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
curves.insert(curves.begin(), m_curves.begin(), m_curves.end());
|
||||
|
||||
std::vector<RimSummaryCurveFilter*> curveFilters;
|
||||
curveFilters.insert(curveFilters.begin(), m_curveFilters.begin(), m_curveFilters.end());
|
||||
|
||||
m_qwtPlot->enableAxis(qwtAxis, true);
|
||||
|
||||
RimSummaryPlotYAxisFormater calc(yAxisProperties, curves, curveFilters);
|
||||
calc.applyYAxisPropertiesToPlot(m_qwtPlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlot->enableAxis(qwtAxis, false);
|
||||
}
|
||||
m_qwtPlot->enableAxis(qwtAxis, false);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryPlot::curvesForAxis(RimDefines::PlotAxis plotAxis) const
|
||||
void RimSummaryPlot::updateZoomForAxis(RimDefines::PlotAxis plotAxis)
|
||||
{
|
||||
RimSummaryYAxisProperties* yAxisProps = yAxisPropertiesForAxis(plotAxis);
|
||||
|
||||
if (yAxisProps->isLogarithmicScaleEnabled)
|
||||
{
|
||||
std::vector<double> yValues;
|
||||
std::vector<QwtPlotCurve*> plotCurves;
|
||||
|
||||
for (RimSummaryCurve* c : visibleSummaryCurvesForAxis(plotAxis))
|
||||
{
|
||||
std::vector<double> curveValues = c->yValues();
|
||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||
plotCurves.push_back(c->qwtPlotCurve());
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* c : visibleTimeHistoryCurvesForAxis(plotAxis))
|
||||
{
|
||||
std::vector<double> curveValues = c->yValues();
|
||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||
plotCurves.push_back(c->qwtPlotCurve());
|
||||
}
|
||||
|
||||
double min, max;
|
||||
RimSummaryPlotYAxisRangeCalculator calc(plotCurves, yValues);
|
||||
calc.computeYRange(&min, &max);
|
||||
|
||||
m_qwtPlot->setAxisScale(yAxisProps->qwtPlotAxisType(), min, max);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlot->setAxisAutoScale(yAxisProps->qwtPlotAxisType(), true);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryPlot::visibleSummaryCurvesForAxis(RimDefines::PlotAxis plotAxis) const
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
|
||||
std::vector<RimSummaryCurve*> childCurves;
|
||||
this->descendantsIncludingThisOfType(childCurves);
|
||||
|
||||
for (RimSummaryCurve* curve : childCurves)
|
||||
for (RimSummaryCurve* curve : m_summaryCurves)
|
||||
{
|
||||
if (curve->yAxis() == plotAxis)
|
||||
if (curve->isCurveVisible() && curve->yAxis() == plotAxis)
|
||||
{
|
||||
curves.push_back(curve);
|
||||
}
|
||||
}
|
||||
|
||||
for (RimSummaryCurveFilter * curveFilter : m_curveFilters)
|
||||
{
|
||||
if (curveFilter->isCurvesVisible())
|
||||
{
|
||||
for (RimSummaryCurve* curve : curveFilter->curves())
|
||||
{
|
||||
if (curve->isCurveVisible() && curve->yAxis() == plotAxis)
|
||||
{
|
||||
curves.push_back(curve);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return curves;
|
||||
}
|
||||
|
||||
@@ -358,25 +467,58 @@ std::vector<RimSummaryCurve*> RimSummaryPlot::curvesForAxis(RimDefines::PlotAxis
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlot::hasVisibleCurvesForAxis(RimDefines::PlotAxis plotAxis) const
|
||||
{
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
if (visibleSummaryCurvesForAxis(plotAxis).size() > 0)
|
||||
{
|
||||
if (curve->isCurveVisible() && curve->yAxis() == plotAxis) return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (RimSummaryCurveFilter * curveFilter : m_curveFilters)
|
||||
if (visibleTimeHistoryCurvesForAxis(plotAxis).size() > 0)
|
||||
{
|
||||
if (curveFilter->isCurvesVisible())
|
||||
{
|
||||
for ( RimSummaryCurve* curve : curveFilter->curves() )
|
||||
{
|
||||
if ( curve->isCurveVisible() && curve->yAxis() == plotAxis ) return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryYAxisProperties* RimSummaryPlot::yAxisPropertiesForAxis(RimDefines::PlotAxis plotAxis) const
|
||||
{
|
||||
RimSummaryYAxisProperties* yAxisProps = nullptr;
|
||||
|
||||
if (plotAxis == RimDefines::PLOT_AXIS_LEFT)
|
||||
{
|
||||
yAxisProps = m_leftYAxisProperties();
|
||||
}
|
||||
else
|
||||
{
|
||||
yAxisProps = m_rightYAxisProperties();
|
||||
}
|
||||
|
||||
CVF_ASSERT(yAxisProps);
|
||||
|
||||
return yAxisProps;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimGridTimeHistoryCurve*> RimSummaryPlot::visibleTimeHistoryCurvesForAxis(RimDefines::PlotAxis plotAxis) const
|
||||
{
|
||||
std::vector<RimGridTimeHistoryCurve*> curves;
|
||||
|
||||
for (auto c : m_gridTimeHistoryCurves)
|
||||
{
|
||||
if (c->isCurveVisible() && c->yAxis() == plotAxis)
|
||||
{
|
||||
curves.push_back(c);
|
||||
}
|
||||
}
|
||||
|
||||
return curves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -442,7 +584,7 @@ void RimSummaryPlot::updateTimeAxis()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateCaseNameHasChanged()
|
||||
{
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
for (RimSummaryCurve* curve : m_summaryCurves)
|
||||
{
|
||||
curve->updateCurveName();
|
||||
curve->updateConnectedEditors();
|
||||
@@ -483,40 +625,13 @@ void RimSummaryPlot::zoomAll()
|
||||
{
|
||||
m_qwtPlot->setAxisAutoScale(QwtPlot::xBottom, true);
|
||||
|
||||
if (m_leftYAxisProperties->isLogarithmicScaleEnabled)
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves = curvesForAxis(RimDefines::PLOT_AXIS_LEFT);
|
||||
|
||||
double min, max;
|
||||
RimSummaryPlotYAxisRangeCalculator calc(m_leftYAxisProperties, curves);
|
||||
calc.computeYRange(&min, &max);
|
||||
|
||||
m_qwtPlot->setAxisScale(m_leftYAxisProperties->qwtPlotAxisType(), min, max);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlot->setAxisAutoScale(QwtPlot::yLeft, true);
|
||||
}
|
||||
|
||||
if (m_rightYAxisProperties->isLogarithmicScaleEnabled)
|
||||
{
|
||||
std::vector<RimSummaryCurve*> curves = curvesForAxis(RimDefines::PLOT_AXIS_RIGHT);
|
||||
|
||||
double min, max;
|
||||
RimSummaryPlotYAxisRangeCalculator calc(m_rightYAxisProperties, curves);
|
||||
calc.computeYRange(&min, &max);
|
||||
|
||||
m_qwtPlot->setAxisScale(m_rightYAxisProperties->qwtPlotAxisType(), min, max);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlot->setAxisAutoScale(QwtPlot::yRight, true);
|
||||
}
|
||||
updateZoomForAxis(RimDefines::PLOT_AXIS_LEFT);
|
||||
updateZoomForAxis(RimDefines::PLOT_AXIS_RIGHT);
|
||||
|
||||
m_qwtPlot->replot();
|
||||
}
|
||||
|
||||
updateZoomFromQwt();
|
||||
updateZoomWindowFromQwt();
|
||||
|
||||
m_isAutoZoom = true;
|
||||
}
|
||||
@@ -528,7 +643,7 @@ void RimSummaryPlot::addCurve(RimSummaryCurve* curve)
|
||||
{
|
||||
if (curve)
|
||||
{
|
||||
m_curves.push_back(curve);
|
||||
m_summaryCurves.push_back(curve);
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
@@ -553,6 +668,21 @@ void RimSummaryPlot::addCurveFilter(RimSummaryCurveFilter* curveFilter)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::addGridTimeHistoryCurve(RimGridTimeHistoryCurve* curve)
|
||||
{
|
||||
CVF_ASSERT(curve);
|
||||
|
||||
m_gridTimeHistoryCurves.push_back(curve);
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
this->updateAxes();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -601,9 +731,10 @@ void RimSummaryPlot::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
axisFolder->add(&m_rightYAxisProperties);
|
||||
|
||||
uiTreeOrdering.add(&m_curveFilters);
|
||||
uiTreeOrdering.add(&m_curves);
|
||||
uiTreeOrdering.add(&m_summaryCurves);
|
||||
uiTreeOrdering.add(&m_gridTimeHistoryCurves);
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -618,11 +749,16 @@ void RimSummaryPlot::loadDataAndUpdate()
|
||||
curveFilter->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
for (RimSummaryCurve* curve : m_summaryCurves)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
this->updateAxes();
|
||||
|
||||
updateZoomInQwt();
|
||||
@@ -665,7 +801,7 @@ void RimSummaryPlot::setZoomIntervalsInQwtPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateZoomFromQwt()
|
||||
void RimSummaryPlot::updateZoomWindowFromQwt()
|
||||
{
|
||||
if (!m_qwtPlot) return;
|
||||
|
||||
@@ -713,7 +849,12 @@ QWidget* RimSummaryPlot::createViewWidget(QWidget* mainWindowParent)
|
||||
curveFilter->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
|
||||
for(RimSummaryCurve* curve : m_curves)
|
||||
for(RimSummaryCurve* curve : m_summaryCurves)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
@@ -766,7 +907,12 @@ void RimSummaryPlot::detachAllCurves()
|
||||
curveFilter->detachQwtCurves();
|
||||
}
|
||||
|
||||
for(RimSummaryCurve* curve : m_curves)
|
||||
for(RimSummaryCurve* curve : m_summaryCurves)
|
||||
{
|
||||
curve->detachQwtCurve();
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||
{
|
||||
curve->detachQwtCurve();
|
||||
}
|
||||
@@ -775,13 +921,21 @@ void RimSummaryPlot::detachAllCurves()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCurve* RimSummaryPlot::findRimCurveFromQwtCurve(const QwtPlotCurve* qwtCurve) const
|
||||
caf::PdmObject* RimSummaryPlot::findRimCurveFromQwtCurve(const QwtPlotCurve* qwtCurve) const
|
||||
{
|
||||
for(RimSummaryCurve* rimCurve: m_curves)
|
||||
for(RimSummaryCurve* curve : m_summaryCurves)
|
||||
{
|
||||
if(rimCurve->qwtPlotCurve() == qwtCurve)
|
||||
if(curve->qwtPlotCurve() == qwtCurve)
|
||||
{
|
||||
return rimCurve;
|
||||
return curve;
|
||||
}
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||
{
|
||||
if (curve->qwtPlotCurve() == qwtCurve)
|
||||
{
|
||||
return curve;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -799,5 +953,5 @@ RimSummaryCurve* RimSummaryPlot::findRimCurveFromQwtCurve(const QwtPlotCurve* qw
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimSummaryPlot::curveCount() const
|
||||
{
|
||||
return m_curves.size();
|
||||
return m_summaryCurves.size() + m_gridTimeHistoryCurves.size();
|
||||
}
|
||||
|
||||
@@ -30,13 +30,12 @@
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class RiuSummaryQwtPlot;
|
||||
class RimSummaryCurve;
|
||||
class RimSummaryCurveFilter;
|
||||
class RimSummaryYAxisProperties;
|
||||
class RimSummaryTimeAxisProperties;
|
||||
class RimGridTimeHistoryCurve;
|
||||
class PdmUiTreeOrdering;
|
||||
|
||||
class QwtPlotCurve;
|
||||
@@ -60,7 +59,9 @@ public:
|
||||
void addCurve(RimSummaryCurve* curve);
|
||||
void addCurveFilter(RimSummaryCurveFilter* curveFilter);
|
||||
|
||||
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const;
|
||||
void addGridTimeHistoryCurve(RimGridTimeHistoryCurve* curve);
|
||||
|
||||
caf::PdmObject* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const;
|
||||
size_t curveCount() const;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
@@ -75,7 +76,7 @@ public:
|
||||
const QwtInterval& timeAxis);
|
||||
|
||||
void updateZoomInQwt();
|
||||
void updateZoomFromQwt();
|
||||
void updateZoomWindowFromQwt();
|
||||
void disableAutoZoom();
|
||||
|
||||
bool isLogarithmicScaleEnabled(RimDefines::PlotAxis plotAxis) const;
|
||||
@@ -98,11 +99,14 @@ protected:
|
||||
virtual QImage snapshotWindowContent() override;
|
||||
|
||||
private:
|
||||
|
||||
void updateAxis(RimDefines::PlotAxis plotAxis);
|
||||
std::vector<RimSummaryCurve*> curvesForAxis(RimDefines::PlotAxis plotAxis) const;
|
||||
std::vector<RimSummaryCurve*> visibleSummaryCurvesForAxis(RimDefines::PlotAxis plotAxis) const;
|
||||
std::vector<RimGridTimeHistoryCurve*> visibleTimeHistoryCurvesForAxis(RimDefines::PlotAxis plotAxis) const;
|
||||
bool hasVisibleCurvesForAxis(RimDefines::PlotAxis plotAxis) const;
|
||||
|
||||
RimSummaryYAxisProperties* yAxisPropertiesForAxis(RimDefines::PlotAxis plotAxis) const;
|
||||
void updateAxis(RimDefines::PlotAxis plotAxis);
|
||||
void updateZoomForAxis(RimDefines::PlotAxis plotAxis);
|
||||
|
||||
void updateTimeAxis();
|
||||
void setZoomIntervalsInQwtPlot();
|
||||
|
||||
@@ -113,21 +117,17 @@ private:
|
||||
virtual void deleteViewWidget() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<QString> m_userName;
|
||||
|
||||
caf::PdmChildArrayField<RimSummaryCurve*> m_curves;
|
||||
caf::PdmChildArrayField<RimSummaryCurveFilter*> m_curveFilters;
|
||||
caf::PdmChildArrayField<RimGridTimeHistoryCurve*> m_gridTimeHistoryCurves;
|
||||
caf::PdmChildArrayField<RimSummaryCurve*> m_summaryCurves;
|
||||
caf::PdmChildArrayField<RimSummaryCurveFilter*> m_curveFilters;
|
||||
|
||||
caf::PdmField<bool> m_isAutoZoom;
|
||||
caf::PdmChildField<RimSummaryYAxisProperties*> m_leftYAxisProperties;
|
||||
caf::PdmChildField<RimSummaryYAxisProperties*> m_rightYAxisProperties;
|
||||
caf::PdmChildField<RimSummaryTimeAxisProperties*> m_timeAxisProperties;
|
||||
caf::PdmField<bool> m_isAutoZoom;
|
||||
caf::PdmChildField<RimSummaryYAxisProperties*> m_leftYAxisProperties;
|
||||
caf::PdmChildField<RimSummaryYAxisProperties*> m_rightYAxisProperties;
|
||||
caf::PdmChildField<RimSummaryTimeAxisProperties*> m_timeAxisProperties;
|
||||
|
||||
QPointer<RiuSummaryQwtPlot> m_qwtPlot;
|
||||
|
||||
// Internal objects managed by unique_ptr
|
||||
std::unique_ptr<RimSummaryYAxisProperties> m_leftYAxisPropertiesObject;
|
||||
std::unique_ptr<RimSummaryYAxisProperties> m_rightYAxisPropertiesObject;
|
||||
std::unique_ptr<RimSummaryTimeAxisProperties> m_timeAxisPropertiesObject;
|
||||
QPointer<RiuSummaryQwtPlot> m_qwtPlot;
|
||||
};
|
||||
|
||||
@@ -301,7 +301,7 @@ void RimSummaryTimeAxisProperties::defineUiOrdering(QString uiConfigName, caf::P
|
||||
timeGroup->add(&m_visibleTimeRangeMin);
|
||||
}
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user