2015-08-26 05:27:29 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-12-07 07:51:58 -06:00
|
|
|
#include "RimWellLogPlot.h"
|
|
|
|
|
2017-12-11 05:59:03 -06:00
|
|
|
#include "RigWellPathFormations.h"
|
|
|
|
|
2015-08-26 05:27:29 -05:00
|
|
|
#include "cafPdmObject.h"
|
2015-08-27 09:13:49 -05:00
|
|
|
#include "cafPdmField.h"
|
2015-08-27 09:43:54 -05:00
|
|
|
#include "cafPdmChildArrayField.h"
|
2017-10-25 07:41:54 -05:00
|
|
|
#include "cafPdmPtrField.h"
|
2015-08-27 09:43:54 -05:00
|
|
|
|
2015-08-30 19:06:37 -05:00
|
|
|
#include <QPointer>
|
|
|
|
|
2017-10-26 03:01:56 -05:00
|
|
|
#include <memory>
|
2015-08-30 19:06:37 -05:00
|
|
|
#include <vector>
|
2017-10-27 08:17:24 -05:00
|
|
|
#include <map>
|
2015-08-30 19:06:37 -05:00
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
class RigWellPath;
|
|
|
|
class RimCase;
|
2018-08-30 07:03:58 -05:00
|
|
|
class RimWellPathAttributeCollection;
|
2017-10-25 07:41:54 -05:00
|
|
|
class RimWellFlowRateCurve;
|
2015-11-04 09:19:38 -06:00
|
|
|
class RimWellLogCurve;
|
2017-10-25 07:41:54 -05:00
|
|
|
class RimWellPath;
|
|
|
|
class RiuPlotAnnotationTool;
|
2018-10-03 08:57:09 -05:00
|
|
|
class RiuWellPathAttributePlotObject;
|
2015-11-04 08:57:06 -06:00
|
|
|
class RiuWellLogTrack;
|
2017-10-27 04:41:19 -05:00
|
|
|
class RigEclipseWellLogExtractor;
|
|
|
|
class RimWellLogPlotCollection;
|
|
|
|
class RigGeoMechWellLogExtractor;
|
|
|
|
class RigResultAccessor;
|
|
|
|
class RigFemResultAddress;
|
2015-08-26 05:27:29 -05:00
|
|
|
|
2015-09-17 04:34:03 -05:00
|
|
|
class QwtPlotCurve;
|
|
|
|
|
2017-10-27 04:41:19 -05:00
|
|
|
struct CurveSamplingPointData
|
|
|
|
{
|
|
|
|
std::vector<double> data;
|
|
|
|
std::vector<double> md;
|
|
|
|
std::vector<double> tvd;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-08-26 05:27:29 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
2015-11-04 08:57:06 -06:00
|
|
|
class RimWellLogTrack : public caf::PdmObject
|
2015-08-26 05:27:29 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
2015-11-04 08:57:06 -06:00
|
|
|
RimWellLogTrack();
|
|
|
|
virtual ~RimWellLogTrack();
|
2015-08-27 09:13:49 -05:00
|
|
|
|
2018-06-27 05:42:11 -05:00
|
|
|
enum TrajectoryType { WELL_PATH, SIMULATION_WELL };
|
|
|
|
enum FormationSource { CASE, WELL_PICK_FILTER };
|
2018-06-27 03:01:44 -05:00
|
|
|
enum WidthScaleFactor { EXTRA_NARROW_TRACK = 2, NARROW_TRACK = 3, NORMAL_TRACK = 4, WIDE_TRACK = 6, EXTRA_WIDE_TRACK = 10 };
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2015-09-18 04:07:21 -05:00
|
|
|
void setDescription(const QString& description);
|
2015-10-29 04:29:48 -05:00
|
|
|
bool isVisible();
|
2015-11-04 09:19:38 -06:00
|
|
|
void addCurve(RimWellLogCurve* curve);
|
|
|
|
void insertCurve(RimWellLogCurve* curve, size_t index);
|
2017-11-15 03:41:00 -06:00
|
|
|
void takeOutCurve(RimWellLogCurve* curve);
|
|
|
|
void deleteAllCurves();
|
|
|
|
|
2018-06-26 04:18:24 -05:00
|
|
|
size_t curveIndex(RimWellLogCurve* curve);
|
|
|
|
size_t curveCount() { return curves.size(); }
|
|
|
|
void setXAxisTitle(const QString& text);
|
2018-06-26 03:38:44 -05:00
|
|
|
QString depthPlotTitle() const;
|
2018-06-26 04:18:24 -05:00
|
|
|
int widthScaleFactor() const;
|
2018-06-26 09:23:06 -05:00
|
|
|
void setWidthScaleFactor(WidthScaleFactor scaleFactor);
|
2017-11-28 04:00:36 -06:00
|
|
|
|
|
|
|
void setFormationWellPath(RimWellPath* wellPath);
|
2018-09-07 07:37:35 -05:00
|
|
|
RimWellPath* formationWellPath() const;
|
2017-11-28 04:00:36 -06:00
|
|
|
void setFormationSimWellName(const QString& simWellName);
|
2017-11-06 06:39:14 -06:00
|
|
|
void setFormationBranchIndex(int branchIndex);
|
2017-11-28 04:00:36 -06:00
|
|
|
void setFormationCase(RimCase* rimCase);
|
|
|
|
void setFormationTrajectoryType(TrajectoryType trajectoryType);
|
2017-11-12 07:45:06 -06:00
|
|
|
RimCase* formationNamesCase() const;
|
2015-09-02 09:46:30 -05:00
|
|
|
|
2015-09-03 07:21:08 -05:00
|
|
|
void recreateViewer();
|
2015-09-03 08:10:02 -05:00
|
|
|
void detachAllCurves();
|
2018-09-07 06:39:50 -05:00
|
|
|
void reattachAllCurves();
|
2015-09-03 08:10:02 -05:00
|
|
|
|
2018-09-10 02:55:07 -05:00
|
|
|
void loadDataAndUpdate(bool updateParentPlotAndToolbars = false);
|
2017-12-07 07:51:58 -06:00
|
|
|
|
2017-11-09 06:36:14 -06:00
|
|
|
void setAndUpdateWellPathFormationNamesData(RimCase* rimCase, RimWellPath* wellPath);
|
2017-12-07 07:51:58 -06:00
|
|
|
|
|
|
|
void setAndUpdateSimWellFormationNamesAndBranchData(RimCase* rimCase, const QString& simWellName, int branchIndex, bool useBranchDetection);
|
|
|
|
void setAndUpdateSimWellFormationNamesData(RimCase* rimCase, const QString& simWellName);
|
|
|
|
|
2018-05-23 04:28:57 -05:00
|
|
|
void setAutoScaleXEnabled(bool enabled);
|
2015-10-28 10:49:52 -05:00
|
|
|
void availableDepthRange(double* minimumDepth, double* maximumDepth);
|
2018-05-23 04:28:57 -05:00
|
|
|
void updateParentPlotZoom();
|
|
|
|
void calculateXZoomRangeAndUpdateQwt();
|
|
|
|
void applyXZoomFromVisibleRange();
|
|
|
|
void calculateXZoomRange();
|
|
|
|
void updateEditors();
|
2018-06-29 04:41:08 -05:00
|
|
|
void setVisibleXRange(double minValue, double maxValue);
|
|
|
|
void setTickIntervals(double majorTickInterval, double minorTickInterval);
|
2018-07-06 04:22:18 -05:00
|
|
|
void setXAxisGridVisibility(RimWellLogPlot::AxisGridVisibility gridLines);
|
2017-11-12 14:22:12 -06:00
|
|
|
void setShowFormations(bool on);
|
2018-09-07 07:37:35 -05:00
|
|
|
bool showFormations() const;
|
2018-07-06 02:16:03 -05:00
|
|
|
void setShowFormationLabels(bool on);
|
2018-10-03 08:57:09 -05:00
|
|
|
|
2018-09-07 07:37:35 -05:00
|
|
|
bool showWellPathAttributes() const;
|
2018-10-03 08:57:09 -05:00
|
|
|
bool showWellPathAttributesBothSides() const;
|
|
|
|
void setShowWellPathAttributes(bool on);
|
2018-09-05 07:03:18 -05:00
|
|
|
void setWellPathAttributesSource(RimWellPath* wellPath);
|
2018-09-07 07:37:35 -05:00
|
|
|
|
|
|
|
RimWellPath* wellPathAttributeSource() const;
|
2015-11-04 08:57:06 -06:00
|
|
|
RiuWellLogTrack* viewer();
|
2015-09-17 04:34:03 -05:00
|
|
|
|
2015-11-04 09:19:38 -06:00
|
|
|
RimWellLogCurve* curveDefinitionFromCurve(const QwtPlotCurve* curve) const;
|
2015-08-30 19:06:37 -05:00
|
|
|
|
2018-09-07 07:37:35 -05:00
|
|
|
void setLogarithmicScale(bool enable);
|
2015-12-09 04:32:46 -06:00
|
|
|
|
2017-10-27 08:17:24 -05:00
|
|
|
std::map<int, std::vector<RimWellFlowRateCurve*>> visibleStackedCurves();
|
2017-03-09 07:27:41 -06:00
|
|
|
|
|
|
|
QString description();
|
|
|
|
std::vector<RimWellLogCurve* > curvesVector();
|
|
|
|
|
2018-01-04 09:42:57 -06:00
|
|
|
void uiOrderingForRftPltFormations(caf::PdmUiOrdering& uiOrdering);
|
2018-06-27 05:42:11 -05:00
|
|
|
void uiOrderingForXAxisSettings(caf::PdmUiOrdering& uiOrdering);
|
2017-11-03 02:58:08 -05:00
|
|
|
|
2018-01-26 03:28:24 -06:00
|
|
|
void setFormationsForCaseWithSimWellOnly(bool caseWithSimWellOnly);
|
2018-07-09 01:54:59 -05:00
|
|
|
void updateAxisAndGridTickIntervals();
|
2018-01-26 03:28:24 -06:00
|
|
|
|
2018-09-07 06:39:50 -05:00
|
|
|
void updateAllLegendItems();
|
2017-10-26 03:18:42 -05:00
|
|
|
private:
|
2017-10-25 07:41:54 -05:00
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
2018-06-26 04:18:24 -05:00
|
|
|
void updateParentPlotLayout();
|
2017-10-25 07:41:54 -05:00
|
|
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
2015-12-09 00:55:35 -06:00
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
virtual caf::PdmFieldHandle* objectToggleField() override;
|
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
|
|
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
2015-08-27 09:13:49 -05:00
|
|
|
|
2017-10-26 03:18:42 -05:00
|
|
|
void computeAndSetXRangeMinForLogarithmicScale();
|
2017-10-26 03:01:56 -05:00
|
|
|
|
|
|
|
static void simWellOptionItems(QList<caf::PdmOptionItemInfo>* options, RimCase* eclCase);
|
2017-10-27 04:41:19 -05:00
|
|
|
|
2017-12-07 07:51:58 -06:00
|
|
|
static RigEclipseWellLogExtractor* createSimWellExtractor(RimWellLogPlotCollection* wellLogCollection, RimCase* rimCase, const QString& simWellName, int branchIndex, bool useBranchDetection);
|
2017-10-27 04:41:19 -05:00
|
|
|
|
|
|
|
static CurveSamplingPointData curveSamplingPointData(RigEclipseWellLogExtractor* extractor, RigResultAccessor* resultAccessor);
|
|
|
|
static CurveSamplingPointData curveSamplingPointData(RigGeoMechWellLogExtractor* extractor, const RigFemResultAddress& resultAddress);
|
|
|
|
|
|
|
|
static std::vector<QString> formationNameIndexToName(RimCase* rimCase, const std::vector<int>& formationNameInidces);
|
|
|
|
|
|
|
|
static void findFormationNamesToPlot(const CurveSamplingPointData& curveData,
|
|
|
|
const std::vector<QString>& formationNamesVector,
|
|
|
|
RimWellLogPlot::DepthTypeEnum depthType,
|
|
|
|
std::vector<QString>* formationNamesToPlot,
|
|
|
|
std::vector<std::pair<double, double>>* yValues);
|
|
|
|
|
|
|
|
static std::vector<QString> formationNamesVector(RimCase* rimCase);
|
|
|
|
|
2017-11-05 05:26:27 -06:00
|
|
|
void setFormationFieldsUiReadOnly(bool readOnly = true);
|
|
|
|
|
2017-10-25 07:41:54 -05:00
|
|
|
void updateFormationNamesOnPlot();
|
2018-08-30 07:03:58 -05:00
|
|
|
void updateWellPathAttributesOnPlot();
|
2017-10-25 07:41:54 -05:00
|
|
|
void removeFormationNames();
|
2015-12-09 00:55:35 -06:00
|
|
|
void updateAxisScaleEngine();
|
2018-07-06 02:17:16 -05:00
|
|
|
bool isFirstVisibleTrackInPlot() const;
|
2015-12-09 00:55:35 -06:00
|
|
|
|
2018-07-09 01:54:59 -05:00
|
|
|
std::pair<double, double> adjustXRange(double minValue, double maxValue, double tickInterval);
|
|
|
|
|
2018-09-05 07:03:18 -05:00
|
|
|
void updateWellPathAttributesCollection();
|
2015-08-27 09:13:49 -05:00
|
|
|
private:
|
2017-02-08 06:23:52 -06:00
|
|
|
QString m_xAxisTitle;
|
|
|
|
|
2018-07-06 04:22:18 -05:00
|
|
|
caf::PdmField<bool> m_show;
|
|
|
|
caf::PdmField<QString> m_userName;
|
|
|
|
caf::PdmChildArrayField<RimWellLogCurve*> curves;
|
|
|
|
caf::PdmField<double> m_visibleXRangeMin;
|
|
|
|
caf::PdmField<double> m_visibleXRangeMax;
|
|
|
|
caf::PdmField<bool> m_isAutoScaleXEnabled;
|
|
|
|
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
|
|
|
|
caf::PdmField<RimWellLogPlot::AxisGridEnum> m_xAxisGridVisibility;
|
|
|
|
caf::PdmField<bool> m_explicitTickIntervals;
|
|
|
|
caf::PdmField<double> m_majorTickInterval;
|
|
|
|
caf::PdmField<double> m_minorTickInterval;
|
2018-06-27 05:42:11 -05:00
|
|
|
|
2017-12-11 05:59:03 -06:00
|
|
|
caf::PdmField<bool> m_showFormations;
|
2018-07-06 02:16:03 -05:00
|
|
|
caf::PdmField<bool> m_showFormationLabels;
|
2018-06-27 03:01:44 -05:00
|
|
|
caf::PdmField<caf::AppEnum<FormationSource>> m_formationSource;
|
2017-12-11 05:59:03 -06:00
|
|
|
caf::PdmPtrField<RimCase*> m_formationCase;
|
2018-06-27 03:01:44 -05:00
|
|
|
caf::PdmField<caf::AppEnum<TrajectoryType>> m_formationTrajectoryType;
|
2018-01-04 09:42:57 -06:00
|
|
|
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceCase;
|
|
|
|
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceWellPath;
|
2017-12-11 05:59:03 -06:00
|
|
|
caf::PdmField<QString> m_formationSimWellName;
|
|
|
|
caf::PdmField<int> m_formationBranchIndex;
|
|
|
|
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;
|
|
|
|
caf::PdmField<bool> m_showformationFluids;
|
2018-06-26 09:23:06 -05:00
|
|
|
caf::PdmField<caf::AppEnum<WidthScaleFactor>> m_widthScaleFactor;
|
2018-06-27 03:01:44 -05:00
|
|
|
caf::PdmField<bool> m_formationBranchDetection;
|
2018-08-30 07:03:58 -05:00
|
|
|
caf::PdmField<bool> m_showWellPathAttributes;
|
2018-10-03 08:57:09 -05:00
|
|
|
caf::PdmField<bool> m_showWellPathAttributesFromCompletions;
|
2018-08-30 07:03:58 -05:00
|
|
|
caf::PdmField<bool> m_showWellPathAttributeBothSides;
|
2018-10-03 08:57:09 -05:00
|
|
|
caf::PdmField<bool> m_showWellPathAttributeLabels;
|
2018-08-30 07:03:58 -05:00
|
|
|
caf::PdmField<bool> m_wellPathAttributesInLegend;
|
2018-09-05 07:03:18 -05:00
|
|
|
caf::PdmPtrField<RimWellPath*> m_wellPathAttributeSource;
|
|
|
|
caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection;
|
2018-10-03 08:57:09 -05:00
|
|
|
|
2018-10-05 08:59:19 -05:00
|
|
|
std::vector<cvf::ref<RiuWellPathAttributePlotObject>> m_wellPathAttributePlotObjects;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2018-01-26 03:28:24 -06:00
|
|
|
bool m_formationsForCaseWithSimWellOnly;
|
|
|
|
|
2015-11-04 08:57:06 -06:00
|
|
|
QPointer<RiuWellLogTrack> m_wellLogTrackPlotWidget;
|
2017-10-25 07:41:54 -05:00
|
|
|
|
2017-10-26 03:01:56 -05:00
|
|
|
std::unique_ptr<RiuPlotAnnotationTool> m_annotationTool;
|
2015-08-26 05:27:29 -05:00
|
|
|
};
|