mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 17:10:19 -05:00
#14772 Forward computeCaseGroupStatistics to RimcEclipseStatisticsCase_computeStatistics
Add an UpdateViews parameter to the existing object method. The legacy command calls computeStatisticsAndUpdateViews() (which also creates a view if none exists) while the object method only computes; the default (false) keeps the object method behavior and the Ricf forwarder passes true. RicfComputeCaseGroupStatistics resolves the statistics cases and loops over them. GridCaseGroup.compute_statistics(case_ids=...) in Python now loops over statistics_cases() and emits a DeprecationWarning.
This commit is contained in:
1 parent
111741b365
commit
1eabb5f5f6
4 files changed
+78
-56
No files matched your search
@@ -70,6 +70,23 @@ CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimEclipseStatisticsCase, RimcEclipseStatisti
|
||||
RimcEclipseStatisticsCase_computeStatistics::RimcEclipseStatisticsCase_computeStatistics( caf::PdmObjectHandle* self )
|
||||
: caf::PdmVoidObjectMethod( self )
|
||||
{
|
||||
CAF_PDM_InitObject( "Compute Statistics", "", "", "Compute statistics for the selected source properties" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_updateViews,
|
||||
"UpdateViews",
|
||||
false,
|
||||
"Update Views",
|
||||
"",
|
||||
"",
|
||||
"Update the 3D views of the case after computing, and create a view if none exists" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimcEclipseStatisticsCase_computeStatistics::setUpdateViews( bool updateViews )
|
||||
{
|
||||
m_updateViews = updateViews;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -78,7 +95,16 @@ RimcEclipseStatisticsCase_computeStatistics::RimcEclipseStatisticsCase_computeSt
|
||||
std::expected<caf::PdmObjectHandle*, QString> RimcEclipseStatisticsCase_computeStatistics::execute()
|
||||
{
|
||||
auto eclipseCase = self<RimEclipseStatisticsCase>();
|
||||
eclipseCase->computeStatistics();
|
||||
if ( !eclipseCase ) return std::unexpected( "No statistics case is available." );
|
||||
|
||||
if ( m_updateViews() )
|
||||
{
|
||||
eclipseCase->computeStatisticsAndUpdateViews();
|
||||
}
|
||||
else
|
||||
{
|
||||
eclipseCase->computeStatistics();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user