diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp index 8e130feeb9..0649d83772 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.cpp @@ -264,7 +264,7 @@ void RimWellPlotTools::addTimeStepsToMap(std::map RimWellPlotTools::wellLogFilesContainingPressure(const QString& simWellName) +std::vector RimWellPlotTools::wellLogFilesContainingPressure(const QString& wellPathNameOrSimWellName) { std::vector wellLogFiles; const RimProject* const project = RiaApplication::instance()->project(); @@ -272,7 +272,9 @@ std::vector RimWellPlotTools::wellLogFilesContainingPressure(co for (auto wellPath : wellPaths) { - if (simWellName == wellPath->associatedSimulationWellName()) + if (!wellPathNameOrSimWellName.isEmpty() && + (wellPathNameOrSimWellName == wellPath->associatedSimulationWellName() || + wellPathNameOrSimWellName == wellPath->name())) { const std::vector files = wellPath->wellLogFiles(); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h index e0adcb1a49..48545d81c5 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPlotTools.h @@ -65,7 +65,7 @@ public: static std::pair pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData); static void addTimeStepsToMap(std::map>& destMap, const std::map>& timeStepsToAdd); - static std::vector wellLogFilesContainingPressure(const QString& simWellName); + static std::vector wellLogFilesContainingPressure(const QString& wellPathNameOrSimWellName); static RimWellLogFileChannel* getPressureChannelFromWellFile(const RimWellLogFile* wellLogFile); static RimWellPath* wellPathFromWellLogFile(const RimWellLogFile* wellLogFile); static std::set timeStepsFromRftCase(RimEclipseResultCase* rftCase, const QString& simWellName); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index b57c9241de..99c0c168e7 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -295,7 +295,7 @@ void RimWellRftPlot::applyInitialSelections() RimWellPlotTools::appendSet(gridTimeSteps, RimWellPlotTools::timeStepsFromGridCase(gridCase)); } - std::vector wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure(simWellName); + std::vector wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure(m_wellPathNameOrSimWellName); if(wellLogFiles.size() > 0) { sourcesToSelect.push_back(RifDataSourceForRftPlt(RifDataSourceForRftPlt::OBSERVED)); @@ -541,7 +541,7 @@ std::vector RimWellRftPlot::selectedSourcesExpanded() co { if (addr.sourceType() == RifDataSourceForRftPlt::OBSERVED) { - for (RimWellLogFile* const wellLogFile : RimWellPlotTools::wellLogFilesContainingPressure(associatedSimWellName())) + for (RimWellLogFile* const wellLogFile : RimWellPlotTools::wellLogFilesContainingPressure(m_wellPathNameOrSimWellName)) { sources.push_back(RifDataSourceForRftPlt(RifDataSourceForRftPlt::OBSERVED, wellLogFile)); } @@ -582,6 +582,10 @@ RimWellLogPlot* RimWellRftPlot::wellLogPlot() const void RimWellRftPlot::setSimWellOrWellPathName(const QString& currWellName) { m_wellPathNameOrSimWellName = currWellName; + if (m_wellPathNameOrSimWellName().isEmpty()) + { + m_wellPathNameOrSimWellName = "None"; + } } //-------------------------------------------------------------------------------------------------- @@ -649,7 +653,7 @@ QList RimWellRftPlot::calculateValueOptions(const caf::P options.push_back(item); } - if (RimWellPlotTools::wellLogFilesContainingPressure(simWellName).size() > 0) + if (RimWellPlotTools::wellLogFilesContainingPressure(m_wellPathNameOrSimWellName).size() > 0) { options.push_back(caf::PdmOptionItemInfo::createHeader(RifDataSourceForRftPlt::sourceTypeUiText(RifDataSourceForRftPlt::OBSERVED), true)); @@ -799,6 +803,8 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList { RimProject * proj = RiaApplication::instance()->project(); + options.push_back(caf::PdmOptionItemInfo("None", "None")); + if (proj != nullptr) { const std::vector simWellNames = proj->simulationWellNames(); @@ -830,8 +836,6 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList options.push_back(caf::PdmOptionItemInfo(wellName.first, wellName.second)); } } - - options.push_back(caf::PdmOptionItemInfo("None", "None")); } //--------------------------------------------------------------------------------------------------