mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
Fix whitespace and includes
This commit is contained in:
1 parent
246326229e
commit
f7600199c7
7 files changed
+299
-300
No files matched your search
@@ -21,8 +21,9 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep, RftWellLogChannelType wellLogChannelName) :
|
||||
m_wellName(wellName), m_wellLogChannel(wellLogChannelName)
|
||||
RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep, RftWellLogChannelType wellLogChannelName)
|
||||
: m_wellName(wellName)
|
||||
, m_wellLogChannel(wellLogChannelName)
|
||||
{
|
||||
timeStep.setTimeSpec(Qt::TimeSpec::UTC);
|
||||
|
||||
@@ -53,4 +54,3 @@ bool operator<(const RifEclipseRftAddress& first, const RifEclipseRftAddress& se
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ std::pair<RigEclipseResultAddress, QString> RimWellPlotTools::pressureResultData
|
||||
for (const auto& pressureDataName : PRESSURE_DATA_NAMES)
|
||||
{
|
||||
if (eclipseCaseData->results(RiaDefines::MATRIX_MODEL)
|
||||
->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName)))
|
||||
->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName)))
|
||||
{
|
||||
return std::make_pair(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName), pressureDataName);
|
||||
}
|
||||
@@ -226,8 +226,8 @@ bool RimWellPlotTools::hasFlowData(RimEclipseResultCase* gridCase)
|
||||
|
||||
for (const QString& channelName : FLOW_DATA_NAMES)
|
||||
{
|
||||
if (eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE,
|
||||
channelName)) )
|
||||
if (eclipseCaseData->results(RiaDefines::MATRIX_MODEL)
|
||||
->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, channelName)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -411,7 +411,7 @@ std::vector<RimEclipseResultCase*> RimWellPlotTools::rftCasesForWell(const QStri
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<QDateTime, std::set<RifDataSourceForRftPlt>> RimWellPlotTools::timeStepsMapFromGridCase(RimEclipseCase* gridCase)
|
||||
{
|
||||
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
|
||||
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
|
||||
std::pair<RigEclipseResultAddress, QString> resultDataInfo = pressureResultDataInfo(eclipseCaseData);
|
||||
|
||||
std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMap;
|
||||
@@ -521,7 +521,7 @@ RiaRftPltCurveDefinition RimWellPlotTools::curveDefFromCurve(const RimWellLogCur
|
||||
}
|
||||
else if (wellLogFileCurve != nullptr)
|
||||
{
|
||||
RimWellLogFile* const wellLogFile = wellLogFileCurve->wellLogFile();
|
||||
RimWellLogFile* const wellLogFile = wellLogFileCurve->wellLogFile();
|
||||
|
||||
if (wellLogFile != nullptr)
|
||||
{
|
||||
@@ -943,9 +943,9 @@ void RimWellPlotTools::calculateValueOptionsForTimeSteps(
|
||||
{
|
||||
QString optionText = RiaQDateTimeTools::toStringUsingApplicationLocale(timeStepPair.first, dateFormatString);
|
||||
|
||||
bool hasObs = false;
|
||||
bool hasRft = false;
|
||||
bool hasGrid = false;
|
||||
bool hasObs = false;
|
||||
bool hasRft = false;
|
||||
bool hasGrid = false;
|
||||
|
||||
for (const auto& source : timeStepPair.second)
|
||||
{
|
||||
|
||||
@@ -75,9 +75,6 @@ public:
|
||||
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromGridCase(RimEclipseCase* gridCase);
|
||||
static RiaRftPltCurveDefinition curveDefFromCurve(const RimWellLogCurve* curve);
|
||||
|
||||
template<typename T>
|
||||
static void appendSet(std::set<T>& destSet, const std::set<T>& setToAppend);
|
||||
|
||||
// others
|
||||
static bool hasFlowData(const RimWellLogFile* wellLogFile);
|
||||
static bool hasAssociatedWellPath(const QString& wellName);
|
||||
@@ -138,12 +135,3 @@ private:
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template<typename T>
|
||||
void RimWellPlotTools::appendSet(std::set<T>& destSet, const std::set<T>& setToAppend)
|
||||
{
|
||||
destSet.insert(setToAppend.begin(), setToAppend.end());
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "RigWellLogExtractor.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimDataSourceForRftPlt.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
@@ -62,19 +63,18 @@
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
#include "cafVecIjk.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <tuple>
|
||||
#include "QMessageBox"
|
||||
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPltPlot, "WellPltPlot");
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< FlowType>::setUp()
|
||||
void caf::AppEnum<FlowType>::setUp()
|
||||
{
|
||||
addItem(FLOW_TYPE_PHASE_SPLIT, "PHASE_SPLIT", "Phase Split");
|
||||
addItem(FLOW_TYPE_TOTAL, "TOTAL", "Total Flow");
|
||||
@@ -82,14 +82,14 @@ void caf::AppEnum< FlowType>::setUp()
|
||||
}
|
||||
|
||||
template<>
|
||||
void caf::AppEnum< FlowPhase>::setUp()
|
||||
void caf::AppEnum<FlowPhase>::setUp()
|
||||
{
|
||||
addItem(FLOW_PHASE_OIL, "PHASE_OIL", "Oil");
|
||||
addItem(FLOW_PHASE_GAS, "PHASE_GAS", "Gas");
|
||||
addItem(FLOW_PHASE_WATER, "PHASE_WATER", "Water");
|
||||
addItem(FLOW_PHASE_TOTAL, "PHASE_TOTAL", "Total");
|
||||
}
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -134,12 +134,12 @@ RimWellPltPlot::RimWellPltPlot()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_phases, "Phases", "Phases", "", "", "");
|
||||
m_phases.uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
|
||||
m_phases = std::vector<caf::AppEnum<FlowPhase>>({ FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER });
|
||||
m_phases = std::vector<caf::AppEnum<FlowPhase>>({FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER});
|
||||
m_phases.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
this->setAsPlotMdiWindow();
|
||||
m_doInitAfterLoad = false;
|
||||
m_isOnLoad = true;
|
||||
m_isOnLoad = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -164,13 +164,12 @@ void RimWellPltPlot::deleteViewWidget()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::setPlotXAxisTitles(RimWellLogTrack* plotTrack)
|
||||
{
|
||||
std::set< RiaEclipseUnitTools::UnitSystem> presentUnitSystems;
|
||||
std::set<RiaEclipseUnitTools::UnitSystem> presentUnitSystems;
|
||||
for (const RifDataSourceForRftPlt& source : m_selectedSources.v())
|
||||
{
|
||||
if (source.eclCase()) presentUnitSystems.insert(source.eclCase()->eclipseCaseData()->unitsType());
|
||||
@@ -181,24 +180,32 @@ void RimWellPltPlot::setPlotXAxisTitles(RimWellLogTrack* plotTrack)
|
||||
// Todo: Handle different units in the relevant las channels
|
||||
switch (source.wellLogFile()->wellLogFileData()->depthUnit())
|
||||
{
|
||||
case RiaDefines::UNIT_METER: presentUnitSystems.insert(RiaEclipseUnitTools::UNITS_METRIC);
|
||||
case RiaDefines::UNIT_FEET: presentUnitSystems.insert(RiaEclipseUnitTools::UNITS_FIELD);
|
||||
case RiaDefines::UNIT_NONE: presentUnitSystems.insert(RiaEclipseUnitTools::UNITS_UNKNOWN);
|
||||
case RiaDefines::UNIT_METER:
|
||||
presentUnitSystems.insert(RiaEclipseUnitTools::UNITS_METRIC);
|
||||
case RiaDefines::UNIT_FEET:
|
||||
presentUnitSystems.insert(RiaEclipseUnitTools::UNITS_FIELD);
|
||||
case RiaDefines::UNIT_NONE:
|
||||
presentUnitSystems.insert(RiaEclipseUnitTools::UNITS_UNKNOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (presentUnitSystems.size() > 1) { QMessageBox::warning(nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot");}
|
||||
if (presentUnitSystems.size() > 1)
|
||||
{
|
||||
QMessageBox::warning(nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot");
|
||||
}
|
||||
|
||||
if (presentUnitSystems.size() <= 0 ) return;
|
||||
if (presentUnitSystems.size() <= 0) return;
|
||||
|
||||
RiaEclipseUnitTools::UnitSystem unitSet = *presentUnitSystems.begin();
|
||||
|
||||
QString axisTitle;
|
||||
if (m_useReservoirConditionCurves) axisTitle += RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WELL_FLOW_COND_RESERVOIR, unitSet);
|
||||
if (m_useReservoirConditionCurves)
|
||||
axisTitle += RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WELL_FLOW_COND_RESERVOIR, unitSet);
|
||||
if (m_useReservoirConditionCurves && m_useStandardConditionCurves) axisTitle += " | ";
|
||||
if (m_useStandardConditionCurves) axisTitle += RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet);
|
||||
if (m_useStandardConditionCurves)
|
||||
axisTitle += RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet);
|
||||
|
||||
plotTrack->setXAxisTitle(axisTitle);
|
||||
#if 0
|
||||
@@ -223,7 +230,7 @@ void RimWellPltPlot::setPlotXAxisTitles(RimWellLogTrack* plotTrack)
|
||||
}
|
||||
|
||||
plotTrack->setXAxisTitle("Surface Flow Rate " + unitText);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -233,18 +240,18 @@ void RimWellPltPlot::updateFormationsOnPlot() const
|
||||
{
|
||||
if (m_wellLogPlot->trackCount() > 0)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = proj->wellPathByName(m_wellPathName);
|
||||
|
||||
RimCase* formationNamesCase = m_wellLogPlot->trackByIndex(0)->formationNamesCase();
|
||||
|
||||
if ( !formationNamesCase )
|
||||
if (!formationNamesCase)
|
||||
{
|
||||
/// Set default case. Todo : Use the first of the selected cases in the plot
|
||||
std::vector<RimCase*> cases;
|
||||
proj->allCases(cases);
|
||||
|
||||
if ( !cases.empty() )
|
||||
if (!cases.empty())
|
||||
{
|
||||
formationNamesCase = cases[0];
|
||||
}
|
||||
@@ -277,7 +284,7 @@ void RimWellPltPlot::updateWidgetTitleWindowTitle()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set < RiaRftPltCurveDefinition > RimWellPltPlot::selectedCurveDefs() const
|
||||
std::set<RiaRftPltCurveDefinition> RimWellPltPlot::selectedCurveDefs() const
|
||||
{
|
||||
std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::pltPlotChannelTypes();
|
||||
|
||||
@@ -297,27 +304,33 @@ public:
|
||||
RigResultPointCalculator() {}
|
||||
virtual ~RigResultPointCalculator() {}
|
||||
|
||||
const std::vector <cvf::Vec3d>& pipeBranchCLCoords() { return m_pipeBranchCLCoords; }
|
||||
const std::vector <RigWellResultPoint>& pipeBranchWellResultPoints() { return m_pipeBranchWellResultPoints; }
|
||||
const std::vector <double>& pipeBranchMeasuredDepths() { return m_pipeBranchMeasuredDepths; }
|
||||
const std::vector<cvf::Vec3d>& pipeBranchCLCoords()
|
||||
{
|
||||
return m_pipeBranchCLCoords;
|
||||
}
|
||||
const std::vector<RigWellResultPoint>& pipeBranchWellResultPoints()
|
||||
{
|
||||
return m_pipeBranchWellResultPoints;
|
||||
}
|
||||
const std::vector<double>& pipeBranchMeasuredDepths()
|
||||
{
|
||||
return m_pipeBranchMeasuredDepths;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
RigEclipseWellLogExtractor* findWellLogExtractor(const QString& wellPathName,
|
||||
RimEclipseResultCase* eclCase)
|
||||
RigEclipseWellLogExtractor* findWellLogExtractor(const QString& wellPathName, RimEclipseResultCase* eclCase)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = proj->wellPathByName(wellPathName);
|
||||
RimWellLogPlotCollection* wellLogCollection = proj->mainPlotCollection()->wellLogPlotCollection();
|
||||
RigEclipseWellLogExtractor* eclExtractor = wellLogCollection->findOrCreateExtractor(wellPath, eclCase);
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = proj->wellPathByName(wellPathName);
|
||||
RimWellLogPlotCollection* wellLogCollection = proj->mainPlotCollection()->wellLogPlotCollection();
|
||||
RigEclipseWellLogExtractor* eclExtractor = wellLogCollection->findOrCreateExtractor(wellPath, eclCase);
|
||||
|
||||
return eclExtractor;
|
||||
}
|
||||
|
||||
|
||||
std::vector <cvf::Vec3d> m_pipeBranchCLCoords;
|
||||
std::vector <RigWellResultPoint> m_pipeBranchWellResultPoints;
|
||||
std::vector <double> m_pipeBranchMeasuredDepths;
|
||||
std::vector<cvf::Vec3d> m_pipeBranchCLCoords;
|
||||
std::vector<RigWellResultPoint> m_pipeBranchWellResultPoints;
|
||||
std::vector<double> m_pipeBranchMeasuredDepths;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -327,11 +340,8 @@ protected:
|
||||
class RigRftResultPointCalculator : public RigResultPointCalculator
|
||||
{
|
||||
public:
|
||||
RigRftResultPointCalculator(const QString& wellPathName,
|
||||
RimEclipseResultCase* eclCase,
|
||||
QDateTime m_timeStep)
|
||||
RigRftResultPointCalculator(const QString& wellPathName, RimEclipseResultCase* eclCase, QDateTime m_timeStep)
|
||||
{
|
||||
|
||||
RifEclipseRftAddress gasRateAddress(RimWellPlotTools::simWellName(wellPathName), m_timeStep, RifEclipseRftAddress::GRAT);
|
||||
RifEclipseRftAddress oilRateAddress(RimWellPlotTools::simWellName(wellPathName), m_timeStep, RifEclipseRftAddress::ORAT);
|
||||
RifEclipseRftAddress watRateAddress(RimWellPlotTools::simWellName(wellPathName), m_timeStep, RifEclipseRftAddress::WRAT);
|
||||
@@ -355,8 +365,8 @@ public:
|
||||
|
||||
for (size_t rftCellIdx = 0; rftCellIdx < rftIndices.size(); rftCellIdx++)
|
||||
{
|
||||
caf::VecIjk ijkIndex = rftIndices[rftCellIdx];
|
||||
size_t globalCellIndex = mainGrid->cellIndexFromIJK(ijkIndex.i(), ijkIndex.j(), ijkIndex.k());
|
||||
caf::VecIjk ijkIndex = rftIndices[rftCellIdx];
|
||||
size_t globalCellIndex = mainGrid->cellIndexFromIJK(ijkIndex.i(), ijkIndex.j(), ijkIndex.k());
|
||||
globCellIdxToIdxInRftFile[globalCellIndex] = rftCellIdx;
|
||||
}
|
||||
|
||||
@@ -385,67 +395,68 @@ public:
|
||||
m_pipeBranchMeasuredDepths.push_back(intersections[wpExIdx].endMD);
|
||||
|
||||
RigWellResultPoint resPoint;
|
||||
resPoint.m_isOpen = true;
|
||||
resPoint.m_gridIndex = 0; // Always main grid
|
||||
resPoint.m_isOpen = true;
|
||||
resPoint.m_gridIndex = 0; // Always main grid
|
||||
resPoint.m_gridCellIndex = globCellIdx; // Shortcut, since we only have main grid results from RFT
|
||||
|
||||
resPoint.m_gasRate = RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents(eclCase->eclipseCaseData()->unitsType(),
|
||||
gasRates[it->second]);
|
||||
resPoint.m_gasRate = RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents(
|
||||
eclCase->eclipseCaseData()->unitsType(), gasRates[it->second]);
|
||||
resPoint.m_oilRate = oilRates[it->second];
|
||||
resPoint.m_waterRate = watRates[it->second];
|
||||
|
||||
m_pipeBranchWellResultPoints.push_back(resPoint);
|
||||
|
||||
if ( wpExIdx < intersections.size() - 1 )
|
||||
if (wpExIdx < intersections.size() - 1)
|
||||
{
|
||||
m_pipeBranchWellResultPoints.push_back(RigWellResultPoint()); // Invalid res point describing the "line" between the cells
|
||||
m_pipeBranchWellResultPoints.push_back(
|
||||
RigWellResultPoint()); // Invalid res point describing the "line" between the cells
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RigSimWellResultPointCalculator: public RigResultPointCalculator
|
||||
class RigSimWellResultPointCalculator : public RigResultPointCalculator
|
||||
{
|
||||
public:
|
||||
RigSimWellResultPointCalculator(const QString& wellPathName,
|
||||
RimEclipseResultCase* eclCase,
|
||||
QDateTime m_timeStep)
|
||||
RigSimWellResultPointCalculator(const QString& wellPathName, RimEclipseResultCase* eclCase, QDateTime m_timeStep)
|
||||
{
|
||||
// Find timestep index from qdatetime
|
||||
|
||||
const std::vector<QDateTime> timeSteps = eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->timeStepDates();
|
||||
size_t tsIdx = timeSteps.size();
|
||||
for ( tsIdx = 0; tsIdx < timeSteps.size(); ++tsIdx) { if (timeSteps[tsIdx] == m_timeStep) break; }
|
||||
size_t tsIdx = timeSteps.size();
|
||||
for (tsIdx = 0; tsIdx < timeSteps.size(); ++tsIdx)
|
||||
{
|
||||
if (timeSteps[tsIdx] == m_timeStep) break;
|
||||
}
|
||||
|
||||
if (tsIdx >= timeSteps.size()) return;
|
||||
|
||||
// Build search map into simulation well data
|
||||
|
||||
std::map<size_t, std::pair<size_t, size_t> > globCellIdxToIdxInSimWellBranch;
|
||||
std::map<size_t, std::pair<size_t, size_t>> globCellIdxToIdxInSimWellBranch;
|
||||
|
||||
const RimWellPath* wellPath = RimWellPlotTools::wellPathByWellPathNameOrSimWellName(wellPathName);
|
||||
const RigSimWellData* simWell = wellPath != nullptr ? eclCase->eclipseCaseData()->findSimWellData(wellPath->associatedSimulationWellName()) : nullptr;
|
||||
const RimWellPath* wellPath = RimWellPlotTools::wellPathByWellPathNameOrSimWellName(wellPathName);
|
||||
const RigSimWellData* simWell =
|
||||
wellPath != nullptr ? eclCase->eclipseCaseData()->findSimWellData(wellPath->associatedSimulationWellName()) : nullptr;
|
||||
|
||||
if (!simWell) return;
|
||||
|
||||
if (!simWell->hasWellResult(tsIdx)) return;
|
||||
|
||||
const RigWellResultFrame & resFrame = simWell->wellResultFrame(tsIdx);
|
||||
const RigWellResultFrame& resFrame = simWell->wellResultFrame(tsIdx);
|
||||
|
||||
const RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid();
|
||||
|
||||
for (size_t brIdx = 0; brIdx < resFrame.m_wellResultBranches.size(); ++brIdx)
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& branchResPoints = resFrame.m_wellResultBranches[brIdx].m_branchResultPoints;
|
||||
for ( size_t wrpIdx = 0; wrpIdx < branchResPoints.size(); wrpIdx++ )
|
||||
const std::vector<RigWellResultPoint>& branchResPoints = resFrame.m_wellResultBranches[brIdx].m_branchResultPoints;
|
||||
for (size_t wrpIdx = 0; wrpIdx < branchResPoints.size(); wrpIdx++)
|
||||
{
|
||||
const RigGridBase* grid = mainGrid->gridByIndex(branchResPoints[wrpIdx].m_gridIndex);
|
||||
size_t globalCellIndex = grid->reservoirCellIndex(branchResPoints[wrpIdx].m_gridCellIndex);
|
||||
const RigGridBase* grid = mainGrid->gridByIndex(branchResPoints[wrpIdx].m_gridIndex);
|
||||
size_t globalCellIndex = grid->reservoirCellIndex(branchResPoints[wrpIdx].m_gridCellIndex);
|
||||
|
||||
globCellIdxToIdxInSimWellBranch[globalCellIndex] = std::make_pair(brIdx, wrpIdx);
|
||||
}
|
||||
@@ -477,24 +488,25 @@ public:
|
||||
m_pipeBranchCLCoords.push_back(intersections[wpExIdx].endPoint);
|
||||
m_pipeBranchMeasuredDepths.push_back(intersections[wpExIdx].endMD);
|
||||
|
||||
const RigWellResultPoint& resPoint = resFrame.m_wellResultBranches[it->second.first].m_branchResultPoints[it->second.second];
|
||||
const RigWellResultPoint& resPoint =
|
||||
resFrame.m_wellResultBranches[it->second.first].m_branchResultPoints[it->second.second];
|
||||
|
||||
m_pipeBranchWellResultPoints.push_back(resPoint);
|
||||
if ( wpExIdx < intersections.size() - 1 )
|
||||
if (wpExIdx < intersections.size() - 1)
|
||||
{
|
||||
m_pipeBranchWellResultPoints.push_back(RigWellResultPoint()); // Invalid res point describing the "line" between the cells
|
||||
m_pipeBranchWellResultPoints.push_back(
|
||||
RigWellResultPoint()); // Invalid res point describing the "line" between the cells
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
{
|
||||
RimWellLogTrack* plotTrack = m_wellLogPlot->trackByIndex(0);
|
||||
RimWellLogTrack* plotTrack = m_wellLogPlot->trackByIndex(0);
|
||||
const std::set<RiaRftPltCurveDefinition>& curveDefs = selectedCurveDefs();
|
||||
|
||||
setPlotXAxisTitles(plotTrack);
|
||||
@@ -508,7 +520,7 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
QString dateFormatString;
|
||||
{
|
||||
std::vector<QDateTime> allTimeSteps;
|
||||
for ( const RiaRftPltCurveDefinition& curveDefToAdd : curveDefs )
|
||||
for (const RiaRftPltCurveDefinition& curveDefToAdd : curveDefs)
|
||||
{
|
||||
allTimeSteps.push_back(curveDefToAdd.timeStep());
|
||||
}
|
||||
@@ -518,36 +530,32 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
// Add curves
|
||||
for (const RiaRftPltCurveDefinition& curveDefToAdd : curveDefs)
|
||||
{
|
||||
std::set<FlowPhase> selectedPhases = std::set<FlowPhase>(m_phases().begin(), m_phases().end()) ;
|
||||
std::set<FlowPhase> selectedPhases = std::set<FlowPhase>(m_phases().begin(), m_phases().end());
|
||||
|
||||
RifDataSourceForRftPlt sourceDef = curveDefToAdd.address();
|
||||
QDateTime timeStep = curveDefToAdd.timeStep();
|
||||
QDateTime timeStep = curveDefToAdd.timeStep();
|
||||
|
||||
std::unique_ptr<RigResultPointCalculator> resultPointCalc;
|
||||
|
||||
QString curveName;
|
||||
|
||||
{
|
||||
curveName += sourceDef.eclCase() ? sourceDef.eclCase()->caseUserDescription() : "";
|
||||
curveName += sourceDef.eclCase() ? sourceDef.eclCase()->caseUserDescription() : "";
|
||||
curveName += sourceDef.wellLogFile() ? sourceDef.wellLogFile()->name() : "";
|
||||
if ( sourceDef.sourceType() == RifDataSourceForRftPlt::RFT ) curveName += ", RFT";
|
||||
if (sourceDef.sourceType() == RifDataSourceForRftPlt::RFT) curveName += ", RFT";
|
||||
|
||||
curveName += ", " + RiaQDateTimeTools::toStringUsingApplicationLocale(timeStep, dateFormatString);
|
||||
}
|
||||
|
||||
RimEclipseResultCase* rimEclipseResultCase = dynamic_cast<RimEclipseResultCase*>(sourceDef.eclCase());
|
||||
|
||||
if ( sourceDef.sourceType() == RifDataSourceForRftPlt::RFT )
|
||||
if (sourceDef.sourceType() == RifDataSourceForRftPlt::RFT)
|
||||
{
|
||||
resultPointCalc.reset(new RigRftResultPointCalculator(m_wellPathName,
|
||||
rimEclipseResultCase,
|
||||
timeStep));
|
||||
resultPointCalc.reset(new RigRftResultPointCalculator(m_wellPathName, rimEclipseResultCase, timeStep));
|
||||
}
|
||||
else if (sourceDef.sourceType() == RifDataSourceForRftPlt::GRID)
|
||||
{
|
||||
resultPointCalc.reset(new RigSimWellResultPointCalculator(m_wellPathName,
|
||||
rimEclipseResultCase,
|
||||
timeStep));
|
||||
resultPointCalc.reset(new RigSimWellResultPointCalculator(m_wellPathName, rimEclipseResultCase, timeStep));
|
||||
}
|
||||
|
||||
RiaEclipseUnitTools::UnitSystem unitSet = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
||||
@@ -558,97 +566,101 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
|
||||
if (resultPointCalc != nullptr)
|
||||
{
|
||||
if ( resultPointCalc->pipeBranchCLCoords().size() )
|
||||
{
|
||||
if (resultPointCalc->pipeBranchCLCoords().size())
|
||||
{
|
||||
if (selectedPhases.count(FLOW_PHASE_TOTAL) && m_useReservoirConditionCurves() &&
|
||||
sourceDef.sourceType() == RifDataSourceForRftPlt::GRID)
|
||||
{
|
||||
RigAccWellFlowCalculator wfTotalAccumulator(resultPointCalc->pipeBranchCLCoords(),
|
||||
resultPointCalc->pipeBranchWellResultPoints(),
|
||||
resultPointCalc->pipeBranchMeasuredDepths(),
|
||||
true);
|
||||
|
||||
if ( selectedPhases.count(FLOW_PHASE_TOTAL)
|
||||
&& m_useReservoirConditionCurves()
|
||||
&& sourceDef.sourceType() == RifDataSourceForRftPlt::GRID )
|
||||
{
|
||||
RigAccWellFlowCalculator wfTotalAccumulator(resultPointCalc->pipeBranchCLCoords(),
|
||||
resultPointCalc->pipeBranchWellResultPoints(),
|
||||
resultPointCalc->pipeBranchMeasuredDepths(),
|
||||
true);
|
||||
const std::vector<double>& depthValues = wfTotalAccumulator.pseudoLengthFromTop(0);
|
||||
|
||||
const std::vector<double>& depthValues = wfTotalAccumulator.pseudoLengthFromTop(0);
|
||||
QString curveUnitText = RimWellPlotTools::flowUnitText(RimWellLogFile::WELL_FLOW_COND_RESERVOIR, unitSet);
|
||||
|
||||
QString curveUnitText = RimWellPlotTools::flowUnitText(RimWellLogFile::WELL_FLOW_COND_RESERVOIR, unitSet);
|
||||
const std::vector<double> accFlow =
|
||||
wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, 0);
|
||||
addStackedCurve(curveName + ", " + RIG_FLOW_TOTAL_NAME + " " + curveUnitText,
|
||||
depthValues,
|
||||
accFlow,
|
||||
plotTrack,
|
||||
cvf::Color3f::DARK_GRAY,
|
||||
curveGroupId,
|
||||
false);
|
||||
curveGroupId++;
|
||||
}
|
||||
|
||||
const std::vector<double> accFlow = wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, 0);
|
||||
addStackedCurve(curveName + ", " + RIG_FLOW_TOTAL_NAME + " " + curveUnitText,
|
||||
depthValues,
|
||||
accFlow,
|
||||
plotTrack,
|
||||
cvf::Color3f::DARK_GRAY,
|
||||
curveGroupId,
|
||||
false);
|
||||
curveGroupId++;
|
||||
}
|
||||
if (m_useStandardConditionCurves())
|
||||
{
|
||||
RigAccWellFlowCalculator wfPhaseAccumulator(resultPointCalc->pipeBranchCLCoords(),
|
||||
resultPointCalc->pipeBranchWellResultPoints(),
|
||||
resultPointCalc->pipeBranchMeasuredDepths(),
|
||||
false);
|
||||
|
||||
if ( m_useStandardConditionCurves() )
|
||||
{
|
||||
RigAccWellFlowCalculator wfPhaseAccumulator(resultPointCalc->pipeBranchCLCoords(),
|
||||
resultPointCalc->pipeBranchWellResultPoints(),
|
||||
resultPointCalc->pipeBranchMeasuredDepths(),
|
||||
false);
|
||||
const std::vector<double>& depthValues = wfPhaseAccumulator.pseudoLengthFromTop(0);
|
||||
std::vector<QString> tracerNames = wfPhaseAccumulator.tracerNames();
|
||||
for (const QString& tracerName : tracerNames)
|
||||
{
|
||||
auto color = tracerName == RIG_FLOW_OIL_NAME
|
||||
? cvf::Color3f::DARK_GREEN
|
||||
: tracerName == RIG_FLOW_GAS_NAME
|
||||
? cvf::Color3f::DARK_RED
|
||||
: tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE : cvf::Color3f::DARK_GRAY;
|
||||
|
||||
if (tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count(FLOW_PHASE_OIL) ||
|
||||
tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count(FLOW_PHASE_GAS) ||
|
||||
tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count(FLOW_PHASE_WATER))
|
||||
{
|
||||
FlowPhase flowPhase = FLOW_PHASE_NONE;
|
||||
if (tracerName == RIG_FLOW_OIL_NAME)
|
||||
flowPhase = FLOW_PHASE_OIL;
|
||||
else if (tracerName == RIG_FLOW_GAS_NAME)
|
||||
flowPhase = FLOW_PHASE_GAS;
|
||||
else if (tracerName == RIG_FLOW_WATER_NAME)
|
||||
flowPhase = FLOW_PHASE_WATER;
|
||||
QString curveUnitText =
|
||||
RimWellPlotTools::curveUnitText(RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet, flowPhase);
|
||||
|
||||
const std::vector<double>& depthValues = wfPhaseAccumulator.pseudoLengthFromTop(0);
|
||||
std::vector<QString> tracerNames = wfPhaseAccumulator.tracerNames();
|
||||
for ( const QString& tracerName: tracerNames )
|
||||
{
|
||||
auto color = tracerName == RIG_FLOW_OIL_NAME ? cvf::Color3f::DARK_GREEN :
|
||||
tracerName == RIG_FLOW_GAS_NAME ? cvf::Color3f::DARK_RED :
|
||||
tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE :
|
||||
cvf::Color3f::DARK_GRAY;
|
||||
|
||||
if ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count(FLOW_PHASE_OIL)
|
||||
|| tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count(FLOW_PHASE_GAS)
|
||||
|| tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count(FLOW_PHASE_WATER) )
|
||||
{
|
||||
FlowPhase flowPhase = FLOW_PHASE_NONE;
|
||||
if (tracerName == RIG_FLOW_OIL_NAME) flowPhase = FLOW_PHASE_OIL;
|
||||
else if (tracerName == RIG_FLOW_GAS_NAME) flowPhase = FLOW_PHASE_GAS;
|
||||
else if (tracerName == RIG_FLOW_WATER_NAME) flowPhase = FLOW_PHASE_WATER;
|
||||
QString curveUnitText = RimWellPlotTools::curveUnitText(RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet, flowPhase);
|
||||
|
||||
const std::vector<double> accFlow = wfPhaseAccumulator.accumulatedTracerFlowPrPseudoLength(tracerName, 0);
|
||||
addStackedCurve(curveName + ", " + tracerName + " " + curveUnitText,
|
||||
depthValues,
|
||||
accFlow,
|
||||
plotTrack,
|
||||
color,
|
||||
curveGroupId,
|
||||
false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const std::vector<double> accFlow =
|
||||
wfPhaseAccumulator.accumulatedTracerFlowPrPseudoLength(tracerName, 0);
|
||||
addStackedCurve(curveName + ", " + tracerName + " " + curveUnitText,
|
||||
depthValues,
|
||||
accFlow,
|
||||
plotTrack,
|
||||
color,
|
||||
curveGroupId,
|
||||
false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( sourceDef.sourceType() == RifDataSourceForRftPlt::OBSERVED )
|
||||
else if (sourceDef.sourceType() == RifDataSourceForRftPlt::OBSERVED)
|
||||
{
|
||||
if ( sourceDef.wellLogFile() && sourceDef.wellLogFile()->wellLogFileData() )
|
||||
if (sourceDef.wellLogFile() && sourceDef.wellLogFile()->wellLogFileData())
|
||||
{
|
||||
RimWellLogFile::WellFlowCondition flowCondition = sourceDef.wellLogFile()->wellFlowRateCondition();
|
||||
|
||||
if ( (m_useStandardConditionCurves() && flowCondition == RimWellLogFile::WELL_FLOW_COND_STANDARD)
|
||||
|| (m_useReservoirConditionCurves() && flowCondition == RimWellLogFile::WELL_FLOW_COND_RESERVOIR) )
|
||||
if ((m_useStandardConditionCurves() && flowCondition == RimWellLogFile::WELL_FLOW_COND_STANDARD) ||
|
||||
(m_useReservoirConditionCurves() && flowCondition == RimWellLogFile::WELL_FLOW_COND_RESERVOIR))
|
||||
{
|
||||
using ChannelValNameIdxTuple = std::tuple<double, QString, int> ;
|
||||
using ChannelValNameIdxTuple = std::tuple<double, QString, int>;
|
||||
|
||||
RigWellLogFile* wellLogFileData = sourceDef.wellLogFile()->wellLogFileData();
|
||||
|
||||
QStringList channelNames = wellLogFileData->wellLogChannelNames();
|
||||
|
||||
std::multiset< ChannelValNameIdxTuple > sortedChannels;
|
||||
std::vector<std::vector<double> > channelData;
|
||||
std::multiset<ChannelValNameIdxTuple> sortedChannels;
|
||||
std::vector<std::vector<double>> channelData;
|
||||
channelData.resize(channelNames.size());
|
||||
|
||||
for ( int chIdx = 0; chIdx < channelNames.size(); ++chIdx )
|
||||
for (int chIdx = 0; chIdx < channelNames.size(); ++chIdx)
|
||||
{
|
||||
QString channelName = channelNames[chIdx];
|
||||
channelData[chIdx] = wellLogFileData->values(channelName);
|
||||
if ( channelData[chIdx].size() )
|
||||
channelData[chIdx] = wellLogFileData->values(channelName);
|
||||
if (channelData[chIdx].size())
|
||||
{
|
||||
sortedChannels.insert(ChannelValNameIdxTuple(-fabs(channelData[chIdx].front()), channelName, chIdx));
|
||||
}
|
||||
@@ -663,22 +675,25 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
if (depthUnit == RiaDefines::UNIT_METER) unitSystem = RiaEclipseUnitTools::UNITS_METRIC;
|
||||
}
|
||||
|
||||
|
||||
for ( const ChannelValNameIdxTuple& channelInfo: sortedChannels )
|
||||
for (const ChannelValNameIdxTuple& channelInfo : sortedChannels)
|
||||
{
|
||||
const auto& channelName = std::get<1>(channelInfo);
|
||||
if ( selectedPhases.count(RimWellPlotTools::flowPhaseFromChannelName(channelName)) > 0 )
|
||||
if (selectedPhases.count(RimWellPlotTools::flowPhaseFromChannelName(channelName)) > 0)
|
||||
{
|
||||
auto color = RimWellPlotTools::isOilFlowChannel(channelName) ? cvf::Color3f::DARK_GREEN :
|
||||
RimWellPlotTools::isGasFlowChannel(channelName) ? cvf::Color3f::DARK_RED :
|
||||
RimWellPlotTools::isWaterFlowChannel(channelName) ? cvf::Color3f::BLUE :
|
||||
cvf::Color3f::DARK_GRAY;
|
||||
|
||||
auto color = RimWellPlotTools::isOilFlowChannel(channelName)
|
||||
? cvf::Color3f::DARK_GREEN
|
||||
: RimWellPlotTools::isGasFlowChannel(channelName)
|
||||
? cvf::Color3f::DARK_RED
|
||||
: RimWellPlotTools::isWaterFlowChannel(channelName) ? cvf::Color3f::BLUE
|
||||
: cvf::Color3f::DARK_GRAY;
|
||||
|
||||
FlowPhase flowPhase = FLOW_PHASE_NONE;
|
||||
if (RimWellPlotTools::isOilFlowChannel(channelName)) flowPhase = FLOW_PHASE_OIL;
|
||||
else if (RimWellPlotTools::isGasFlowChannel(channelName)) flowPhase = FLOW_PHASE_GAS;
|
||||
else if (RimWellPlotTools::isWaterFlowChannel(channelName)) flowPhase = FLOW_PHASE_WATER;
|
||||
if (RimWellPlotTools::isOilFlowChannel(channelName))
|
||||
flowPhase = FLOW_PHASE_OIL;
|
||||
else if (RimWellPlotTools::isGasFlowChannel(channelName))
|
||||
flowPhase = FLOW_PHASE_GAS;
|
||||
else if (RimWellPlotTools::isWaterFlowChannel(channelName))
|
||||
flowPhase = FLOW_PHASE_WATER;
|
||||
QString curveUnitText = RimWellPlotTools::curveUnitText(flowCondition, unitSystem, flowPhase);
|
||||
|
||||
addStackedCurve(curveName + ", " + channelName + " " + curveUnitText,
|
||||
@@ -691,7 +706,7 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
|
||||
// Total flow channel will end up first, so just increment the group
|
||||
// idx to make the rest of the phases group together
|
||||
if ( RimWellPlotTools::isTotalFlowChannel(channelName) ) curveGroupId++;
|
||||
if (RimWellPlotTools::isTotalFlowChannel(channelName)) curveGroupId++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -708,13 +723,13 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::addStackedCurve(const QString& curveName,
|
||||
void RimWellPltPlot::addStackedCurve(const QString& curveName,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack,
|
||||
cvf::Color3f color,
|
||||
int curveGroupId,
|
||||
bool doFillCurve)
|
||||
RimWellLogTrack* plotTrack,
|
||||
cvf::Color3f color,
|
||||
int curveGroupId,
|
||||
bool doFillCurve)
|
||||
{
|
||||
RimWellFlowRateCurve* curve = new RimWellFlowRateCurve;
|
||||
curve->setFlowValuesPrDepthValue(curveName, depthValues, accFlow);
|
||||
@@ -801,10 +816,11 @@ const char* RimWellPltPlot::plotNameFormatString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
const QString simWellName = RimWellPlotTools::simWellName(m_wellPathName);
|
||||
const QString simWellName = RimWellPlotTools::simWellName(m_wellPathName);
|
||||
|
||||
if (fieldNeedingOptions == &m_wellPathName)
|
||||
{
|
||||
@@ -815,7 +831,7 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::P
|
||||
std::set<RifDataSourceForRftPlt> optionAddresses;
|
||||
|
||||
const std::vector<RimEclipseResultCase*> rftCases = RimWellPlotTools::rftCasesForWell(simWellName);
|
||||
std::set<RifDataSourceForRftPlt> availableRftSources;
|
||||
std::set<RifDataSourceForRftPlt> availableRftSources;
|
||||
|
||||
for (const auto& rftCase : rftCases)
|
||||
{
|
||||
@@ -828,11 +844,12 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::P
|
||||
}
|
||||
}
|
||||
|
||||
if ( availableRftSources.size() )
|
||||
if (availableRftSources.size())
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo::createHeader(RifDataSourceForRftPlt::sourceTypeUiText(RifDataSourceForRftPlt::RFT), true));
|
||||
options.push_back(caf::PdmOptionItemInfo::createHeader(
|
||||
RifDataSourceForRftPlt::sourceTypeUiText(RifDataSourceForRftPlt::RFT), true));
|
||||
|
||||
for ( const auto& addr : availableRftSources )
|
||||
for (const auto& addr : availableRftSources)
|
||||
{
|
||||
auto item = caf::PdmOptionItemInfo(addr.eclCase()->caseUserDescription(), QVariant::fromValue(addr));
|
||||
item.setLevel(1);
|
||||
@@ -843,7 +860,8 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::P
|
||||
const std::vector<RimEclipseResultCase*> gridCases = RimWellPlotTools::gridCasesForWell(simWellName);
|
||||
if (gridCases.size() > 0)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo::createHeader(RifDataSourceForRftPlt::sourceTypeUiText(RifDataSourceForRftPlt::GRID), true));
|
||||
options.push_back(caf::PdmOptionItemInfo::createHeader(
|
||||
RifDataSourceForRftPlt::sourceTypeUiText(RifDataSourceForRftPlt::GRID), true));
|
||||
}
|
||||
|
||||
for (const auto& gridCase : gridCases)
|
||||
@@ -856,7 +874,8 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::P
|
||||
|
||||
if (RimWellPlotTools::wellLogFilesContainingFlow(m_wellPathName).size() > 0)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo::createHeader(RifDataSourceForRftPlt::sourceTypeUiText(RifDataSourceForRftPlt::OBSERVED), true));
|
||||
options.push_back(caf::PdmOptionItemInfo::createHeader(
|
||||
RifDataSourceForRftPlt::sourceTypeUiText(RifDataSourceForRftPlt::OBSERVED), true));
|
||||
|
||||
auto addr = RifDataSourceForRftPlt(RifDataSourceForRftPlt::OBSERVED);
|
||||
auto item = caf::PdmOptionItemInfo("Observed Data", QVariant::fromValue(addr));
|
||||
@@ -869,10 +888,8 @@ QList<caf::PdmOptionItemInfo> RimWellPltPlot::calculateValueOptions(const caf::P
|
||||
{
|
||||
std::set<RifEclipseRftAddress::RftWellLogChannelType> channelTypesToUse = RifEclipseRftAddress::pltPlotChannelTypes();
|
||||
|
||||
RimWellPlotTools::calculateValueOptionsForTimeSteps(RimWellPlotTools::simWellName(m_wellPathName),
|
||||
selectedSourcesExpanded(),
|
||||
channelTypesToUse,
|
||||
options);
|
||||
RimWellPlotTools::calculateValueOptionsForTimeSteps(
|
||||
RimWellPlotTools::simWellName(m_wellPathName), selectedSourcesExpanded(), channelTypesToUse, options);
|
||||
}
|
||||
|
||||
if (fieldNeedingOptions == &m_phases)
|
||||
@@ -908,7 +925,7 @@ void RimWellPltPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
}
|
||||
else if (changedField == &m_selectedSources)
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RimWellPath* wellPath = project->wellPathByName(m_wellPathName());
|
||||
if (wellPath && !wellPath->wellPathGeometry())
|
||||
{
|
||||
@@ -918,7 +935,8 @@ void RimWellPltPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
if (!wellPath->wellPathGeometry())
|
||||
{
|
||||
QString tmp = QString("Display of Measured Depth (MD) for Grid or RFT curves is not possible without a well log path, and the curve will be hidden in this mode.\n\n");
|
||||
QString tmp = QString("Display of Measured Depth (MD) for Grid or RFT curves is not possible without a "
|
||||
"well log path, and the curve will be hidden in this mode.\n\n");
|
||||
|
||||
QMessageBox::warning(nullptr, "Grid/RFT curve without MD", tmp);
|
||||
|
||||
@@ -930,8 +948,7 @@ void RimWellPltPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
}
|
||||
}
|
||||
|
||||
if (changedField == &m_selectedSources ||
|
||||
changedField == &m_selectedTimeSteps)
|
||||
if (changedField == &m_selectedSources || changedField == &m_selectedTimeSteps)
|
||||
{
|
||||
updateFormationsOnPlot();
|
||||
syncSourcesIoFieldFromGuiField();
|
||||
@@ -942,16 +959,14 @@ void RimWellPltPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
plotTrack->calculateXZoomRangeAndUpdateQwt();
|
||||
}
|
||||
|
||||
if ( changedField == &m_useStandardConditionCurves
|
||||
|| changedField == &m_useReservoirConditionCurves
|
||||
|| changedField == &m_phases)
|
||||
if (changedField == &m_useStandardConditionCurves || changedField == &m_useReservoirConditionCurves ||
|
||||
changedField == &m_phases)
|
||||
{
|
||||
syncCurvesFromUiSelection();
|
||||
m_wellLogPlot->updateDepthZoom();
|
||||
|
||||
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
||||
plotTrack->calculateXZoomRangeAndUpdateQwt();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -973,7 +988,7 @@ QImage RimWellPltPlot::snapshotWindowContent()
|
||||
if (m_wellLogPlotWidget)
|
||||
{
|
||||
QPixmap pix = QPixmap::grabWidget(m_wellLogPlotWidget);
|
||||
image = pix.toImage();
|
||||
image = pix.toImage();
|
||||
}
|
||||
|
||||
return image;
|
||||
@@ -1023,13 +1038,15 @@ void RimWellPltPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
void RimWellPltPlot::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (field == &m_phases)
|
||||
{
|
||||
caf::PdmUiTreeSelectionEditorAttribute* attrib = dynamic_cast<caf::PdmUiTreeSelectionEditorAttribute*> (attribute);
|
||||
attrib->showTextFilter = false;
|
||||
attrib->showToggleAllCheckbox = false;
|
||||
caf::PdmUiTreeSelectionEditorAttribute* attrib = dynamic_cast<caf::PdmUiTreeSelectionEditorAttribute*>(attribute);
|
||||
attrib->showTextFilter = false;
|
||||
attrib->showToggleAllCheckbox = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1076,7 +1093,6 @@ void RimWellPltPlot::syncSourcesIoFieldFromGuiField()
|
||||
{
|
||||
m_selectedSourcesForIo.push_back(new RimDataSourceForRftPlt(addr));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1084,7 +1100,7 @@ void RimWellPltPlot::syncSourcesIoFieldFromGuiField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPltPlot::calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options)
|
||||
{
|
||||
RimProject * proj = RiaApplication::instance()->project();
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
if (proj != nullptr)
|
||||
{
|
||||
@@ -1093,7 +1109,7 @@ void RimWellPltPlot::calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>
|
||||
{
|
||||
const QString wellName = wellPath->name();
|
||||
|
||||
if(wellPath->wellPathGeometry() || RimWellPlotTools::hasFlowData(wellPath))
|
||||
if (wellPath->wellPathGeometry() || RimWellPlotTools::hasFlowData(wellPath))
|
||||
options.push_back(caf::PdmOptionItemInfo(wellName, wellName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "RimViewWindow.h"
|
||||
#include "RigFlowDiagResultAddress.h"
|
||||
|
||||
#include "RimDataSourceForRftPlt.h"
|
||||
#include "RifDataSourceForRftPltQMetaType.h"
|
||||
#include "RimPlotCurve.h"
|
||||
|
||||
#include "RimWellPlotTools.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
@@ -34,9 +30,9 @@
|
||||
#include <QPointer>
|
||||
#include <QDate>
|
||||
#include <QMetaType>
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include "RifEclipseRftAddress.h"
|
||||
|
||||
class RimEclipseCase;
|
||||
class RimEclipseResultCase;
|
||||
@@ -46,6 +42,8 @@ class RimWellLogPlot;
|
||||
class RimWellPath;
|
||||
class RiuWellPltPlot;
|
||||
class RimWellLogTrack;
|
||||
class RiaRftPltCurveDefinition;
|
||||
class RimDataSourceForRftPlt;
|
||||
|
||||
|
||||
namespace cvf {
|
||||
@@ -70,63 +68,62 @@ public:
|
||||
RimWellPltPlot();
|
||||
~RimWellPltPlot() override;
|
||||
|
||||
void setDescription(const QString& description);
|
||||
QString description() const;
|
||||
void setDescription(const QString& description);
|
||||
QString description() const;
|
||||
|
||||
QWidget* viewWidget() override;
|
||||
void zoomAll() override;
|
||||
QWidget* viewWidget() override;
|
||||
void zoomAll() override;
|
||||
|
||||
RimWellLogPlot* wellLogPlot() const;
|
||||
RimWellLogPlot* wellLogPlot() const;
|
||||
|
||||
void setCurrentWellName(const QString& currWellName);
|
||||
void setCurrentWellName(const QString& currWellName);
|
||||
|
||||
static const char* plotNameFormatString();
|
||||
static const char* plotNameFormatString();
|
||||
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options);
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options);
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
void initAfterRead() override;
|
||||
void setupBeforeSave() override;
|
||||
void initAfterLoad();
|
||||
void initAfterRead() override;
|
||||
void setupBeforeSave() override;
|
||||
void initAfterLoad();
|
||||
|
||||
private:
|
||||
void syncSourcesIoFieldFromGuiField();
|
||||
void syncCurvesFromUiSelection();
|
||||
|
||||
void syncSourcesIoFieldFromGuiField();
|
||||
void syncCurvesFromUiSelection();
|
||||
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
|
||||
void addStackedCurve(const QString& tracerName,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack,
|
||||
cvf::Color3f color,
|
||||
int curveGroupId,
|
||||
bool doFillCurve);
|
||||
|
||||
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
|
||||
void addStackedCurve(const QString& tracerName,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack,
|
||||
cvf::Color3f color,
|
||||
int curveGroupId,
|
||||
bool doFillCurve);
|
||||
|
||||
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
|
||||
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
|
||||
|
||||
// RimViewWindow overrides
|
||||
|
||||
void updateWidgetTitleWindowTitle();
|
||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
void deleteViewWidget() override;
|
||||
void updateWidgetTitleWindowTitle();
|
||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
void deleteViewWidget() override;
|
||||
|
||||
void setPlotXAxisTitles(RimWellLogTrack* plotTrack);
|
||||
void setPlotXAxisTitles(RimWellLogTrack* plotTrack);
|
||||
|
||||
void updateFormationsOnPlot() const;
|
||||
void updateFormationsOnPlot() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
@@ -134,8 +131,8 @@ private:
|
||||
|
||||
caf::PdmField<QString> m_wellPathName;
|
||||
|
||||
caf::PdmField<std::vector<RifDataSourceForRftPlt>> m_selectedSources;
|
||||
caf::PdmChildArrayField<RimDataSourceForRftPlt*> m_selectedSourcesForIo;
|
||||
caf::PdmField<std::vector<RifDataSourceForRftPlt>> m_selectedSources;
|
||||
caf::PdmChildArrayField<RimDataSourceForRftPlt*> m_selectedSourcesForIo;
|
||||
|
||||
caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ RimWellRftPlot::RimWellRftPlot()
|
||||
m_selectedTimeSteps.uiCapability()->setAutoAddingOptionFromValue(false);
|
||||
|
||||
this->setAsPlotMdiWindow();
|
||||
m_isOnLoad = true;
|
||||
m_isOnLoad = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -21,11 +21,6 @@
|
||||
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "RiaRftPltCurveDefinition.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimPlotCurve.h"
|
||||
|
||||
#include "RifDataSourceForRftPltQMetaType.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
@@ -36,6 +31,7 @@
|
||||
#include <QDate>
|
||||
#include <QMetaType>
|
||||
#include <QPointer>
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
@@ -48,6 +44,8 @@ class RimWellLogPlot;
|
||||
class RimWellPath;
|
||||
class RiuWellRftPlot;
|
||||
class RigEclipseCaseData;
|
||||
class RiaRftPltCurveDefinition;
|
||||
class RifDataSourceForRftPlt;
|
||||
|
||||
namespace cvf {
|
||||
class Color3f;
|
||||
@@ -73,60 +71,60 @@ public:
|
||||
RimWellRftPlot();
|
||||
~RimWellRftPlot() override;
|
||||
|
||||
void setDescription(const QString& description);
|
||||
QString description() const;
|
||||
void setDescription(const QString& description);
|
||||
QString description() const;
|
||||
|
||||
QWidget* viewWidget() override;
|
||||
void zoomAll() override;
|
||||
QWidget* viewWidget() override;
|
||||
void zoomAll() override;
|
||||
|
||||
RimWellLogPlot* wellLogPlot() const;
|
||||
RimWellLogPlot* wellLogPlot() const;
|
||||
|
||||
void setSimWellOrWellPathName(const QString& currWellName);
|
||||
int branchIndex() const;
|
||||
void setSimWellOrWellPathName(const QString& currWellName);
|
||||
|
||||
static const char* plotNameFormatString();
|
||||
int branchIndex() const;
|
||||
|
||||
void applyInitialSelections();
|
||||
void applyInitialSelections();
|
||||
|
||||
static const char* plotNameFormatString();
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
private:
|
||||
void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options);
|
||||
void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options);
|
||||
void updateEditorsFromCurves();
|
||||
void updateWidgetTitleWindowTitle();
|
||||
void syncCurvesFromUiSelection();
|
||||
|
||||
void updateEditorsFromCurves();
|
||||
void updateWidgetTitleWindowTitle();
|
||||
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
|
||||
std::set<RiaRftPltCurveDefinition> curveDefsFromCurves() const;
|
||||
|
||||
void syncCurvesFromUiSelection();
|
||||
void updateCurvesInPlot(const std::set<RiaRftPltCurveDefinition>& allCurveDefs,
|
||||
const std::set<RiaRftPltCurveDefinition>& curveDefsToAdd,
|
||||
const std::set<RimWellLogCurve*>& curvesToDelete);
|
||||
|
||||
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
|
||||
std::set<RiaRftPltCurveDefinition> curveDefsFromCurves() const;
|
||||
|
||||
void updateCurvesInPlot(const std::set<RiaRftPltCurveDefinition>& allCurveDefs,
|
||||
const std::set<RiaRftPltCurveDefinition>& curveDefsToAdd,
|
||||
const std::set<RimWellLogCurve*>& curvesToDelete);
|
||||
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
|
||||
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
|
||||
|
||||
// RimViewWindow overrides
|
||||
|
||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
void deleteViewWidget() override;
|
||||
QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
void deleteViewWidget() override;
|
||||
|
||||
void applyCurveAppearance(RimWellLogCurve* newCurve);
|
||||
void applyCurveAppearance(RimWellLogCurve* newCurve);
|
||||
|
||||
void updateFormationsOnPlot() const;
|
||||
QString associatedSimWellName() const;
|
||||
void updateFormationsOnPlot() const;
|
||||
QString associatedSimWellName() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
|
||||
Reference in new issue
Block a user