2017-09-27 05:39:28 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
2017-09-27 05:39:28 -05:00
|
|
|
// 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.
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
2017-09-27 05:39:28 -05:00
|
|
|
// 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.
|
2019-07-25 00:38:46 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-09-27 05:39:28 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-12-02 08:26:24 -06:00
|
|
|
#include "RimEnsembleCurveSetColorManager.h"
|
2017-09-27 05:39:28 -05:00
|
|
|
#include "RimViewWindow.h"
|
2019-09-04 08:51:44 -05:00
|
|
|
#include "RimWellLogPlot.h"
|
2019-12-02 08:26:24 -06:00
|
|
|
#include "RimWellRftEnsembleCurveSet.h"
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2017-11-13 04:10:27 -06:00
|
|
|
#include "RifDataSourceForRftPltQMetaType.h"
|
2022-01-17 06:14:21 -06:00
|
|
|
#include "RiuPlotCurveSymbol.h"
|
2017-11-02 12:14:47 -05:00
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmPtrField.h"
|
2017-10-11 06:52:29 -05:00
|
|
|
#include "cvfCollection.h"
|
2017-10-26 03:35:23 -05:00
|
|
|
|
2017-10-03 01:19:38 -05:00
|
|
|
#include <QDate>
|
|
|
|
#include <QMetaType>
|
2017-11-02 12:14:47 -05:00
|
|
|
#include <QPointer>
|
2019-03-12 03:13:48 -05:00
|
|
|
|
2017-10-13 07:32:26 -05:00
|
|
|
#include <map>
|
2017-11-02 12:14:47 -05:00
|
|
|
#include <set>
|
2017-11-02 05:05:39 -05:00
|
|
|
#include <utility>
|
2017-10-13 06:44:53 -05:00
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
class RimEclipseCase;
|
2017-10-13 02:29:42 -05:00
|
|
|
class RimEclipseResultCase;
|
2019-12-02 08:26:24 -06:00
|
|
|
class RimRegularLegendConfig;
|
2017-10-13 02:29:42 -05:00
|
|
|
class RimWellLogCurve;
|
|
|
|
class RimWellLogFileChannel;
|
2017-10-03 06:54:07 -05:00
|
|
|
class RimWellPath;
|
2019-09-25 10:48:19 -05:00
|
|
|
class RimWellPathCollection;
|
2017-10-13 02:29:42 -05:00
|
|
|
class RiuWellRftPlot;
|
2017-11-02 05:05:39 -05:00
|
|
|
class RigEclipseCaseData;
|
2019-03-12 03:13:48 -05:00
|
|
|
class RiaRftPltCurveDefinition;
|
|
|
|
class RifDataSourceForRftPlt;
|
2019-07-25 00:38:46 -05:00
|
|
|
class RifEclipseRftAddress;
|
2019-12-18 05:25:19 -06:00
|
|
|
class RiuDraggableOverlayFrame;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class Color3f;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
class PdmOptionItemInfo;
|
2017-09-27 05:39:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
2019-07-25 00:38:46 -05:00
|
|
|
///
|
|
|
|
///
|
2017-09-27 05:39:28 -05:00
|
|
|
//==================================================================================================
|
2019-09-04 08:51:44 -05:00
|
|
|
class RimWellRftPlot : public RimWellLogPlot
|
2017-09-27 05:39:28 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2017-10-04 07:36:33 -05:00
|
|
|
|
2017-11-02 05:05:39 -05:00
|
|
|
static const std::set<QString> PRESSURE_DATA_NAMES;
|
2019-07-25 00:38:46 -05:00
|
|
|
static const char PLOT_NAME_QFORMAT_STRING[];
|
2017-09-27 05:39:28 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
RimWellRftPlot();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RimWellRftPlot() override;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
const QString& simWellOrWellPathName() const;
|
2019-09-06 06:17:36 -05:00
|
|
|
void setSimWellOrWellPathName( const QString& currWellName );
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
int branchIndex() const;
|
2017-10-05 09:25:04 -05:00
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
void applyInitialSelections();
|
2019-03-12 03:13:48 -05:00
|
|
|
|
|
|
|
static const char* plotNameFormatString();
|
2017-10-17 04:01:15 -05:00
|
|
|
|
2019-09-06 06:17:36 -05:00
|
|
|
void deleteCurvesAssosicatedWithObservedData( const RimObservedFmuRftData* observedFmuRftData );
|
2019-08-20 08:09:13 -05:00
|
|
|
|
2019-09-25 10:48:19 -05:00
|
|
|
bool showErrorBarsForObservedData() const;
|
2019-12-05 05:54:32 -06:00
|
|
|
void onLegendDefinitionChanged();
|
2019-09-25 10:48:19 -05:00
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
protected:
|
2020-02-12 04:43:15 -06:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2019-09-06 06:17:36 -05:00
|
|
|
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2022-05-29 06:01:27 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
2023-01-30 04:12:26 -06:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptionsForSources() const;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-09-06 06:17:36 -05:00
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2019-07-25 00:38:46 -05:00
|
|
|
void onLoadDataAndUpdate() override;
|
2019-09-04 08:51:44 -05:00
|
|
|
void initAfterRead() override;
|
2021-03-29 01:46:14 -05:00
|
|
|
bool useUndoRedoForFieldChanged() override;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
|
|
|
private:
|
2019-09-17 12:07:55 -05:00
|
|
|
std::map<QString, QStringList> findWellSources();
|
2019-09-26 03:02:29 -05:00
|
|
|
void updateEditorsFromPreviousSelection();
|
2019-09-17 12:07:55 -05:00
|
|
|
void updateEditorsFromCurves();
|
|
|
|
void syncCurvesFromUiSelection();
|
|
|
|
void assignWellPathToExtractionCurves();
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-09-06 06:17:36 -05:00
|
|
|
RimObservedFmuRftData* findObservedFmuData( const QString& wellPathName, const QDateTime& timeStep ) const;
|
2019-08-28 09:00:01 -05:00
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
|
|
|
|
std::set<RiaRftPltCurveDefinition> curveDefsFromCurves() const;
|
2017-10-03 01:19:38 -05:00
|
|
|
|
2019-09-06 06:17:36 -05:00
|
|
|
void updateCurvesInPlot( const std::set<RiaRftPltCurveDefinition>& allCurveDefs,
|
|
|
|
const std::set<RiaRftPltCurveDefinition>& curveDefsToAdd,
|
|
|
|
const std::set<RimWellLogCurve*>& curvesToDelete );
|
2017-11-08 03:30:55 -06:00
|
|
|
|
2019-03-12 03:13:48 -05:00
|
|
|
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
|
2017-10-13 07:32:26 -05:00
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
// RimViewWindow overrides
|
|
|
|
|
2019-10-20 03:45:31 -05:00
|
|
|
void applyCurveAppearance( RimWellLogCurve* curve );
|
|
|
|
void applyCurveColor( RimWellLogCurve* curve );
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
void updateFormationsOnPlot() const;
|
|
|
|
QString associatedSimWellName() const;
|
2017-10-09 03:51:07 -05:00
|
|
|
|
2022-01-17 06:14:21 -06:00
|
|
|
static RiuPlotCurveSymbol::PointSymbolEnum statisticsCurveSymbolFromAddress( const RifEclipseRftAddress& address );
|
|
|
|
static RiuPlotCurveSymbol::LabelPosition statisticsLabelPosFromAddress( const RifEclipseRftAddress& address );
|
2019-07-25 00:38:46 -05:00
|
|
|
|
2019-10-20 03:45:31 -05:00
|
|
|
cvf::Color3f findCurveColor( RimWellLogCurve* curve );
|
|
|
|
void defineCurveColorsAndSymbols( const std::set<RiaRftPltCurveDefinition>& allCurveDefs );
|
2017-11-10 08:41:16 -06:00
|
|
|
|
2019-12-02 08:26:24 -06:00
|
|
|
std::vector<RimSummaryCaseCollection*> selectedEnsembles() const;
|
|
|
|
void createEnsembleCurveSets();
|
|
|
|
RimWellRftEnsembleCurveSet* findEnsembleCurveSet( RimSummaryCaseCollection* ensemble ) const;
|
|
|
|
|
2017-09-27 05:39:28 -05:00
|
|
|
private:
|
2019-12-02 08:26:24 -06:00
|
|
|
friend class RimWellRftEnsembleCurveSet;
|
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
caf::PdmField<QString> m_wellPathNameOrSimWellName;
|
|
|
|
caf::PdmField<int> m_branchIndex;
|
|
|
|
caf::PdmField<bool> m_branchDetection;
|
|
|
|
caf::PdmField<bool> m_showStatisticsCurves;
|
|
|
|
caf::PdmField<bool> m_showEnsembleCurves;
|
2019-09-25 10:48:19 -05:00
|
|
|
caf::PdmField<bool> m_showErrorInObservedData;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-07-25 00:38:46 -05:00
|
|
|
caf::PdmField<std::vector<RifDataSourceForRftPlt>> m_selectedSources;
|
2019-09-26 03:02:29 -05:00
|
|
|
caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps;
|
2017-09-27 05:39:28 -05:00
|
|
|
|
2019-09-25 10:48:19 -05:00
|
|
|
caf::PdmPtrField<RimWellPathCollection*> m_wellPathCollection;
|
|
|
|
|
2019-12-18 05:25:19 -06:00
|
|
|
caf::PdmChildArrayField<RimWellRftEnsembleCurveSet*> m_ensembleCurveSets;
|
|
|
|
std::map<RimWellRftEnsembleCurveSet*, QPointer<RiuDraggableOverlayFrame>> m_ensembleLegendFrames;
|
2018-05-11 06:14:49 -05:00
|
|
|
|
2022-01-17 06:14:21 -06:00
|
|
|
std::map<RifDataSourceForRftPlt, cvf::Color3f> m_dataSourceColors;
|
|
|
|
std::map<QDateTime, RiuPlotCurveSymbol::PointSymbolEnum> m_timeStepSymbols;
|
|
|
|
bool m_isOnLoad;
|
2021-02-24 14:01:16 -06:00
|
|
|
|
|
|
|
caf::PdmChildField<RimWellLogPlot*> m_wellLogPlot_OBSOLETE;
|
2017-09-27 05:39:28 -05:00
|
|
|
};
|