///////////////////////////////////////////////////////////////////////////////// // // 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 class RigSimWellData; class RimEclipseResultCase; class RimFlowDiagSolution; class RimSimWellInView; class RimTofAccumulatedPhaseFractionsPlot; class RimTotalWellAllocationPlot; class RimWellAllocationPlotLegend; class RimWellLogPlot; class RimWellLogTrack; class RiuWellAllocationPlot; namespace cvf { class Color3f; } namespace caf { class PdmOptionItemInfo; } //================================================================================================== /// /// //================================================================================================== class RimWellAllocationPlot : public RimViewWindow { CAF_PDM_HEADER_INIT; public: enum FlowType { ACCUMULATED, INFLOW}; public: RimWellAllocationPlot(); ~RimWellAllocationPlot() override; void setFromSimulationWell(RimSimWellInView* simWell); void setDescription(const QString& description); QString description() const; QWidget* viewWidget() override; void zoomAll() override; RimWellLogPlot* accumulatedWellFlowPlot(); RimTotalWellAllocationPlot* totalWellFlowPlot(); RimTofAccumulatedPhaseFractionsPlot* tofAccumulatedPhaseFractionsPlot(); caf::PdmObject* plotLegend(); RimEclipseResultCase* rimCase(); int timeStep(); QString wellName() const; void removeFromMdiAreaAndDeleteViewWidget(); void showPlotLegend(bool doShow); protected: // Overridden PDM methods caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; } void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; std::set findSortedWellNames(); QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; QImage snapshotWindowContent() override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void onLoadDataAndUpdate() override; private: void updateFromWell(); std::map *> findRelevantTracerCellFractions(const RigSimWellData* simWellData); void updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTrack); void addStackedCurve(const QString& tracerName, const std::vector& depthValues, const std::vector& accFlow, RimWellLogTrack* plotTrack); void updateWidgetTitleWindowTitle(); static QString wellStatusTextForTimeStep(const QString& wellName, const RimEclipseResultCase* eclipseResultCase, size_t timeStep); // RimViewWindow overrides QWidget* createViewWidget(QWidget* mainWindowParent) override; void deleteViewWidget() override; cvf::Color3f getTracerColor(const QString& tracerName); void updateFormationNamesData() const; private: caf::PdmField m_showPlotTitle; caf::PdmField m_userName; caf::PdmField m_branchDetection; caf::PdmPtrField m_case; caf::PdmField m_wellName; caf::PdmField m_timeStep; caf::PdmPtrField m_flowDiagSolution; caf::PdmField m_groupSmallContributions; caf::PdmField m_smallContributionsThreshold; caf::PdmField > m_flowType; QPointer m_wellAllocationPlotWidget; caf::PdmChildField m_accumulatedWellFlowPlot; caf::PdmChildField m_totalWellAllocationPlot; caf::PdmChildField m_wellAllocationPlotLegend; caf::PdmChildField m_tofAccumulatedPhaseFractionsPlot; };