///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RimViewWindow.h" #include "cafPdmField.h" #include "cafPdmObject.h" #include "cafPdmPtrField.h" #include "cvfCollection.h" #include "RimWellRftAddress.h" #include "RimPlotCurve.h" #include #include #include class RimEclipseResultCase; class RimEclipseCase; class RimEclipseWell; class RimFlowDiagSolution; class RimTotalWellAllocationPlot; class RimWellLogPlot; class RiuWellRftPlot; class RimWellLogTrack; class RimTofAccumulatedPhaseFractionsPlot; class RigSingleWellResultsData; class RimWellLogFileChannel; class RimWellPath; class RimWellLogCurve; class RigWellPath; namespace cvf { class Color3f; } namespace caf { class PdmOptionItemInfo; } //================================================================================================== /// /// //================================================================================================== class RimWellRftPlot : public RimViewWindow { CAF_PDM_HEADER_INIT; static const char PRESSURE_DATA_NAME[]; static const char PLOT_NAME_QFORMAT_STRING[]; public: RimWellRftPlot(); virtual ~RimWellRftPlot(); void setDescription(const QString& description); QString description() const; virtual void loadDataAndUpdate() override; virtual QWidget* viewWidget() override; virtual void zoomAll() override; RimWellLogPlot* wellLogPlot() const; void setCurrentWellName(const QString& currWellName); QString currentWellName() const; static bool hasPressureData(RimWellLogFile* wellLogFile); static bool hasPressureData(RimWellLogFileChannel* channel); static bool hasPressureData(RimEclipseResultCase* gridCase); static const char* plotNameFormatString(); protected: // Overridden PDM methods virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; } virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; virtual QImage snapshotWindowContent() override; virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; private: void calculateValueOptionsForWells(QList& options); void calculateValueOptionsForTimeSteps(const QString& wellName, QList& options); void updateEditorsFromCurves(); void updateWidgetTitleWindowTitle(); void syncCurvesFromUiSelection(); std::vector wellPathsContainingPressure(const QString& wellName) const; std::vector getPressureChannelsFromWellPath(const RimWellPath* wellPath) const; RimEclipseCase* eclipseCaseFromCaseId(int caseId); RimWellPath* wellPathForObservedData(const QString& wellName, const QDateTime& date) const; std::vector> eclipseCasesContainingPressure(const QString& wellName) const; std::vector gridCasesFromEclipseCases(const std::vector>& eclipseCasesTuple) const; std::vector rftCasesFromEclipseCases(const std::vector>& eclipseCasesTuple) const; std::vector timeStepsFromRftCase(RimEclipseResultCase* gridCase) const; std::vector timeStepsFromGridCase(const RimEclipseCase* gridCase) const; std::vector timeStepsFromWellPaths(const std::vector wellPaths) const; std::set> selectedCurveDefs() const; std::set> curveDefsFromCurves() const; std::pair curveDefFromCurve(const RimWellLogCurve* curve) const; void updateCurvesInPlot(const std::set>& allCurveDefs, const std::set>& curveDefsToAdd, const std::set& curvesToDelete); // RimViewWindow overrides virtual QWidget* createViewWidget(QWidget* mainWindowParent) override; virtual void deleteViewWidget() override; void applyCurveAppearance(RimWellLogCurve* newCurve); private: caf::PdmField m_showPlotTitle; caf::PdmField m_userName; caf::PdmField m_wellName; caf::PdmField m_branchIndex; caf::PdmField> m_selectedSources; caf::PdmField> m_selectedTimeSteps; QPointer m_wellLogPlotWidget; caf::PdmChildField m_wellLogPlot; };