mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-10 08:03:05 -06:00
#5131 : Calculated curves : Show native address in title
This commit is contained in:
parent
03581804e2
commit
532d5899de
@ -119,6 +119,22 @@ std::vector<RimSummaryCalculation*> RimSummaryCalculationCollection::calculation
|
||||
return m_calcuations.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCalculation* RimSummaryCalculationCollection::findCalculationById( int id ) const
|
||||
{
|
||||
for ( RimSummaryCalculation* calc : m_calcuations )
|
||||
{
|
||||
if ( calc->id() == id )
|
||||
{
|
||||
return calc;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
RimSummaryCalculation* addCalculationCopy( const RimSummaryCalculation* sourceCalculation );
|
||||
void deleteCalculation( RimSummaryCalculation* calculation );
|
||||
std::vector<RimSummaryCalculation*> calculations() const;
|
||||
RimSummaryCalculation* findCalculationById( int id ) const;
|
||||
|
||||
RimSummaryCase* calculationSummaryCase();
|
||||
|
||||
|
@ -36,6 +36,10 @@
|
||||
#include "RimMultiPlotWindow.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCalculationVariable.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
@ -1779,16 +1783,38 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na
|
||||
{
|
||||
for ( RimSummaryCurve* curve : m_summaryCurveCollection->curves() )
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressY() );
|
||||
sumCases.push_back( curve->summaryCaseY() );
|
||||
|
||||
if ( curve->summaryCaseX() )
|
||||
if ( curve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_CALCULATED )
|
||||
{
|
||||
sumCases.push_back( curve->summaryCaseX() );
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimSummaryCalculationCollection* calculationColl = proj->calculationCollection();
|
||||
|
||||
if ( curve->summaryAddressX().category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||
if ( calculationColl )
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressX() );
|
||||
RimSummaryCalculation* calculation = calculationColl->findCalculationById(
|
||||
curve->summaryAddressY().id() );
|
||||
if ( calculation )
|
||||
{
|
||||
for ( RimSummaryCalculationVariable* v : calculation->allVariables() )
|
||||
{
|
||||
sumCases.push_back( v->summaryCase() );
|
||||
addresses.push_back( v->summaryAddress()->address() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressY() );
|
||||
sumCases.push_back( curve->summaryCaseY() );
|
||||
|
||||
if ( curve->summaryCaseX() )
|
||||
{
|
||||
sumCases.push_back( curve->summaryCaseX() );
|
||||
|
||||
if ( curve->summaryAddressX().category() != RifEclipseSummaryAddress::SUMMARY_INVALID )
|
||||
{
|
||||
addresses.push_back( curve->summaryAddressX() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user