mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
More summary data types in data source tree (#8840)
* Add support for block data in data sources tree * Add option to show summary data sub-tree for single realizations inside an ensemble
This commit is contained in:
parent
774538868a
commit
5d9f7b165c
@ -33,6 +33,7 @@ void caf::AppEnum<RimSummaryAddressCollection::CollectionContentType>::setUp()
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::REGION, "REGION", "Region" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::MISC, "MISC", "Miscellaneous" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::FIELD, "FIELD", "Field" );
|
||||
addItem( RimSummaryAddressCollection::CollectionContentType::BLOCK, "BLOCK", "Block" );
|
||||
setDefault( RimSummaryAddressCollection::CollectionContentType::NOT_DEFINED );
|
||||
}
|
||||
|
||||
@ -132,6 +133,7 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
|
||||
RimSummaryAddressCollection* regions = getOrCreateSubfolder( "Regions", CollectionContentType::REGION_FOLDER );
|
||||
RimSummaryAddressCollection* wells = getOrCreateSubfolder( "Wells", CollectionContentType::WELL_FOLDER );
|
||||
RimSummaryAddressCollection* groups = getOrCreateSubfolder( "Groups", CollectionContentType::GROUP_FOLDER );
|
||||
RimSummaryAddressCollection* blocks = getOrCreateSubfolder( "Blocks", CollectionContentType::BLOCK_FOLDER );
|
||||
|
||||
for ( const auto& address : addresses )
|
||||
{
|
||||
@ -161,6 +163,14 @@ void RimSummaryAddressCollection::updateFolderStructure( const std::set<RifEclip
|
||||
ensembleId );
|
||||
break;
|
||||
|
||||
case RifEclipseSummaryAddress::SummaryVarCategory::SUMMARY_BLOCK:
|
||||
blocks->addToSubfolder( QString::fromStdString( address.blockAsString() ),
|
||||
CollectionContentType::BLOCK,
|
||||
address,
|
||||
caseId,
|
||||
ensembleId );
|
||||
break;
|
||||
|
||||
case RifEclipseSummaryAddress::SummaryVarCategory::SUMMARY_WELL:
|
||||
wells->addToSubfolder( QString::fromStdString( address.wellName() ),
|
||||
CollectionContentType::WELL,
|
||||
|
@ -43,7 +43,9 @@ public:
|
||||
MISC,
|
||||
WELL_FOLDER,
|
||||
GROUP_FOLDER,
|
||||
REGION_FOLDER
|
||||
REGION_FOLDER,
|
||||
BLOCK,
|
||||
BLOCK_FOLDER
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
@ -54,6 +55,9 @@ RimSummaryCase::RimSummaryCase()
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_displayName, "ShortName", "Display Name" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_displayNameOption, "NameSetting", "Name Setting" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_showSubNodesInTree, "ShowSubNodesInTree", false, "Show Summary Data Sub-Tree" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showSubNodesInTree );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_useAutoShortName_OBSOLETE, "AutoShortyName", false, "Use Auto Display Name" );
|
||||
m_useAutoShortName_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
m_useAutoShortName_OBSOLETE.uiCapability()->setUiHidden( true );
|
||||
@ -181,6 +185,10 @@ void RimSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
updateTreeItemName();
|
||||
nameChanged.send();
|
||||
}
|
||||
else if ( changedField == &m_showSubNodesInTree )
|
||||
{
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
@ -222,12 +230,27 @@ void RimSummaryCase::buildChildNodes()
|
||||
m_dataVectorFolders->updateFolderStructure( reader->allResultAddresses(), m_caseId );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_displayName );
|
||||
uiOrdering.add( &m_displayNameOption );
|
||||
uiOrdering.add( &m_summaryHeaderFilename );
|
||||
uiOrdering.add( &m_caseId );
|
||||
|
||||
if ( ensemble() ) uiOrdering.add( &m_showSubNodesInTree );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
||||
{
|
||||
if ( !ensemble() )
|
||||
if ( !ensemble() || m_showSubNodesInTree() )
|
||||
{
|
||||
if ( m_dataVectorFolders->isEmpty() ) buildChildNodes();
|
||||
m_dataVectorFolders->updateUiTreeOrdering( uiTreeOrdering );
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
bool operator<( const RimSummaryCase& rhs ) const;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
void updateTreeItemName();
|
||||
@ -102,6 +103,8 @@ protected:
|
||||
caf::PdmField<DisplayNameEnum> m_displayNameOption;
|
||||
caf::PdmField<caf::FilePath> m_summaryHeaderFilename;
|
||||
|
||||
caf::PdmField<bool> m_showSubNodesInTree;
|
||||
|
||||
caf::PdmChildField<RimSummaryAddressCollection*> m_dataVectorFolders;
|
||||
|
||||
bool m_isObservedData;
|
||||
|
Loading…
Reference in New Issue
Block a user