mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 17:10:19 -05:00
Summary case refresh update. (#13123)
Use improved opm-common reader with less throws. Add reload selected cases button Add timer for auto-reload of cases Add include in auto update option for cases and ensembles Do not enable auto reload option for cases in an ensemble
This commit is contained in:
14 files changed
+202
-21
No files matched your search
@@ -213,6 +213,7 @@ void RimSummaryFileSetEnsemble::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
auto group = uiOrdering.addNewGroup( "Ensemble Definition" );
|
||||
m_ensembleFileSet()->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
uiOrdering.add( &m_includeInAutoReload );
|
||||
|
||||
auto developersGroup = uiOrdering.addNewGroup( " -- Developers --" );
|
||||
developersGroup->setCollapsedByDefault();
|
||||
|
||||
@@ -49,6 +49,9 @@ RimSummaryCase::RimSummaryCase()
|
||||
CAF_PDM_InitScriptableField( &m_showSubNodesInTree, "ShowSubNodesInTree", true, "Show Summary Data Sub-Tree" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showSubNodesInTree );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_includeInAutoReload, "IncludeInAutoReload", false, "Include in Automatic Case Reloads" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_includeInAutoReload );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_useAutoShortName_OBSOLETE, "AutoShortyName", false, "Use Auto Display Name" );
|
||||
m_useAutoShortName_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
m_useAutoShortName_OBSOLETE.uiCapability()->setUiHidden( true );
|
||||
@@ -299,6 +302,12 @@ void RimSummaryCase::defineObjectEditorAttribute( QString uiConfigName, caf::Pdm
|
||||
|
||||
treeItemAttribute->tags.push_back( std::move( tag ) );
|
||||
}
|
||||
if ( m_includeInAutoReload() )
|
||||
{
|
||||
auto tag = caf::PdmUiTreeViewItemAttribute::createTag();
|
||||
tag->icon = caf::IconProvider( ":/TimedRefresh.png" );
|
||||
treeItemAttribute->tags.push_back( std::move( tag ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,8 +320,14 @@ void RimSummaryCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
uiOrdering.add( &m_displayNameOption );
|
||||
uiOrdering.add( &m_summaryHeaderFilename );
|
||||
uiOrdering.add( &m_caseId );
|
||||
|
||||
if ( ensemble() ) uiOrdering.add( &m_showSubNodesInTree );
|
||||
if ( ensemble() )
|
||||
{
|
||||
uiOrdering.add( &m_showSubNodesInTree );
|
||||
}
|
||||
else
|
||||
{
|
||||
uiOrdering.add( &m_includeInAutoReload );
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
@@ -425,6 +440,14 @@ void RimSummaryCase::updateAutoShortName()
|
||||
updateTreeItemName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryCase::includeInAutoReload() const
|
||||
{
|
||||
return m_includeInAutoReload;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -91,6 +91,8 @@ public:
|
||||
void copyFrom( const RimSummaryCase& rhs );
|
||||
bool operator<( const RimSummaryCase& rhs ) const;
|
||||
|
||||
bool includeInAutoReload() const;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
@@ -116,6 +118,7 @@ protected:
|
||||
caf::PdmField<caf::FilePath> m_summaryHeaderFilename;
|
||||
|
||||
caf::PdmField<bool> m_showSubNodesInTree;
|
||||
caf::PdmField<bool> m_includeInAutoReload;
|
||||
|
||||
caf::PdmChildField<RimSummaryAddressCollection*> m_dataVectorFolders;
|
||||
|
||||
|
||||
@@ -42,8 +42,10 @@
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
#include "cafPdmObjectScriptingCapability.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiTextEditor.h"
|
||||
#include "cafPdmUiTreeAttributes.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
@@ -74,6 +76,9 @@ RimSummaryEnsemble::RimSummaryEnsemble()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_groupingMode, "GroupingMode", "Grouping Mode" );
|
||||
|
||||
CAF_PDM_InitScriptableField( &m_includeInAutoReload, "IncludeInAutoReload", false, "Include in Automatic Case Reloads" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_includeInAutoReload );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_nameAndItemCount, "NameCount", "Name" );
|
||||
m_nameAndItemCount.registerGetMethod( this, &RimSummaryEnsemble::nameAndItemCount );
|
||||
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &m_nameAndItemCount );
|
||||
@@ -985,6 +990,8 @@ void RimSummaryEnsemble::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
|
||||
uiOrdering.add( &m_ensembleDescription );
|
||||
|
||||
uiOrdering.add( &m_includeInAutoReload );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
@@ -1029,6 +1036,22 @@ void RimSummaryEnsemble::defineEditorAttribute( const caf::PdmFieldHandle* field
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryEnsemble::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
if ( auto* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute ) )
|
||||
{
|
||||
if ( m_includeInAutoReload() )
|
||||
{
|
||||
auto tag = caf::PdmUiTreeViewItemAttribute::createTag();
|
||||
tag->icon = caf::IconProvider( ":/TimedRefresh.png" );
|
||||
treeItemAttribute->tags.push_back( std::move( tag ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1233,3 +1256,11 @@ void RimSummaryEnsemble::clearChildNodes()
|
||||
{
|
||||
m_dataVectorFolders->deleteChildren();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryEnsemble::includeInAutoReload() const
|
||||
{
|
||||
return m_includeInAutoReload();
|
||||
}
|
||||
@@ -122,6 +122,8 @@ public:
|
||||
|
||||
virtual void cleanupBeforeDelete();
|
||||
|
||||
bool includeInAutoReload() const;
|
||||
|
||||
protected:
|
||||
virtual void onLoadDataAndUpdate();
|
||||
|
||||
@@ -139,6 +141,7 @@ private:
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
QString nameAndItemCount() const;
|
||||
void updateIcon();
|
||||
@@ -154,6 +157,7 @@ private:
|
||||
protected:
|
||||
caf::PdmChildArrayField<RimSummaryCase*> m_cases;
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmField<bool> m_includeInAutoReload;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_nameTemplateString;
|
||||
|
||||
@@ -42,6 +42,12 @@ RimAutomationSettings::RimAutomationSettings()
|
||||
"Cell Selection Destination",
|
||||
"",
|
||||
"Add curves to the selected Summary Plot when clicking on cells in a 3D view." );
|
||||
|
||||
CAF_PDM_InitField( &m_caseReloadIntervalSeconds,
|
||||
"CaseReloadIntervalSeconds",
|
||||
15,
|
||||
"Case Reload Interval (seconds)",
|
||||
"Interval in seconds for automatic reload of cases when enabled." );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -79,6 +85,9 @@ void RimAutomationSettings::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
|
||||
group->add( &m_cellSelectionDestination );
|
||||
m_cellSelectionDestination.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
auto refreshGrp = uiOrdering.addNewGroup( "Plot Update" );
|
||||
refreshGrp->add( &m_caseReloadIntervalSeconds );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -112,3 +121,11 @@ QList<caf::PdmOptionItemInfo> RimAutomationSettings::calculateValueOptions( cons
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimAutomationSettings::caseReloadIntervalMs() const
|
||||
{
|
||||
return m_caseReloadIntervalSeconds() * 1000;
|
||||
}
|
||||
@@ -40,10 +40,13 @@ public:
|
||||
|
||||
void setDestinationPlot( RimPlotWindow* plotWindow );
|
||||
|
||||
int caseReloadIntervalMs() const;
|
||||
|
||||
private:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimPlotWindow*> m_cellSelectionDestination;
|
||||
caf::PdmField<int> m_caseReloadIntervalSeconds;
|
||||
};
|
||||
Reference in new issue
Block a user