mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5326 Phase Distribution : Add max TOF to property editor
This commit is contained in:
@@ -73,6 +73,8 @@ RimWellDistributionPlot::RimWellDistributionPlot( RiaDefines::PhaseType phase )
|
|||||||
"",
|
"",
|
||||||
"" );
|
"" );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_maximumTof, "MaximumTOF", 20.0, "Maximum Time of Flight [0, 200]", "", "", "" );
|
||||||
|
|
||||||
m_showWindow = false;
|
m_showWindow = false;
|
||||||
m_showPlotLegends = true;
|
m_showPlotLegends = true;
|
||||||
}
|
}
|
||||||
@@ -97,10 +99,13 @@ void RimWellDistributionPlot::setDataSourceParameters( RimEclipseResultCase* ecl
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellDistributionPlot::setPlotOptions( bool groupSmallContributions, double smallContributionsRelativeThreshold )
|
void RimWellDistributionPlot::setPlotOptions( bool groupSmallContributions,
|
||||||
|
double smallContributionsRelativeThreshold,
|
||||||
|
double maximumTof )
|
||||||
{
|
{
|
||||||
m_groupSmallContributions = groupSmallContributions;
|
m_groupSmallContributions = groupSmallContributions;
|
||||||
m_smallContributionsRelativeThreshold = smallContributionsRelativeThreshold;
|
m_smallContributionsRelativeThreshold = smallContributionsRelativeThreshold;
|
||||||
|
m_maximumTof = maximumTof;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -355,7 +360,7 @@ void RimWellDistributionPlot::onLoadDataAndUpdate()
|
|||||||
|
|
||||||
// cvf::Trace::show("Populating plot for phase '%s'", m_phase == RiaDefines::OIL_PHASE ? "oil" : (m_phase ==
|
// cvf::Trace::show("Populating plot for phase '%s'", m_phase == RiaDefines::OIL_PHASE ? "oil" : (m_phase ==
|
||||||
// RiaDefines::GAS_PHASE ? "gas" : "water"));
|
// RiaDefines::GAS_PHASE ? "gas" : "water"));
|
||||||
populatePlotWidgetWithCurveData( calc, *flowDiagSolution, m_plotWidget );
|
populatePlotWidgetWithCurveData( calc, *flowDiagSolution, m_plotWidget, m_maximumTof );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString phaseString = "N/A";
|
QString phaseString = "N/A";
|
||||||
@@ -385,7 +390,8 @@ void RimWellDistributionPlot::onLoadDataAndUpdate()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellDistributionPlot::populatePlotWidgetWithCurveData( const RigTofWellDistributionCalculator& calculator,
|
void RimWellDistributionPlot::populatePlotWidgetWithCurveData( const RigTofWellDistributionCalculator& calculator,
|
||||||
const RimFlowDiagSolution& flowDiagSolution,
|
const RimFlowDiagSolution& flowDiagSolution,
|
||||||
RiuQwtPlotWidget* plotWidget )
|
RiuQwtPlotWidget* plotWidget,
|
||||||
|
double maximumTof )
|
||||||
{
|
{
|
||||||
// cvf::Trace::show("RimWellDistributionPlot::populatePlotWidgetWithCurves()");
|
// cvf::Trace::show("RimWellDistributionPlot::populatePlotWidgetWithCurves()");
|
||||||
|
|
||||||
@@ -409,6 +415,9 @@ void RimWellDistributionPlot::populatePlotWidgetWithCurveData( const RigTofWellD
|
|||||||
for ( double tofDays : tofValuesDays )
|
for ( double tofDays : tofValuesDays )
|
||||||
{
|
{
|
||||||
const double tofYears = tofDays / 365.2425;
|
const double tofYears = tofDays / 365.2425;
|
||||||
|
|
||||||
|
if ( tofYears > maximumTof ) continue;
|
||||||
|
|
||||||
tofValuesYears.push_back( tofYears );
|
tofValuesYears.push_back( tofYears );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
~RimWellDistributionPlot() override;
|
~RimWellDistributionPlot() override;
|
||||||
|
|
||||||
void setDataSourceParameters( RimEclipseResultCase* eclipseResultCase, int timeStepIndex, QString targetWellName );
|
void setDataSourceParameters( RimEclipseResultCase* eclipseResultCase, int timeStepIndex, QString targetWellName );
|
||||||
void setPlotOptions( bool groupSmallContributions, double smallContributionsRelativeThreshold );
|
void setPlotOptions( bool groupSmallContributions, double smallContributionsRelativeThreshold, double maximumTof );
|
||||||
|
|
||||||
// RimPlot implementations
|
// RimPlot implementations
|
||||||
RiuQwtPlotWidget* viewer() override;
|
RiuQwtPlotWidget* viewer() override;
|
||||||
@@ -81,7 +81,8 @@ private:
|
|||||||
void fixupDependentFieldsAfterCaseChange();
|
void fixupDependentFieldsAfterCaseChange();
|
||||||
static void populatePlotWidgetWithCurveData( const RigTofWellDistributionCalculator& calculator,
|
static void populatePlotWidgetWithCurveData( const RigTofWellDistributionCalculator& calculator,
|
||||||
const RimFlowDiagSolution& flowDiagSolution,
|
const RimFlowDiagSolution& flowDiagSolution,
|
||||||
RiuQwtPlotWidget* plotWidget );
|
RiuQwtPlotWidget* plotWidget,
|
||||||
|
double maximumTof );
|
||||||
|
|
||||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||||
@@ -98,6 +99,7 @@ private:
|
|||||||
caf::PdmField<caf::AppEnum<RiaDefines::PhaseType>> m_phase;
|
caf::PdmField<caf::AppEnum<RiaDefines::PhaseType>> m_phase;
|
||||||
caf::PdmField<bool> m_groupSmallContributions;
|
caf::PdmField<bool> m_groupSmallContributions;
|
||||||
caf::PdmField<double> m_smallContributionsRelativeThreshold;
|
caf::PdmField<double> m_smallContributionsRelativeThreshold;
|
||||||
|
caf::PdmField<double> m_maximumTof;
|
||||||
|
|
||||||
QPointer<RiuQwtPlotWidget> m_plotWidget;
|
QPointer<RiuQwtPlotWidget> m_plotWidget;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()
|
|||||||
{
|
{
|
||||||
// cvf::Trace::show("RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()");
|
// cvf::Trace::show("RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()");
|
||||||
|
|
||||||
CAF_PDM_InitObject( "Well Distribution Plots", "", "", "" );
|
CAF_PDM_InitObject( "Cumulative Phase Distribution", "", "", "" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_case, "Case", "Case", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_case, "Case", "Case", "", "", "" );
|
||||||
CAF_PDM_InitField( &m_timeStepIndex, "TimeStepIndex", -1, "Time Step", "", "", "" );
|
CAF_PDM_InitField( &m_timeStepIndex, "TimeStepIndex", -1, "Time Step", "", "", "" );
|
||||||
@@ -71,6 +71,7 @@ RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()
|
|||||||
"",
|
"",
|
||||||
"" );
|
"" );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_maximumTof, "MaximumTOF", 20.0, "Maximum Time of Flight [0, 200]", "", "", "" );
|
||||||
m_plotWindowTitle = "Well Distribution Plots";
|
m_plotWindowTitle = "Well Distribution Plots";
|
||||||
m_columnCount = RimMultiPlotWindow::COLUMNS_UNLIMITED;
|
m_columnCount = RimMultiPlotWindow::COLUMNS_UNLIMITED;
|
||||||
|
|
||||||
@@ -110,6 +111,7 @@ void RimWellDistributionPlotCollection::defineUiOrdering( QString uiConfigName,
|
|||||||
uiOrdering.add( &m_wellName );
|
uiOrdering.add( &m_wellName );
|
||||||
uiOrdering.add( &m_groupSmallContributions );
|
uiOrdering.add( &m_groupSmallContributions );
|
||||||
uiOrdering.add( &m_smallContributionsRelativeThreshold );
|
uiOrdering.add( &m_smallContributionsRelativeThreshold );
|
||||||
|
uiOrdering.add( &m_maximumTof );
|
||||||
|
|
||||||
m_smallContributionsRelativeThreshold.uiCapability()->setUiReadOnly( m_groupSmallContributions == false );
|
m_smallContributionsRelativeThreshold.uiCapability()->setUiReadOnly( m_groupSmallContributions == false );
|
||||||
|
|
||||||
@@ -194,7 +196,8 @@ void RimWellDistributionPlotCollection::fieldChangedByUi( const caf::PdmFieldHan
|
|||||||
|
|
||||||
bool shouldRecalculatePlotData = false;
|
bool shouldRecalculatePlotData = false;
|
||||||
if ( changedField == &m_case || changedField == &m_timeStepIndex || changedField == &m_wellName ||
|
if ( changedField == &m_case || changedField == &m_timeStepIndex || changedField == &m_wellName ||
|
||||||
changedField == &m_groupSmallContributions || changedField == &m_smallContributionsRelativeThreshold )
|
changedField == &m_groupSmallContributions || changedField == &m_smallContributionsRelativeThreshold ||
|
||||||
|
changedField == &m_maximumTof )
|
||||||
{
|
{
|
||||||
applyPlotParametersToContainedPlots();
|
applyPlotParametersToContainedPlots();
|
||||||
shouldRecalculatePlotData = true;
|
shouldRecalculatePlotData = true;
|
||||||
@@ -221,7 +224,7 @@ void RimWellDistributionPlotCollection::applyPlotParametersToContainedPlots()
|
|||||||
if ( aPlot )
|
if ( aPlot )
|
||||||
{
|
{
|
||||||
aPlot->setDataSourceParameters( m_case, m_timeStepIndex, m_wellName );
|
aPlot->setDataSourceParameters( m_case, m_timeStepIndex, m_wellName );
|
||||||
aPlot->setPlotOptions( m_groupSmallContributions, m_smallContributionsRelativeThreshold );
|
aPlot->setPlotOptions( m_groupSmallContributions, m_smallContributionsRelativeThreshold, m_maximumTof );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,5 @@ private:
|
|||||||
caf::PdmField<QString> m_wellName;
|
caf::PdmField<QString> m_wellName;
|
||||||
caf::PdmField<bool> m_groupSmallContributions;
|
caf::PdmField<bool> m_groupSmallContributions;
|
||||||
caf::PdmField<double> m_smallContributionsRelativeThreshold;
|
caf::PdmField<double> m_smallContributionsRelativeThreshold;
|
||||||
|
caf::PdmField<double> m_maximumTof;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user