mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Summary Plot : Move building of auto plot name to SummaryCurveCollection
This commit is contained in:
@@ -18,9 +18,11 @@
|
||||
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaSummaryCurveAnalyzer.h"
|
||||
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
@@ -160,16 +162,9 @@ void RimSummaryCurveCollection::deleteCurve(RimSummaryCurve* curve)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curves()
|
||||
std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curves() const
|
||||
{
|
||||
std::vector<RimSummaryCurve*> myCurves;
|
||||
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
myCurves.push_back(curve);
|
||||
}
|
||||
|
||||
return myCurves;
|
||||
return m_curves.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -247,6 +242,42 @@ void RimSummaryCurveCollection::applyPreviousIdentifier()
|
||||
m_curvesModifier->applyPreviousIdentifier();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCurveCollection::compileAutoPlotTitle() const
|
||||
{
|
||||
RiaSummaryCurveAnalyzer analyzer;
|
||||
|
||||
analyzer.analyzeCurves(this);
|
||||
|
||||
auto quantities = analyzer.quantities();
|
||||
auto wellNames = analyzer.wellNames();
|
||||
auto wellGroupNames = analyzer.wellGroupNames();
|
||||
auto regions = analyzer.regionNumbers();
|
||||
|
||||
QString title;
|
||||
|
||||
if (wellNames.size() == 1)
|
||||
{
|
||||
title = QString::fromStdString(*(wellNames.begin()));
|
||||
}
|
||||
else if (wellGroupNames.size() == 1)
|
||||
{
|
||||
title = QString::fromStdString(*(wellGroupNames.begin()));
|
||||
}
|
||||
else if (regions.size() == 1)
|
||||
{
|
||||
title = "Region : " + QString::number(*(regions.begin()));
|
||||
}
|
||||
else if (quantities.size() == 1)
|
||||
{
|
||||
title = QString::fromStdString(*(quantities.begin()));
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user