#5775 Add case id to summary case.

This commit is contained in:
Kristian Bendiksen
2020-04-08 14:30:38 +02:00
committed by Gaute Lindkvist
parent 0a33cc269a
commit bc08aa1905
5 changed files with 57 additions and 3 deletions

View File

@@ -113,6 +113,7 @@ RimProject::RimProject( void )
, m_nextValidViewId( 1 )
, m_nextValidPlotId( 1 )
, m_nextValidCalculationId( 1 )
, m_nextValidSummaryCaseId( 1 )
{
CAF_PDM_InitScriptableObjectWithNameAndComment( "Project", "", "", "", "Project", "The ResInsight Project" );
@@ -255,6 +256,7 @@ void RimProject::close()
m_nextValidViewId = 1;
m_nextValidPlotId = 1;
m_nextValidCalculationId = 1;
m_nextValidSummaryCaseId = 1;
}
//--------------------------------------------------------------------------------------------------
@@ -485,6 +487,23 @@ void RimProject::setProjectFileNameAndUpdateDependencies( const QString& project
wellPathImport->updateFilePaths();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::assignCaseIdToSummaryCase( RimSummaryCase* summaryCase )
{
if ( summaryCase )
{
std::vector<RimSummaryCase*> summaryCases = allSummaryCases();
for ( RimSummaryCase* s : summaryCases )
{
m_nextValidSummaryCaseId = std::max( m_nextValidSummaryCaseId, s->caseId() + 1 );
}
summaryCase->setCaseId( m_nextValidSummaryCaseId++ );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------