#2282 RFT plot. Fix strange behavior

This commit is contained in:
Bjørn Erik Jensen 2017-12-21 09:39:26 +01:00
parent ea362ad154
commit 6beb217882
3 changed files with 14 additions and 8 deletions

View File

@ -264,7 +264,7 @@ void RimWellPlotTools::addTimeStepsToMap(std::map<QDateTime, std::set<RifDataSou
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure(const QString& simWellName)
std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure(const QString& wellPathNameOrSimWellName)
{
std::vector<RimWellLogFile*> wellLogFiles;
const RimProject* const project = RiaApplication::instance()->project();
@ -272,7 +272,9 @@ std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingPressure(co
for (auto wellPath : wellPaths)
{
if (simWellName == wellPath->associatedSimulationWellName())
if (!wellPathNameOrSimWellName.isEmpty() &&
(wellPathNameOrSimWellName == wellPath->associatedSimulationWellName() ||
wellPathNameOrSimWellName == wellPath->name()))
{
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();

View File

@ -65,7 +65,7 @@ public:
static std::pair<size_t, QString> pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData);
static void addTimeStepsToMap(std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd);
static std::vector<RimWellLogFile*> wellLogFilesContainingPressure(const QString& simWellName);
static std::vector<RimWellLogFile*> wellLogFilesContainingPressure(const QString& wellPathNameOrSimWellName);
static RimWellLogFileChannel* getPressureChannelFromWellFile(const RimWellLogFile* wellLogFile);
static RimWellPath* wellPathFromWellLogFile(const RimWellLogFile* wellLogFile);
static std::set<QDateTime> timeStepsFromRftCase(RimEclipseResultCase* rftCase, const QString& simWellName);

View File

@ -295,7 +295,7 @@ void RimWellRftPlot::applyInitialSelections()
RimWellPlotTools::appendSet(gridTimeSteps, RimWellPlotTools::timeStepsFromGridCase(gridCase));
}
std::vector<RimWellLogFile*> wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure(simWellName);
std::vector<RimWellLogFile*> wellLogFiles = RimWellPlotTools::wellLogFilesContainingPressure(m_wellPathNameOrSimWellName);
if(wellLogFiles.size() > 0)
{
sourcesToSelect.push_back(RifDataSourceForRftPlt(RifDataSourceForRftPlt::OBSERVED));
@ -541,7 +541,7 @@ std::vector<RifDataSourceForRftPlt> 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<caf::PdmOptionItemInfo> 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<caf::PdmOptionItemInfo>
{
RimProject * proj = RiaApplication::instance()->project();
options.push_back(caf::PdmOptionItemInfo("None", "None"));
if (proj != nullptr)
{
const std::vector<QString> simWellNames = proj->simulationWellNames();
@ -830,8 +836,6 @@ void RimWellRftPlot::calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>
options.push_back(caf::PdmOptionItemInfo(wellName.first, wellName.second));
}
}
options.push_back(caf::PdmOptionItemInfo("None", "None"));
}
//--------------------------------------------------------------------------------------------------