mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Grid Ensemble: add pdm object.
This commit is contained in:
@@ -135,6 +135,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimPlotRectAnnotation.h
|
${CMAKE_CURRENT_LIST_DIR}/RimPlotRectAnnotation.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimEmCase.h
|
${CMAKE_CURRENT_LIST_DIR}/RimEmCase.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseViewCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseViewCollection.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseEnsemble.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCE_GROUP_SOURCE_FILES
|
set(SOURCE_GROUP_SOURCE_FILES
|
||||||
@@ -270,6 +271,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimEmCase.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimEmCase.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimPolylinePickerInterface.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimPolylinePickerInterface.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimEclipseViewCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseViewCollection.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseEnsemble.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(RESINSIGHT_USE_QT_CHARTS)
|
if(RESINSIGHT_USE_QT_CHARTS)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "RimCaseCollection.h"
|
#include "RimCaseCollection.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimEclipseCaseEnsemble.h"
|
||||||
#include "RimEclipseStatisticsCase.h"
|
#include "RimEclipseStatisticsCase.h"
|
||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
@@ -47,6 +48,8 @@ RimEclipseCaseCollection::RimEclipseCaseCollection()
|
|||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &caseGroups, "CaseGroups", "" );
|
CAF_PDM_InitFieldNoDefault( &caseGroups, "CaseGroups", "" );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &caseEnsembles, "CaseEnsembles", "" );
|
||||||
|
|
||||||
m_gridCollection = new RigGridManager;
|
m_gridCollection = new RigGridManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,6 +70,7 @@ void RimEclipseCaseCollection::close()
|
|||||||
|
|
||||||
cases.deleteChildren();
|
cases.deleteChildren();
|
||||||
caseGroups.deleteChildren();
|
caseGroups.deleteChildren();
|
||||||
|
caseEnsembles.deleteChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class RigMainGrid;
|
|||||||
class RimEclipseCase;
|
class RimEclipseCase;
|
||||||
class RimIdenticalGridCaseGroup;
|
class RimIdenticalGridCaseGroup;
|
||||||
class RimWellPathCollection;
|
class RimWellPathCollection;
|
||||||
|
class RimEclipseCaseEnsemble;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -48,6 +49,7 @@ public:
|
|||||||
|
|
||||||
caf::PdmChildArrayField<RimEclipseCase*> cases;
|
caf::PdmChildArrayField<RimEclipseCase*> cases;
|
||||||
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroups;
|
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroups;
|
||||||
|
caf::PdmChildArrayField<RimEclipseCaseEnsemble*> caseEnsembles;
|
||||||
|
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2024- Eqinor ASA
|
||||||
|
//
|
||||||
|
// 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 "RimEclipseCaseEnsemble.h"
|
||||||
|
|
||||||
|
#include "RimCaseCollection.h"
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
|
#include "RimEclipseResultCase.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldScriptingCapability.h"
|
||||||
|
#include "cafPdmObjectScriptingCapability.h"
|
||||||
|
|
||||||
|
CAF_PDM_SOURCE_INIT( RimEclipseCaseEnsemble, "RimEclipseCaseEnsemble" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEclipseCaseEnsemble::RimEclipseCaseEnsemble()
|
||||||
|
{
|
||||||
|
CAF_PDM_InitScriptableObjectWithNameAndComment( "Grid Ensemble", ":/GridCaseGroup16x16.png", "", "", "EclipseCaseEnsemble", "Grid Ensemble" );
|
||||||
|
|
||||||
|
CAF_PDM_InitScriptableField( &m_groupId, "Id", -1, "Id" );
|
||||||
|
m_groupId.uiCapability()->setUiReadOnly( true );
|
||||||
|
m_groupId.capability<caf::PdmAbstractFieldScriptingCapability>()->setIOWriteable( false );
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault( &m_caseCollection, "CaseCollection", "Ensemble Cases" );
|
||||||
|
|
||||||
|
m_caseCollection = new RimCaseCollection;
|
||||||
|
m_caseCollection->uiCapability()->setUiName( "Cases" );
|
||||||
|
m_caseCollection->uiCapability()->setUiIconFromResourceString( ":/Cases16x16.png" );
|
||||||
|
|
||||||
|
setDeletable( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimEclipseCaseEnsemble::~RimEclipseCaseEnsemble()
|
||||||
|
{
|
||||||
|
delete m_caseCollection;
|
||||||
|
m_caseCollection = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseCaseEnsemble::addCase( RimEclipseCase* reservoir )
|
||||||
|
{
|
||||||
|
CVF_ASSERT( reservoir );
|
||||||
|
|
||||||
|
m_caseCollection()->reservoirs().push_back( reservoir );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseCaseEnsemble::removeCase( RimEclipseCase* reservoir )
|
||||||
|
{
|
||||||
|
if ( m_caseCollection()->reservoirs().count( reservoir ) == 0 ) return;
|
||||||
|
|
||||||
|
m_caseCollection()->reservoirs().removeChild( reservoir );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimEclipseCaseEnsemble::contains( RimEclipseCase* reservoir ) const
|
||||||
|
{
|
||||||
|
CVF_ASSERT( reservoir );
|
||||||
|
|
||||||
|
for ( RimEclipseCase* rimReservoir : cases() )
|
||||||
|
{
|
||||||
|
if ( reservoir->gridFileName() == rimReservoir->gridFileName() ) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
49
ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.h
Normal file
49
ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2024- Equinor ASA
|
||||||
|
//
|
||||||
|
// 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 "RimNamedObject.h"
|
||||||
|
|
||||||
|
#include "cafPdmChildField.h"
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
|
||||||
|
class RimCaseCollection;
|
||||||
|
class RimEclipseCase;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class RimEclipseCaseEnsemble : public RimNamedObject
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimEclipseCaseEnsemble();
|
||||||
|
~RimEclipseCaseEnsemble() override;
|
||||||
|
|
||||||
|
void addCase( RimEclipseCase* reservoir );
|
||||||
|
void removeCase( RimEclipseCase* reservoir );
|
||||||
|
bool contains( RimEclipseCase* reservoir ) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmField<int> m_groupId;
|
||||||
|
caf::PdmChildField<RimCaseCollection*> m_caseCollection;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user