mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#625) Guard against All Timesteps Visible cells statistics when using dyn prop filter
This commit is contained in:
parent
7b65cb91ce
commit
8283f6665b
@ -108,6 +108,15 @@ 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)
|
||||||
|
{
|
||||||
|
displayPropertyFilteredStatisticsMessage(false);
|
||||||
|
if (changedField == &m_statisticsTimeRange) m_statisticsTimeRange = CURRENT_TIMESTEP;
|
||||||
|
if (changedField == &m_statisticsCellRange) m_statisticsCellRange = ALL_CELLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this->update3DInfo();
|
this->update3DInfo();
|
||||||
|
|
||||||
if (m_viewDef && m_viewDef->viewer())
|
if (m_viewDef && m_viewDef->viewer())
|
||||||
@ -149,6 +158,13 @@ void Rim3dOverlayInfoConfig::update3DInfo()
|
|||||||
|
|
||||||
m_isVisCellStatUpToDate = false;
|
m_isVisCellStatUpToDate = false;
|
||||||
|
|
||||||
|
if (m_viewDef->propertyFilterCollection() && m_viewDef->propertyFilterCollection()->hasActiveDynamicFilters() &&
|
||||||
|
m_statisticsCellRange() == VISIBLE_CELLS && m_statisticsTimeRange() == ALL_TIMESTEPS)
|
||||||
|
{
|
||||||
|
displayPropertyFilteredStatisticsMessage(true);
|
||||||
|
m_statisticsTimeRange = CURRENT_TIMESTEP;
|
||||||
|
}
|
||||||
|
|
||||||
RimEclipseView * reservoirView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
RimEclipseView * reservoirView = dynamic_cast<RimEclipseView*>(m_viewDef.p());
|
||||||
if (reservoirView) updateEclipse3DInfo(reservoirView);
|
if (reservoirView) updateEclipse3DInfo(reservoirView);
|
||||||
RimGeoMechView * geoMechView = dynamic_cast<RimGeoMechView*>(m_viewDef.p());
|
RimGeoMechView * geoMechView = dynamic_cast<RimGeoMechView*>(m_viewDef.p());
|
||||||
@ -528,3 +544,30 @@ void Rim3dOverlayInfoConfig::updateVisCellStatsIfNeeded()
|
|||||||
m_isVisCellStatUpToDate = true;
|
m_isVisCellStatUpToDate = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
void Rim3dOverlayInfoConfig::displayPropertyFilteredStatisticsMessage(bool showSwitchToCurrentTimestep)
|
||||||
|
{
|
||||||
|
static bool isShowing = false;
|
||||||
|
|
||||||
|
QString switchString;
|
||||||
|
if (showSwitchToCurrentTimestep)
|
||||||
|
{
|
||||||
|
switchString = QString("<br>"
|
||||||
|
"Switching to statistics for <b>Current Time Step</b>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isShowing)
|
||||||
|
{
|
||||||
|
isShowing = true;
|
||||||
|
QMessageBox::information(m_viewDef->viewer()->layoutWidget(),
|
||||||
|
QString("ResInsight"),
|
||||||
|
QString("Statistics not available<br>"
|
||||||
|
"<br>"
|
||||||
|
"Statistics calculations of <b>Visible Cells</b> for <b>All Time Steps</b> is not supported<br>"
|
||||||
|
"when you have an active Property filter on a time varying result.<br>")
|
||||||
|
+ switchString);
|
||||||
|
isShowing = false;
|
||||||
|
}
|
||||||
|
}
|
@ -84,7 +84,7 @@ private:
|
|||||||
cvf::Vec2ui m_position;
|
cvf::Vec2ui m_position;
|
||||||
|
|
||||||
void updateVisCellStatsIfNeeded();
|
void updateVisCellStatsIfNeeded();
|
||||||
|
void displayPropertyFilteredStatisticsMessage(bool showSwitchToCurrentTimestep);
|
||||||
bool m_isVisCellStatUpToDate;
|
bool m_isVisCellStatUpToDate;
|
||||||
cvf::ref<RigStatisticsDataCache> m_visibleCellStatistics;
|
cvf::ref<RigStatisticsDataCache> m_visibleCellStatistics;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user