mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Implemented check for any results of statistics cases
p4#: 21148
This commit is contained in:
@@ -1029,8 +1029,7 @@ bool RimUiTreeView::userConfirmedGridCaseGroupChange(const QModelIndex & itemInd
|
||||
RimIdenticalGridCaseGroup* gridCaseGroup = myModel->gridCaseGroupFromItemIndex(itemIndex);
|
||||
if (gridCaseGroup)
|
||||
{
|
||||
// TODO: This test has to check if any of the statistical cases has result values
|
||||
if (gridCaseGroup->statisticsCaseCollection()->reservoirs.size() > 0)
|
||||
if (hasAnyStatisticsResults(gridCaseGroup))
|
||||
{
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
|
||||
@@ -1052,3 +1051,25 @@ bool RimUiTreeView::userConfirmedGridCaseGroupChange(const QModelIndex & itemInd
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimUiTreeView::hasAnyStatisticsResults(RimIdenticalGridCaseGroup* gridCaseGroup)
|
||||
{
|
||||
CVF_ASSERT(gridCaseGroup);
|
||||
|
||||
for (size_t i = 0; i < gridCaseGroup->statisticsCaseCollection()->reservoirs().size(); i++)
|
||||
{
|
||||
RimStatisticsCase* rimStaticsCase = dynamic_cast<RimStatisticsCase*>(gridCaseGroup->statisticsCaseCollection()->reservoirs[i]);
|
||||
if (rimStaticsCase)
|
||||
{
|
||||
if (rimStaticsCase->hasComputedStatistics())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user