2020-08-07 09:00:17 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2020- 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
2020-11-04 06:46:17 -06:00
|
|
|
#include "RimcStimPlanModelCollection.h"
|
2020-08-07 09:00:17 -05:00
|
|
|
|
2020-08-12 03:58:55 -05:00
|
|
|
#include "RicElasticPropertiesImportTools.h"
|
|
|
|
|
2020-11-04 06:46:17 -06:00
|
|
|
#include "FractureCommands/RicNewStimPlanModelFeature.h"
|
2020-08-07 09:00:17 -05:00
|
|
|
|
2020-10-23 08:29:02 -05:00
|
|
|
#include "RimEclipseCase.h"
|
2020-11-04 06:46:17 -06:00
|
|
|
#include "RimStimPlanModel.h"
|
|
|
|
#include "RimStimPlanModelCollection.h"
|
|
|
|
#include "RimStimPlanModelTemplate.h"
|
2020-08-07 09:00:17 -05:00
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RimWellPathCollection.h"
|
|
|
|
|
2020-08-21 04:13:07 -05:00
|
|
|
#include "cafPdmAbstractFieldScriptingCapability.h"
|
|
|
|
#include "cafPdmFieldScriptingCapability.h"
|
2020-08-07 09:00:17 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimStimPlanModelCollection, RimcStimPlanModelCollection_appendStimPlanModel, "AppendStimPlanModel" );
|
2020-08-07 09:00:17 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-10-24 02:13:42 -05:00
|
|
|
RimcStimPlanModelCollection_appendStimPlanModel::RimcStimPlanModelCollection_appendStimPlanModel( caf::PdmObjectHandle* self )
|
2020-08-07 09:00:17 -05:00
|
|
|
: caf::PdmObjectMethod( self )
|
|
|
|
{
|
2020-11-04 06:46:17 -06:00
|
|
|
CAF_PDM_InitObject( "Create StimPlan Model", "", "", "Create a new StimPlan Model" );
|
2020-08-21 04:13:07 -05:00
|
|
|
CAF_PDM_InitScriptableFieldNoDefault( &m_wellPath, "WellPath", "", "", "", "Well Path" );
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitScriptableField( &m_md, "MeasuredDepth", 0.0, "Measured Depth" );
|
2020-11-04 06:46:17 -06:00
|
|
|
CAF_PDM_InitScriptableFieldNoDefault( &m_stimPlanModelTemplate, "StimPlanModelTemplate", "", "", "", "StimPlan Model Template" );
|
2020-08-07 09:00:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-10-24 02:13:42 -05:00
|
|
|
caf::PdmObjectHandle* RimcStimPlanModelCollection_appendStimPlanModel::execute()
|
2020-08-07 09:00:17 -05:00
|
|
|
{
|
2021-10-24 02:13:42 -05:00
|
|
|
RimStimPlanModel* stimPlanModel = nullptr;
|
2020-11-04 06:46:17 -06:00
|
|
|
RimStimPlanModelCollection* stimPlanModelCollection = self<RimStimPlanModelCollection>();
|
2021-02-17 06:10:23 -06:00
|
|
|
if ( m_wellPath )
|
2020-08-07 09:00:17 -05:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
auto wellPathCollection = stimPlanModelCollection->firstAncestorOrThisOfTypeAsserted<RimWellPathCollection>();
|
2020-08-07 09:00:17 -05:00
|
|
|
|
2021-10-24 02:13:42 -05:00
|
|
|
stimPlanModel = RicNewStimPlanModelFeature::addStimPlanModel( m_wellPath, wellPathCollection );
|
2020-08-07 09:00:17 -05:00
|
|
|
}
|
|
|
|
|
2021-10-24 02:13:42 -05:00
|
|
|
if ( stimPlanModel )
|
2020-08-07 09:00:17 -05:00
|
|
|
{
|
2021-10-24 02:13:42 -05:00
|
|
|
stimPlanModel->setMD( m_md() );
|
|
|
|
stimPlanModel->setStimPlanModelTemplate( m_stimPlanModelTemplate() );
|
2020-11-04 06:46:17 -06:00
|
|
|
stimPlanModelCollection->updateAllRequiredEditors();
|
2020-08-07 09:00:17 -05:00
|
|
|
}
|
|
|
|
|
2021-10-24 02:13:42 -05:00
|
|
|
return stimPlanModel;
|
2020-08-07 09:00:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-10-24 02:13:42 -05:00
|
|
|
bool RimcStimPlanModelCollection_appendStimPlanModel::resultIsPersistent() const
|
2020-08-07 09:00:17 -05:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-10-24 02:13:42 -05:00
|
|
|
std::unique_ptr<caf::PdmObjectHandle> RimcStimPlanModelCollection_appendStimPlanModel::defaultResult() const
|
2020-08-07 09:00:17 -05:00
|
|
|
{
|
2020-11-04 06:46:17 -06:00
|
|
|
return std::unique_ptr<caf::PdmObjectHandle>( new RimStimPlanModel );
|
2020-08-07 09:00:17 -05:00
|
|
|
}
|