2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -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.
|
|
|
|
//
|
|
|
|
// 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 <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-06-13 08:41:52 -05:00
|
|
|
#include "RiaDefines.h"
|
2017-08-11 03:25:33 -05:00
|
|
|
#include "RiaPorosityModel.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
|
2017-08-10 08:08:30 -05:00
|
|
|
#include "RigFlowDiagResultAddress.h"
|
2018-09-27 08:11:49 -05:00
|
|
|
#include "RimFlowDiagSolution.h"
|
2017-08-10 08:08:30 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cafAppEnum.h"
|
|
|
|
#include "cafPdmField.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "cafPdmObject.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cafPdmPointer.h"
|
2016-12-14 02:50:30 -06:00
|
|
|
#include "cafPdmPtrField.h"
|
2018-09-27 15:29:04 -05:00
|
|
|
#include "cafPdmUiItem.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-11-23 01:20:05 -06:00
|
|
|
#include <limits>
|
|
|
|
|
2019-01-22 01:54:00 -06:00
|
|
|
#include "RigCaseCellResultsData.h"
|
|
|
|
|
2013-03-22 09:43:42 -05:00
|
|
|
class RigCaseCellResultsData;
|
2015-09-01 06:56:35 -05:00
|
|
|
class RimEclipseCase;
|
2016-10-21 07:02:06 -05:00
|
|
|
class RimEclipseView;
|
|
|
|
class RimReservoirCellResultsStorage;
|
|
|
|
|
2017-01-12 04:13:33 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
2015-06-25 02:38:53 -05:00
|
|
|
class RimEclipseResultDefinition : public caf::PdmObject
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2017-01-12 04:13:33 -06:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum FlowTracerSelectionType
|
|
|
|
{
|
2017-01-12 08:00:18 -06:00
|
|
|
FLOW_TR_INJ_AND_PROD,
|
2017-01-12 04:13:33 -06:00
|
|
|
FLOW_TR_PRODUCERS,
|
2017-01-12 08:00:18 -06:00
|
|
|
FLOW_TR_INJECTORS,
|
|
|
|
FLOW_TR_BY_SELECTION
|
2017-01-12 04:13:33 -06:00
|
|
|
};
|
|
|
|
typedef caf::AppEnum<RimEclipseResultDefinition::FlowTracerSelectionType> FlowTracerSelectionEnum;
|
|
|
|
|
2018-09-28 07:21:55 -05:00
|
|
|
enum FlowTracerSelectionState
|
2018-09-27 15:29:04 -05:00
|
|
|
{
|
|
|
|
NONE_SELECTED,
|
|
|
|
ONE_SELECTED,
|
2018-09-28 07:21:55 -05:00
|
|
|
MULTIPLE_SELECTED,
|
|
|
|
ALL_SELECTED
|
2018-09-27 15:29:04 -05:00
|
|
|
};
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
public:
|
2015-06-25 02:38:53 -05:00
|
|
|
RimEclipseResultDefinition();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RimEclipseResultDefinition() override;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-12-20 07:33:35 -06:00
|
|
|
void simpleCopy(const RimEclipseResultDefinition* other);
|
|
|
|
|
2015-09-01 06:56:35 -05:00
|
|
|
void setEclipseCase(RimEclipseCase* eclipseCase);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2017-06-13 08:41:52 -05:00
|
|
|
RiaDefines::ResultCatType resultType() const { return m_resultType(); }
|
|
|
|
void setResultType(RiaDefines::ResultCatType val);
|
2017-08-11 07:05:59 -05:00
|
|
|
RiaDefines::PorosityModelType porosityModel() const { return m_porosityModel(); }
|
|
|
|
void setPorosityModel(RiaDefines::PorosityModelType val);
|
2013-04-30 06:41:53 -05:00
|
|
|
QString resultVariable() const { return m_resultVariable(); }
|
2014-06-13 01:12:45 -05:00
|
|
|
virtual void setResultVariable(const QString& val);
|
2017-03-09 15:45:47 -06:00
|
|
|
|
|
|
|
void setFlowSolution(RimFlowDiagSolution* flowSol);
|
2016-12-16 07:17:56 -06:00
|
|
|
RimFlowDiagSolution* flowDiagSolution();
|
|
|
|
RigFlowDiagResultAddress flowDiagResAddress() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2017-03-02 09:10:18 -06:00
|
|
|
void setFlowDiagTracerSelectionType(FlowTracerSelectionType selectionType);
|
|
|
|
|
2017-01-12 08:00:18 -06:00
|
|
|
QString resultVariableUiName() const;
|
|
|
|
QString resultVariableUiShortName() const;
|
2017-01-04 06:13:06 -06:00
|
|
|
|
2013-04-30 06:41:53 -05:00
|
|
|
void loadResult();
|
2019-01-23 07:24:12 -06:00
|
|
|
RigEclipseResultAddress eclipseResultAddress() const;
|
2013-04-30 06:41:53 -05:00
|
|
|
bool hasStaticResult() const;
|
|
|
|
bool hasDynamicResult() const;
|
|
|
|
bool hasResult() const;
|
2014-04-04 03:59:21 -05:00
|
|
|
bool isTernarySaturationSelected() const;
|
2017-06-01 06:46:22 -05:00
|
|
|
bool isCompletionTypeSelected() const;
|
2016-08-05 01:31:15 -05:00
|
|
|
bool hasCategoryResult() const;
|
2017-10-18 04:31:19 -05:00
|
|
|
bool isFlowDiagOrInjectionFlooding() const;
|
2014-04-04 03:59:21 -05:00
|
|
|
|
2017-09-13 03:39:20 -05:00
|
|
|
RigCaseCellResultsData* currentGridCellResults() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2017-02-15 03:40:32 -06:00
|
|
|
void loadDataAndUpdate();
|
2016-10-21 07:02:06 -05:00
|
|
|
void updateAnyFieldHasChanged();
|
2016-09-07 04:41:02 -05:00
|
|
|
|
2017-02-13 08:00:49 -06:00
|
|
|
void setTofAndSelectTracer(const QString& tracerName);
|
2017-08-17 04:24:51 -05:00
|
|
|
void setSelectedTracers(const std::vector<QString>& selectedTracers);
|
2018-09-27 08:11:49 -05:00
|
|
|
void setSelectedInjectorTracers(const std::vector<QString>& selectedTracers);
|
|
|
|
void setSelectedProducerTracers(const std::vector<QString>& selectedTracers);
|
2017-08-31 09:22:50 -05:00
|
|
|
void setSelectedSouringTracers(const std::vector<QString>& selectedTracers);
|
2017-02-13 08:00:49 -06:00
|
|
|
|
2018-02-13 06:29:44 -06:00
|
|
|
void updateUiFieldsFromActiveResult();
|
2017-03-17 10:09:48 -05:00
|
|
|
|
2016-12-14 02:50:30 -06:00
|
|
|
protected:
|
2018-11-30 04:25:56 -06:00
|
|
|
virtual void updateLegendCategorySettings() {};
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2018-10-18 12:45:57 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
|
|
|
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
2018-09-27 08:11:49 -05:00
|
|
|
|
2018-10-18 12:45:57 -05:00
|
|
|
void initAfterRead() override;
|
|
|
|
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
|
|
|
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
2018-11-30 04:25:56 -06:00
|
|
|
void onEditorWidgetsCreated() override;
|
2016-10-21 06:57:15 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
protected:
|
2017-06-13 08:41:52 -05:00
|
|
|
caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultType;
|
2017-08-11 07:05:59 -05:00
|
|
|
caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModel;
|
2013-04-30 06:41:53 -05:00
|
|
|
caf::PdmField<QString> m_resultVariable;
|
2019-01-30 09:46:16 -06:00
|
|
|
caf::PdmField<bool> m_isTimeLapseResult;
|
|
|
|
caf::PdmField<int> m_timeLapseBaseTimestep;
|
2013-04-30 06:41:53 -05:00
|
|
|
|
2018-09-28 06:21:02 -05:00
|
|
|
caf::PdmPtrField<RimFlowDiagSolution*> m_flowSolution;
|
2018-09-27 08:11:49 -05:00
|
|
|
caf::PdmField<std::vector<QString> > m_selectedInjectorTracers;
|
|
|
|
caf::PdmField<std::vector<QString> > m_selectedProducerTracers;
|
2017-08-31 09:22:50 -05:00
|
|
|
caf::PdmField<std::vector<QString> > m_selectedSouringTracers;
|
|
|
|
|
2015-06-25 04:45:31 -05:00
|
|
|
friend class RimEclipsePropertyFilter;
|
2015-06-25 05:06:43 -05:00
|
|
|
friend class RimEclipseFaultColors;
|
2015-09-02 05:13:38 -05:00
|
|
|
friend class RimWellLogExtractionCurve;
|
2014-09-08 00:53:49 -05:00
|
|
|
|
2013-04-30 06:41:53 -05:00
|
|
|
// User interface only fields, to support "filtering"-like behaviour etc.
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2017-06-13 08:41:52 -05:00
|
|
|
caf::PdmField< caf::AppEnum< RiaDefines::ResultCatType > > m_resultTypeUiField;
|
2017-08-11 07:05:59 -05:00
|
|
|
caf::PdmField< caf::AppEnum< RiaDefines::PorosityModelType > > m_porosityModelUiField;
|
2013-04-30 06:41:53 -05:00
|
|
|
caf::PdmField<QString> m_resultVariableUiField;
|
2019-01-30 09:46:16 -06:00
|
|
|
caf::PdmField<bool> m_isTimeLapseResultUiField;
|
|
|
|
caf::PdmField<int> m_timeLapseBaseTimestepUiField;
|
2013-04-30 06:41:53 -05:00
|
|
|
|
2017-01-12 04:13:33 -06:00
|
|
|
caf::PdmField< caf::AppEnum< FlowTracerSelectionType > > m_flowTracerSelectionMode;
|
2016-12-14 02:50:30 -06:00
|
|
|
caf::PdmPtrField<RimFlowDiagSolution*> m_flowSolutionUiField;
|
2017-08-10 08:08:30 -05:00
|
|
|
caf::PdmField< RigFlowDiagResultAddress::PhaseSelectionEnum > m_phaseSelection;
|
2017-03-27 04:24:51 -05:00
|
|
|
|
2018-09-28 06:21:02 -05:00
|
|
|
caf::PdmField<bool> m_syncInjectorToProducerSelection;
|
|
|
|
caf::PdmField<bool> m_syncProducerToInjectorSelection;
|
2018-09-27 08:11:49 -05:00
|
|
|
caf::PdmField<std::vector<QString> > m_selectedInjectorTracersUiField;
|
|
|
|
caf::PdmField<std::vector<QString> > m_selectedProducerTracersUiField;
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2017-08-31 09:22:50 -05:00
|
|
|
caf::PdmField<std::vector<QString> > m_selectedSouringTracersUiField;
|
|
|
|
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2015-09-01 06:56:35 -05:00
|
|
|
caf::PdmPointer<RimEclipseCase> m_eclipseCase;
|
2015-08-10 07:14:22 -05:00
|
|
|
|
2018-09-27 08:11:49 -05:00
|
|
|
caf::PdmField<std::vector<QString> > m_selectedTracers_OBSOLETE;
|
2013-04-30 06:41:53 -05:00
|
|
|
private:
|
2018-09-28 06:21:02 -05:00
|
|
|
struct TracerComp
|
|
|
|
{
|
|
|
|
bool operator()(const QString& lhs, const QString& rhs) const;
|
|
|
|
};
|
|
|
|
|
2018-11-21 06:32:55 -06:00
|
|
|
private:
|
2017-02-13 08:00:49 -06:00
|
|
|
void assignFlowSolutionFromCase();
|
2016-12-20 07:33:35 -06:00
|
|
|
|
|
|
|
bool hasDualPorFractureResult();
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2018-11-21 06:32:55 -06:00
|
|
|
QString flowDiagResUiText(bool shortLabel, int maxTracerStringLength = std::numeric_limits<int>::max()) const;
|
2019-02-11 00:59:03 -06:00
|
|
|
static QString timeDiffResultName(const QString& resultName, int timeStepIndex);
|
2018-11-21 06:32:55 -06:00
|
|
|
|
2019-01-30 09:46:16 -06:00
|
|
|
QString convertToTimeDiffUiVarName(const QString& resultName);
|
2016-12-14 02:50:30 -06:00
|
|
|
QList<caf::PdmOptionItemInfo> calcOptionsForVariableUiFieldStandard();
|
2018-09-27 08:11:49 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> calcOptionsForSelectedTracerField(bool injector);
|
2018-11-30 04:25:56 -06:00
|
|
|
|
2018-11-21 06:32:55 -06:00
|
|
|
QString timeOfFlightString(bool shorter) const;
|
|
|
|
QString maxFractionTracerString(bool shorter) const;
|
|
|
|
|
|
|
|
QString selectedTracersString() const;
|
2018-09-27 08:11:49 -05:00
|
|
|
|
|
|
|
void changedTracerSelectionField(bool injector);
|
2016-12-14 02:50:30 -06:00
|
|
|
QStringList getResultNamesForCurrentUiResultType();
|
2015-12-02 03:32:59 -06:00
|
|
|
static void removePerCellFaceOptionItems(QList<caf::PdmOptionItemInfo>& optionItems);
|
2017-03-27 04:24:51 -05:00
|
|
|
|
2018-09-28 02:39:29 -05:00
|
|
|
std::vector<QString> allTracerNames() const;
|
2018-09-28 06:21:02 -05:00
|
|
|
std::set<QString, TracerComp> setOfTracersOfType(bool injector) const;
|
2018-09-28 02:39:29 -05:00
|
|
|
|
2018-09-28 07:21:55 -05:00
|
|
|
FlowTracerSelectionState injectorSelectionState() const;
|
|
|
|
FlowTracerSelectionState producerSelectionState() const;
|
|
|
|
|
2018-09-28 06:21:02 -05:00
|
|
|
void syncInjectorToProducerSelection();
|
|
|
|
void syncProducerToInjectorSelection();
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
|
|
|
|