mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Moved statistical cases into statistics case collection
p4#: 20599
This commit is contained in:
parent
f45c581dbc
commit
4a3bde5baa
@ -76,6 +76,7 @@ list( APPEND CPP_SOURCES
|
||||
ProjectDataModel/RimWellCollection.cpp
|
||||
ProjectDataModel/RimScriptCollection.cpp
|
||||
ProjectDataModel/RimStatisticalCalculation.cpp
|
||||
ProjectDataModel/RimStatisticalCollection.cpp
|
||||
ProjectDataModel/RimCalcScript.cpp
|
||||
ProjectDataModel/RimExportInputPropertySettings.cpp
|
||||
ProjectDataModel/RimBinaryExportSettings.cpp
|
||||
|
@ -22,7 +22,9 @@
|
||||
#include "RimReservoir.h"
|
||||
#include "RimReservoirView.h"
|
||||
#include "RigEclipseCase.h"
|
||||
|
||||
#include "RimStatisticalCalculation.h"
|
||||
#include "RimStatisticalCollection.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimIdenticalGridCaseGroup, "RimIdenticalGridCaseGroup");
|
||||
@ -37,12 +39,11 @@ RimIdenticalGridCaseGroup::RimIdenticalGridCaseGroup()
|
||||
CAF_PDM_InitField(&name, "UserDescription", QString("Identical Grid Case Group"), "Name", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&reservoirs, "Reservoirs", "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&statisticalReservoirs, "StatisticalReservoirs", "", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&statisticalReservoirCollection, "StatisticalReservoirCollection", "StatisticalReservoirCollection", "", "", "");
|
||||
|
||||
RimStatisticalCalculation* dummyStat = new RimStatisticalCalculation;
|
||||
dummyStat->caseName = "Statistics 1";
|
||||
statisticalReservoirCollection = new RimStatisticalCollection;
|
||||
|
||||
statisticalReservoirs.push_back(dummyStat);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -90,20 +91,6 @@ RigMainGrid* RimIdenticalGridCaseGroup::mainGrid()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStatisticalCalculation* RimIdenticalGridCaseGroup::createAndAppendStatisticalCalculation()
|
||||
{
|
||||
RimStatisticalCalculation* newObject = new RimStatisticalCalculation;
|
||||
|
||||
newObject->caseName = "Statistics 1";
|
||||
|
||||
statisticalReservoirs.push_back(newObject);
|
||||
|
||||
return newObject;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -23,9 +23,10 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RimStatisticalCollection.h"
|
||||
|
||||
class RimReservoir;
|
||||
class RigMainGrid;
|
||||
class RimStatisticalCalculation;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@ -44,13 +45,11 @@ public:
|
||||
|
||||
void addCase(RimReservoir* reservoir);
|
||||
|
||||
caf::PdmPointersField<RimReservoir*> reservoirs;
|
||||
caf::PdmPointersField<RimReservoir*> statisticalReservoirs;
|
||||
caf::PdmPointersField<RimReservoir*> reservoirs;
|
||||
caf::PdmField<RimStatisticalCollection*> statisticalReservoirCollection;
|
||||
|
||||
RigMainGrid* mainGrid();
|
||||
|
||||
RimStatisticalCalculation* createAndAppendStatisticalCalculation();
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
|
||||
|
@ -91,18 +91,18 @@ void RimStatisticalCalculation::defineUiOrdering(QString uiConfigName, caf::PdmU
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIdenticalGridCaseGroup* RimStatisticalCalculation::parent()
|
||||
RimStatisticalCollection* RimStatisticalCalculation::parent()
|
||||
{
|
||||
std::vector<caf::PdmObject*> parentObjects;
|
||||
this->parentObjects(parentObjects);
|
||||
|
||||
RimIdenticalGridCaseGroup* parentObject = NULL;
|
||||
RimStatisticalCollection* parentObject = NULL;
|
||||
for (size_t i = 0; i < parentObjects.size(); i++)
|
||||
{
|
||||
if (parentObject) continue;
|
||||
|
||||
caf::PdmObject* obj = parentObjects[i];
|
||||
parentObject = dynamic_cast<RimIdenticalGridCaseGroup*>(obj);
|
||||
parentObject = dynamic_cast<RimStatisticalCollection*>(obj);
|
||||
}
|
||||
|
||||
CVF_ASSERT(parentObject);
|
||||
|
@ -28,6 +28,7 @@
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimResultDefinition;
|
||||
class RifReaderStatisticalCalculation;
|
||||
class RimStatisticalCollection;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@ -50,7 +51,7 @@ public:
|
||||
caf::PdmField<bool> statisticsMean;
|
||||
caf::PdmField<bool> statisticsStdDev;
|
||||
|
||||
RimIdenticalGridCaseGroup* parent();
|
||||
RimStatisticalCollection* parent();
|
||||
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) const;
|
||||
void computeStatistics();
|
||||
|
@ -0,0 +1,61 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RIStdInclude.h"
|
||||
|
||||
#include "RimReservoirView.h"
|
||||
|
||||
#include "RimStatisticalCollection.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimStatisticalCollection, "RimStatisticalCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStatisticalCollection::RimStatisticalCollection()
|
||||
: PdmObject()
|
||||
{
|
||||
CAF_PDM_InitObject("Derived Statistics", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&reservoirs, "Reservoirs", "", "", "", "");
|
||||
|
||||
createAndAppendStatisticalCalculation();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStatisticalCollection::~RimStatisticalCollection()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimStatisticalCalculation* RimStatisticalCollection::createAndAppendStatisticalCalculation()
|
||||
{
|
||||
RimStatisticalCalculation* newObject = new RimStatisticalCalculation;
|
||||
|
||||
newObject->caseName = "Statistics 1";
|
||||
|
||||
reservoirs.push_back(newObject);
|
||||
|
||||
return newObject;
|
||||
}
|
49
ApplicationCode/ProjectDataModel/RimStatisticalCollection.h
Normal file
49
ApplicationCode/ProjectDataModel/RimStatisticalCollection.h
Normal file
@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RimStatisticalCalculation.h"
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimStatisticalCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimStatisticalCollection();
|
||||
virtual ~RimStatisticalCollection();
|
||||
|
||||
caf::PdmPointersField<RimStatisticalCalculation*> reservoirs;
|
||||
|
||||
RimStatisticalCalculation* createAndAppendStatisticalCalculation();
|
||||
|
||||
private:
|
||||
|
||||
};
|
@ -464,7 +464,7 @@ RimStatisticalCalculation* RimUiTreeModelPdm::addStatisticalCalculation(const QM
|
||||
caf::PdmUiTreeItem* currentItem = getTreeItemFromIndex(itemIndex);
|
||||
|
||||
QModelIndex collectionIndex;
|
||||
RimIdenticalGridCaseGroup* caseGroup = NULL;
|
||||
RimStatisticalCollection* caseGroup = NULL;
|
||||
caf::PdmUiTreeItem* parentCollectionItem = NULL;
|
||||
int position = 0;
|
||||
|
||||
@ -476,9 +476,9 @@ RimStatisticalCalculation* RimUiTreeModelPdm::addStatisticalCalculation(const QM
|
||||
position = itemIndex.row();
|
||||
collectionIndex = itemIndex.parent();
|
||||
}
|
||||
else if (dynamic_cast<RimIdenticalGridCaseGroup*>(currentItem->dataObject().p()))
|
||||
else if (dynamic_cast<RimStatisticalCollection*>(currentItem->dataObject().p()))
|
||||
{
|
||||
caseGroup = dynamic_cast<RimIdenticalGridCaseGroup*>(currentItem->dataObject().p());
|
||||
caseGroup = dynamic_cast<RimStatisticalCollection*>(currentItem->dataObject().p());
|
||||
parentCollectionItem = currentItem;
|
||||
position = parentCollectionItem->childCount();
|
||||
collectionIndex = itemIndex;
|
||||
|
@ -144,7 +144,7 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
|
||||
menu.addAction(QString("Save Property To File"), this, SLOT(slotWriteBinaryResultAsInputProperty()));
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
else if (dynamic_cast<RimIdenticalGridCaseGroup*>(uiItem->dataObject().p()))
|
||||
else if (dynamic_cast<RimStatisticalCollection*>(uiItem->dataObject().p()))
|
||||
{
|
||||
QMenu menu;
|
||||
menu.addAction(QString("New Statistical Case"), this, SLOT(slotNewStatisticalCase()));
|
||||
|
Loading…
Reference in New Issue
Block a user