mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#2780 Ensemble Curve Set : Improve plot title including ensembles
This commit is contained in:
@@ -65,6 +65,11 @@ void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
||||||
|
|
||||||
|
if (!project->summaryGroups().empty())
|
||||||
|
{
|
||||||
|
curveSet->setSummaryCaseCollection(project->summaryGroups().back());
|
||||||
|
}
|
||||||
|
|
||||||
plot->ensembleCurveSets()->addCurveSet(curveSet);
|
plot->ensembleCurveSets()->addCurveSet(curveSet);
|
||||||
plot->updateConnectedEditors();
|
plot->updateConnectedEditors();
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,14 @@ void RimEnsembleCurveSet::deleteCurve(RimSummaryCurve* curve)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RifEclipseSummaryAddress RimEnsembleCurveSet::summaryAddress() const
|
||||||
|
{
|
||||||
|
return m_yValuesCurveVariable->address();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -293,6 +301,14 @@ void RimEnsembleCurveSet::onLegendDefinitionChanged()
|
|||||||
updateCurveColors();
|
updateCurveColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEnsembleCurveSet::setSummaryCaseCollection(RimSummaryCaseCollection* sumCaseCollection)
|
||||||
|
{
|
||||||
|
m_yValuesSummaryGroup = sumCaseCollection;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -360,21 +376,6 @@ void RimEnsembleCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEnsembleCurveSet::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
void RimEnsembleCurveSet::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||||
{
|
{
|
||||||
{
|
|
||||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name");
|
|
||||||
nameGroup->setCollapsedByDefault(true);
|
|
||||||
nameGroup->add(&m_isUsingAutoName);
|
|
||||||
if (m_isUsingAutoName)
|
|
||||||
{
|
|
||||||
nameGroup->add(&m_autoGeneratedName);
|
|
||||||
m_summaryAddressNameTools->uiOrdering(uiConfigName, *nameGroup);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nameGroup->add(&m_userDefinedName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
QString curveDataGroupName = "Summary Vector";
|
QString curveDataGroupName = "Summary Vector";
|
||||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword(curveDataGroupName, "Summary Vector Y");
|
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword(curveDataGroupName, "Summary Vector Y");
|
||||||
@@ -404,11 +405,19 @@ void RimEnsembleCurveSet::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
|||||||
colorsGroup->add(&m_ensembleParameter);
|
colorsGroup->add(&m_ensembleParameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set default initial ensemble
|
|
||||||
RimProject* project = RiaApplication::instance()->project();
|
|
||||||
if (m_yValuesSummaryGroup() == nullptr && project->summaryGroups().size() == 1)
|
|
||||||
{
|
{
|
||||||
m_yValuesSummaryGroup = project->summaryGroups().front();
|
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name");
|
||||||
|
nameGroup->setCollapsedByDefault(true);
|
||||||
|
nameGroup->add(&m_isUsingAutoName);
|
||||||
|
if (m_isUsingAutoName)
|
||||||
|
{
|
||||||
|
nameGroup->add(&m_autoGeneratedName);
|
||||||
|
m_summaryAddressNameTools->uiOrdering(uiConfigName, *nameGroup);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nameGroup->add(&m_userDefinedName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uiOrdering.skipRemainingFields(true);
|
uiOrdering.skipRemainingFields(true);
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public:
|
|||||||
void addCurve(RimSummaryCurve* curve);
|
void addCurve(RimSummaryCurve* curve);
|
||||||
void deleteCurve(RimSummaryCurve* curve);
|
void deleteCurve(RimSummaryCurve* curve);
|
||||||
|
|
||||||
|
RifEclipseSummaryAddress summaryAddress() const;
|
||||||
std::vector<RimSummaryCurve*> curves() const;
|
std::vector<RimSummaryCurve*> curves() const;
|
||||||
std::vector<RimSummaryCurve*> visibleCurves() const;
|
std::vector<RimSummaryCurve*> visibleCurves() const;
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ public:
|
|||||||
RimRegularLegendConfig* legendConfig();
|
RimRegularLegendConfig* legendConfig();
|
||||||
void onLegendDefinitionChanged();
|
void onLegendDefinitionChanged();
|
||||||
|
|
||||||
|
void setSummaryCaseCollection(RimSummaryCaseCollection* sumCaseCollection);
|
||||||
RimSummaryCaseCollection* summaryCaseCollection() const;
|
RimSummaryCaseCollection* summaryCaseCollection() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -82,33 +82,30 @@ QString RimSummaryCurveAutoName::curveNameY(const RifEclipseSummaryAddress& summ
|
|||||||
|
|
||||||
appendAddressDetails(text, summaryAddress, nameHelper);
|
appendAddressDetails(text, summaryAddress, nameHelper);
|
||||||
|
|
||||||
RimEnsembleCurveSet* ensambleCurveSet = nullptr;
|
QString caseName;
|
||||||
this->firstAncestorOrThisOfType(ensambleCurveSet);
|
|
||||||
|
|
||||||
if (ensambleCurveSet)
|
|
||||||
{
|
{
|
||||||
bool skipSubString = nameHelper && nameHelper->isCaseInTitle();
|
RimEnsembleCurveSet* ensambleCurveSet = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(ensambleCurveSet);
|
||||||
if (m_caseName && !skipSubString)
|
if (ensambleCurveSet && ensambleCurveSet->summaryCaseCollection())
|
||||||
{
|
{
|
||||||
if (ensambleCurveSet && ensambleCurveSet->summaryCaseCollection())
|
caseName = ensambleCurveSet->summaryCaseCollection()->name();
|
||||||
{
|
|
||||||
if (!text.empty()) text += ", ";
|
|
||||||
text += ensambleCurveSet->summaryCaseCollection()->name().toStdString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (summaryCurve)
|
|
||||||
|
if (caseName.isEmpty() && summaryCurve && summaryCurve->summaryCaseY())
|
||||||
|
{
|
||||||
|
caseName = summaryCurve->summaryCaseY()->caseName();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!caseName.isEmpty())
|
||||||
{
|
{
|
||||||
bool skipSubString = nameHelper && nameHelper->isCaseInTitle();
|
bool skipSubString = nameHelper && nameHelper->isCaseInTitle();
|
||||||
|
|
||||||
if (m_caseName && !skipSubString)
|
if (m_caseName && !skipSubString)
|
||||||
{
|
{
|
||||||
if (summaryCurve && summaryCurve->summaryCaseY())
|
if (!text.empty()) text += ", ";
|
||||||
{
|
text += caseName.toStdString();
|
||||||
if (!text.empty()) text += ", ";
|
|
||||||
text += summaryCurve->summaryCaseY()->caseName().toStdString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,8 +139,10 @@ QString RimSummaryCurveAutoName::curveNameX(const RifEclipseSummaryAddress& summ
|
|||||||
|
|
||||||
appendAddressDetails(text, summaryAddress, nameHelper);
|
appendAddressDetails(text, summaryAddress, nameHelper);
|
||||||
|
|
||||||
if (summaryCurve)
|
if (summaryCurve && summaryCurve->summaryCaseX())
|
||||||
{
|
{
|
||||||
|
QString caseName = summaryCurve->summaryCaseX()->caseName();
|
||||||
|
|
||||||
bool skipSubString = nameHelper && nameHelper->isCaseInTitle();
|
bool skipSubString = nameHelper && nameHelper->isCaseInTitle();
|
||||||
|
|
||||||
if (m_caseName && !skipSubString)
|
if (m_caseName && !skipSubString)
|
||||||
@@ -151,7 +150,7 @@ QString RimSummaryCurveAutoName::curveNameX(const RifEclipseSummaryAddress& summ
|
|||||||
if (summaryCurve && summaryCurve->summaryCaseX())
|
if (summaryCurve && summaryCurve->summaryCaseX())
|
||||||
{
|
{
|
||||||
if (!text.empty()) text += ", ";
|
if (!text.empty()) text += ", ";
|
||||||
text += summaryCurve->summaryCaseX()->caseName().toStdString();
|
text += caseName.toStdString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1460,6 +1460,7 @@ QString RimSummaryPlot::generatePlotTitle(RimSummaryPlotNameHelper* nameHelper)
|
|||||||
|
|
||||||
std::vector<RifEclipseSummaryAddress> addresses;
|
std::vector<RifEclipseSummaryAddress> addresses;
|
||||||
std::vector<RimSummaryCase*> sumCases;
|
std::vector<RimSummaryCase*> sumCases;
|
||||||
|
std::vector<RimSummaryCaseCollection*> ensambleCases;
|
||||||
|
|
||||||
if (m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible())
|
if (m_summaryCurveCollection && m_summaryCurveCollection->isCurvesVisible())
|
||||||
{
|
{
|
||||||
@@ -1483,9 +1484,19 @@ QString RimSummaryPlot::generatePlotTitle(RimSummaryPlotNameHelper* nameHelper)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto curveSet : m_ensembleCurveSetCollection->curveSets())
|
||||||
|
{
|
||||||
|
if (curveSet->isCurvesVisible())
|
||||||
|
{
|
||||||
|
addresses.push_back(curveSet->summaryAddress());
|
||||||
|
ensambleCases.push_back(curveSet->summaryCaseCollection());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nameHelper->clear();
|
nameHelper->clear();
|
||||||
nameHelper->appendAddresses(addresses);
|
nameHelper->appendAddresses(addresses);
|
||||||
nameHelper->appendSummaryCases(sumCases);
|
nameHelper->appendSummaryCases(sumCases);
|
||||||
|
nameHelper->appendEnsembleCases(ensambleCases);
|
||||||
|
|
||||||
return nameHelper->plotTitle();
|
return nameHelper->plotTitle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#include "RifEclipseSummaryAddress.h"
|
#include "RifEclipseSummaryAddress.h"
|
||||||
|
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
|
#include "RimSummaryCaseCollection.h"
|
||||||
|
|
||||||
#include "RiuSummaryVectorDescriptionMap.h"
|
#include "RiuSummaryVectorDescriptionMap.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -29,7 +31,7 @@
|
|||||||
RimSummaryPlotNameHelper::RimSummaryPlotNameHelper() {}
|
RimSummaryPlotNameHelper::RimSummaryPlotNameHelper() {}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlotNameHelper::clear()
|
void RimSummaryPlotNameHelper::clear()
|
||||||
{
|
{
|
||||||
@@ -51,7 +53,7 @@ void RimSummaryPlotNameHelper::appendAddresses(const std::vector<RifEclipseSumma
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlotNameHelper::appendSummaryCases(const std::vector<RimSummaryCase*>& summaryCases)
|
void RimSummaryPlotNameHelper::appendSummaryCases(const std::vector<RimSummaryCase*>& summaryCases)
|
||||||
{
|
{
|
||||||
@@ -65,6 +67,21 @@ void RimSummaryPlotNameHelper::appendSummaryCases(const std::vector<RimSummaryCa
|
|||||||
extractPlotTitleSubStrings();
|
extractPlotTitleSubStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryPlotNameHelper::appendEnsembleCases(const std::vector<RimSummaryCaseCollection*>& ensembleCases)
|
||||||
|
{
|
||||||
|
m_ensembleCases.clear();
|
||||||
|
|
||||||
|
for (auto c : ensembleCases)
|
||||||
|
{
|
||||||
|
m_ensembleCases.insert(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
extractPlotTitleSubStrings();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -143,7 +160,7 @@ bool RimSummaryPlotNameHelper::isRegionInTitle() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimSummaryPlotNameHelper::isCaseInTitle() const
|
bool RimSummaryPlotNameHelper::isCaseInTitle() const
|
||||||
{
|
{
|
||||||
@@ -151,7 +168,7 @@ bool RimSummaryPlotNameHelper::isCaseInTitle() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlotNameHelper::clearTitleSubStrings()
|
void RimSummaryPlotNameHelper::clearTitleSubStrings()
|
||||||
{
|
{
|
||||||
@@ -195,11 +212,31 @@ void RimSummaryPlotNameHelper::extractPlotTitleSubStrings()
|
|||||||
m_titleRegion = std::to_string(*(regions.begin()));
|
m_titleRegion = std::to_string(*(regions.begin()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Case mane
|
|
||||||
if (m_summaryCases.size() == 1)
|
|
||||||
{
|
{
|
||||||
auto summaryCase = *(m_summaryCases.begin());
|
QString summaryCaseTitle;
|
||||||
|
if (m_summaryCases.size() == 1)
|
||||||
|
{
|
||||||
|
auto summaryCase = *(m_summaryCases.begin());
|
||||||
|
|
||||||
m_titleCaseName = summaryCase->caseName();
|
summaryCaseTitle = summaryCase->caseName();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ensembleCaseTitle;
|
||||||
|
if (m_titleCaseName.isEmpty() && m_ensembleCases.size() == 1)
|
||||||
|
{
|
||||||
|
auto ensembleCase = *(m_ensembleCases.begin());
|
||||||
|
|
||||||
|
ensembleCaseTitle = ensembleCase->name();
|
||||||
|
}
|
||||||
|
|
||||||
|
// If one case title is the single available, use the single title
|
||||||
|
if (summaryCaseTitle.isEmpty() && !ensembleCaseTitle.isEmpty())
|
||||||
|
{
|
||||||
|
m_titleCaseName = ensembleCaseTitle;
|
||||||
|
}
|
||||||
|
else if (!summaryCaseTitle.isEmpty() && ensembleCaseTitle.isEmpty())
|
||||||
|
{
|
||||||
|
m_titleCaseName = summaryCaseTitle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
class RimSummaryCurve;
|
class RimSummaryCurve;
|
||||||
class RimSummaryCase;
|
class RimSummaryCase;
|
||||||
|
class RimSummaryCaseCollection;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@@ -42,6 +43,7 @@ public:
|
|||||||
|
|
||||||
void appendAddresses(const std::vector<RifEclipseSummaryAddress>& addresses);
|
void appendAddresses(const std::vector<RifEclipseSummaryAddress>& addresses);
|
||||||
void appendSummaryCases(const std::vector<RimSummaryCase*>& summaryCases);
|
void appendSummaryCases(const std::vector<RimSummaryCase*>& summaryCases);
|
||||||
|
void appendEnsembleCases(const std::vector<RimSummaryCaseCollection*>& ensembleCases);
|
||||||
|
|
||||||
QString plotTitle() const;
|
QString plotTitle() const;
|
||||||
|
|
||||||
@@ -58,7 +60,8 @@ private:
|
|||||||
private:
|
private:
|
||||||
RiaSummaryCurveAnalyzer m_analyzer;
|
RiaSummaryCurveAnalyzer m_analyzer;
|
||||||
|
|
||||||
std::set<RimSummaryCase*> m_summaryCases;
|
std::set<RimSummaryCase*> m_summaryCases;
|
||||||
|
std::set<RimSummaryCaseCollection*> m_ensembleCases;
|
||||||
|
|
||||||
std::string m_titleQuantity;
|
std::string m_titleQuantity;
|
||||||
std::string m_titleWellName;
|
std::string m_titleWellName;
|
||||||
|
|||||||
Reference in New Issue
Block a user