#2689 Ensemble curves. Adapt legend range settings to curve set

This commit is contained in:
Bjørn Erik Jensen 2018-04-20 11:28:28 +02:00
parent 6c45725b19
commit 27ba7c5d9d

View File

@ -777,11 +777,16 @@ void RimRegularLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
QList<caf::PdmOptionItemInfo> RimRegularLegendConfig::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) QList<caf::PdmOptionItemInfo> RimRegularLegendConfig::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
{ {
bool hasStimPlanParent = false; bool hasStimPlanParent = false;
bool hasEnsembleCurveSetParent = false;
RimStimPlanColors* stimPlanColors = nullptr; RimStimPlanColors* stimPlanColors = nullptr;
this->firstAncestorOrThisOfType(stimPlanColors); this->firstAncestorOrThisOfType(stimPlanColors);
if (stimPlanColors) hasStimPlanParent = true; if (stimPlanColors) hasStimPlanParent = true;
RimEnsembleCurveSet* ensembleCurveSet = nullptr;
this->firstAncestorOrThisOfType(ensembleCurveSet);
if (ensembleCurveSet) hasEnsembleCurveSetParent = true;
bool isCategoryResult = false; bool isCategoryResult = false;
{ {
RimEclipseCellColors* eclCellColors = nullptr; RimEclipseCellColors* eclCellColors = nullptr;
@ -849,9 +854,13 @@ QList<caf::PdmOptionItemInfo> RimRegularLegendConfig::calculateValueOptions(cons
{ {
if (!m_isAllTimeStepsRangeDisabled) if (!m_isAllTimeStepsRangeDisabled)
{ {
options.push_back(caf::PdmOptionItemInfo(RangeModeEnum::uiText(RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS), RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS)); QString uiText;
if(!hasEnsembleCurveSetParent) uiText = RangeModeEnum::uiText(RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS);
else uiText = "Auto Range";
options.push_back(caf::PdmOptionItemInfo(uiText, RimRegularLegendConfig::AUTOMATIC_ALLTIMESTEPS));
} }
if (!hasStimPlanParent) if (!hasStimPlanParent && !hasEnsembleCurveSetParent)
{ {
options.push_back(caf::PdmOptionItemInfo(RangeModeEnum::uiText(RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP), RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP)); options.push_back(caf::PdmOptionItemInfo(RangeModeEnum::uiText(RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP), RimRegularLegendConfig::AUTOMATIC_CURRENT_TIMESTEP));
} }