mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Assign calculation ID to existing addresses (#5304)
#5278 Assign calculation ID to existing addresses
This commit is contained in:
@@ -18,6 +18,12 @@
|
||||
|
||||
#include "RimSummaryAddress.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
@@ -126,3 +132,24 @@ RifEclipseSummaryAddress RimSummaryAddress::address()
|
||||
m_isErrorResult,
|
||||
m_calculationId );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddress::ensureIdIsAssigned()
|
||||
{
|
||||
if ( m_category == RifEclipseSummaryAddress::SUMMARY_CALCULATED && m_calculationId == -1 )
|
||||
{
|
||||
RimSummaryCalculationCollection* calcColl = RiaApplication::instance()->project()->calculationCollection();
|
||||
|
||||
for ( const RimSummaryCalculation* c : calcColl->calculations() )
|
||||
{
|
||||
QString description = c->description();
|
||||
|
||||
if ( description == m_quantityName )
|
||||
{
|
||||
m_calculationId = c->id();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user