Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ApplicationLibCode/Commands/RicCloseSummaryCaseFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "RimProject.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCaseUpdateBatch.h"
#include "RimSummaryMultiPlot.h"
#include "RimSummaryMultiPlotCollection.h"
#include "RimSummaryPlot.h"
Expand Down Expand Up @@ -61,6 +62,10 @@ void RicCloseSummaryCaseFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
void RicCloseSummaryCaseFeature::deleteSummaryCases( std::vector<RimSummaryCase*> cases )
{
// The case list is used all the way down to the delete below. Keep a batch open for that whole span, so a derived
// case detached by the removal is not destroyed while this list still refers to it.
RimSummaryCaseUpdateBatch updateBatch;

RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
RimSummaryCaseMainCollection* summaryCaseMainCollection = RiaSummaryTools::summaryCaseMainCollection();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimSummaryAddressSelector.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCrossPlotStatisticsCase.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryEnsembleTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseUpdateBatch.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotReadOut.cpp
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,41 +183,29 @@ RimDeltaSummaryCase::RimDeltaSummaryCase()

CAF_PDM_InitFieldNoDefault( &m_useFixedTimeStep, "UseFixedTimeStep", "Use Fixed Time Step" );
CAF_PDM_InitField( &m_fixedTimeStepIndex, "FixedTimeStepIndex", 0, "Time Step" );
CAF_PDM_InitField( &m_inUse, "InUse", false, "In Use" );
m_fixedTimeStepIndex.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
m_fixedTimeStepIndex.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosition::HIDDEN );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDeltaSummaryCase::setInUse( bool inUse )
void RimDeltaSummaryCase::setSummaryCases( RimSummaryCase* sumCase1, RimSummaryCase* sumCase2 )
{
m_inUse = inUse;

if ( !m_inUse )
{
m_summaryCase1 = nullptr;
m_summaryCase2 = nullptr;
m_dataCache.clear();
}
}
m_summaryCase1 = sumCase1;
m_summaryCase2 = sumCase2;

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimDeltaSummaryCase::isInUse() const
{
return m_inUse;
clearCache();
}

//--------------------------------------------------------------------------------------------------
///
/// Sever the references to the source cases. Used when a derived case is detached from its ensemble,
/// so it does not keep the source cases alive in any way after the ensemble has moved on.
//--------------------------------------------------------------------------------------------------
void RimDeltaSummaryCase::setSummaryCases( RimSummaryCase* sumCase1, RimSummaryCase* sumCase2 )
void RimDeltaSummaryCase::clearSourceCases()
{
m_summaryCase1 = sumCase1;
m_summaryCase2 = sumCase2;
m_summaryCase1 = nullptr;
m_summaryCase2 = nullptr;

clearCache();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ class RimDeltaSummaryCase : public RimSummaryCase, public RifSummaryReaderInterf
public:
RimDeltaSummaryCase();

void setInUse( bool inUse );
bool isInUse() const;
void setSummaryCases( RimSummaryCase* sumCase1, RimSummaryCase* sumCase2 );
void clearSourceCases();
void setOperator( DerivedSummaryOperator oper );
void setFixedTimeSteps( int fixedTimeStepCase1, int fixedTimeStepCase2 );

Expand Down Expand Up @@ -111,8 +110,6 @@ class RimDeltaSummaryCase : public RimSummaryCase, public RifSummaryReaderInterf
caf::PdmField<caf::AppEnum<FixedTimeStepMode>> m_useFixedTimeStep;
caf::PdmField<int> m_fixedTimeStepIndex;

caf::PdmField<bool> m_inUse;

// Local cache considered mutable
mutable std::map<RifEclipseSummaryAddress, std::pair<std::vector<time_t>, std::vector<double>>> m_dataCache;
};
Loading