2017-09-27 05:39:28 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimWellRftPlot.h"
|
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
2017-10-12 04:44:21 -05:00
|
|
|
#include "RiaColorTables.h"
|
|
|
|
#include "RiaDateStringParser.h"
|
|
|
|
#include "RifReaderEclipseRft.h"
|
|
|
|
#include "RigCaseCellResultsData.h"
|
2017-09-27 05:39:28 -05:00
|
|
|
#include "RigEclipseCaseData.h"
|
2017-10-13 06:44:53 -05:00
|
|
|
#include "RigSimWellData.h"
|
2017-10-12 04:44:21 -05:00
|
|
|
#include "RigWellPath.h"
|
2017-09-27 05:39:28 -05:00
|
|
|
#include "RimEclipseCase.h"
|
2017-10-12 04:44:21 -05:00
|
|
|
#include "RimEclipseCaseCollection.h"
|
2017-09-27 05:39:28 -05:00
|
|
|
#include "RimEclipseResultCase.h"
|
2017-10-12 04:44:21 -05:00
|
|
|
#include "RimEclipseResultDefinition.h"
|
2017-09-29 04:24:18 -05:00
|
|
|
#include "RimOilField.h"
|
2017-10-12 04:44:21 -05:00
|
|
|
#include "RimProject.h"
|
|
|
|
#include "RimTools.h"
|
|
|
|
#include "RimWellLogExtractionCurve.h"
|
2017-09-29 04:24:18 -05:00
|
|
|
#include "RimWellLogFile.h"
|
|
|
|
#include "RimWellLogFileChannel.h"
|
2017-10-03 06:54:07 -05:00
|
|
|
#include "RimWellLogFileCurve.h"
|
2017-10-12 04:44:21 -05:00
|
|
|
#include "RimWellLogPlot.h"
|
2017-10-06 07:20:01 -05:00
|
|
|
#include "RimWellLogRftCurve.h"
|
2017-10-12 04:44:21 -05:00
|
|
|
#include "RimWellLogTrack.h"
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RimWellPathCollection.h"
|
|
|
|
#include "RiuWellRftPlot.h"
|
|
|
|
#include "cafPdmUiTreeSelectionEditor.h"
|
2017-10-06 07:20:01 -05:00
|
|
|
#include <tuple>
|
2017-10-13 07:32:26 -05:00
|
|
|
#include <algorithm>
|
|
|
|
#include <iterator>
|
2017-09-27 05:39:28 -05:00
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimWellRftPlot, "WellRftPlot");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-04 07:36:33 -05:00
|
|
|
const char RimWellRftPlot::PRESSURE_DATA_NAME[] = "PRESSURE";
|
2017-10-05 09:25:04 -05:00
|
|
|
const char RimWellRftPlot::PLOT_NAME_QFORMAT_STRING[] = "RFT: %1";
|
2017-09-27 05:39:28 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellRftPlot::RimWellRftPlot()
|
|
|
|
{
|
|
|
|
CAF_PDM_InitObject("Well Allocation Plot", ":/WellAllocPlot16x16.png", "", "");
|
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
CAF_PDM_InitField(&m_userName, "PlotDescription", QString("RFT Plot"), "Name", "", "", "");
|
2017-09-27 05:39:28 -05:00
|
|
|
m_userName.uiCapability()->setUiReadOnly(true);
|
|
|
|
|
|
|
|
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
|
|
|
|
|
2017-09-27 07:05:14 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_wellLogPlot, "WellLog", "WellLog", "", "", "");
|
|
|
|
m_wellLogPlot.uiCapability()->setUiHidden(true);
|
|
|
|
m_wellLogPlot = new RimWellLogPlot();
|
2017-10-16 07:01:45 -05:00
|
|
|
m_wellLogPlot->setDepthType(RimWellLogPlot::TRUE_VERTICAL_DEPTH);
|
2017-09-27 07:05:14 -05:00
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_wellName, "WellName", "WellName", "", "", "");
|
2017-10-24 02:02:14 -05:00
|
|
|
CAF_PDM_InitField(&m_branchIndex, "BranchIndex", 0, "BranchIndex", "", "", "");
|
2017-09-27 07:05:14 -05:00
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_selectedSources, "Sources", "Sources", "", "", "");
|
|
|
|
m_selectedSources.uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
|
2017-10-05 03:54:52 -05:00
|
|
|
m_selectedSources.xmlCapability()->disableIO();
|
2017-09-29 04:24:18 -05:00
|
|
|
m_selectedSources.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
2017-10-05 03:54:52 -05:00
|
|
|
m_selectedSources.uiCapability()->setAutoAddingOptionFromValue(false);
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_selectedTimeSteps, "TimeSteps", "TimeSteps", "", "", "");
|
|
|
|
m_selectedTimeSteps.uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
|
2017-10-05 03:54:52 -05:00
|
|
|
m_selectedTimeSteps.xmlCapability()->disableIO();
|
2017-09-29 04:24:18 -05:00
|
|
|
m_selectedTimeSteps.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
2017-10-05 03:54:52 -05:00
|
|
|
m_selectedTimeSteps.uiCapability()->setAutoAddingOptionFromValue(false);
|
2017-10-02 02:40:33 -05:00
|
|
|
|
|
|
|
this->setAsPlotMdiWindow();
|
2017-10-19 09:12:22 -05:00
|
|
|
m_selectedSourcesOrTimeStepsFieldsChanged = false;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellRftPlot::~RimWellRftPlot()
|
|
|
|
{
|
|
|
|
removeMdiWindowFromMdiArea();
|
|
|
|
|
|
|
|
deleteViewWidget();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellRftPlot::deleteViewWidget()
|
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
if (m_wellLogPlotWidget)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
m_wellLogPlotWidget->deleteLater();
|
|
|
|
m_wellLogPlotWidget = nullptr;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-09 03:51:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellRftPlot::applyCurveAppearance(RimWellLogCurve* newCurve)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::pair<RifWellRftAddress, QDateTime>& newCurveDef = curveDefFromCurve(newCurve);
|
2017-10-09 03:51:07 -05:00
|
|
|
|
|
|
|
std::vector<cvf::Color3f> colorTable;
|
|
|
|
RiaColorTables::summaryCurveDefaultPaletteColors().color3fArray().toStdVector(&colorTable);
|
|
|
|
|
|
|
|
std::vector<RimPlotCurve::PointSymbolEnum> symbolTable =
|
|
|
|
{
|
|
|
|
RimPlotCurve::SYMBOL_ELLIPSE,
|
|
|
|
RimPlotCurve::SYMBOL_RECT,
|
|
|
|
RimPlotCurve::SYMBOL_DIAMOND,
|
|
|
|
RimPlotCurve::SYMBOL_TRIANGLE,
|
|
|
|
RimPlotCurve::SYMBOL_CROSS,
|
|
|
|
RimPlotCurve::SYMBOL_XCROSS
|
|
|
|
};
|
|
|
|
|
2017-10-17 02:17:09 -05:00
|
|
|
// State variables
|
|
|
|
static size_t defaultColorTableIndex = 0;
|
|
|
|
static size_t defaultSymbolTableIndex = 0;
|
|
|
|
|
2017-10-09 03:51:07 -05:00
|
|
|
cvf::Color3f currentColor;
|
2017-10-17 02:17:09 -05:00
|
|
|
RimPlotCurve::PointSymbolEnum currentSymbol = symbolTable.front();
|
2017-10-09 03:51:07 -05:00
|
|
|
RimPlotCurve::LineStyleEnum currentLineStyle = RimPlotCurve::STYLE_SOLID;
|
|
|
|
bool isCurrentColorSet = false;
|
|
|
|
bool isCurrentSymbolSet = false;
|
|
|
|
|
|
|
|
std::set<cvf::Color3f> assignedColors;
|
|
|
|
std::set<RimPlotCurve::PointSymbolEnum> assignedSymbols;
|
|
|
|
|
|
|
|
// Used colors and symbols
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimWellLogCurve* const curve : m_wellLogPlot->trackByIndex(0)->curvesVector())
|
2017-10-09 03:51:07 -05:00
|
|
|
{
|
|
|
|
if (curve == newCurve) continue;
|
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
std::pair<RifWellRftAddress, QDateTime> cDef = curveDefFromCurve(curve);
|
2017-10-09 03:51:07 -05:00
|
|
|
if (cDef.first == newCurveDef.first)
|
|
|
|
{
|
|
|
|
currentColor = curve->color();
|
|
|
|
isCurrentColorSet = true;
|
|
|
|
}
|
|
|
|
if (cDef.second == newCurveDef.second)
|
|
|
|
{
|
|
|
|
currentSymbol = curve->symbol();
|
|
|
|
isCurrentSymbolSet = true;
|
|
|
|
}
|
|
|
|
assignedColors.insert(curve->color());
|
|
|
|
assignedSymbols.insert(curve->symbol());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Assign color
|
|
|
|
if (!isCurrentColorSet)
|
|
|
|
{
|
|
|
|
for(const auto& color : colorTable)
|
|
|
|
{
|
|
|
|
if (assignedColors.count(color) == 0)
|
|
|
|
{
|
|
|
|
currentColor = color;
|
|
|
|
isCurrentColorSet = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isCurrentColorSet)
|
|
|
|
{
|
2017-10-17 02:17:09 -05:00
|
|
|
currentColor = colorTable[defaultColorTableIndex];
|
|
|
|
if (++defaultColorTableIndex == colorTable.size())
|
|
|
|
defaultColorTableIndex = 0;
|
|
|
|
|
2017-10-09 03:51:07 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Assign symbol
|
|
|
|
if (!isCurrentSymbolSet)
|
|
|
|
{
|
|
|
|
for (const auto& symbol : symbolTable)
|
|
|
|
{
|
|
|
|
if (assignedSymbols.count(symbol) == 0)
|
|
|
|
{
|
|
|
|
currentSymbol = symbol;
|
|
|
|
isCurrentSymbolSet = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isCurrentSymbolSet)
|
|
|
|
{
|
2017-10-17 02:17:09 -05:00
|
|
|
currentSymbol = symbolTable[defaultSymbolTableIndex];
|
|
|
|
if (++defaultSymbolTableIndex == symbolTable.size())
|
|
|
|
defaultSymbolTableIndex = 0;
|
2017-10-09 03:51:07 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Observed data
|
2017-10-26 03:35:23 -05:00
|
|
|
currentLineStyle = newCurveDef.first.sourceType() == RifWellRftAddress::OBSERVED
|
2017-10-09 03:51:07 -05:00
|
|
|
? RimPlotCurve::STYLE_NONE : RimPlotCurve::STYLE_SOLID;
|
|
|
|
|
|
|
|
newCurve->setColor(currentColor);
|
|
|
|
newCurve->setSymbol(currentSymbol);
|
|
|
|
newCurve->setLineStyle(currentLineStyle);
|
|
|
|
}
|
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-17 06:35:12 -05:00
|
|
|
void RimWellRftPlot::updateSelectedTimeStepsFromSelectedSources()
|
|
|
|
{
|
|
|
|
std::vector<QDateTime> newTimeStepsSelections;
|
2017-10-26 03:35:23 -05:00
|
|
|
std::vector<RifWellRftAddress> selectedSourcesVector = selectedSources();
|
|
|
|
auto selectedSources = std::set<RifWellRftAddress>(selectedSourcesVector.begin(), selectedSourcesVector.end());
|
2017-10-17 06:35:12 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const QDateTime& timeStep : m_selectedTimeSteps())
|
2017-10-17 06:35:12 -05:00
|
|
|
{
|
|
|
|
if(m_timeStepsToAddresses.count(timeStep) > 0)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::vector<RifWellRftAddress> intersectVector;
|
|
|
|
const std::set<RifWellRftAddress>& addresses = m_timeStepsToAddresses[timeStep];
|
2017-10-17 06:35:12 -05:00
|
|
|
std::set_intersection(selectedSources.begin(), selectedSources.end(),
|
|
|
|
addresses.begin(), addresses.end(), std::inserter(intersectVector, intersectVector.end()));
|
|
|
|
if(intersectVector.size() > 0)
|
|
|
|
{
|
|
|
|
newTimeStepsSelections.push_back(timeStep);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_selectedTimeSteps = newTimeStepsSelections;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-17 04:01:15 -05:00
|
|
|
void RimWellRftPlot::applyInitialSelections()
|
|
|
|
{
|
|
|
|
std::vector<std::tuple<RimEclipseResultCase*, bool, bool>> eclCaseTuples = eclipseCasesForWell(m_wellName);
|
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
std::vector<RifWellRftAddress> sourcesToSelect;
|
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> rftTimeStepsMap;
|
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> observedTimeStepsMap;
|
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> gridTimeStepsMap;
|
2017-10-17 04:01:15 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for(RimEclipseResultCase* const rftCase : rftCasesFromEclipseCases(eclCaseTuples))
|
2017-10-17 04:01:15 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
sourcesToSelect.push_back(RifWellRftAddress(RifWellRftAddress::RFT, rftCase));
|
2017-10-18 03:55:19 -05:00
|
|
|
addTimeStepsToMap(rftTimeStepsMap, timeStepsFromRftCase(rftCase));
|
2017-10-17 04:01:15 -05:00
|
|
|
}
|
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimEclipseResultCase* const gridCase : gridCasesFromEclipseCases(eclCaseTuples))
|
2017-10-17 04:01:15 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
sourcesToSelect.push_back(RifWellRftAddress(RifWellRftAddress::GRID, gridCase));
|
2017-10-18 03:55:19 -05:00
|
|
|
addTimeStepsToMap(gridTimeStepsMap, timeStepsFromGridCase(gridCase));
|
2017-10-17 04:01:15 -05:00
|
|
|
}
|
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
std::vector<RimWellLogFile*> wellLogFiles = wellLogFilesContainingPressure(m_wellName);
|
|
|
|
if(wellLogFiles.size() > 0)
|
2017-10-17 04:01:15 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
sourcesToSelect.push_back(RifWellRftAddress(RifWellRftAddress::OBSERVED));
|
2017-10-19 09:12:22 -05:00
|
|
|
for (RimWellLogFile* const wellLogFile : wellLogFiles)
|
|
|
|
{
|
|
|
|
addTimeStepsToMap(observedTimeStepsMap, timeStepsFromWellLogFile(wellLogFile));
|
|
|
|
}
|
2017-10-17 04:01:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_selectedSources = sourcesToSelect;
|
|
|
|
|
|
|
|
std::set<QDateTime> timeStepsToSelect;
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const std::pair<QDateTime, std::set<RifWellRftAddress>>& dateTimePair : rftTimeStepsMap)
|
2017-10-17 04:01:15 -05:00
|
|
|
{
|
|
|
|
timeStepsToSelect.insert(dateTimePair.first);
|
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const std::pair<QDateTime, std::set<RifWellRftAddress>>& dateTimePair : observedTimeStepsMap)
|
2017-10-17 04:01:15 -05:00
|
|
|
{
|
|
|
|
timeStepsToSelect.insert(dateTimePair.first);
|
|
|
|
}
|
2017-10-18 03:55:19 -05:00
|
|
|
if (gridTimeStepsMap.size() > 0)
|
|
|
|
timeStepsToSelect.insert((*gridTimeStepsMap.begin()).first);
|
2017-10-17 04:01:15 -05:00
|
|
|
|
|
|
|
m_selectedTimeSteps = std::vector<QDateTime>(timeStepsToSelect.begin(), timeStepsToSelect.end());
|
|
|
|
|
|
|
|
syncCurvesFromUiSelection();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-05 03:54:52 -05:00
|
|
|
void RimWellRftPlot::updateEditorsFromCurves()
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::set<RifWellRftAddress> selectedSources;
|
2017-10-13 07:32:26 -05:00
|
|
|
std::set<QDateTime> selectedTimeSteps;
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> selectedTimeStepsMap;
|
2017-10-05 03:54:52 -05:00
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const std::pair<RifWellRftAddress, QDateTime>& curveDef : curveDefsFromCurves())
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
if (curveDef.first.sourceType() == RifWellRftAddress::OBSERVED)
|
|
|
|
selectedSources.insert(RifWellRftAddress(RifWellRftAddress::OBSERVED));
|
2017-10-19 09:12:22 -05:00
|
|
|
else
|
|
|
|
selectedSources.insert(curveDef.first);
|
2017-10-13 07:32:26 -05:00
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
auto newTimeStepMap = std::map<QDateTime, std::set<RifWellRftAddress>>
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
{ curveDef.second, std::set<RifWellRftAddress> { curveDef.first} }
|
2017-10-13 07:32:26 -05:00
|
|
|
};
|
|
|
|
addTimeStepsToMap(selectedTimeStepsMap, newTimeStepMap);
|
2017-10-05 03:54:52 -05:00
|
|
|
selectedTimeSteps.insert(curveDef.second);
|
|
|
|
}
|
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
m_selectedSources = std::vector<RifWellRftAddress>(selectedSources.begin(), selectedSources.end());
|
2017-10-05 03:54:52 -05:00
|
|
|
m_selectedTimeSteps = std::vector<QDateTime>(selectedTimeSteps.begin(), selectedTimeSteps.end());
|
2017-10-13 07:32:26 -05:00
|
|
|
addTimeStepsToMap(m_timeStepsToAddresses, selectedTimeStepsMap);
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellRftPlot::updateWidgetTitleWindowTitle()
|
|
|
|
{
|
|
|
|
updateMdiWindowTitle();
|
|
|
|
|
2017-09-27 07:05:14 -05:00
|
|
|
if (m_wellLogPlotWidget)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
|
|
|
if (m_showPlotTitle)
|
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
m_wellLogPlotWidget->showTitle(m_userName);
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
m_wellLogPlotWidget->hideTitle();
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-03 01:19:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-05 09:25:04 -05:00
|
|
|
void RimWellRftPlot::syncCurvesFromUiSelection()
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
RimWellLogTrack* plotTrack = m_wellLogPlot->trackByIndex(0);
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::set<std::pair<RifWellRftAddress, QDateTime>>& allCurveDefs = selectedCurveDefs();
|
|
|
|
const std::set<std::pair<RifWellRftAddress, QDateTime>>& curveDefsInPlot = curveDefsFromCurves();
|
2017-10-05 03:54:52 -05:00
|
|
|
std::set<RimWellLogCurve*> curvesToDelete;
|
2017-10-26 03:35:23 -05:00
|
|
|
std::set<std::pair<RifWellRftAddress, QDateTime>> newCurveDefs;
|
2017-10-04 07:36:33 -05:00
|
|
|
|
2017-10-05 03:54:52 -05:00
|
|
|
if (allCurveDefs.size() < curveDefsInPlot.size())
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-05 03:54:52 -05:00
|
|
|
// Determine which curves to delete from plot
|
2017-10-26 03:35:23 -05:00
|
|
|
std::set<std::pair<RifWellRftAddress, QDateTime>> deleteCurveDefs;
|
2017-10-05 03:54:52 -05:00
|
|
|
std::set_difference(curveDefsInPlot.begin(), curveDefsInPlot.end(),
|
|
|
|
allCurveDefs.begin(), allCurveDefs.end(),
|
|
|
|
std::inserter(deleteCurveDefs, deleteCurveDefs.end()));
|
2017-10-04 07:36:33 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimWellLogCurve* const curve : plotTrack->curvesVector())
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::pair<RifWellRftAddress, QDateTime> curveDef = curveDefFromCurve(curve);
|
2017-10-05 03:54:52 -05:00
|
|
|
if (deleteCurveDefs.count(curveDef) > 0)
|
|
|
|
curvesToDelete.insert(curve);
|
2017-10-03 06:54:07 -05:00
|
|
|
}
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
2017-10-05 03:54:52 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// Determine which curves are new since last time
|
|
|
|
std::set_difference(allCurveDefs.begin(), allCurveDefs.end(),
|
|
|
|
curveDefsInPlot.begin(), curveDefsInPlot.end(),
|
|
|
|
std::inserter(newCurveDefs, newCurveDefs.end()));
|
|
|
|
}
|
|
|
|
updateCurvesInPlot(allCurveDefs, newCurveDefs, curvesToDelete);
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-19 09:12:22 -05:00
|
|
|
std::vector<RimWellLogFile*> RimWellRftPlot::wellLogFilesContainingPressure(const QString& wellName) const
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
std::vector<RimWellLogFile*> wellLogFiles;
|
2017-10-18 03:55:19 -05:00
|
|
|
const RimProject* const project = RiaApplication::instance()->project();
|
2017-10-03 01:19:38 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const auto& oilField : project->oilFields)
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
auto wellPathsVector = std::vector<RimWellPath*>(oilField->wellPathCollection()->wellPaths.begin(), oilField->wellPathCollection()->wellPaths.end());
|
2017-10-11 14:58:51 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const auto& wellPath : wellPathsVector)
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
|
|
|
bool hasPressure = false;
|
2017-10-19 09:12:22 -05:00
|
|
|
const std::vector<RimWellLogFile*> files = wellPath->wellLogFiles();
|
2017-10-03 01:19:38 -05:00
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
for (RimWellLogFile* const file : files)
|
|
|
|
{
|
|
|
|
size_t timeStepCount = timeStepsFromWellLogFile(file).size();
|
|
|
|
|
|
|
|
if (timeStepCount == 0) continue;
|
|
|
|
if (QString::compare(file->wellName(), wellName) != 0) continue;
|
2017-10-03 06:54:07 -05:00
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
if (hasPressureData(file))
|
|
|
|
{
|
|
|
|
wellLogFiles.push_back(file);
|
|
|
|
}
|
|
|
|
}
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-19 09:12:22 -05:00
|
|
|
return wellLogFiles;
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-19 09:12:22 -05:00
|
|
|
RimWellLogFileChannel* RimWellRftPlot::getPressureChannelFromWellFile(const RimWellLogFile* wellLogFile) const
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
if(wellLogFile != nullptr)
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimWellLogFileChannel* const channel : wellLogFile->wellLogChannels())
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
if (isPressureChannel(channel))
|
2017-10-17 04:37:32 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
return channel;
|
2017-10-17 04:37:32 -05:00
|
|
|
}
|
2017-10-03 06:54:07 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-19 09:12:22 -05:00
|
|
|
return nullptr;
|
2017-10-05 03:54:52 -05:00
|
|
|
}
|
|
|
|
|
2017-10-03 06:54:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-19 09:12:22 -05:00
|
|
|
RimWellPath* RimWellRftPlot::wellPathFromWellLogFile(const RimWellLogFile* wellLogFile) const
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
RimProject* const project = RiaApplication::instance()->project();
|
|
|
|
for (const auto& oilField : project->oilFields)
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
auto wellPaths = std::vector<RimWellPath*>(oilField->wellPathCollection()->wellPaths.begin(), oilField->wellPathCollection()->wellPaths.end());
|
|
|
|
|
|
|
|
for (const auto& wellPath : wellPaths)
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
for (RimWellLogFile* const file : wellPath->wellLogFiles())
|
2017-10-17 04:37:32 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
if (file == wellLogFile)
|
|
|
|
{
|
|
|
|
return wellPath;
|
|
|
|
}
|
2017-10-17 04:37:32 -05:00
|
|
|
}
|
2017-10-03 06:54:07 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-19 09:12:22 -05:00
|
|
|
|
2017-10-03 06:54:07 -05:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-10-04 07:36:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-06 07:20:01 -05:00
|
|
|
std::vector<std::tuple<RimEclipseResultCase*, bool/*hasPressure*/, bool /*hasRftData*/>>
|
2017-10-16 05:22:13 -05:00
|
|
|
RimWellRftPlot::eclipseCasesForWell(const QString& wellName) const
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-06 07:20:01 -05:00
|
|
|
std::vector<std::tuple<RimEclipseResultCase*, bool, bool>> cases;
|
2017-10-18 03:55:19 -05:00
|
|
|
const RimProject* const project = RiaApplication::instance()->project();
|
2017-10-04 07:36:33 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const auto& oilField : project->oilFields)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
const RimEclipseCaseCollection* const eclCaseColl = oilField->analysisModels();
|
2017-10-06 07:20:01 -05:00
|
|
|
for (RimEclipseCase* eCase : eclCaseColl->cases())
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-06 07:20:01 -05:00
|
|
|
auto eclCase = dynamic_cast<RimEclipseResultCase*>(eCase);
|
|
|
|
if (eclCase != nullptr)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
RigEclipseCaseData* const eclipseCaseData = eclCase->eclipseCaseData();
|
|
|
|
for (const cvf::ref<RigSimWellData>& wellResult : eclipseCaseData->wellResults())
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
|
|
|
if (QString::compare(wellResult->m_wellName, wellName) == 0)
|
|
|
|
{
|
2017-10-06 07:20:01 -05:00
|
|
|
bool hasPressure = hasPressureData(eclCase);
|
|
|
|
bool hasRftData = eclCase->rftReader() != nullptr;
|
|
|
|
cases.push_back(std::make_tuple(eclCase, hasPressure, hasRftData));
|
|
|
|
break;
|
2017-10-04 07:36:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return cases;
|
|
|
|
}
|
|
|
|
|
2017-10-06 07:20:01 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimEclipseResultCase*>
|
2017-10-11 14:58:51 -05:00
|
|
|
RimWellRftPlot::gridCasesFromEclipseCases(const std::vector<std::tuple<RimEclipseResultCase*, bool, bool>>& eclipseCasesTuple) const
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
|
|
|
std::vector<RimEclipseResultCase*> cases;
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const std::tuple<RimEclipseResultCase*, bool, bool>& eclCaseTuple : eclipseCasesTuple)
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
2017-10-11 14:58:51 -05:00
|
|
|
bool hasPressureData = std::get<1>(eclCaseTuple);
|
|
|
|
size_t timeStepCount = timeStepsFromGridCase(std::get<0>(eclCaseTuple)).size();
|
2017-10-16 05:22:13 -05:00
|
|
|
if (hasPressureData && timeStepCount > 0)
|
2017-10-11 14:58:51 -05:00
|
|
|
{
|
|
|
|
cases.push_back(std::get<0>(eclCaseTuple));
|
|
|
|
}
|
2017-10-06 07:20:01 -05:00
|
|
|
}
|
|
|
|
return cases;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimEclipseResultCase*>
|
2017-10-11 14:58:51 -05:00
|
|
|
RimWellRftPlot::rftCasesFromEclipseCases(const std::vector<std::tuple<RimEclipseResultCase*, bool, bool>>& eclipseCasesTuple) const
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
|
|
|
std::vector<RimEclipseResultCase*> cases;
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const std::tuple<RimEclipseResultCase*, bool, bool>& eclCaseTuple : eclipseCasesTuple)
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
2017-10-11 14:58:51 -05:00
|
|
|
bool hasRftData = std::get<2>(eclCaseTuple);
|
|
|
|
size_t timeStepCount = timeStepsFromRftCase(std::get<0>(eclCaseTuple)).size();
|
|
|
|
if (hasRftData && timeStepCount > 0)
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
2017-10-11 14:58:51 -05:00
|
|
|
cases.push_back(std::get<0>(eclCaseTuple));
|
2017-10-06 07:20:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return cases;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> RimWellRftPlot::timeStepsFromRftCase(RimEclipseResultCase* rftCase) const
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> timeStepsMap;
|
2017-10-18 03:55:19 -05:00
|
|
|
RifReaderEclipseRft* const reader = rftCase->rftReader();
|
2017-10-06 07:20:01 -05:00
|
|
|
if (reader != nullptr)
|
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const QDateTime& timeStep : reader->availableTimeSteps(m_wellName, RifEclipseRftAddress::PRESSURE))
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
|
|
|
if (timeStepsMap.count(timeStep) == 0)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
timeStepsMap.insert(std::make_pair(timeStep, std::set<RifWellRftAddress>()));
|
2017-10-13 07:32:26 -05:00
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
timeStepsMap[timeStep].insert(RifWellRftAddress(RifWellRftAddress::RFT, rftCase));
|
2017-10-13 07:32:26 -05:00
|
|
|
}
|
2017-10-06 07:20:01 -05:00
|
|
|
}
|
2017-10-13 07:32:26 -05:00
|
|
|
return timeStepsMap;
|
2017-10-06 07:20:01 -05:00
|
|
|
}
|
|
|
|
|
2017-10-04 07:36:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> RimWellRftPlot::timeStepsFromGridCase(RimEclipseCase* gridCase) const
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
|
2017-10-13 07:32:26 -05:00
|
|
|
size_t resultIndex = eclipseCaseData != nullptr ?
|
|
|
|
eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, PRESSURE_DATA_NAME) :
|
|
|
|
cvf::UNDEFINED_SIZE_T;
|
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> timeStepsMap;
|
2017-10-13 07:32:26 -05:00
|
|
|
if (resultIndex != cvf::UNDEFINED_SIZE_T)
|
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const QDateTime& timeStep : eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->timeStepDates(resultIndex))
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
|
|
|
if (timeStepsMap.count(timeStep) == 0)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
timeStepsMap.insert(std::make_pair(timeStep, std::set<RifWellRftAddress>()));
|
2017-10-13 07:32:26 -05:00
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
timeStepsMap[timeStep].insert(RifWellRftAddress(RifWellRftAddress::GRID, gridCase));
|
2017-10-13 07:32:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return timeStepsMap;
|
2017-10-04 07:36:33 -05:00
|
|
|
}
|
|
|
|
|
2017-10-11 14:58:51 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress> > RimWellRftPlot::timeStepsFromWellLogFile(RimWellLogFile* wellLogFile) const
|
2017-10-11 14:58:51 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress> > timeStepsMap;
|
2017-10-13 07:32:26 -05:00
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
QDateTime timeStep = RiaDateStringParser::parseDateString(wellLogFile->date());
|
2017-10-13 09:11:37 -05:00
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
if (timeStepsMap.count(timeStep) == 0)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
timeStepsMap.insert(std::make_pair(timeStep, std::set<RifWellRftAddress>()));
|
2017-10-11 14:58:51 -05:00
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
timeStepsMap[timeStep].insert(RifWellRftAddress(RifWellRftAddress::OBSERVED, wellLogFile));
|
2017-10-19 09:12:22 -05:00
|
|
|
|
2017-10-13 07:32:26 -05:00
|
|
|
return timeStepsMap;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>>
|
|
|
|
RimWellRftPlot::adjacentTimeSteps(const std::vector<std::pair<QDateTime, std::set<RifWellRftAddress>>>& allTimeSteps,
|
|
|
|
const std::pair<QDateTime, std::set<RifWellRftAddress>>& searchTimeStepPair)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> timeStepsMap;
|
2017-10-13 07:32:26 -05:00
|
|
|
|
|
|
|
if (allTimeSteps.size() > 0)
|
|
|
|
{
|
|
|
|
auto itr = std::find_if(allTimeSteps.begin(), allTimeSteps.end(),
|
2017-10-26 03:35:23 -05:00
|
|
|
[searchTimeStepPair](const std::pair<QDateTime, std::set<RifWellRftAddress>>& dt)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
|
|
|
return dt.first > searchTimeStepPair.first;
|
|
|
|
});
|
|
|
|
|
|
|
|
auto itrEnd = itr != allTimeSteps.end() ? itr + 1 : itr;
|
|
|
|
|
|
|
|
for (itr = itrEnd - 1; itr != allTimeSteps.begin() && (*itr).first >= searchTimeStepPair.first; itr--);
|
|
|
|
auto itrFirst = itr;
|
|
|
|
|
|
|
|
timeStepsMap.insert(itrFirst, itrEnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add searched time step in case it is not included
|
|
|
|
addTimeStepToMap(timeStepsMap, searchTimeStepPair);
|
|
|
|
|
|
|
|
return timeStepsMap;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
bool RimWellRftPlot::mapContainsTimeStep(const std::map<QDateTime, std::set<RifWellRftAddress>>& map, const QDateTime& timeStep)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
return std::find_if(map.begin(), map.end(), [timeStep](const std::pair<QDateTime, std::set<RifWellRftAddress>>& pair)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
|
|
|
return pair.first == timeStep;
|
|
|
|
}) != map.end();
|
2017-10-11 14:58:51 -05:00
|
|
|
}
|
|
|
|
|
2017-10-03 06:54:07 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::set < std::pair<RifWellRftAddress, QDateTime>> RimWellRftPlot::selectedCurveDefs() const
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::set<std::pair<RifWellRftAddress, QDateTime>> curveDefs;
|
2017-10-16 05:22:13 -05:00
|
|
|
const std::vector<std::tuple<RimEclipseResultCase*,bool,bool>>& eclipseCases = eclipseCasesForWell(m_wellName);
|
2017-10-18 03:55:19 -05:00
|
|
|
const std::vector<RimEclipseResultCase*> rftCases = rftCasesFromEclipseCases(eclipseCases);
|
|
|
|
const std::vector<RimEclipseResultCase*> gridCases = gridCasesFromEclipseCases(eclipseCases);
|
2017-10-03 06:54:07 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const QDateTime& timeStep : m_selectedTimeSteps())
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const RifWellRftAddress& addr : selectedSources())
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
if (addr.sourceType() == RifWellRftAddress::RFT)
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimEclipseResultCase* const rftCase : rftCases)
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::map<QDateTime, std::set<RifWellRftAddress>>& timeStepsMap = timeStepsFromRftCase(rftCase);
|
2017-10-18 03:55:19 -05:00
|
|
|
if (mapContainsTimeStep(timeStepsMap , timeStep))
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
curveDefs.insert(std::make_pair(addr, timeStep));
|
2017-10-06 07:20:01 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-03 06:54:07 -05:00
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
else if (addr.sourceType() == RifWellRftAddress::GRID)
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimEclipseResultCase* const gridCase : gridCases)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::map<QDateTime, std::set<RifWellRftAddress>>& timeStepsMap = timeStepsFromGridCase(gridCase);
|
2017-10-18 03:55:19 -05:00
|
|
|
if (mapContainsTimeStep(timeStepsMap, timeStep))
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
curveDefs.insert(std::make_pair(addr, timeStep));
|
2017-10-04 07:36:33 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-03 06:54:07 -05:00
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
else if (addr.sourceType() == RifWellRftAddress::OBSERVED)
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
if (addr.wellLogFile() != nullptr)
|
2017-10-03 06:54:07 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::map<QDateTime, std::set<RifWellRftAddress>>& timeStepsMap = timeStepsFromWellLogFile(addr.wellLogFile());
|
2017-10-19 09:12:22 -05:00
|
|
|
if (mapContainsTimeStep(timeStepsMap, timeStep))
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
curveDefs.insert(std::make_pair(RifWellRftAddress(RifWellRftAddress::OBSERVED, addr.wellLogFile()), timeStep));
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
2017-10-03 06:54:07 -05:00
|
|
|
}
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-10-03 06:54:07 -05:00
|
|
|
return curveDefs;
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
|
|
|
|
2017-10-05 03:54:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::set<std::pair<RifWellRftAddress, QDateTime>> RimWellRftPlot::curveDefsFromCurves() const
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::set<std::pair<RifWellRftAddress, QDateTime>> curveDefs;
|
2017-10-05 03:54:52 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
|
|
|
for (RimWellLogCurve* const curve : plotTrack->curvesVector())
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
|
|
|
curveDefs.insert(curveDefFromCurve(curve));
|
|
|
|
}
|
|
|
|
return curveDefs;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::pair<RifWellRftAddress, QDateTime> RimWellRftPlot::curveDefFromCurve(const RimWellLogCurve* curve) const
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-06 07:20:01 -05:00
|
|
|
const RimWellLogRftCurve* rftCurve = dynamic_cast<const RimWellLogRftCurve*>(curve);
|
2017-10-05 03:54:52 -05:00
|
|
|
const RimWellLogExtractionCurve* gridCurve = dynamic_cast<const RimWellLogExtractionCurve*>(curve);
|
|
|
|
const RimWellLogFileCurve* wellLogFileCurve = dynamic_cast<const RimWellLogFileCurve*>(curve);
|
|
|
|
|
2017-10-06 07:20:01 -05:00
|
|
|
if (rftCurve != nullptr)
|
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
RimEclipseResultCase* rftCase = dynamic_cast<RimEclipseResultCase*>(rftCurve->eclipseResultCase());
|
2017-10-06 07:20:01 -05:00
|
|
|
if (rftCase != nullptr)
|
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
const RifEclipseRftAddress rftAddress = rftCurve->rftAddress();
|
|
|
|
const QDateTime timeStep = rftAddress.timeStep();
|
2017-10-26 03:35:23 -05:00
|
|
|
return std::make_pair(RifWellRftAddress(RifWellRftAddress::RFT, rftCase), timeStep);
|
2017-10-06 07:20:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (gridCurve != nullptr)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
RimEclipseResultCase* gridCase = dynamic_cast<RimEclipseResultCase*>(gridCurve->rimCase());
|
2017-10-05 03:54:52 -05:00
|
|
|
if (gridCase != nullptr)
|
|
|
|
{
|
2017-10-12 03:00:32 -05:00
|
|
|
size_t timeStepIndex = gridCurve->currentTimeStep();
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::map<QDateTime, std::set<RifWellRftAddress>>& timeStepsMap = timeStepsFromGridCase(gridCase);
|
|
|
|
auto timeStepsVector = std::vector<std::pair<QDateTime, std::set<RifWellRftAddress>>>(
|
2017-10-13 07:32:26 -05:00
|
|
|
timeStepsMap.begin(), timeStepsMap.end());
|
|
|
|
if (timeStepIndex < timeStepsMap.size())
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
return std::make_pair(RifWellRftAddress(RifWellRftAddress::GRID, gridCase),
|
2017-10-13 07:32:26 -05:00
|
|
|
timeStepsVector[timeStepIndex].first);
|
2017-10-05 03:54:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (wellLogFileCurve != nullptr)
|
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
const RimWellPath* const wellPath = wellLogFileCurve->wellPath();
|
2017-10-19 09:12:22 -05:00
|
|
|
RimWellLogFile* const wellLogFile = wellLogFileCurve->wellLogFile();
|
2017-10-05 03:54:52 -05:00
|
|
|
|
2017-10-17 04:37:32 -05:00
|
|
|
if (wellLogFile != nullptr)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
const QDateTime date = RiaDateStringParser::parseDateString(wellLogFile->date());
|
2017-10-17 04:37:32 -05:00
|
|
|
|
|
|
|
if (date.isValid())
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
return std::make_pair(RifWellRftAddress(RifWellRftAddress::OBSERVED, wellLogFile), date);
|
2017-10-17 04:37:32 -05:00
|
|
|
}
|
2017-10-05 03:54:52 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
return std::make_pair(RifWellRftAddress(), QDateTime());
|
2017-10-05 03:54:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
void RimWellRftPlot::updateCurvesInPlot(const std::set<std::pair<RifWellRftAddress, QDateTime>>& allCurveDefs,
|
|
|
|
const std::set<std::pair<RifWellRftAddress, QDateTime>>& curveDefsToAdd,
|
2017-10-05 03:54:52 -05:00
|
|
|
const std::set<RimWellLogCurve*>& curvesToDelete)
|
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
2017-10-05 03:54:52 -05:00
|
|
|
|
|
|
|
// Delete curves
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimWellLogCurve* const curve : curvesToDelete)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
|
|
|
plotTrack->removeCurve(curve);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add new curves
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const std::pair<RifWellRftAddress, QDateTime>& curveDefToAdd : curveDefsToAdd)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
if (curveDefToAdd.first.sourceType() == RifWellRftAddress::RFT)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-06 07:20:01 -05:00
|
|
|
auto curve = new RimWellLogRftCurve();
|
|
|
|
plotTrack->addCurve(curve);
|
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
auto rftCase = curveDefToAdd.first.eclCase();
|
2017-10-11 06:52:29 -05:00
|
|
|
curve->setEclipseResultCase(dynamic_cast<RimEclipseResultCase*>(rftCase));
|
2017-10-05 03:54:52 -05:00
|
|
|
|
2017-10-06 07:20:01 -05:00
|
|
|
RifEclipseRftAddress address(m_wellName, curveDefToAdd.second, RifEclipseRftAddress::PRESSURE);
|
|
|
|
curve->setRftAddress(address);
|
2017-10-17 08:59:05 -05:00
|
|
|
curve->setZOrder(1);
|
2017-10-09 03:51:07 -05:00
|
|
|
|
|
|
|
applyCurveAppearance(curve);
|
2017-10-06 07:20:01 -05:00
|
|
|
curve->loadDataAndUpdate(true);
|
2017-10-05 03:54:52 -05:00
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
else if (curveDefToAdd.first.sourceType() == RifWellRftAddress::GRID)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
|
|
|
auto curve = new RimWellLogExtractionCurve();
|
|
|
|
plotTrack->addCurve(curve);
|
|
|
|
|
|
|
|
cvf::Color3f curveColor = RiaColorTables::wellLogPlotPaletteColors().cycledColor3f(plotTrack->curveCount());
|
|
|
|
curve->setColor(curveColor);
|
|
|
|
curve->setFromSimulationWellName(m_wellName, m_branchIndex);
|
|
|
|
|
|
|
|
// Fetch cases and time steps
|
2017-10-19 09:12:22 -05:00
|
|
|
auto gridCase = curveDefToAdd.first.eclCase();
|
2017-10-05 03:54:52 -05:00
|
|
|
if (gridCase != nullptr)
|
|
|
|
{
|
|
|
|
// Case
|
|
|
|
curve->setCase(gridCase);
|
|
|
|
|
|
|
|
// Result definition
|
|
|
|
RimEclipseResultDefinition* resultDef = new RimEclipseResultDefinition();
|
|
|
|
resultDef->setResultVariable(PRESSURE_DATA_NAME);
|
|
|
|
curve->setEclipseResultDefinition(resultDef);
|
|
|
|
|
|
|
|
// Time step
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::map<QDateTime, std::set<RifWellRftAddress>>& timeSteps = timeStepsFromGridCase(gridCase);
|
2017-10-18 03:55:19 -05:00
|
|
|
auto currentTimeStepItr = std::find_if(timeSteps.begin(), timeSteps.end(),
|
2017-10-26 03:35:23 -05:00
|
|
|
[curveDefToAdd](std::pair<QDateTime, std::set<RifWellRftAddress>> pair) {return pair.first == curveDefToAdd.second; });
|
2017-10-18 03:55:19 -05:00
|
|
|
auto currentTimeStepIndex = std::distance(timeSteps.begin(), currentTimeStepItr);
|
|
|
|
curve->setCurrentTimeStep(currentTimeStepIndex);
|
2017-10-17 08:59:05 -05:00
|
|
|
curve->setZOrder(0);
|
2017-10-09 03:51:07 -05:00
|
|
|
|
|
|
|
applyCurveAppearance(curve);
|
2017-10-05 03:54:52 -05:00
|
|
|
curve->loadDataAndUpdate(false);
|
|
|
|
}
|
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
else if (curveDefToAdd.first.sourceType() == RifWellRftAddress::OBSERVED)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
RimWellLogFile* const wellLogFile = curveDefToAdd.first.wellLogFile();
|
|
|
|
RimWellPath* const wellPath = wellPathFromWellLogFile(wellLogFile);
|
|
|
|
if(wellLogFile!= nullptr)
|
2017-10-05 03:54:52 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
RimWellLogFileChannel* pressureChannel = getPressureChannelFromWellFile(wellLogFile);
|
2017-10-05 03:54:52 -05:00
|
|
|
auto curve = new RimWellLogFileCurve();
|
|
|
|
plotTrack->addCurve(curve);
|
|
|
|
curve->setWellPath(wellPath);
|
2017-10-19 09:12:22 -05:00
|
|
|
curve->setWellLogFile(wellLogFile);
|
|
|
|
curve->setWellLogChannelName(pressureChannel->name());
|
2017-10-17 08:59:05 -05:00
|
|
|
curve->setZOrder(2);
|
2017-10-09 03:51:07 -05:00
|
|
|
|
|
|
|
applyCurveAppearance(curve);
|
2017-10-05 03:54:52 -05:00
|
|
|
curve->loadDataAndUpdate(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-13 07:32:26 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellRftPlot::isOnlyGridSourcesSelected() const
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::vector<RifWellRftAddress>& selSources = m_selectedSources();
|
|
|
|
return std::find_if(selSources.begin(), selSources.end(), [](const RifWellRftAddress& addr)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
return addr.sourceType() == RifWellRftAddress::RFT || addr.sourceType() == RifWellRftAddress::OBSERVED;
|
2017-10-13 07:32:26 -05:00
|
|
|
}) == selSources.end();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
bool RimWellRftPlot::isAnySourceAddressSelected(const std::set<RifWellRftAddress>& addresses) const
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::vector<RifWellRftAddress>& selectedSourcesVector = m_selectedSources();
|
|
|
|
const auto selectedSources = std::set<RifWellRftAddress>(selectedSourcesVector.begin(), selectedSourcesVector.end());
|
|
|
|
std::vector<RifWellRftAddress> intersectVector;
|
2017-10-13 07:32:26 -05:00
|
|
|
|
|
|
|
std::set_intersection(selectedSources.begin(), selectedSources.end(),
|
|
|
|
addresses.begin(), addresses.end(), std::inserter(intersectVector, intersectVector.end()));
|
|
|
|
return intersectVector.size() > 0;
|
|
|
|
}
|
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
std::vector<RifWellRftAddress> RimWellRftPlot::selectedSources() const
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::vector<RifWellRftAddress> sources;
|
|
|
|
for (const RifWellRftAddress& addr : m_selectedSources())
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
if (addr.sourceType() == RifWellRftAddress::OBSERVED)
|
2017-10-19 09:12:22 -05:00
|
|
|
{
|
|
|
|
for (RimWellLogFile* const wellLogFile : wellLogFilesContainingPressure(m_wellName))
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
sources.push_back(RifWellRftAddress(RifWellRftAddress::OBSERVED, wellLogFile));
|
2017-10-19 09:12:22 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
sources.push_back(addr);
|
|
|
|
}
|
|
|
|
return sources;
|
|
|
|
}
|
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QWidget* RimWellRftPlot::viewWidget()
|
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
return m_wellLogPlotWidget;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellRftPlot::zoomAll()
|
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
m_wellLogPlot()->zoomAll();
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-29 04:24:18 -05:00
|
|
|
RimWellLogPlot* RimWellRftPlot::wellLogPlot() const
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
return m_wellLogPlot();
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-29 04:24:18 -05:00
|
|
|
void RimWellRftPlot::setCurrentWellName(const QString& currWellName)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-09-29 04:24:18 -05:00
|
|
|
m_wellName = currWellName;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-29 04:24:18 -05:00
|
|
|
QString RimWellRftPlot::currentWellName() const
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-09-29 04:24:18 -05:00
|
|
|
return m_wellName;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
2017-10-05 09:25:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-19 09:12:22 -05:00
|
|
|
bool RimWellRftPlot::hasPressureData(const RimWellLogFile* wellLogFile)
|
2017-10-05 09:25:04 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimWellLogFileChannel* const wellLogChannel : wellLogFile->wellLogChannels())
|
2017-10-05 09:25:04 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
if (isPressureChannel(wellLogChannel)) return true;
|
2017-10-05 09:25:04 -05:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-19 09:12:22 -05:00
|
|
|
bool RimWellRftPlot::hasPressureData(RimWellPath* wellPath)
|
|
|
|
{
|
|
|
|
for (RimWellLogFile* const wellLogFile : wellPath->wellLogFiles())
|
|
|
|
{
|
|
|
|
if (hasPressureData(wellLogFile))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellRftPlot::isPressureChannel(RimWellLogFileChannel* channel)
|
2017-10-05 09:25:04 -05:00
|
|
|
{
|
|
|
|
// Todo: read pressure channel names from config/defines
|
|
|
|
return QString::compare(channel->name(), PRESSURE_DATA_NAME) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellRftPlot::hasPressureData(RimEclipseResultCase* gridCase)
|
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
|
2017-10-05 09:25:04 -05:00
|
|
|
size_t resultIndex = eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->
|
|
|
|
findScalarResultIndex(RiaDefines::DYNAMIC_NATIVE, PRESSURE_DATA_NAME);
|
|
|
|
return resultIndex != cvf::UNDEFINED_SIZE_T;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const char* RimWellRftPlot::plotNameFormatString()
|
|
|
|
{
|
|
|
|
return PLOT_NAME_QFORMAT_STRING;
|
|
|
|
}
|
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QList<caf::PdmOptionItemInfo> RimWellRftPlot::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
|
|
|
{
|
|
|
|
QList<caf::PdmOptionItemInfo> options;
|
|
|
|
|
|
|
|
if (fieldNeedingOptions == &m_wellName)
|
|
|
|
{
|
2017-09-29 04:24:18 -05:00
|
|
|
calculateValueOptionsForWells(options);
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
2017-09-29 04:24:18 -05:00
|
|
|
else if (fieldNeedingOptions == &m_selectedSources)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-10-16 05:22:13 -05:00
|
|
|
const std::vector<std::tuple<RimEclipseResultCase*, bool, bool>>& eclipseCases = eclipseCasesForWell(m_wellName);
|
2017-10-02 02:40:33 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
const std::vector<RimEclipseResultCase*> rftCases = rftCasesFromEclipseCases(eclipseCases);
|
2017-10-11 14:58:51 -05:00
|
|
|
if (rftCases.size() > 0)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
options.push_back(caf::PdmOptionItemInfo::createHeader(RifWellRftAddress::sourceTypeUiText(RifWellRftAddress::RFT), true));
|
2017-10-11 14:58:51 -05:00
|
|
|
}
|
2017-10-06 07:20:01 -05:00
|
|
|
for (const auto& rftCase : rftCases)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
auto addr = RifWellRftAddress(RifWellRftAddress::RFT, rftCase);
|
2017-10-06 07:20:01 -05:00
|
|
|
auto item = caf::PdmOptionItemInfo(rftCase->caseUserDescription(), QVariant::fromValue(addr));
|
|
|
|
item.setLevel(1);
|
|
|
|
options.push_back(item);
|
|
|
|
}
|
2017-10-04 07:36:33 -05:00
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
const std::vector<RimEclipseResultCase*> gridCases = gridCasesFromEclipseCases(eclipseCases);
|
2017-10-11 14:58:51 -05:00
|
|
|
if (gridCases.size() > 0)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
options.push_back(caf::PdmOptionItemInfo::createHeader(RifWellRftAddress::sourceTypeUiText(RifWellRftAddress::GRID), true));
|
2017-10-11 14:58:51 -05:00
|
|
|
}
|
2017-10-04 07:36:33 -05:00
|
|
|
for (const auto& gridCase : gridCases)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
auto addr = RifWellRftAddress(RifWellRftAddress::GRID, gridCase);
|
2017-10-04 07:36:33 -05:00
|
|
|
auto item = caf::PdmOptionItemInfo(gridCase->caseUserDescription(), QVariant::fromValue(addr));
|
|
|
|
item.setLevel(1);
|
|
|
|
options.push_back(item);
|
|
|
|
}
|
2017-10-03 01:19:38 -05:00
|
|
|
|
2017-10-19 09:12:22 -05:00
|
|
|
if (wellLogFilesContainingPressure(m_wellName).size() > 0)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
options.push_back(caf::PdmOptionItemInfo::createHeader(RifWellRftAddress::sourceTypeUiText(RifWellRftAddress::OBSERVED), true));
|
2017-10-11 14:58:51 -05:00
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
auto addr = RifWellRftAddress(RifWellRftAddress::OBSERVED);
|
2017-10-19 09:12:22 -05:00
|
|
|
auto item = caf::PdmOptionItemInfo("Observed Data", QVariant::fromValue(addr));
|
2017-10-04 07:36:33 -05:00
|
|
|
item.setLevel(1);
|
|
|
|
options.push_back(item);
|
|
|
|
}
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
2017-09-29 04:24:18 -05:00
|
|
|
else if (fieldNeedingOptions == &m_selectedTimeSteps)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-10-04 07:36:33 -05:00
|
|
|
calculateValueOptionsForTimeSteps(m_wellName, options);
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
2017-10-11 06:52:29 -05:00
|
|
|
else if (fieldNeedingOptions == &m_branchIndex)
|
|
|
|
{
|
|
|
|
RimProject* proj = RiaApplication::instance()->project();
|
|
|
|
|
|
|
|
size_t branchCount = proj->simulationWellBranches(m_wellName).size();
|
|
|
|
|
|
|
|
for (int bIdx = 0; bIdx < static_cast<int>(branchCount); ++bIdx)
|
|
|
|
{
|
|
|
|
options.push_back(caf::PdmOptionItemInfo("Branch " + QString::number(bIdx + 1), QVariant::fromValue(bIdx)));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (options.size() == 0)
|
|
|
|
{
|
|
|
|
options.push_front(caf::PdmOptionItemInfo("None", -1));
|
|
|
|
}
|
|
|
|
}
|
2017-09-27 05:39:28 -05:00
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-29 04:24:18 -05:00
|
|
|
void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-10-02 02:40:33 -05:00
|
|
|
RimViewWindow::fieldChangedByUi(changedField, oldValue, newValue);
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2017-10-05 09:25:04 -05:00
|
|
|
if (changedField == &m_wellName)
|
|
|
|
{
|
|
|
|
setDescription(QString(plotNameFormatString()).arg(m_wellName));
|
|
|
|
}
|
2017-10-12 06:16:37 -05:00
|
|
|
|
|
|
|
if (changedField == &m_wellName || changedField == &m_branchIndex)
|
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
|
|
|
for (RimWellLogCurve* const curve : plotTrack->curvesVector())
|
2017-10-12 06:16:37 -05:00
|
|
|
{
|
|
|
|
plotTrack->removeCurve(curve);
|
|
|
|
}
|
2017-10-13 07:32:26 -05:00
|
|
|
m_timeStepsToAddresses.clear();
|
2017-10-12 06:16:37 -05:00
|
|
|
updateEditorsFromCurves();
|
|
|
|
}
|
2017-10-17 06:35:12 -05:00
|
|
|
else if (changedField == &m_selectedSources)
|
|
|
|
{
|
|
|
|
// Update time steps selections based on source selections
|
|
|
|
updateSelectedTimeStepsFromSelectedSources();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (changedField == &m_selectedSources ||
|
|
|
|
changedField == &m_selectedTimeSteps)
|
2017-10-03 01:19:38 -05:00
|
|
|
{
|
2017-10-05 09:25:04 -05:00
|
|
|
syncCurvesFromUiSelection();
|
2017-10-19 09:12:22 -05:00
|
|
|
m_selectedSourcesOrTimeStepsFieldsChanged = true;
|
2017-10-05 09:25:04 -05:00
|
|
|
}
|
|
|
|
else if (changedField == &m_showPlotTitle)
|
|
|
|
{
|
|
|
|
//m_wellLogPlot->setShowDescription(m_showPlotTitle);
|
2017-10-03 01:19:38 -05:00
|
|
|
}
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-29 04:24:18 -05:00
|
|
|
QImage RimWellRftPlot::snapshotWindowContent()
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-09-29 04:24:18 -05:00
|
|
|
QImage image;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
if (m_wellLogPlotWidget)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-09-29 04:24:18 -05:00
|
|
|
QPixmap pix = QPixmap::grabWidget(m_wellLogPlotWidget);
|
|
|
|
image = pix.toImage();
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
return image;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-09-29 04:24:18 -05:00
|
|
|
void RimWellRftPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
if (!m_selectedSourcesOrTimeStepsFieldsChanged)
|
|
|
|
{
|
|
|
|
updateEditorsFromCurves();
|
|
|
|
}
|
|
|
|
m_selectedSourcesOrTimeStepsFieldsChanged = false;
|
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
uiOrdering.add(&m_userName);
|
|
|
|
uiOrdering.add(&m_wellName);
|
2017-10-11 06:52:29 -05:00
|
|
|
|
|
|
|
RimProject* proj = RiaApplication::instance()->project();
|
|
|
|
if (proj->simulationWellBranches(m_wellName).size() > 1)
|
|
|
|
{
|
|
|
|
uiOrdering.add(&m_branchIndex);
|
|
|
|
}
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2017-09-29 04:24:18 -05:00
|
|
|
caf::PdmUiGroup* sourcesGroup = uiOrdering.addNewGroupWithKeyword("Sources", "Sources");
|
|
|
|
sourcesGroup->add(&m_selectedSources);
|
|
|
|
|
|
|
|
caf::PdmUiGroup* timeStepsGroup = uiOrdering.addNewGroupWithKeyword("Time Steps", "TimeSteps");
|
|
|
|
timeStepsGroup->add(&m_selectedTimeSteps);
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2017-10-05 09:25:04 -05:00
|
|
|
//uiOrdering.add(&m_showPlotTitle);
|
2017-10-11 14:58:51 -05:00
|
|
|
|
|
|
|
uiOrdering.skipRemainingFields(true);
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
2017-10-13 07:32:26 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
void RimWellRftPlot::addTimeStepToMap(std::map<QDateTime, std::set<RifWellRftAddress>>& destMap,
|
|
|
|
const std::pair<QDateTime, std::set<RifWellRftAddress>>& timeStepToAdd)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
auto timeStepMapToAdd = std::map<QDateTime, std::set<RifWellRftAddress>> { timeStepToAdd };
|
2017-10-13 07:32:26 -05:00
|
|
|
addTimeStepsToMap(destMap, timeStepMapToAdd);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-26 03:35:23 -05:00
|
|
|
void RimWellRftPlot::addTimeStepsToMap(std::map<QDateTime, std::set<RifWellRftAddress>>& destMap,
|
|
|
|
const std::map<QDateTime, std::set<RifWellRftAddress>>& timeStepsToAdd)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
|
|
|
for (const auto& timeStepPair : timeStepsToAdd)
|
|
|
|
{
|
|
|
|
if (timeStepPair.first.isValid())
|
|
|
|
{
|
|
|
|
if (destMap.count(timeStepPair.first) == 0)
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
destMap.insert(std::make_pair(timeStepPair.first, std::set<RifWellRftAddress>()));
|
2017-10-13 07:32:26 -05:00
|
|
|
}
|
|
|
|
auto addresses = timeStepPair.second;
|
|
|
|
destMap[timeStepPair.first].insert(addresses.begin(), addresses.end());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-03 01:19:38 -05:00
|
|
|
void RimWellRftPlot::calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options)
|
2017-10-02 02:40:33 -05:00
|
|
|
{
|
2017-10-11 06:52:29 -05:00
|
|
|
RimProject * proj = RiaApplication::instance()->project();
|
2017-10-02 02:40:33 -05:00
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
if (proj != nullptr)
|
2017-10-02 02:40:33 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
const std::vector<QString> simWellNames = proj->simulationWellNames();
|
|
|
|
auto wellNames = std::set<QString>(simWellNames.begin(), simWellNames.end());
|
2017-10-11 06:52:29 -05:00
|
|
|
|
|
|
|
// Observed wells
|
|
|
|
for (const auto& oilField : proj->oilFields())
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-11 06:52:29 -05:00
|
|
|
auto wellPathColl = oilField->wellPathCollection();
|
|
|
|
for (const auto& wellPath : wellPathColl->wellPaths)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-11 06:52:29 -05:00
|
|
|
wellNames.insert(wellPath->name());
|
2017-10-04 07:36:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
for (const auto& wellName : wellNames)
|
2017-10-02 02:40:33 -05:00
|
|
|
{
|
2017-10-11 06:52:29 -05:00
|
|
|
options.push_back(caf::PdmOptionItemInfo(wellName, wellName));
|
2017-10-02 02:40:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-04 07:36:33 -05:00
|
|
|
void RimWellRftPlot::calculateValueOptionsForTimeSteps(const QString& wellName, QList<caf::PdmOptionItemInfo>& options)
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
std::map<QDateTime, std::set<RifWellRftAddress>> displayTimeStepsMap, obsAndRftTimeStepsMap, gridTimeStepsMap;
|
2017-10-16 05:22:13 -05:00
|
|
|
const std::vector<std::tuple<RimEclipseResultCase*, bool, bool>>& eclipseCases = eclipseCasesForWell(wellName);
|
2017-10-18 03:55:19 -05:00
|
|
|
const std::vector<RimEclipseResultCase*> rftCases = rftCasesFromEclipseCases(eclipseCases);
|
|
|
|
const std::vector<RimEclipseResultCase*> gridCases = gridCasesFromEclipseCases(eclipseCases);
|
2017-10-04 07:36:33 -05:00
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const RifWellRftAddress& selection : selectedSources())
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
if (selection.sourceType() == RifWellRftAddress::RFT)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimEclipseResultCase* const rftCase : rftCases)
|
2017-10-06 07:20:01 -05:00
|
|
|
{
|
2017-10-13 07:32:26 -05:00
|
|
|
addTimeStepsToMap(obsAndRftTimeStepsMap, timeStepsFromRftCase(rftCase));
|
2017-10-06 07:20:01 -05:00
|
|
|
}
|
2017-10-04 07:36:33 -05:00
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
else if (selection.sourceType() == RifWellRftAddress::GRID)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-18 03:55:19 -05:00
|
|
|
for (RimEclipseResultCase* const gridCase : gridCases)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-13 07:32:26 -05:00
|
|
|
addTimeStepsToMap(gridTimeStepsMap, timeStepsFromGridCase(gridCase));
|
2017-10-04 07:36:33 -05:00
|
|
|
}
|
|
|
|
}
|
2017-10-26 03:35:23 -05:00
|
|
|
else if (selection.sourceType() == RifWellRftAddress::OBSERVED)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-19 09:12:22 -05:00
|
|
|
if (selection.wellLogFile() != nullptr)
|
|
|
|
{
|
|
|
|
addTimeStepsToMap(obsAndRftTimeStepsMap, timeStepsFromWellLogFile(selection.wellLogFile()));
|
|
|
|
}
|
2017-10-13 07:32:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isOnlyGridSourcesSelected())
|
|
|
|
{
|
|
|
|
displayTimeStepsMap = gridTimeStepsMap;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const auto gridTimeStepsVector = std::vector<std::pair<QDateTime, std::set<RifWellRftAddress>>>(gridTimeStepsMap.begin(), gridTimeStepsMap.end());
|
2017-10-13 07:45:59 -05:00
|
|
|
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const std::pair<QDateTime, std::set<RifWellRftAddress>>& timeStepPair : obsAndRftTimeStepsMap)
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::map<QDateTime, std::set<RifWellRftAddress>>& adjTimeSteps = adjacentTimeSteps(gridTimeStepsVector, timeStepPair);
|
2017-10-13 07:32:26 -05:00
|
|
|
addTimeStepsToMap(displayTimeStepsMap, adjTimeSteps);
|
|
|
|
}
|
|
|
|
|
2017-10-13 07:45:59 -05:00
|
|
|
// Add the first grid time step (from the total grid time steps list)
|
|
|
|
if (gridTimeStepsVector.size() > 0)
|
|
|
|
{
|
|
|
|
addTimeStepToMap(displayTimeStepsMap, gridTimeStepsVector.front());
|
|
|
|
}
|
|
|
|
|
2017-10-13 07:32:26 -05:00
|
|
|
// Add already selected time steps
|
2017-10-18 03:55:19 -05:00
|
|
|
for (const QDateTime& timeStep : m_selectedTimeSteps())
|
2017-10-13 07:32:26 -05:00
|
|
|
{
|
|
|
|
if (m_timeStepsToAddresses.count(timeStep) > 0)
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-26 03:35:23 -05:00
|
|
|
const std::set<RifWellRftAddress> sourceAddresses = m_timeStepsToAddresses[timeStep];
|
2017-10-13 07:32:26 -05:00
|
|
|
if (isAnySourceAddressSelected(sourceAddresses))
|
2017-10-04 07:36:33 -05:00
|
|
|
{
|
2017-10-13 07:45:59 -05:00
|
|
|
addTimeStepToMap(displayTimeStepsMap, std::make_pair(timeStep, m_timeStepsToAddresses[timeStep]));
|
2017-10-04 07:36:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-16 06:50:57 -05:00
|
|
|
addTimeStepsToMap(m_timeStepsToAddresses, displayTimeStepsMap);
|
|
|
|
|
|
|
|
// Create vector of all time steps
|
|
|
|
std::vector<QDateTime> allTimeSteps;
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const std::pair<QDateTime, std::set<RifWellRftAddress>>& timeStepPair : m_timeStepsToAddresses)
|
2017-10-16 06:50:57 -05:00
|
|
|
{
|
|
|
|
allTimeSteps.push_back(timeStepPair.first);
|
|
|
|
}
|
|
|
|
|
2017-10-18 03:55:19 -05:00
|
|
|
const QString dateFormatString = RimTools::createTimeFormatStringFromDates(allTimeSteps);
|
2017-10-26 03:35:23 -05:00
|
|
|
for (const std::pair<QDateTime, std::set<RifWellRftAddress>>& timeStepPair : displayTimeStepsMap)
|
2017-09-29 04:24:18 -05:00
|
|
|
{
|
2017-10-16 06:50:57 -05:00
|
|
|
options.push_back(caf::PdmOptionItemInfo(timeStepPair.first.toString(dateFormatString), timeStepPair.first));
|
2017-09-29 04:24:18 -05:00
|
|
|
}
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellRftPlot::setDescription(const QString& description)
|
|
|
|
{
|
|
|
|
m_userName = description;
|
|
|
|
|
|
|
|
updateWidgetTitleWindowTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimWellRftPlot::description() const
|
|
|
|
{
|
|
|
|
return m_userName();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellRftPlot::loadDataAndUpdate()
|
|
|
|
{
|
|
|
|
updateMdiWindowVisibility();
|
2017-09-27 07:05:14 -05:00
|
|
|
m_wellLogPlot->loadDataAndUpdate();
|
2017-10-05 03:54:52 -05:00
|
|
|
updateEditorsFromCurves();
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QWidget* RimWellRftPlot::createViewWidget(QWidget* mainWindowParent)
|
|
|
|
{
|
2017-09-27 07:05:14 -05:00
|
|
|
m_wellLogPlotWidget = new RiuWellRftPlot(this, mainWindowParent);
|
|
|
|
return m_wellLogPlotWidget;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|