diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index 0de6aada07..c532e1a57b 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -404,6 +404,8 @@ void RimWellRftPlot::updateCurvesInPlot(const std::set defineCurveColorsAndSymbols(allCurveDefs); + std::set ensemblesWithSummaryCurves; + // Add new curves for (const RiaRftPltCurveDefinition& curveDefToAdd : allCurveDefs) { @@ -428,10 +430,15 @@ void RimWellRftPlot::updateCurvesInPlot(const std::set plotTrack->addCurve(curve); auto rftCase = curveDefToAdd.address().summaryCase(); curve->setSummaryCase(rftCase); + curve->setEnsemble(curveDefToAdd.address().ensemble()); RifEclipseRftAddress address(simWellName, curveDefToAdd.timeStep(), RifEclipseRftAddress::PRESSURE); curve->setRftAddress(address); curve->setZOrder(1); applyCurveAppearance(curve); + + bool isFirstSummaryCurveInEnsemble = ensemblesWithSummaryCurves.count(curveDefToAdd.address().ensemble()) == 0u; + curve->showLegend(isFirstSummaryCurveInEnsemble); + ensemblesWithSummaryCurves.insert(curveDefToAdd.address().ensemble()); } else if (m_showStatisticsCurves && curveDefToAdd.address().sourceType() == RifDataSourceForRftPlt::ENSEMBLE_RFT) { diff --git a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp index babb89e325..9056639e6a 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogRftCurve.cpp @@ -308,14 +308,14 @@ QString RimWellLogRftCurve::createCurveAutoName() { name.push_back(m_eclipseResultCase->caseUserDescription()); } + else if (m_ensemble) // Summary RFT curves have both ensemble and summary set. Prioritize ensemble for name. + { + name.push_back(m_ensemble->name()); + } else if (m_summaryCase) { name.push_back(m_summaryCase->caseName()); } - else if (m_ensemble) - { - name.push_back(m_ensemble->name()); - } if (wellLogChannelName() != caf::AppEnum::text(RifEclipseRftAddress::NONE)) { RifEclipseRftAddress::RftWellLogChannelType channelNameEnum = @@ -592,7 +592,7 @@ RifReaderRftInterface* RimWellLogRftCurve::rftReader() const { return m_eclipseResultCase()->rftReader(); } - else if (m_summaryCase()) + else if (m_summaryCase()) // Summary RFT curves have both summary and ensemble set. Prioritize summary for reader. { return m_summaryCase()->rftReader(); }