#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

@@ -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;
}