mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add Sumo summary ensemble and summary case
Add feature to create ensemble from a sumo data source
This commit is contained in:
@@ -124,7 +124,7 @@ void SimpleDialog::onAssetsClicked()
|
||||
{
|
||||
if ( !isTokenValid() ) return;
|
||||
|
||||
m_sumoConnector->requestAssets();
|
||||
m_sumoConnector->requestAssetsBlocking();
|
||||
m_sumoConnector->assets();
|
||||
|
||||
label->setText( "Requesting fields (see log for response" );
|
||||
|
||||
@@ -42,6 +42,7 @@ set(COMMAND_REFERENCED_CMAKE_FILES
|
||||
FractureCommands/CMakeLists_files.cmake
|
||||
PlotBuilderCommands/CMakeLists_files.cmake
|
||||
PolygonCommands/CMakeLists_files.cmake
|
||||
Sumo/CMakeLists_files.cmake
|
||||
)
|
||||
|
||||
# Include source file lists from *.cmake files
|
||||
|
||||
@@ -46,7 +46,7 @@ bool RicShowDataSourcesForRealization::isCommandChecked() const
|
||||
|
||||
if ( !selection.empty() )
|
||||
{
|
||||
return selection.front()->showRealizationDataSources();
|
||||
return selection.front()->showVectorItemsInProjectTree();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -80,10 +80,10 @@ void RicShowDataSourcesForRealization::onActionTriggered( bool isChecked )
|
||||
|
||||
if ( selection.empty() ) return;
|
||||
|
||||
bool enableDataSources = !selection.front()->showRealizationDataSources();
|
||||
bool enableDataSources = !selection.front()->showVectorItemsInProjectTree();
|
||||
|
||||
for ( auto summaryCase : selection )
|
||||
{
|
||||
summaryCase->setShowRealizationDataSource( enableDataSources );
|
||||
summaryCase->setShowVectorItemsInProjectTree( enableDataSources );
|
||||
}
|
||||
}
|
||||
|
||||
10
ApplicationLibCode/Commands/Sumo/CMakeLists_files.cmake
Normal file
10
ApplicationLibCode/Commands/Sumo/CMakeLists_files.cmake
Normal file
@@ -0,0 +1,10 @@
|
||||
set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateSumoEnsembleFeature.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateSumoEnsembleFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
|
||||
@@ -0,0 +1,62 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicCreateSumoEnsembleFeature.h"
|
||||
|
||||
#include "RiaSummaryTools.h"
|
||||
|
||||
#include "PlotBuilderCommands/RicSummaryPlotBuilder.h"
|
||||
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "Sumo/RimSummaryEnsembleSumo.h"
|
||||
#include "Sumo/RimSummarySumoDataSource.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicCreateSumoEnsembleFeature, "RicCreateSumoEnsembleFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateSumoEnsembleFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
auto dataSources = caf::selectedObjectsByType<RimSummarySumoDataSource*>();
|
||||
for ( auto dataSource : dataSources )
|
||||
{
|
||||
RimSummaryEnsembleSumo* ensemble = new RimSummaryEnsembleSumo();
|
||||
ensemble->setSumoDataSource( dataSource );
|
||||
ensemble->updateName();
|
||||
RiaSummaryTools::summaryCaseMainCollection()->addEnsemble( ensemble );
|
||||
ensemble->loadDataAndUpdate();
|
||||
|
||||
RicSummaryPlotBuilder::createAndAppendDefaultSummaryMultiPlot( {}, { ensemble } );
|
||||
}
|
||||
|
||||
RiaSummaryTools::summaryCaseMainCollection()->updateAllRequiredEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateSumoEnsembleFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Create Sumo Ensemble" );
|
||||
actionToSetup->setIcon( QIcon( ":/SummaryEnsemble.svg" ) );
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicCreateSumoEnsembleFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
Reference in New Issue
Block a user