mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -06:00
#3626 2d Maps: Adjust min/max limits for all time steps and TOP result.
This commit is contained in:
parent
5970d217a8
commit
c8ebb0a4d1
@ -117,7 +117,7 @@ void Rim2dEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrderi
|
||||
uiTreeOrdering.add(m_overlayInfoConfig());
|
||||
uiTreeOrdering.add(m_2dGridProjection);
|
||||
uiTreeOrdering.add(cellResult());
|
||||
cellResult()->uiCapability()->setUiReadOnly(m_2dGridProjection->isColumnResult());
|
||||
cellResult()->uiCapability()->setUiReadOnly(m_2dGridProjection->isSummationResult());
|
||||
uiTreeOrdering.add(wellCollection());
|
||||
uiTreeOrdering.add(faultCollection());
|
||||
uiTreeOrdering.add(m_rangeFilterCollection());
|
||||
|
@ -319,11 +319,12 @@ const std::vector<double>& Rim2dGridProjection::aggregatedResults() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Rim2dGridProjection::isColumnResult() const
|
||||
bool Rim2dGridProjection::isSummationResult() const
|
||||
{
|
||||
return m_resultAggregation() == RESULTS_OIL_COLUMN ||
|
||||
m_resultAggregation() == RESULTS_GAS_COLUMN ||
|
||||
m_resultAggregation() == RESULTS_HC_COLUMN;
|
||||
m_resultAggregation() == RESULTS_HC_COLUMN ||
|
||||
m_resultAggregation() == RESULTS_SUM;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -801,10 +802,18 @@ void Rim2dGridProjection::updateLegend()
|
||||
firstAncestorOrThisOfTypeAsserted(view);
|
||||
RimEclipseCellColors* cellColors = view->cellResult();
|
||||
|
||||
double minVal = minValue();
|
||||
double maxVal = maxValue();
|
||||
if (isSummationResult() || (m_resultAggregation != RESULTS_TOP_VALUE && legendConfig()->rangeMode() != RimLegendConfig::AUTOMATIC_ALLTIMESTEPS))
|
||||
{
|
||||
double minVal = minValue();
|
||||
double maxVal = maxValue();
|
||||
|
||||
legendConfig()->setAutomaticRanges(minVal, maxVal, minVal, maxVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
cellColors->updateLegendData(view->currentTimeStep(), legendConfig());
|
||||
}
|
||||
|
||||
legendConfig()->setAutomaticRanges(minVal, maxVal, minVal, maxVal);
|
||||
if (m_resultAggregation() == RESULTS_OIL_COLUMN ||
|
||||
m_resultAggregation() == RESULTS_GAS_COLUMN ||
|
||||
m_resultAggregation() == RESULTS_HC_COLUMN)
|
||||
@ -883,6 +892,10 @@ void Rim2dGridProjection::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
view->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
if (changedField == &m_resultAggregation)
|
||||
{
|
||||
legendConfig()->disableAllTimeStepsRange(isSummationResult());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -909,3 +922,11 @@ void Rim2dGridProjection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrd
|
||||
{
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim2dGridProjection::initAfterRead()
|
||||
{
|
||||
legendConfig()->disableAllTimeStepsRange(isSummationResult());
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
double sampleSpacing() const;
|
||||
void updateDefaultSampleSpacingFromGrid();
|
||||
const std::vector<double>& aggregatedResults() const;
|
||||
bool isColumnResult() const;
|
||||
bool isSummationResult() const;
|
||||
|
||||
double value(uint i, uint j) const;
|
||||
|
||||
@ -106,6 +106,7 @@ protected:
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void initAfterRead() override;
|
||||
|
||||
protected:
|
||||
caf::PdmField<double> m_sampleSpacing;
|
||||
|
@ -752,6 +752,14 @@ const caf::TitledOverlayFrame* RimRegularLegendConfig::titledOverlayFrame() cons
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimLegendConfig::RangeModeType RimRegularLegendConfig::rangeMode() const
|
||||
{
|
||||
return m_rangeMode();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -126,6 +126,8 @@ public:
|
||||
const caf::TitledOverlayFrame* titledOverlayFrame() const override;
|
||||
caf::TitledOverlayFrame* titledOverlayFrame() override;
|
||||
|
||||
RangeModeType rangeMode() const;
|
||||
|
||||
private:
|
||||
void setNamedCategories(const std::vector<QString>& categoryNames, bool inverse);
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
Loading…
Reference in New Issue
Block a user