mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#2064 Fix wrong timestep range text in Gui. Complete Fix #1986. Make it possible with Visible cells and FlowDiag/Injection flooding
This commit is contained in:
@@ -211,7 +211,7 @@ bool RicNewGridTimeHistoryCurveFeature::isCommandEnabled()
|
|||||||
const RiuEclipseSelectionItem* eclSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>(items[0]);
|
const RiuEclipseSelectionItem* eclSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>(items[0]);
|
||||||
if (eclSelectionItem)
|
if (eclSelectionItem)
|
||||||
{
|
{
|
||||||
if (eclSelectionItem->m_view->cellResult()->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
if (eclSelectionItem->m_view->cellResult()->isFlowDiagOrInjectionFlooding())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,15 +117,14 @@ Rim3dOverlayInfoConfig::~Rim3dOverlayInfoConfig()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void Rim3dOverlayInfoConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void Rim3dOverlayInfoConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
if (m_viewDef->propertyFilterCollection() && m_viewDef->propertyFilterCollection()->hasActiveDynamicFilters() &&
|
|
||||||
m_statisticsCellRange() == VISIBLE_CELLS && m_statisticsTimeRange() == ALL_TIMESTEPS)
|
if ( hasInvalidStatisticsCombination() )
|
||||||
{
|
{
|
||||||
displayPropertyFilteredStatisticsMessage(false);
|
displayPropertyFilteredStatisticsMessage(false);
|
||||||
if (changedField == &m_statisticsTimeRange) m_statisticsTimeRange = CURRENT_TIMESTEP;
|
if ( changedField == &m_statisticsTimeRange ) m_statisticsTimeRange = CURRENT_TIMESTEP;
|
||||||
if (changedField == &m_statisticsCellRange) m_statisticsCellRange = ALL_CELLS;
|
if ( changedField == &m_statisticsCellRange ) m_statisticsCellRange = ALL_CELLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this->update3DInfo();
|
this->update3DInfo();
|
||||||
|
|
||||||
if (m_viewDef && m_viewDef->viewer())
|
if (m_viewDef && m_viewDef->viewer())
|
||||||
@@ -167,10 +166,7 @@ void Rim3dOverlayInfoConfig::update3DInfo()
|
|||||||
|
|
||||||
m_isVisCellStatUpToDate = false;
|
m_isVisCellStatUpToDate = false;
|
||||||
|
|
||||||
if (m_viewDef->propertyFilterCollection() &&
|
if (hasInvalidStatisticsCombination())
|
||||||
m_viewDef->propertyFilterCollection()->hasActiveDynamicFilters() &&
|
|
||||||
m_statisticsCellRange() == VISIBLE_CELLS &&
|
|
||||||
m_statisticsTimeRange() == ALL_TIMESTEPS)
|
|
||||||
{
|
{
|
||||||
displayPropertyFilteredStatisticsMessage(true);
|
displayPropertyFilteredStatisticsMessage(true);
|
||||||
m_statisticsTimeRange = CURRENT_TIMESTEP;
|
m_statisticsTimeRange = CURRENT_TIMESTEP;
|
||||||
@@ -384,7 +380,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
|||||||
{
|
{
|
||||||
QString propName = eclipseView->cellResult()->resultVariableUiShortName();
|
QString propName = eclipseView->cellResult()->resultVariableUiShortName();
|
||||||
QString timeRangeText = m_statisticsTimeRange().uiText();
|
QString timeRangeText = m_statisticsTimeRange().uiText();
|
||||||
if (eclipseView->cellResult()->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
if (eclipseView->cellResult()->isFlowDiagOrInjectionFlooding())
|
||||||
{
|
{
|
||||||
timeRangeText = caf::AppEnum<StatisticsTimeRangeType>::uiText(CURRENT_TIMESTEP);
|
timeRangeText = caf::AppEnum<StatisticsTimeRangeType>::uiText(CURRENT_TIMESTEP);
|
||||||
}
|
}
|
||||||
@@ -679,3 +675,23 @@ void Rim3dOverlayInfoConfig::displayPropertyFilteredStatisticsMessage(bool showS
|
|||||||
isShowing = false;
|
isShowing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool Rim3dOverlayInfoConfig::hasInvalidStatisticsCombination()
|
||||||
|
{
|
||||||
|
if (m_viewDef->propertyFilterCollection()
|
||||||
|
&& m_viewDef->propertyFilterCollection()->hasActiveDynamicFilters()
|
||||||
|
&& m_statisticsCellRange() == VISIBLE_CELLS
|
||||||
|
&& m_statisticsTimeRange() == ALL_TIMESTEPS )
|
||||||
|
{
|
||||||
|
RimEclipseView * eclipseView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||||
|
if (!(eclipseView && eclipseView->cellResult()->isFlowDiagOrInjectionFlooding())) // If isFlowDiagOrInjFlooding then skip this check as ALL_TIMESTEPS is overridden to CURRENT behind the scenes
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ private:
|
|||||||
|
|
||||||
void updateVisCellStatsIfNeeded();
|
void updateVisCellStatsIfNeeded();
|
||||||
void displayPropertyFilteredStatisticsMessage(bool showSwitchToCurrentTimestep);
|
void displayPropertyFilteredStatisticsMessage(bool showSwitchToCurrentTimestep);
|
||||||
|
bool hasInvalidStatisticsCombination();
|
||||||
bool m_isVisCellStatUpToDate;
|
bool m_isVisCellStatUpToDate;
|
||||||
cvf::ref<RigStatisticsDataCache> m_visibleCellStatistics;
|
cvf::ref<RigStatisticsDataCache> m_visibleCellStatistics;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ bool RimCellEdgeColors::hasResult() const
|
|||||||
{
|
{
|
||||||
if (!enableCellEdgeColors()) return false;
|
if (!enableCellEdgeColors()) return false;
|
||||||
|
|
||||||
if (isUsingSingleVariable() && m_singleVarEdgeResultColors->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
if (isUsingSingleVariable() && m_singleVarEdgeResultColors->isFlowDiagOrInjectionFlooding())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -437,7 +437,7 @@ void RimCellEdgeColors::minMaxCellEdgeValues(double& min, double& max)
|
|||||||
globalMin = HUGE_VAL;
|
globalMin = HUGE_VAL;
|
||||||
globalMax = -HUGE_VAL;
|
globalMax = -HUGE_VAL;
|
||||||
|
|
||||||
if (isUsingSingleVariable() && singleVarEdgeResultColors()->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
if (isUsingSingleVariable() && singleVarEdgeResultColors()->isFlowDiagOrInjectionFlooding())
|
||||||
{
|
{
|
||||||
int currentTimeStep = m_reservoirView->currentTimeStep();
|
int currentTimeStep = m_reservoirView->currentTimeStep();
|
||||||
|
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ public :
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
|
void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
|
||||||
{
|
{
|
||||||
if (this->resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->resultType() == RiaDefines::INJECTION_FLOODING)
|
if (this->isFlowDiagOrInjectionFlooding())
|
||||||
{
|
{
|
||||||
double globalMin, globalMax;
|
double globalMin, globalMax;
|
||||||
double globalPosClosestToZero, globalNegClosestToZero;
|
double globalPosClosestToZero, globalNegClosestToZero;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec
|
|||||||
{
|
{
|
||||||
RimEclipseView* eclipseView = eclipseSelectionItem->m_view.p();
|
RimEclipseView* eclipseView = eclipseSelectionItem->m_view.p();
|
||||||
|
|
||||||
if (eclipseView->cellResult()->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
|
if (eclipseView->cellResult()->isFlowDiagOrInjectionFlooding())
|
||||||
{
|
{
|
||||||
// NB! Do not read out data for flow results, as this can be a time consuming operation
|
// NB! Do not read out data for flow results, as this can be a time consuming operation
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user