mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Adds MSW name grouping pattern functionality
Implements a new command to set the MSW grouping pattern, and ensures that the pattern is only updated if a new value is set.
This commit is contained in:
1 parent
e79ff8e7a7
commit
c6ed12be92
3 files changed
+54
-2
No files matched your search
@@ -644,8 +644,16 @@ void RimWellPathCollection::deleteWell( RimWellPath* wellPath )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::setMswWellPattern( const QString& pattern )
|
||||
{
|
||||
m_mswNameGrouping = MswGroupingMode::CUSTOM;
|
||||
m_mswNameGroupingPattern = pattern;
|
||||
if ( pattern.isEmpty() )
|
||||
{
|
||||
m_mswNameGrouping = MswGroupingMode::DISABLED;
|
||||
m_mswNameGroupingPattern = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mswNameGrouping = MswGroupingMode::CUSTOM;
|
||||
m_mswNameGroupingPattern = pattern;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -182,3 +182,31 @@ QString RimcWellPathCollection_importWellPathFromPointsInternal::classKeywordRet
|
||||
{
|
||||
return RimPointBasedWellPath::classKeywordStatic();
|
||||
}
|
||||
|
||||
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPathCollection, RimcWellPathCollection_setMswNameGrouping, "setMswNameGrouping" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimcWellPathCollection_setMswNameGrouping::RimcWellPathCollection_setMswNameGrouping( caf::PdmObjectHandle* self )
|
||||
: caf::PdmVoidObjectMethod( self )
|
||||
{
|
||||
CAF_PDM_InitObject( "Set MSW Name Grouping" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_mswNameGrouping, "MswNameGrouping", "MSW Name Grouping" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::expected<caf::PdmObjectHandle*, QString> RimcWellPathCollection_setMswNameGrouping::execute()
|
||||
{
|
||||
auto wellPathCollection = self<RimWellPathCollection>();
|
||||
if ( !wellPathCollection )
|
||||
{
|
||||
return std::unexpected( QString( "Well path collection is null. Cannot add well path." ) );
|
||||
}
|
||||
|
||||
wellPathCollection->setMswWellPattern( m_mswNameGrouping() );
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@@ -63,3 +63,19 @@ private:
|
||||
caf::PdmField<QString> m_coordinateYKey;
|
||||
caf::PdmField<QString> m_coordinateZKey;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimcWellPathCollection_setMswNameGrouping : public caf::PdmVoidObjectMethod
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimcWellPathCollection_setMswNameGrouping( caf::PdmObjectHandle* self );
|
||||
|
||||
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_mswNameGrouping;
|
||||
};
|
||||
Reference in new issue
Block a user