mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
#6479 Update analysis and correlation plots when closing derived cases
This commit is contained in:
1 parent
81b2bd1720
commit
b4aaaa98e9
22 files changed
+269
-60
No files matched your search
@@ -76,6 +76,7 @@ RimAbstractCorrelationPlot::~RimAbstractCorrelationPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAbstractCorrelationPlot::setCurveDefinitions( const std::vector<RiaSummaryCurveDefinition>& curveDefinitions )
|
||||
{
|
||||
disconnectAllCaseSignals();
|
||||
m_analysisPlotDataSelection.deleteAllChildObjects();
|
||||
for ( auto curveDef : curveDefinitions )
|
||||
{
|
||||
@@ -83,6 +84,8 @@ void RimAbstractCorrelationPlot::setCurveDefinitions( const std::vector<RiaSumma
|
||||
dataEntry->setFromCurveDefinition( curveDef );
|
||||
m_analysisPlotDataSelection.push_back( dataEntry );
|
||||
}
|
||||
connectAllCaseSignals();
|
||||
|
||||
auto timeSteps = allAvailableTimeSteps();
|
||||
if ( m_timeStep().isNull() && !timeSteps.empty() )
|
||||
{
|
||||
@@ -124,6 +127,7 @@ void RimAbstractCorrelationPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
if ( !curveSelection.empty() )
|
||||
{
|
||||
std::vector<RiaSummaryCurveDefinition> summaryVectorDefinitions = dlg.curveSelection();
|
||||
disconnectAllCaseSignals();
|
||||
m_analysisPlotDataSelection.deleteAllChildObjects();
|
||||
for ( const RiaSummaryCurveDefinition& vectorDef : summaryVectorDefinitions )
|
||||
{
|
||||
@@ -131,6 +135,7 @@ void RimAbstractCorrelationPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
plotEntry->setFromCurveDefinition( vectorDef );
|
||||
m_analysisPlotDataSelection.push_back( plotEntry );
|
||||
}
|
||||
connectAllCaseSignals();
|
||||
this->loadDataAndUpdate();
|
||||
this->updateConnectedEditors();
|
||||
}
|
||||
@@ -577,3 +582,48 @@ QString RimAbstractCorrelationPlot::selectedVarsText()
|
||||
|
||||
return vectorNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAbstractCorrelationPlot::initAfterRead()
|
||||
{
|
||||
connectAllCaseSignals();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAbstractCorrelationPlot::onCaseRemoved( const SignalEmitter* emitter, RimSummaryCase* summaryCase )
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
if ( m_plotWidget ) m_plotWidget->scheduleReplot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAbstractCorrelationPlot::connectAllCaseSignals()
|
||||
{
|
||||
for ( auto dataEntry : m_analysisPlotDataSelection )
|
||||
{
|
||||
if ( dataEntry->ensemble() )
|
||||
{
|
||||
dataEntry->ensemble()->caseRemoved.connect( this, &RimAbstractCorrelationPlot::onCaseRemoved );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAbstractCorrelationPlot::disconnectAllCaseSignals()
|
||||
{
|
||||
for ( auto dataEntry : m_analysisPlotDataSelection )
|
||||
{
|
||||
if ( dataEntry->ensemble() )
|
||||
{
|
||||
dataEntry->ensemble()->caseRemoved.disconnect( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user