mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2659 Ensemble statistics. Support for setting curve color. Group check boxes
This commit is contained in:
parent
06749a20e0
commit
1abea45d45
@ -967,6 +967,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves(bool calculate = true)
|
||||
auto curve = new RimSummaryCurve();
|
||||
curve->setParentQwtPlotNoReplot(plot->qwtPlot());
|
||||
m_curves.push_back(curve);
|
||||
curve->setColor(m_statistics->color());
|
||||
curve->setSymbol(RimPlotCurve::SYMBOL_ELLIPSE);
|
||||
curve->setSymbolSkipDinstance(50);
|
||||
curve->setSymbolLabel(QString::fromStdString(address.ensembleStatisticsQuantityName()));
|
||||
|
@ -37,11 +37,12 @@ RimEnsembleStatistics::RimEnsembleStatistics()
|
||||
{
|
||||
CAF_PDM_InitObject("Ensemble Curve Filter", ":/EnsembleCurveSet16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_active, "Active", "Active", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_active, "Active", "Show statistics curves", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_showP10Curve, "ShowP10Curve", "P10", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_showP50Curve, "ShowP50Curve", "P50", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_showP90Curve, "ShowP90Curve", "P90", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_showMeanCurve, "ShowPMeanCurve", "Mean", "", "", "");
|
||||
CAF_PDM_InitField(&m_color, "Color", cvf::Color3f(cvf::Color3::BLACK), "Color", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -72,11 +73,15 @@ void RimEnsembleStatistics::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
||||
changedField == &m_showP10Curve ||
|
||||
changedField == &m_showP50Curve ||
|
||||
changedField == &m_showP90Curve ||
|
||||
changedField == &m_showMeanCurve)
|
||||
changedField == &m_showMeanCurve ||
|
||||
changedField == &m_color)
|
||||
{
|
||||
if (!parentCurveSet()) return;
|
||||
auto curveSet = parentCurveSet();
|
||||
if (!curveSet) return;
|
||||
|
||||
parentCurveSet()->updateStatisticsCurves(false);
|
||||
curveSet->updateStatisticsCurves(false);
|
||||
|
||||
if (changedField == &m_active) curveSet->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,10 +91,19 @@ void RimEnsembleStatistics::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
||||
void RimEnsembleStatistics::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_active);
|
||||
uiOrdering.add(&m_showP10Curve);
|
||||
uiOrdering.add(&m_showP50Curve);
|
||||
uiOrdering.add(&m_showP90Curve);
|
||||
uiOrdering.add(&m_showMeanCurve);
|
||||
|
||||
auto group = uiOrdering.addNewGroup("Curves");
|
||||
group->add(&m_showP10Curve);
|
||||
group->add(&m_showP50Curve);
|
||||
group->add(&m_showP90Curve);
|
||||
group->add(&m_showMeanCurve);
|
||||
group->add(&m_color);
|
||||
|
||||
m_showP10Curve.uiCapability()->setUiReadOnly(!m_active);
|
||||
m_showP50Curve.uiCapability()->setUiReadOnly(!m_active);
|
||||
m_showP90Curve.uiCapability()->setUiReadOnly(!m_active);
|
||||
m_showMeanCurve.uiCapability()->setUiReadOnly(!m_active);
|
||||
m_color.uiCapability()->setUiReadOnly(!m_active);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
bool showP50Curve() const { return m_showP50Curve; };
|
||||
bool showP90Curve() const { return m_showP90Curve; };
|
||||
bool showMeanCurve() const { return m_showMeanCurve; };
|
||||
cvf::Color3f color() const { return m_color; }
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
@ -59,6 +60,8 @@ private:
|
||||
caf::PdmField<bool> m_showP90Curve;
|
||||
caf::PdmField<bool> m_showMeanCurve;
|
||||
|
||||
caf::PdmField<cvf::Color3f> m_color;
|
||||
|
||||
RimSummaryCaseCollection* m_ensemble;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user