#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:
Jacob Støren 2017-10-27 17:12:25 +02:00
parent 88b8bdf5c2
commit 46e8144f3b
6 changed files with 32 additions and 15 deletions

View File

@ -211,7 +211,7 @@ bool RicNewGridTimeHistoryCurveFeature::isCommandEnabled()
const RiuEclipseSelectionItem* eclSelectionItem = dynamic_cast<const RiuEclipseSelectionItem*>(items[0]);
if (eclSelectionItem)
{
if (eclSelectionItem->m_view->cellResult()->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
if (eclSelectionItem->m_view->cellResult()->isFlowDiagOrInjectionFlooding())
{
return false;
}

View File

@ -117,15 +117,14 @@ Rim3dOverlayInfoConfig::~Rim3dOverlayInfoConfig()
//--------------------------------------------------------------------------------------------------
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);
if (changedField == &m_statisticsTimeRange) m_statisticsTimeRange = CURRENT_TIMESTEP;
if (changedField == &m_statisticsCellRange) m_statisticsCellRange = ALL_CELLS;
if ( changedField == &m_statisticsTimeRange ) m_statisticsTimeRange = CURRENT_TIMESTEP;
if ( changedField == &m_statisticsCellRange ) m_statisticsCellRange = ALL_CELLS;
}
this->update3DInfo();
if (m_viewDef && m_viewDef->viewer())
@ -167,10 +166,7 @@ void Rim3dOverlayInfoConfig::update3DInfo()
m_isVisCellStatUpToDate = false;
if (m_viewDef->propertyFilterCollection() &&
m_viewDef->propertyFilterCollection()->hasActiveDynamicFilters() &&
m_statisticsCellRange() == VISIBLE_CELLS &&
m_statisticsTimeRange() == ALL_TIMESTEPS)
if (hasInvalidStatisticsCombination())
{
displayPropertyFilteredStatisticsMessage(true);
m_statisticsTimeRange = CURRENT_TIMESTEP;
@ -384,7 +380,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
{
QString propName = eclipseView->cellResult()->resultVariableUiShortName();
QString timeRangeText = m_statisticsTimeRange().uiText();
if (eclipseView->cellResult()->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
if (eclipseView->cellResult()->isFlowDiagOrInjectionFlooding())
{
timeRangeText = caf::AppEnum<StatisticsTimeRangeType>::uiText(CURRENT_TIMESTEP);
}
@ -679,3 +675,23 @@ void Rim3dOverlayInfoConfig::displayPropertyFilteredStatisticsMessage(bool showS
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;
}

View File

@ -88,6 +88,7 @@ private:
void updateVisCellStatsIfNeeded();
void displayPropertyFilteredStatisticsMessage(bool showSwitchToCurrentTimestep);
bool hasInvalidStatisticsCombination();
bool m_isVisCellStatUpToDate;
cvf::ref<RigStatisticsDataCache> m_visibleCellStatistics;
};

View File

@ -398,7 +398,7 @@ bool RimCellEdgeColors::hasResult() const
{
if (!enableCellEdgeColors()) return false;
if (isUsingSingleVariable() && m_singleVarEdgeResultColors->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
if (isUsingSingleVariable() && m_singleVarEdgeResultColors->isFlowDiagOrInjectionFlooding())
{
return true;
}
@ -437,7 +437,7 @@ void RimCellEdgeColors::minMaxCellEdgeValues(double& min, double& max)
globalMin = HUGE_VAL;
globalMax = -HUGE_VAL;
if (isUsingSingleVariable() && singleVarEdgeResultColors()->resultType() == RiaDefines::FLOW_DIAGNOSTICS)
if (isUsingSingleVariable() && singleVarEdgeResultColors()->isFlowDiagOrInjectionFlooding())
{
int currentTimeStep = m_reservoirView->currentTimeStep();

View File

@ -273,7 +273,7 @@ public :
//--------------------------------------------------------------------------------------------------
void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
{
if (this->resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->resultType() == RiaDefines::INJECTION_FLOODING)
if (this->isFlowDiagOrInjectionFlooding())
{
double globalMin, globalMax;
double globalPosClosestToZero, globalNegClosestToZero;

View File

@ -179,7 +179,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec
{
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