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:
parent
5911e2bf32
commit
ae812a2bbf
@ -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;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QTreeView>
|
||||
|
||||
class QItemSelection;
|
||||
class RimIdenticalGridCaseGroup;
|
||||
|
||||
namespace caf {
|
||||
class PdmObjectGroup;
|
||||
@ -90,6 +91,7 @@ signals:
|
||||
|
||||
private:
|
||||
bool userConfirmedGridCaseGroupChange(const QModelIndex & itemIndex);
|
||||
bool hasAnyStatisticsResults(RimIdenticalGridCaseGroup* gridCaseGroup);
|
||||
|
||||
void createPdmObjectsFromClipboard(caf::PdmObjectGroup* objectGroup);
|
||||
bool hasClipboardValidData();
|
||||
|
Loading…
Reference in New Issue
Block a user