diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp index 53baa81c96..a08fc14615 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp @@ -682,7 +682,7 @@ bool RimWellPlotTools::tryMatchChannelName(const std::set& channelNames /// //-------------------------------------------------------------------------------------------------- std::set - RimWellPlotTools::curveDefsFromTimesteps(const QString& simWellName, + RimWellPlotTools::curveDefsFromTimesteps(const QString& wellPathNameOrSimWellName, const std::vector& selectedTimeSteps, bool firstSimWellTimeStepIsValid, const std::vector& selectedSourcesExpanded, @@ -692,6 +692,8 @@ std::set std::set selectedTimeStepSet(selectedTimeSteps.begin(), selectedTimeSteps.end()); + const QString simWellName = RimWellPlotTools::simWellName(wellPathNameOrSimWellName); + for (const RifDataSourceForRftPlt& addr : selectedSourcesExpanded) { if (addr.sourceType() == RifDataSourceForRftPlt::RFT && addr.rftReader()) @@ -733,12 +735,12 @@ std::set RimObservedFmuRftData* observedFmuRftData = addr.observedFmuRftData(); if (observedFmuRftData && observedFmuRftData->rftReader()) { - std::set timeSteps = observedFmuRftData->rftReader()->availableTimeSteps(simWellName); + std::set timeSteps = observedFmuRftData->rftReader()->availableTimeSteps(wellPathNameOrSimWellName); for (const QDateTime& time : timeSteps) { if (selectedTimeStepSet.count(time)) { - curveDefs.insert(RiaRftPltCurveDefinition(addr, simWellName, time)); + curveDefs.insert(RiaRftPltCurveDefinition(addr, wellPathNameOrSimWellName, time)); } } } @@ -753,22 +755,22 @@ std::set { RifDataSourceForRftPlt summaryAddr(RifDataSourceForRftPlt::SUMMARY_RFT, summaryCase, addr.ensemble()); - std::set timeSteps = summaryCase->rftReader()->availableTimeSteps(simWellName); + std::set timeSteps = summaryCase->rftReader()->availableTimeSteps(wellPathNameOrSimWellName); for (const QDateTime& time : timeSteps) { if (selectedTimeStepSet.count(time)) { - curveDefs.insert(RiaRftPltCurveDefinition(summaryAddr, simWellName, time)); + curveDefs.insert(RiaRftPltCurveDefinition(summaryAddr, wellPathNameOrSimWellName, time)); } } } } - std::set statTimeSteps = addr.ensemble()->rftTimeStepsForWell(simWellName); + std::set statTimeSteps = addr.ensemble()->rftTimeStepsForWell(wellPathNameOrSimWellName); for (const QDateTime& time : statTimeSteps) { if (selectedTimeStepSet.count(time)) { - curveDefs.insert(RiaRftPltCurveDefinition(addr, simWellName, time)); + curveDefs.insert(RiaRftPltCurveDefinition(addr, wellPathNameOrSimWellName, time)); } } } @@ -928,6 +930,8 @@ std::map> RimWellPlotTools::calculat { bool addFirstTimestep = (interestingRFTResults.count(RifEclipseRftAddress::PRESSURE) == 1); + const QString simWellName = RimWellPlotTools::simWellName(wellPathNameOrSimWellName); + bool hasObservedData = false; bool hasRftData = false; bool hasGridData = false; @@ -990,7 +994,7 @@ std::map> RimWellPlotTools::calculat if (source.sourceType() == RifDataSourceForRftPlt::RFT && source.rftReader()) { std::set rftTimes = - source.rftReader()->availableTimeSteps(wellPathNameOrSimWellName, interestingRFTResults); + source.rftReader()->availableTimeSteps(simWellName, interestingRFTResults); for (const QDateTime& date : rftTimes) { rftTimeStepsWithSources[date].insert(source); @@ -1006,7 +1010,7 @@ std::map> RimWellPlotTools::calculat if (source.sourceType() == RifDataSourceForRftPlt::GRID && source.eclCase()) { std::set wellTimeSteps = - RimWellPlotTools::availableSimWellTimesteps(source.eclCase(), wellPathNameOrSimWellName, addFirstTimestep); + RimWellPlotTools::availableSimWellTimesteps(source.eclCase(), simWellName, addFirstTimestep); for (const QDateTime& date : wellTimeSteps) { diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h index d96173c106..985675f034 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h @@ -100,7 +100,7 @@ public: const std::set& interestingRFTResults, QList& options); - static std::set < RiaRftPltCurveDefinition > curveDefsFromTimesteps(const QString& simWellName, + static std::set < RiaRftPltCurveDefinition > curveDefsFromTimesteps(const QString& wellPathNameOrSimWellName, const std::vector& selectedTimeStepVector, bool firstReportTimeStepIsValid, const std::vector& selectedSourcesExpanded, diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index 152ba79009..1d6f795075 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -241,7 +241,7 @@ void RimWellRftPlot::applyInitialSelections() sourcesToSelect.push_back(RifDataSourceForRftPlt(RifDataSourceForRftPlt::GRID, gridCase)); } - for (RimSummaryCaseCollection* const ensemble : RimWellPlotTools::rftEnsemblesForWell(simWellName)) + for (RimSummaryCaseCollection* const ensemble : RimWellPlotTools::rftEnsemblesForWell(m_wellPathNameOrSimWellName)) { sourcesToSelect.push_back(RifDataSourceForRftPlt(RifDataSourceForRftPlt::ENSEMBLE_RFT, ensemble)); } @@ -266,7 +266,7 @@ void RimWellRftPlot::applyInitialSelections() std::set channelTypesToUse = RifEclipseRftAddress::rftPlotChannelTypes(); auto relevantTimeSteps = - RimWellPlotTools::calculateRelevantTimeStepsFromCases(associatedSimWellName(), m_selectedSources, channelTypesToUse); + RimWellPlotTools::calculateRelevantTimeStepsFromCases(m_wellPathNameOrSimWellName, m_selectedSources, channelTypesToUse); std::vector timeStepVector; for (const auto& item : relevantTimeSteps) @@ -378,7 +378,7 @@ std::set RimWellRftPlot::selectedCurveDefs() const std::set channelTypesToUse = RifEclipseRftAddress::rftPlotChannelTypes(); return RimWellPlotTools::curveDefsFromTimesteps( - associatedSimWellName(), m_selectedTimeSteps.v(), true, selectedSourcesExpanded(), channelTypesToUse); + m_wellPathNameOrSimWellName, m_selectedTimeSteps.v(), true, selectedSourcesExpanded(), channelTypesToUse); } //-------------------------------------------------------------------------------------------------- @@ -438,7 +438,7 @@ void RimWellRftPlot::updateCurvesInPlot(const std::set auto observedFmuRftData = curveDefToAdd.address().observedFmuRftData(); curve->setObservedFmuRftData(observedFmuRftData); - RifEclipseRftAddress address(simWellName, curveDefToAdd.timeStep(), RifEclipseRftAddress::PRESSURE); + RifEclipseRftAddress address(m_wellPathNameOrSimWellName, curveDefToAdd.timeStep(), RifEclipseRftAddress::PRESSURE); curve->setRftAddress(address); curve->setZOrder(RiuQwtPlotCurve::Z_SINGLE_CURVE_OBSERVED); applyCurveAppearance(curve); @@ -450,7 +450,7 @@ void RimWellRftPlot::updateCurvesInPlot(const std::set auto rftCase = curveDefToAdd.address().summaryCase(); curve->setSummaryCase(rftCase); curve->setEnsemble(curveDefToAdd.address().ensemble()); - RifEclipseRftAddress address(simWellName, curveDefToAdd.timeStep(), RifEclipseRftAddress::PRESSURE); + RifEclipseRftAddress address(m_wellPathNameOrSimWellName, curveDefToAdd.timeStep(), RifEclipseRftAddress::PRESSURE); curve->setRftAddress(address); curve->setZOrder(1); applyCurveAppearance(curve); @@ -463,7 +463,7 @@ void RimWellRftPlot::updateCurvesInPlot(const std::set { RimSummaryCaseCollection* ensemble = curveDefToAdd.address().ensemble(); std::set rftAddresses = - ensemble->rftStatisticsReader()->eclipseRftAddresses(simWellName, curveDefToAdd.timeStep()); + ensemble->rftStatisticsReader()->eclipseRftAddresses(m_wellPathNameOrSimWellName, curveDefToAdd.timeStep()); for (auto rftAddress : rftAddresses) { if (rftAddress.wellLogChannel() != RifEclipseRftAddress::TVD) @@ -691,7 +691,7 @@ QList RimWellRftPlot::calculateValueOptions(const caf::P } } - const std::vector rftEnsembles = RimWellPlotTools::rftEnsemblesForWell(simWellName); + const std::vector rftEnsembles = RimWellPlotTools::rftEnsemblesForWell(m_wellPathNameOrSimWellName); if (!rftEnsembles.empty()) { options.push_back(caf::PdmOptionItemInfo::createHeader( @@ -731,8 +731,7 @@ QList RimWellRftPlot::calculateValueOptions(const caf::P item.setLevel(1); options.push_back(item); } - - const std::vector observedFmuRftCases = RimWellPlotTools::observedFmuRftDataForWell(simWellName); + const std::vector observedFmuRftCases = RimWellPlotTools::observedFmuRftDataForWell(m_wellPathNameOrSimWellName); if (!observedFmuRftCases.empty()) { options.push_back(caf::PdmOptionItemInfo::createHeader( @@ -753,7 +752,7 @@ QList RimWellRftPlot::calculateValueOptions(const caf::P std::set channelTypesToUse = RifEclipseRftAddress::rftPlotChannelTypes(); RimWellPlotTools::calculateValueOptionsForTimeSteps( - associatedSimWellName(), selectedSourcesExpanded(), channelTypesToUse, options); + m_wellPathNameOrSimWellName, selectedSourcesExpanded(), channelTypesToUse, options); } else if (fieldNeedingOptions == &m_branchIndex) { @@ -898,14 +897,14 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList if (proj != nullptr) { - const std::vector simWellNames = proj->simulationWellNames(); - std::set simWellsAssociatedWithWellPath; - std::set> wellNames; + const std::vector simWellNames = proj->simulationWellNames(); + std::set simWellsAssociatedWithWellPath; + std::map wellNames; // Observed wells for (RimWellPath* const wellPath : proj->allWellPaths()) { - wellNames.insert(std::make_pair(wellPath->name() + " (Well Path)", wellPath->name())); + wellNames[wellPath->name()].push_back("Well Path"); if (!wellPath->associatedSimulationWellName().isEmpty()) { @@ -918,25 +917,23 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList { if (simWellsAssociatedWithWellPath.count(simWellName) == 0) { - wellNames.insert(std::make_pair(simWellName, simWellName)); + wellNames[simWellName].push_back("Sim.Well"); } } - - // Ensemble RFT wells const std::vector rftEnsembles = RimWellPlotTools::rftEnsembles(); - if (!rftEnsembles.empty()) + // Ensemble RFT wells { for (RimSummaryCaseCollection* summaryCaseColl : rftEnsembles) { std::set wellsWithRftData = summaryCaseColl->wellsWithRftData(); for (QString wellName : wellsWithRftData) { - wellNames.insert(std::make_pair(wellName, wellName)); + wellNames[wellName].push_back("Ensemble"); } } } - // Observer FMU RFT wells + // Observed FMU RFT wells const std::vector allRftFmuData = RimWellPlotTools::observedFmuRftData(); if (!allRftFmuData.empty()) { @@ -944,14 +941,21 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList { for (QString wellName : rftFmuData->wells()) { - wellNames.insert(std::make_pair(wellName, wellName)); + wellNames[wellName].push_back("Observed"); } } } for (const auto& wellName : wellNames) { - options.push_back(caf::PdmOptionItemInfo(wellName.first, wellName.second)); + const QStringList& tags = wellName.second; + QString uiText = wellName.first; + if (!tags.empty()) + { + uiText += QString(" (%1)").arg(wellName.second.join(", ")); + } + + options.push_back(caf::PdmOptionItemInfo(uiText, wellName.first)); } } }