mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add a proxy field Show Ensemble Curves
Create a proxy field to invert the logic in m_hideEnsembleCurves, and avoid adding obsolete field and conversion code in initAfterRead()
This commit is contained in:
parent
6e41ef8af9
commit
ececc3ae47
@ -37,7 +37,14 @@ RimEnsembleStatistics::RimEnsembleStatistics( RimEnsembleCurveSetInterface* pare
|
||||
|
||||
CAF_PDM_InitField( &m_active, "Active", true, "Show Statistics Curves" );
|
||||
CAF_PDM_InitField( &m_showStatisticsCurveLegends, "ShowStatisticsCurveLegends", false, "Show Statistics Curve Legends" );
|
||||
|
||||
// Create a proxy field to invert the logic in m_hideEnsembleCurves, and avoid adding obsolete field and conversion code in initAfterRead()
|
||||
CAF_PDM_InitField( &m_hideEnsembleCurves, "HideEnsembleCurves", false, "Hide Ensemble Curves" );
|
||||
m_hideEnsembleCurves.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_showEnsembleCurves, "ShowEnsembleCurves", "Show Ensemble Curves" );
|
||||
m_showEnsembleCurves.registerGetMethod( this, &RimEnsembleStatistics::onShowEnsembleCurves );
|
||||
m_showEnsembleCurves.registerSetMethod( this, &RimEnsembleStatistics::onSetShowEnsembleCurves );
|
||||
|
||||
CAF_PDM_InitField( &m_basedOnFilteredCases, "BasedOnFilteredCases", false, "Based on Filtered Cases" );
|
||||
CAF_PDM_InitField( &m_showP10Curve, "ShowP10Curve", true, "P10" );
|
||||
CAF_PDM_InitField( &m_showP50Curve, "ShowP50Curve", false, "P50" );
|
||||
@ -85,6 +92,94 @@ void RimEnsembleStatistics::setShowStatisticsCurves( bool show )
|
||||
m_active = show;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::showStatisticsCurveLegends() const
|
||||
{
|
||||
return m_showStatisticsCurveLegends;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::hideEnsembleCurves() const
|
||||
{
|
||||
return m_hideEnsembleCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::basedOnFilteredCases() const
|
||||
{
|
||||
return m_basedOnFilteredCases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::showP10Curve() const
|
||||
{
|
||||
return m_showP10Curve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::showP50Curve() const
|
||||
{
|
||||
return m_showP50Curve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::showP90Curve() const
|
||||
{
|
||||
return m_showP90Curve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::showMeanCurve() const
|
||||
{
|
||||
return m_showMeanCurve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::showCurveLabels() const
|
||||
{
|
||||
return m_showCurveLabels;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleStatistics::enableCurveLabels( bool enable )
|
||||
{
|
||||
m_showCurveLabels = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleStatistics::setColor( const cvf::Color3f& color )
|
||||
{
|
||||
m_color = color;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::includeIncompleteCurves() const
|
||||
{
|
||||
return m_includeIncompleteCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -146,7 +241,7 @@ void RimEnsembleStatistics::showColorField( bool show )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleStatistics::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_hideEnsembleCurves )
|
||||
if ( changedField == &m_showEnsembleCurves )
|
||||
{
|
||||
auto curveSet = m_parentCurveSet;
|
||||
if ( !curveSet ) return;
|
||||
@ -175,7 +270,7 @@ void RimEnsembleStatistics::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
uiOrdering.add( &m_active );
|
||||
m_showStatisticsCurveLegends.uiCapability()->setUiReadOnly( !m_active );
|
||||
uiOrdering.add( &m_showStatisticsCurveLegends );
|
||||
uiOrdering.add( &m_hideEnsembleCurves );
|
||||
uiOrdering.add( &m_showEnsembleCurves );
|
||||
uiOrdering.add( &m_basedOnFilteredCases );
|
||||
uiOrdering.add( &m_includeIncompleteCurves );
|
||||
uiOrdering.add( &m_showCurveLabels );
|
||||
@ -205,3 +300,19 @@ void RimEnsembleStatistics::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleStatistics::onShowEnsembleCurves() const
|
||||
{
|
||||
return !m_hideEnsembleCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleStatistics::onSetShowEnsembleCurves( const bool& enable )
|
||||
{
|
||||
m_hideEnsembleCurves = !enable;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmProxyValueField.h"
|
||||
|
||||
class RimEnsembleCurveSetInterface;
|
||||
|
||||
@ -36,21 +37,21 @@ public:
|
||||
|
||||
bool isActive() const;
|
||||
void setShowStatisticsCurves( bool show );
|
||||
bool showStatisticsCurveLegends() const { return m_showStatisticsCurveLegends; }
|
||||
bool hideEnsembleCurves() const { return m_hideEnsembleCurves; }
|
||||
bool basedOnFilteredCases() const { return m_basedOnFilteredCases; }
|
||||
bool showP10Curve() const { return m_showP10Curve; }
|
||||
bool showP50Curve() const { return m_showP50Curve; }
|
||||
bool showP90Curve() const { return m_showP90Curve; }
|
||||
bool showMeanCurve() const { return m_showMeanCurve; }
|
||||
bool showStatisticsCurveLegends() const;
|
||||
bool hideEnsembleCurves() const;
|
||||
bool basedOnFilteredCases() const;
|
||||
bool showP10Curve() const;
|
||||
bool showP50Curve() const;
|
||||
bool showP90Curve() const;
|
||||
bool showMeanCurve() const;
|
||||
|
||||
bool showCurveLabels() const { return m_showCurveLabels; }
|
||||
void enableCurveLabels( bool enable ) { m_showCurveLabels = enable; }
|
||||
bool showCurveLabels() const;
|
||||
void enableCurveLabels( bool enable );
|
||||
|
||||
cvf::Color3f color() const { return m_color; }
|
||||
void setColor( const cvf::Color3f& color ) { m_color = color; }
|
||||
void setColor( const cvf::Color3f& color );
|
||||
|
||||
bool includeIncompleteCurves() const { return m_includeIncompleteCurves; }
|
||||
bool includeIncompleteCurves() const;
|
||||
|
||||
int crossPlotCurvesBinCount() const;
|
||||
int crossPlotRealizationCountThresholdPerBin() const;
|
||||
@ -65,19 +66,24 @@ public:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
private:
|
||||
bool onShowEnsembleCurves() const;
|
||||
void onSetShowEnsembleCurves( const bool& enable );
|
||||
|
||||
private:
|
||||
RimEnsembleCurveSetInterface* m_parentCurveSet;
|
||||
|
||||
caf::PdmField<bool> m_active;
|
||||
caf::PdmField<bool> m_showStatisticsCurveLegends;
|
||||
caf::PdmField<bool> m_hideEnsembleCurves;
|
||||
caf::PdmField<bool> m_basedOnFilteredCases;
|
||||
caf::PdmField<bool> m_showP10Curve;
|
||||
caf::PdmField<bool> m_showP50Curve;
|
||||
caf::PdmField<bool> m_showP90Curve;
|
||||
caf::PdmField<bool> m_showMeanCurve;
|
||||
caf::PdmField<bool> m_showCurveLabels;
|
||||
caf::PdmField<bool> m_includeIncompleteCurves;
|
||||
caf::PdmField<bool> m_active;
|
||||
caf::PdmField<bool> m_showStatisticsCurveLegends;
|
||||
caf::PdmField<bool> m_hideEnsembleCurves;
|
||||
caf::PdmProxyValueField<bool> m_showEnsembleCurves;
|
||||
caf::PdmField<bool> m_basedOnFilteredCases;
|
||||
caf::PdmField<bool> m_showP10Curve;
|
||||
caf::PdmField<bool> m_showP50Curve;
|
||||
caf::PdmField<bool> m_showP90Curve;
|
||||
caf::PdmField<bool> m_showMeanCurve;
|
||||
caf::PdmField<bool> m_showCurveLabels;
|
||||
caf::PdmField<bool> m_includeIncompleteCurves;
|
||||
|
||||
// Ensemble cross plot settings
|
||||
caf::PdmField<int> m_crossPlotCurvesBinCount;
|
||||
|
Loading…
Reference in New Issue
Block a user