///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2023- Equinor 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 "RimPlot.h" #include "cafPdmField.h" #include "cafPdmPtrField.h" #include #include #include #include #include class RigAccWellFlowCalculator; class RimEclipseResultCase; class RimFlowDiagSolution; class RigWellAllocationOverTime; class RimSimWellInView; class RiuPlotWidget; class RiuQwtPlotWidget; namespace cvf { class Color3f; } class RimWellAllocationOverTimePlot : public RimPlot { CAF_PDM_HEADER_INIT; public: enum class FlowValueType { FLOW_RATE, FLOW_RATE_PERCENTAGE, FLOW_VOLUME, ACCUMULATED_FLOW_VOLUME, ACCUMULATED_FLOW_VOLUME_PERCENTAGE, }; enum class TimeStepFilterMode { NONE, TIME_STEP_COUNT, }; public: RimWellAllocationOverTimePlot(); ~RimWellAllocationOverTimePlot() override; void setDescription( const QString& description ); void setFromSimulationWell( RimSimWellInView* simWell ); void setWellName( const QString& wellName ); // RimPlot implementations RiuPlotWidget* plotWidget() override; void setAutoScaleXEnabled( bool enabled ) override{}; void setAutoScaleYEnabled( bool enabled ) override{}; void updateAxes() override{}; void updateLegend() override{}; QString asciiDataForPlotExport() const override; void reattachAllCurves() override{}; void detachAllCurves() override{}; // RimPlotWindow implementations QString description() const override; // RimViewWindow implementations QWidget* viewWidget() override; QImage snapshotWindowContent() override; void zoomAll() override{}; private: // RimPlot implementations RiuPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent ) override; // RimViewWindow implementations void deleteViewWidget() override; void onLoadDataAndUpdate() override; // PDM methods caf::PdmFieldHandle* userDescriptionField() override; private: void doUpdateLayout() override; void updateFromWell(); RigWellAllocationOverTime createWellAllocationOverTime() const; std::set findSortedWellNames(); cvf::Color3f getTracerColor( const QString& tracerName ); void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; QString getValueTypeText() const; QString dateFormatString() const; void setValidTimeStepRangeForCase(); int axisTitleFontSize() const; int axisValueFontSize() const; std::set getSelectedTimeSteps( const std::vector& timeSteps ) const; private: caf::PdmField m_userName; caf::PdmPtrField m_case; caf::PdmField m_wellName; caf::PdmField m_selectedFromTimeStep; caf::PdmField m_selectedToTimeStep; caf::PdmField> m_timeStepFilterMode; caf::PdmField m_timeStepCount; caf::PdmField> m_excludeTimeSteps; caf::PdmField m_applyTimeStepSelections; caf::PdmPtrField m_flowDiagSolution; caf::PdmField> m_flowValueType; caf::PdmField m_groupSmallContributions; caf::PdmField m_smallContributionsThreshold; QPointer m_plotWidget; caf::PdmField m_axisTitleFontSize; caf::PdmField m_axisValueFontSize; const int m_initialNumberOfTimeSteps = 10; };