#5326 Phase Distribution : Add individual visibility control of oil/gas/water

This commit is contained in:
Magne Sjaastad 2020-01-13 09:10:03 +01:00
parent aaf939794d
commit bd0c165d17
4 changed files with 40 additions and 1 deletions

View File

@ -108,6 +108,14 @@ void RimWellDistributionPlot::setPlotOptions( bool groupSmallContributions,
m_maximumTof = maximumTof;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::PhaseType RimWellDistributionPlot::phase() const
{
return m_phase();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -46,6 +46,8 @@ public:
void setDataSourceParameters( RimEclipseResultCase* eclipseResultCase, int timeStepIndex, QString targetWellName );
void setPlotOptions( bool groupSmallContributions, double smallContributionsRelativeThreshold, double maximumTof );
RiaDefines::PhaseType phase() const;
// RimPlot implementations
RiuQwtPlotWidget* viewer() override;
void setAutoScaleXEnabled( bool enabled ) override;

View File

@ -72,6 +72,11 @@ RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()
"" );
CAF_PDM_InitField( &m_maximumTof, "MaximumTOF", 20.0, "Maximum Time of Flight [0, 200]", "", "", "" );
CAF_PDM_InitField( &m_showOil, "ShowOil", true, "Show Oil", "", "", "" );
CAF_PDM_InitField( &m_showGas, "ShowGas", true, "Show Gas", "", "", "" );
CAF_PDM_InitField( &m_showWater, "ShowWater", true, "Show Water", "", "", "" );
m_plotWindowTitle = "Cumulative Phase Distribution Plots";
m_columnCount = RimMultiPlotWindow::COLUMNS_UNLIMITED;
@ -125,6 +130,10 @@ void RimWellDistributionPlotCollection::defineUiOrdering( QString uiConfigName,
uiOrdering.add( &m_smallContributionsRelativeThreshold );
uiOrdering.add( &m_maximumTof );
uiOrdering.add( &m_showOil );
uiOrdering.add( &m_showGas );
uiOrdering.add( &m_showWater );
m_smallContributionsRelativeThreshold.uiCapability()->setUiReadOnly( m_groupSmallContributions == false );
// RimMultiPlotWindow::defineUiOrdering(uiConfigName, uiOrdering);
@ -209,7 +218,8 @@ void RimWellDistributionPlotCollection::fieldChangedByUi( const caf::PdmFieldHan
bool shouldRecalculatePlotData = false;
if ( changedField == &m_case || changedField == &m_timeStepIndex || changedField == &m_wellName ||
changedField == &m_groupSmallContributions || changedField == &m_smallContributionsRelativeThreshold ||
changedField == &m_maximumTof )
changedField == &m_maximumTof || changedField == &m_showOil || changedField == &m_showGas ||
changedField == &m_showWater )
{
applyPlotParametersToContainedPlots();
shouldRecalculatePlotData = true;
@ -219,6 +229,8 @@ void RimWellDistributionPlotCollection::fieldChangedByUi( const caf::PdmFieldHan
if ( shouldRecalculatePlotData )
{
updateLayout();
loadDataAndUpdate();
}
}
@ -235,6 +247,19 @@ void RimWellDistributionPlotCollection::applyPlotParametersToContainedPlots()
RimWellDistributionPlot* aPlot = dynamic_cast<RimWellDistributionPlot*>( plotByIndex( i ) );
if ( aPlot )
{
if ( aPlot->phase() == RiaDefines::PhaseType::OIL_PHASE )
{
aPlot->setShowWindow( m_showOil );
}
else if ( aPlot->phase() == RiaDefines::PhaseType::GAS_PHASE )
{
aPlot->setShowWindow( m_showGas );
}
else if ( aPlot->phase() == RiaDefines::PhaseType::WATER_PHASE )
{
aPlot->setShowWindow( m_showWater );
}
aPlot->setDataSourceParameters( m_case, m_timeStepIndex, m_wellName );
aPlot->setPlotOptions( m_groupSmallContributions, m_smallContributionsRelativeThreshold, m_maximumTof );
}

View File

@ -71,4 +71,8 @@ private:
caf::PdmField<bool> m_groupSmallContributions;
caf::PdmField<double> m_smallContributionsRelativeThreshold;
caf::PdmField<double> m_maximumTof;
caf::PdmField<bool> m_showOil;
caf::PdmField<bool> m_showGas;
caf::PdmField<bool> m_showWater;
};