2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02: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-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02: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-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-05-18 09:45:23 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2017-06-13 15:41:52 +02:00
|
|
|
#include "RiaDefines.h"
|
2017-08-11 10:25:33 +02:00
|
|
|
#include "RiaPorosityModel.h"
|
2014-07-24 10:11:43 +02:00
|
|
|
|
2017-08-10 15:08:30 +02:00
|
|
|
#include "RigFlowDiagResultAddress.h"
|
2023-05-11 08:37:58 +02:00
|
|
|
|
2021-10-06 12:25:20 +02:00
|
|
|
#include "RimCheckableObject.h"
|
2018-09-27 15:11:49 +02:00
|
|
|
#include "RimFlowDiagSolution.h"
|
2017-08-10 15:08:30 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "cafAppEnum.h"
|
|
|
|
|
#include "cafPdmField.h"
|
2014-07-24 10:11:43 +02:00
|
|
|
#include "cafPdmObject.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "cafPdmPointer.h"
|
2016-12-14 09:50:30 +01:00
|
|
|
#include "cafPdmPtrField.h"
|
2018-09-27 22:29:04 +02:00
|
|
|
#include "cafPdmUiItem.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2018-11-23 08:20:05 +01:00
|
|
|
#include <limits>
|
|
|
|
|
|
2013-03-22 15:43:42 +01:00
|
|
|
class RigCaseCellResultsData;
|
2015-09-01 13:56:35 +02:00
|
|
|
class RimEclipseCase;
|
2016-10-21 14:02:06 +02:00
|
|
|
class RimEclipseView;
|
|
|
|
|
class RimReservoirCellResultsStorage;
|
2019-11-22 12:36:39 +01:00
|
|
|
class RimRegularLegendConfig;
|
|
|
|
|
class RimTernaryLegendConfig;
|
2023-05-11 08:37:58 +02:00
|
|
|
class RigEclipseResultAddress;
|
2016-10-21 14:02:06 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
|
|
|
|
///
|
2012-05-18 09:45:23 +02:00
|
|
|
//==================================================================================================
|
2021-10-06 12:25:20 +02:00
|
|
|
class RimEclipseResultDefinition : public RimCheckableObject
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2017-01-12 11:13:33 +01:00
|
|
|
|
|
|
|
|
public:
|
2023-05-11 08:37:58 +02:00
|
|
|
enum class FlowTracerSelectionType
|
2017-01-12 11:13:33 +01:00
|
|
|
{
|
2017-01-12 15:00:18 +01:00
|
|
|
FLOW_TR_INJ_AND_PROD,
|
2017-01-12 11:13:33 +01:00
|
|
|
FLOW_TR_PRODUCERS,
|
2017-01-12 15:00:18 +01:00
|
|
|
FLOW_TR_INJECTORS,
|
|
|
|
|
FLOW_TR_BY_SELECTION
|
2017-01-12 11:13:33 +01:00
|
|
|
};
|
2023-04-14 14:07:45 +02:00
|
|
|
using FlowTracerSelectionEnum = caf::AppEnum<RimEclipseResultDefinition::FlowTracerSelectionType>;
|
2017-01-12 11:13:33 +01:00
|
|
|
|
2023-05-11 08:37:58 +02:00
|
|
|
enum class FlowTracerSelectionState
|
2018-09-27 22:29:04 +02:00
|
|
|
{
|
|
|
|
|
NONE_SELECTED,
|
|
|
|
|
ONE_SELECTED,
|
2018-09-28 14:21:55 +02:00
|
|
|
MULTIPLE_SELECTED,
|
|
|
|
|
ALL_SELECTED
|
2018-09-27 22:29:04 +02:00
|
|
|
};
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
public:
|
2019-09-06 10:40:57 +02:00
|
|
|
RimEclipseResultDefinition( caf::PdmUiItemInfo::LabelPosType labelPosition = caf::PdmUiItemInfo::LEFT );
|
2018-10-18 19:45:57 +02:00
|
|
|
~RimEclipseResultDefinition() override;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void simpleCopy( const RimEclipseResultDefinition* other );
|
2016-12-20 14:33:35 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setEclipseCase( RimEclipseCase* eclipseCase );
|
2019-11-20 10:28:35 +01:00
|
|
|
RimEclipseCase* eclipseCase() const;
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2021-10-06 12:25:20 +02:00
|
|
|
RiaDefines::ResultCatType resultType() const;
|
2019-09-06 10:40:57 +02:00
|
|
|
void setResultType( RiaDefines::ResultCatType val );
|
2021-10-06 12:25:20 +02:00
|
|
|
RiaDefines::PorosityModelType porosityModel() const;
|
2020-02-12 11:13:38 +01:00
|
|
|
void setPorosityModel( RiaDefines::PorosityModelType val );
|
2021-10-06 12:25:20 +02:00
|
|
|
QString resultVariable() const;
|
2020-02-12 11:13:38 +01:00
|
|
|
virtual void setResultVariable( const QString& val );
|
2020-06-19 12:40:48 +02:00
|
|
|
RiaDefines::PhaseType resultPhaseType() const;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setFlowSolution( RimFlowDiagSolution* flowSol );
|
2019-11-20 10:28:35 +01:00
|
|
|
RimFlowDiagSolution* flowDiagSolution() const;
|
2019-09-06 10:40:57 +02:00
|
|
|
RigFlowDiagResultAddress flowDiagResAddress() const;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setFlowDiagTracerSelectionType( FlowTracerSelectionType selectionType );
|
2017-03-02 16:10:18 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
QString resultVariableUiName() const;
|
|
|
|
|
QString resultVariableUiShortName() const;
|
2017-01-04 13:13:06 +01:00
|
|
|
|
2021-02-11 03:01:17 +01:00
|
|
|
void enableDeltaResults( bool enable );
|
|
|
|
|
int timeLapseBaseTimeStep() const;
|
|
|
|
|
int caseDiffIndex() const;
|
|
|
|
|
QString additionalResultText() const;
|
2019-09-10 09:18:40 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void loadResult();
|
|
|
|
|
RigEclipseResultAddress eclipseResultAddress() const;
|
|
|
|
|
void setFromEclipseResultAddress( const RigEclipseResultAddress& resultAddress );
|
|
|
|
|
bool hasStaticResult() const;
|
|
|
|
|
bool hasDynamicResult() const;
|
|
|
|
|
bool hasResult() const;
|
|
|
|
|
bool isTernarySaturationSelected() const;
|
|
|
|
|
bool isCompletionTypeSelected() const;
|
|
|
|
|
bool hasCategoryResult() const;
|
|
|
|
|
bool isFlowDiagOrInjectionFlooding() const;
|
2014-04-04 10:59:21 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RigCaseCellResultsData* currentGridCellResults() const;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void loadDataAndUpdate();
|
|
|
|
|
void updateAnyFieldHasChanged();
|
2016-09-07 11:41:02 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setTofAndSelectTracer( const QString& tracerName );
|
|
|
|
|
void setSelectedTracers( const std::vector<QString>& selectedTracers );
|
|
|
|
|
void setSelectedInjectorTracers( const std::vector<QString>& selectedTracers );
|
|
|
|
|
void setSelectedProducerTracers( const std::vector<QString>& selectedTracers );
|
|
|
|
|
void setSelectedSouringTracers( const std::vector<QString>& selectedTracers );
|
2017-02-13 15:00:49 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateUiFieldsFromActiveResult();
|
2017-03-17 16:09:48 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
bool hasDualPorFractureResult();
|
2019-03-08 14:52:43 +01:00
|
|
|
|
2023-02-26 10:48:40 +01:00
|
|
|
static QList<caf::PdmOptionItemInfo> calcOptionsForVariableUiFieldStandard( RiaDefines::ResultCatType resultCatType,
|
2019-09-06 10:40:57 +02:00
|
|
|
const RigCaseCellResultsData* results,
|
|
|
|
|
bool showDerivedResultsFirst = false,
|
|
|
|
|
bool addPerCellFaceOptionItems = false,
|
2023-02-26 10:48:40 +01:00
|
|
|
bool enableTernary = false );
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
void setTernaryEnabled( bool enabled );
|
2019-03-18 12:52:01 +01:00
|
|
|
|
2023-02-26 10:48:40 +01:00
|
|
|
void updateRangesForExplicitLegends( RimRegularLegendConfig* legendConfig, RimTernaryLegendConfig* ternaryLegendConfig, int currentTimeStep );
|
2019-11-22 12:36:39 +01:00
|
|
|
void updateLegendTitle( RimRegularLegendConfig* legendConfig, const QString& legendHeading );
|
|
|
|
|
|
2023-05-11 08:37:58 +02:00
|
|
|
bool showOnlyVisibleCategoriesInLegend() const;
|
|
|
|
|
|
2016-12-14 09:50:30 +01:00
|
|
|
protected:
|
2019-09-06 10:40:57 +02:00
|
|
|
virtual void updateLegendCategorySettings(){};
|
2016-12-14 09:50:30 +01:00
|
|
|
|
2022-05-29 13:01:27 +02:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
2023-02-26 10:48:40 +01:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2018-09-27 15:11:49 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void initAfterRead() override;
|
|
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2023-02-26 10:48:40 +01:00
|
|
|
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
2016-10-21 13:57:15 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
protected:
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<caf::AppEnum<RiaDefines::ResultCatType>> m_resultType;
|
|
|
|
|
caf::PdmField<caf::AppEnum<RiaDefines::PorosityModelType>> m_porosityModel;
|
|
|
|
|
caf::PdmField<QString> m_resultVariable;
|
2020-01-16 21:53:38 +01:00
|
|
|
caf::PdmField<QString> m_inputPropertyFileName;
|
2013-04-30 13:41:53 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmPtrField<RimFlowDiagSolution*> m_flowSolution;
|
|
|
|
|
caf::PdmField<std::vector<QString>> m_selectedInjectorTracers;
|
|
|
|
|
caf::PdmField<std::vector<QString>> m_selectedProducerTracers;
|
|
|
|
|
caf::PdmField<std::vector<QString>> m_selectedSouringTracers;
|
2017-08-31 16:22:50 +02:00
|
|
|
|
2015-06-25 11:45:31 +02:00
|
|
|
friend class RimEclipsePropertyFilter;
|
2015-06-25 12:06:43 +02:00
|
|
|
friend class RimEclipseFaultColors;
|
2015-09-02 12:13:38 +02:00
|
|
|
friend class RimWellLogExtractionCurve;
|
2014-09-08 07:53:49 +02:00
|
|
|
|
2013-04-30 13:41:53 +02:00
|
|
|
// User interface only fields, to support "filtering"-like behaviour etc.
|
2016-12-14 09:50:30 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<caf::AppEnum<RiaDefines::ResultCatType>> m_resultTypeUiField;
|
|
|
|
|
|
2019-08-21 07:25:17 +02:00
|
|
|
// TODO: Remove Ui field, as behavior is similar to time difference fields
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<caf::AppEnum<RiaDefines::PorosityModelType>> m_porosityModelUiField;
|
2019-08-21 07:25:17 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<QString> m_resultVariableUiField;
|
2019-02-12 12:48:18 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<caf::AppEnum<FlowTracerSelectionType>> m_flowTracerSelectionMode;
|
|
|
|
|
caf::PdmPtrField<RimFlowDiagSolution*> m_flowSolutionUiField;
|
|
|
|
|
caf::PdmField<RigFlowDiagResultAddress::PhaseSelectionEnum> m_phaseSelection;
|
2021-05-31 08:19:12 +02:00
|
|
|
caf::PdmField<bool> m_showOnlyVisibleCategoriesInLegend;
|
2016-12-14 09:50:30 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<bool> m_syncInjectorToProducerSelection;
|
|
|
|
|
caf::PdmField<bool> m_syncProducerToInjectorSelection;
|
|
|
|
|
caf::PdmField<std::vector<QString>> m_selectedInjectorTracersUiField;
|
|
|
|
|
caf::PdmField<std::vector<QString>> m_selectedProducerTracersUiField;
|
2017-08-31 16:22:50 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<std::vector<QString>> m_selectedSouringTracersUiField;
|
2019-02-20 11:35:31 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
|
|
|
|
|
2013-04-30 13:41:53 +02:00
|
|
|
private:
|
2021-02-11 03:01:17 +01:00
|
|
|
caf::PdmField<int> m_timeLapseBaseTimestep;
|
|
|
|
|
caf::PdmPtrField<RimEclipseCase*> m_differenceCase;
|
|
|
|
|
caf::PdmField<bool> m_divideByCellFaceArea;
|
|
|
|
|
|
2018-11-21 13:32:55 +01:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
void assignFlowSolutionFromCase();
|
|
|
|
|
|
|
|
|
|
QString flowDiagResUiText( bool shortLabel, int maxTracerStringLength = std::numeric_limits<int>::max() ) const;
|
2016-12-20 14:33:35 +01:00
|
|
|
|
2023-05-11 08:37:58 +02:00
|
|
|
void changedTracerSelectionField( bool injector );
|
2017-03-27 11:24:51 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
FlowTracerSelectionState injectorSelectionState() const;
|
|
|
|
|
FlowTracerSelectionState producerSelectionState() const;
|
2019-02-13 09:37:02 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void syncInjectorToProducerSelection();
|
|
|
|
|
void syncProducerToInjectorSelection();
|
2019-03-18 12:52:01 +01:00
|
|
|
|
2021-02-11 03:01:17 +01:00
|
|
|
// Delta Case / Delta Time Step / Divide by Cell Face Area
|
|
|
|
|
bool isDeltaResultEnabled() const;
|
|
|
|
|
bool isDeltaCasePossible() const;
|
|
|
|
|
bool isDeltaCaseActive() const;
|
|
|
|
|
bool isDeltaTimeStepPossible() const;
|
|
|
|
|
bool isDeltaTimeStepActive() const;
|
|
|
|
|
bool isDivideByCellFaceAreaPossible() const;
|
|
|
|
|
bool isDivideByCellFaceAreaActive() const;
|
|
|
|
|
|
|
|
|
|
QString additionalResultTextShort() const;
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
bool showDerivedResultsFirstInVariableUiField() const;
|
|
|
|
|
bool addPerCellFaceOptionsForVariableUiField() const;
|
|
|
|
|
|
2019-02-15 09:37:17 +01:00
|
|
|
private:
|
2021-02-11 03:01:17 +01:00
|
|
|
bool m_isDeltaResultEnabled;
|
2019-04-03 14:20:32 +02:00
|
|
|
caf::PdmUiItemInfo::LabelPosType m_labelPosition;
|
|
|
|
|
bool m_ternaryEnabled;
|
2012-05-18 09:45:23 +02:00
|
|
|
};
|