mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Python support for grid case groups
This commit is contained in:
parent
35e2e43c3a
commit
91c253f8fe
@ -66,7 +66,7 @@ CAF_PDM_SOURCE_INIT( RimEclipseStatisticsCase, "RimStatisticalCalculation" );
|
||||
RimEclipseStatisticsCase::RimEclipseStatisticsCase()
|
||||
: RimEclipseCase()
|
||||
{
|
||||
CAF_PDM_InitObject( "Case Group Statistics", ":/Histogram16x16.png" );
|
||||
CAF_PDM_InitScriptableObject( "Case Group Statistics", ":/Histogram16x16.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_calculateEditCommand, "m_editingAllowed", "" );
|
||||
caf::PdmUiPushButtonEditor::configureEditorForField( &m_calculateEditCommand );
|
||||
@ -202,6 +202,44 @@ void RimEclipseStatisticsCase::populateResultSelectionAfterLoadingGrid()
|
||||
m_populateSelectionAfterLoadingGrid = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseStatisticsCase::setSourceProperties( RiaDefines::ResultCatType propertyType, const std::vector<QString>& propertyNames )
|
||||
{
|
||||
switch ( propertyType )
|
||||
{
|
||||
case RiaDefines::ResultCatType::DYNAMIC_NATIVE:
|
||||
m_selectedDynamicProperties = propertyNames;
|
||||
break;
|
||||
case RiaDefines::ResultCatType::STATIC_NATIVE:
|
||||
m_selectedStaticProperties = propertyNames;
|
||||
break;
|
||||
case RiaDefines::ResultCatType::SOURSIMRL:
|
||||
break;
|
||||
case RiaDefines::ResultCatType::GENERATED:
|
||||
m_selectedGeneratedProperties = propertyNames;
|
||||
break;
|
||||
case RiaDefines::ResultCatType::INPUT_PROPERTY:
|
||||
m_selectedInputProperties = propertyNames;
|
||||
break;
|
||||
case RiaDefines::ResultCatType::FORMATION_NAMES:
|
||||
break;
|
||||
case RiaDefines::ResultCatType::ALLAN_DIAGRAMS:
|
||||
break;
|
||||
case RiaDefines::ResultCatType::FLOW_DIAGNOSTICS:
|
||||
break;
|
||||
case RiaDefines::ResultCatType::INJECTION_FLOODING:
|
||||
break;
|
||||
case RiaDefines::ResultCatType::REMOVED:
|
||||
break;
|
||||
case RiaDefines::ResultCatType::UNDEFINED:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -74,6 +74,8 @@ public:
|
||||
|
||||
void populateResultSelectionAfterLoadingGrid();
|
||||
|
||||
void setSourceProperties( RiaDefines::ResultCatType propertyType, const std::vector<QString>& propertyNames );
|
||||
|
||||
private:
|
||||
void scheduleACTIVEGeometryRegenOnReservoirViews();
|
||||
|
||||
|
@ -24,6 +24,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcThermalFractureTemplate.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcIntersection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcEclipseCase.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcEclipseStatisticsCase.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@ -52,6 +53,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcThermalFractureTemplate.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcIntersection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcEclipseCase.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcEclipseStatisticsCase.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
@ -0,0 +1,148 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimcEclipseStatisticsCase.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
|
||||
#include "RicImportSummaryCasesFeature.h"
|
||||
|
||||
/*
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimFileSummaryCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSurfaceCollection.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
*/
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RimEclipseStatisticsCase.h"
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
|
||||
/*
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include <memory>
|
||||
*/
|
||||
|
||||
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimEclipseStatisticsCase, RimcEclipseStatisticsCase_defineSourceProperties, "set_source_result" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimcEclipseStatisticsCase_defineSourceProperties::RimcEclipseStatisticsCase_defineSourceProperties( caf::PdmObjectHandle* self )
|
||||
: caf::PdmObjectMethod( self )
|
||||
{
|
||||
CAF_PDM_InitObject( "Define Source Properties" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_propertyType, "PropertyType", "" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_propertyNames, "PropertyNames", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObjectHandle* RimcEclipseStatisticsCase_defineSourceProperties::execute()
|
||||
{
|
||||
RiaDefines::ResultCatType myEnum = caf::AppEnum<RiaDefines::ResultCatType>::fromText( m_propertyType() );
|
||||
|
||||
if ( myEnum == RiaDefines::ResultCatType::DYNAMIC_NATIVE || myEnum == RiaDefines::ResultCatType::STATIC_NATIVE ||
|
||||
myEnum == RiaDefines::ResultCatType::INPUT_PROPERTY || myEnum == RiaDefines::ResultCatType::GENERATED )
|
||||
{
|
||||
auto eclipseCase = self<RimEclipseStatisticsCase>();
|
||||
eclipseCase->setSourceProperties( myEnum, m_propertyNames );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::error( "Wrong result type. Supported types are DYNAMIC_NATIVE, STATIC_NATIVE, INPUT_PROPERTY, GENERATED" );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimcEclipseStatisticsCase_defineSourceProperties::resultIsPersistent() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::unique_ptr<caf::PdmObjectHandle> RimcEclipseStatisticsCase_defineSourceProperties::defaultResult() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimcEclipseStatisticsCase_defineSourceProperties::isNullptrValidResult() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimEclipseStatisticsCase, RimcEclipseStatisticsCase_computeStatistics, "compute_statistics" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimcEclipseStatisticsCase_computeStatistics::RimcEclipseStatisticsCase_computeStatistics( caf::PdmObjectHandle* self )
|
||||
: caf::PdmObjectMethod( self )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObjectHandle* RimcEclipseStatisticsCase_computeStatistics::execute()
|
||||
{
|
||||
auto eclipseCase = self<RimEclipseStatisticsCase>();
|
||||
eclipseCase->computeStatistics();
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimcEclipseStatisticsCase_computeStatistics::resultIsPersistent() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::unique_ptr<caf::PdmObjectHandle> RimcEclipseStatisticsCase_computeStatistics::defaultResult() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimcEclipseStatisticsCase_computeStatistics::isNullptrValidResult() const
|
||||
{
|
||||
return true;
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObjectHandle.h"
|
||||
#include "cafPdmObjectMethod.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <memory>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimcEclipseStatisticsCase_defineSourceProperties : public caf::PdmObjectMethod
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimcEclipseStatisticsCase_defineSourceProperties( caf::PdmObjectHandle* self );
|
||||
|
||||
caf::PdmObjectHandle* execute() override;
|
||||
bool resultIsPersistent() const override;
|
||||
std::unique_ptr<PdmObjectHandle> defaultResult() const override;
|
||||
bool isNullptrValidResult() const override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_propertyType;
|
||||
caf::PdmField<std::vector<QString>> m_propertyNames;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimcEclipseStatisticsCase_computeStatistics : public caf::PdmObjectMethod
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimcEclipseStatisticsCase_computeStatistics( caf::PdmObjectHandle* self );
|
||||
|
||||
caf::PdmObjectHandle* execute() override;
|
||||
bool resultIsPersistent() const override;
|
||||
std::unique_ptr<PdmObjectHandle> defaultResult() const override;
|
||||
bool isNullptrValidResult() const override;
|
||||
};
|
Loading…
Reference in New Issue
Block a user