Whitespace

This commit is contained in:
Magne Sjaastad committed 2019-02-08 13:02:48 +01:00
1 parent 75833f491a
commit 3586988d1d
1 file changed
+133 -150
@@ -31,9 +31,9 @@
#include "Rim3dView.h"
#include "Rim3dWellLogCurve.h"
#include "RimCellEdgeColors.h"
#include "RimEclipseContourMapProjection.h"
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseContourMapProjection.h"
#include "RimEclipseFaultColors.h"
#include "RimEclipsePropertyFilter.h"
#include "RimEclipseResultCase.h"
@@ -43,6 +43,7 @@
#include "RimIntersectionCollection.h"
#include "RimPlotCurve.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimTools.h"
#include "RimViewLinker.h"
#include "RimWellLogExtractionCurve.h"
@@ -51,24 +52,20 @@
#include "cafPdmUiTreeSelectionEditor.h"
#include "cafUtils.h"
#include <QDebug>
#include <QList>
#include "RimTools.h"
namespace caf
{
template<>
void RimEclipseResultDefinition::FlowTracerSelectionEnum::setUp()
{
addItem(RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD, "FLOW_TR_INJ_AND_PROD", "All Injectors and Producers");
addItem(RimEclipseResultDefinition::FLOW_TR_PRODUCERS, "FLOW_TR_PRODUCERS", "All Producers");
addItem(RimEclipseResultDefinition::FLOW_TR_INJECTORS, "FLOW_TR_INJECTORS", "All Injectors");
addItem(RimEclipseResultDefinition::FLOW_TR_BY_SELECTION, "FLOW_TR_BY_SELECTION", "By Selection");
template<>
void RimEclipseResultDefinition::FlowTracerSelectionEnum::setUp()
{
addItem(RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD, "FLOW_TR_INJ_AND_PROD", "All Injectors and Producers");
addItem(RimEclipseResultDefinition::FLOW_TR_PRODUCERS, "FLOW_TR_PRODUCERS", "All Producers");
addItem(RimEclipseResultDefinition::FLOW_TR_INJECTORS, "FLOW_TR_INJECTORS", "All Injectors");
addItem(RimEclipseResultDefinition::FLOW_TR_BY_SELECTION, "FLOW_TR_BY_SELECTION", "By Selection");
setDefault(RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD);
}
setDefault(RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD);
}
} // namespace caf
CAF_PDM_SOURCE_INIT(RimEclipseResultDefinition, "ResultDefinition");
@@ -79,13 +76,13 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
{
CAF_PDM_InitObject("Result Definition", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_resultType, "ResultType", "Type", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_resultType, "ResultType", "Type", "", "", "");
m_resultType.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_porosityModel, "PorosityModelType", "Porosity", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_porosityModel, "PorosityModelType", "Porosity", "", "", "");
m_porosityModel.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_resultVariable, "ResultVariable", RiaDefines::undefinedResultName(), "Variable", "", "", "" );
CAF_PDM_InitField(&m_resultVariable, "ResultVariable", RiaDefines::undefinedResultName(), "Variable", "", "", "");
m_resultVariable.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_flowSolution, "FlowDiagSolution", "Solution", "", "", "");
@@ -97,7 +94,6 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
CAF_PDM_InitField(&m_timeLapseBaseTimestep, "TimeLapseBaseTimeStep", 0, "Base Time Step", "", "", "");
m_timeLapseBaseTimestep.uiCapability()->setUiHidden(true);
// One single tracer list has been split into injectors and producers.
// The old list is defined as injectors and we'll have to move any producers in old projects.
CAF_PDM_InitFieldNoDefault(&m_selectedTracers_OBSOLETE, "SelectedTracers", "Tracers", "", "", "");
@@ -109,7 +105,6 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
CAF_PDM_InitFieldNoDefault(&m_selectedProducerTracers, "SelectedProducerTracers", "Producer Tracers", "", "", "");
m_selectedProducerTracers.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_selectedSouringTracers, "SelectedSouringTracers", "Tracers", "", "", "");
m_selectedSouringTracers.uiCapability()->setUiHidden(true);
@@ -118,23 +113,29 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
// Ui only fields
CAF_PDM_InitFieldNoDefault(&m_resultTypeUiField, "MResultType", "Type", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_resultTypeUiField, "MResultType", "Type", "", "", "");
m_resultTypeUiField.xmlCapability()->disableIO();
CAF_PDM_InitFieldNoDefault(&m_porosityModelUiField, "MPorosityModelType", "Porosity", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_porosityModelUiField, "MPorosityModelType", "Porosity", "", "", "");
m_porosityModelUiField.xmlCapability()->disableIO();
CAF_PDM_InitField(&m_resultVariableUiField, "MResultVariable", RiaDefines::undefinedResultName(), "Result Property", "", "", "" );
CAF_PDM_InitField(
&m_resultVariableUiField, "MResultVariable", RiaDefines::undefinedResultName(), "Result Property", "", "", "");
m_resultVariableUiField.xmlCapability()->disableIO();
m_resultVariableUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
CAF_PDM_InitField(&m_isTimeLapseResultUiField, "IsTimeLapseResultUI", false, "Enable Time Difference", "", "Use the difference with respect to a specific time step as the result variable to plot", "");
CAF_PDM_InitField(&m_isTimeLapseResultUiField,
"IsTimeLapseResultUI",
false,
"Enable Time Difference",
"",
"Use the difference with respect to a specific time step as the result variable to plot",
"");
m_isTimeLapseResultUiField.xmlCapability()->disableIO();
CAF_PDM_InitField(&m_timeLapseBaseTimestepUiField, "TimeLapseBaseTimeStepUI", 0, "Base Time Step", "", "", "");
m_timeLapseBaseTimestepUiField.xmlCapability()->disableIO();
CAF_PDM_InitFieldNoDefault(&m_flowSolutionUiField, "MFlowDiagSolution", "Solution", "", "", "");
m_flowSolutionUiField.xmlCapability()->disableIO();
m_flowSolutionUiField.uiCapability()->setUiHidden(true); // For now since there are only one to choose from
@@ -145,7 +146,6 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
CAF_PDM_InitField(&m_syncProducerToInjectorSelection, "MSyncSelectedProdInj", false, "<- Add Communicators", "", "", "");
m_syncProducerToInjectorSelection.uiCapability()->setUiEditorTypeName(caf::PdmUiToolButtonEditor::uiEditorTypeName());
CAF_PDM_InitFieldNoDefault(&m_selectedInjectorTracersUiField, "MSelectedInjectorTracers", "Injector Tracers", "", "", "");
m_selectedInjectorTracersUiField.xmlCapability()->disableIO();
m_selectedInjectorTracersUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiTreeSelectionEditor::uiEditorTypeName());
@@ -164,10 +164,7 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseResultDefinition::~RimEclipseResultDefinition()
{
}
RimEclipseResultDefinition::~RimEclipseResultDefinition() {}
//--------------------------------------------------------------------------------------------------
///
@@ -182,7 +179,7 @@ void RimEclipseResultDefinition::simpleCopy(const RimEclipseResultDefinition* ot
this->setSelectedProducerTracers(other->m_selectedProducerTracers());
this->setSelectedSouringTracers(other->m_selectedSouringTracers());
m_flowTracerSelectionMode = other->m_flowTracerSelectionMode();
m_phaseSelection = other->m_phaseSelection;
m_phaseSelection = other->m_phaseSelection;
}
//--------------------------------------------------------------------------------------------------
@@ -190,18 +187,17 @@ void RimEclipseResultDefinition::simpleCopy(const RimEclipseResultDefinition* ot
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setEclipseCase(RimEclipseCase* eclipseCase)
{
m_eclipseCase = eclipseCase;
m_eclipseCase = eclipseCase;
assignFlowSolutionFromCase();
assignFlowSolutionFromCase();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigCaseCellResultsData* RimEclipseResultDefinition::currentGridCellResults() const
{
if (!m_eclipseCase ) return nullptr;
if (!m_eclipseCase) return nullptr;
return m_eclipseCase->results(m_porosityModel());
}
@@ -209,11 +205,11 @@ RigCaseCellResultsData* RimEclipseResultDefinition::currentGridCellResults() con
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
{
if ( &m_flowSolutionUiField == changedField
|| &m_resultTypeUiField == changedField
|| &m_porosityModelUiField == changedField )
if (&m_flowSolutionUiField == changedField || &m_resultTypeUiField == changedField || &m_porosityModelUiField == changedField)
{
// If the user are seeing the list with the actually selected result,
// select that result in the list. Otherwise select nothing.
@@ -222,10 +218,8 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
bool isFlowDiagFieldsRelevant = (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS);
if ( ( m_flowSolutionUiField() == m_flowSolution() || !isFlowDiagFieldsRelevant)
&& m_resultTypeUiField() == m_resultType()
&& m_porosityModelUiField() == m_porosityModel() )
if ((m_flowSolutionUiField() == m_flowSolution() || !isFlowDiagFieldsRelevant) &&
m_resultTypeUiField() == m_resultType() && m_porosityModelUiField() == m_porosityModel())
{
if (varList.contains(resultVariable()))
{
@@ -245,7 +239,7 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
}
else
{
m_resultVariableUiField = "";
m_resultVariableUiField = "";
m_selectedInjectorTracersUiField = std::vector<QString>();
m_selectedProducerTracersUiField = std::vector<QString>();
}
@@ -253,15 +247,15 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
if (&m_resultVariableUiField == changedField)
{
m_porosityModel = m_porosityModelUiField;
m_resultType = m_resultTypeUiField;
m_resultVariable = m_resultVariableUiField;
m_isTimeLapseResult = m_isTimeLapseResultUiField;
m_porosityModel = m_porosityModelUiField;
m_resultType = m_resultTypeUiField;
m_resultVariable = m_resultVariableUiField;
m_isTimeLapseResult = m_isTimeLapseResultUiField;
m_timeLapseBaseTimestep = m_timeLapseBaseTimestepUiField;
if (m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS)
{
m_flowSolution = m_flowSolutionUiField();
m_flowSolution = m_flowSolutionUiField();
m_selectedInjectorTracers = m_selectedInjectorTracersUiField();
m_selectedProducerTracers = m_selectedProducerTracersUiField();
}
@@ -287,8 +281,7 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
loadDataAndUpdate();
}
if (&m_selectedInjectorTracersUiField == changedField )
if (&m_selectedInjectorTracersUiField == changedField)
{
changedTracerSelectionField(true);
}
@@ -310,7 +303,6 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
m_syncProducerToInjectorSelection = false;
}
if (&m_selectedSouringTracersUiField == changedField)
{
if (!m_resultVariable().isEmpty())
@@ -324,8 +316,8 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
{
if (m_phaseSelection() != RigFlowDiagResultAddress::PHASE_ALL)
{
m_resultType = m_resultTypeUiField;
m_resultVariable = RIG_FLD_TOF_RESNAME;
m_resultType = m_resultTypeUiField;
m_resultVariable = RIG_FLD_TOF_RESNAME;
m_resultVariableUiField = RIG_FLD_TOF_RESNAME;
}
loadDataAndUpdate();
@@ -341,10 +333,9 @@ void RimEclipseResultDefinition::changedTracerSelectionField(bool injector)
{
m_flowSolution = m_flowSolutionUiField();
std::vector<QString>& selectedTracers = injector ? m_selectedInjectorTracers.v()
: m_selectedProducerTracers.v();
std::vector<QString>& selectedTracersUi = injector ? m_selectedInjectorTracersUiField.v()
: m_selectedProducerTracersUiField.v();
std::vector<QString>& selectedTracers = injector ? m_selectedInjectorTracers.v() : m_selectedProducerTracers.v();
std::vector<QString>& selectedTracersUi =
injector ? m_selectedInjectorTracersUiField.v() : m_selectedProducerTracersUiField.v();
selectedTracers = selectedTracersUi;
@@ -510,15 +501,16 @@ void RimEclipseResultDefinition::loadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_resultTypeUiField )
if (fieldNeedingOptions == &m_resultTypeUiField)
{
bool hasSourSimRLFile = false;
RimEclipseResultCase* eclResCase = dynamic_cast<RimEclipseResultCase*>(m_eclipseCase.p());
if ( eclResCase && eclResCase->eclipseCaseData() )
bool hasSourSimRLFile = false;
RimEclipseResultCase* eclResCase = dynamic_cast<RimEclipseResultCase*>(m_eclipseCase.p());
if (eclResCase && eclResCase->eclipseCaseData())
{
hasSourSimRLFile = eclResCase->hasSourSimFile();
}
@@ -543,26 +535,23 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
}
#endif /* ENABLE_SOURING */
RimGridTimeHistoryCurve* timeHistoryCurve;
this->firstAncestorOrThisOfType(timeHistoryCurve);
// Do not include flow diagnostics results if it is a time history curve
// Do not include SourSimRL if no SourSim file is loaded
if ( timeHistoryCurve != nullptr || !hasSourSimRLFile || !enableSouring )
if (timeHistoryCurve != nullptr || !hasSourSimRLFile || !enableSouring)
{
using ResCatEnum = caf::AppEnum< RiaDefines::ResultCatType >;
for ( size_t i = 0; i < ResCatEnum::size(); ++i )
using ResCatEnum = caf::AppEnum<RiaDefines::ResultCatType>;
for (size_t i = 0; i < ResCatEnum::size(); ++i)
{
RiaDefines::ResultCatType resType = ResCatEnum::fromIndex(i);
if ( resType == RiaDefines::FLOW_DIAGNOSTICS
&& (timeHistoryCurve) )
if (resType == RiaDefines::FLOW_DIAGNOSTICS && (timeHistoryCurve))
{
continue;
continue;
}
if ( resType == RiaDefines::SOURSIMRL
&& (!hasSourSimRLFile ) )
if (resType == RiaDefines::SOURSIMRL && (!hasSourSimRLFile))
{
continue;
}
@@ -578,9 +567,9 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
}
}
if ( m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS )
if (m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS)
{
if ( fieldNeedingOptions == &m_resultVariableUiField )
if (fieldNeedingOptions == &m_resultVariableUiField)
{
options.push_back(caf::PdmOptionItemInfo(timeOfFlightString(false), RIG_FLD_TOF_RESNAME));
if (m_phaseSelection() == RigFlowDiagResultAddress::PHASE_ALL)
@@ -622,8 +611,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
for (const QString& resultName : dynamicResultNames)
{
if (!resultName.endsWith("F") ||
resultName == RiaDefines::completionTypeResultName())
if (!resultName.endsWith("F") || resultName == RiaDefines::completionTypeResultName())
{
continue;
}
@@ -638,28 +626,27 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
}
else
{
if ( fieldNeedingOptions == &m_resultVariableUiField )
if (fieldNeedingOptions == &m_resultVariableUiField)
{
options = calcOptionsForVariableUiFieldStandard();
}
else if (fieldNeedingOptions == &m_timeLapseBaseTimestepUiField)
{
std::vector<QDateTime> stepDates;
std::vector<QDateTime> stepDates;
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
if(gridCellResults)
if (gridCellResults)
{
stepDates = gridCellResults->timeStepDates();
}
for (size_t stepIdx = 0; stepIdx < stepDates.size(); ++stepIdx)
{
options.push_back(caf::PdmOptionItemInfo(stepDates[stepIdx].toString(RimTools::dateFormatString()),
static_cast<int>(stepIdx)));
options.push_back(
caf::PdmOptionItemInfo(stepDates[stepIdx].toString(RimTools::dateFormatString()), static_cast<int>(stepIdx)));
}
}
}
(*useOptionsOnly) = true;
return options;
@@ -673,7 +660,7 @@ RigEclipseResultAddress RimEclipseResultDefinition::eclipseResultAddress() const
if (isFlowDiagOrInjectionFlooding()) return RigEclipseResultAddress();
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
if (gridCellResults )
if (gridCellResults)
{
if (m_isTimeLapseResult())
return RigEclipseResultAddress(m_resultType(), m_resultVariable(), m_timeLapseBaseTimestep());
@@ -848,7 +835,6 @@ void RimEclipseResultDefinition::loadResult()
gridCellResults->ensureKnownResultLoaded(this->eclipseResultAddress());
}
}
//--------------------------------------------------------------------------------------------------
@@ -859,10 +845,10 @@ bool RimEclipseResultDefinition::hasStaticResult() const
{
if (isFlowDiagOrInjectionFlooding()) return false;
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress();
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress();
if (hasResult() && gridCellResults->timeStepCount(gridScalarResultIndex) == 1 )
if (hasResult() && gridCellResults->timeStepCount(gridScalarResultIndex) == 1)
{
return true;
}
@@ -881,7 +867,7 @@ bool RimEclipseResultDefinition::hasResult() const
{
if (m_flowSolution() && !m_resultVariable().isEmpty()) return true;
}
else if (this->currentGridCellResults() )
else if (this->currentGridCellResults())
{
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
@@ -918,9 +904,9 @@ bool RimEclipseResultDefinition::hasDynamicResult() const
if (this->currentGridCellResults())
{
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress();
if (gridCellResults->timeStepCount(gridScalarResultIndex) > 1 )
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress();
if (gridCellResults->timeStepCount(gridScalarResultIndex) > 1)
{
return true;
}
@@ -930,7 +916,6 @@ bool RimEclipseResultDefinition::hasDynamicResult() const
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -941,13 +926,13 @@ void RimEclipseResultDefinition::initAfterRead()
assignFlowSolutionFromCase();
}
m_porosityModelUiField = m_porosityModel;
m_resultTypeUiField = m_resultType;
m_resultVariableUiField = m_resultVariable;
m_isTimeLapseResultUiField = m_isTimeLapseResult;
m_porosityModelUiField = m_porosityModel;
m_resultTypeUiField = m_resultType;
m_resultVariableUiField = m_resultVariable;
m_isTimeLapseResultUiField = m_isTimeLapseResult;
m_timeLapseBaseTimestepUiField = m_timeLapseBaseTimestep;
m_flowSolutionUiField = m_flowSolution();
m_flowSolutionUiField = m_flowSolution();
m_selectedInjectorTracersUiField = m_selectedInjectorTracers;
this->updateUiIconFromToggleField();
@@ -958,7 +943,7 @@ void RimEclipseResultDefinition::initAfterRead()
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setResultType(RiaDefines::ResultCatType val)
{
m_resultType = val;
m_resultType = val;
m_resultTypeUiField = val;
}
@@ -967,7 +952,7 @@ void RimEclipseResultDefinition::setResultType(RiaDefines::ResultCatType val)
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setPorosityModel(RiaDefines::PorosityModelType val)
{
m_porosityModel = val;
m_porosityModel = val;
m_porosityModelUiField = val;
}
@@ -976,7 +961,7 @@ void RimEclipseResultDefinition::setPorosityModel(RiaDefines::PorosityModelType
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setResultVariable(const QString& val)
{
m_resultVariable = val;
m_resultVariable = val;
m_resultVariableUiField = val;
}
@@ -993,7 +978,7 @@ RimFlowDiagSolution* RimEclipseResultDefinition::flowDiagSolution()
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setFlowSolution(RimFlowDiagSolution* flowSol)
{
this->m_flowSolution = flowSol;
this->m_flowSolution = flowSol;
this->m_flowSolutionUiField = flowSol;
}
@@ -1037,7 +1022,7 @@ void RimEclipseResultDefinition::setSelectedTracers(const std::vector<QString>&
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setSelectedInjectorTracers(const std::vector<QString>& selectedTracers)
{
this->m_selectedInjectorTracers = selectedTracers;
this->m_selectedInjectorTracers = selectedTracers;
this->m_selectedInjectorTracersUiField = selectedTracers;
}
@@ -1046,7 +1031,7 @@ void RimEclipseResultDefinition::setSelectedInjectorTracers(const std::vector<QS
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setSelectedProducerTracers(const std::vector<QString>& selectedTracers)
{
this->m_selectedProducerTracers = selectedTracers;
this->m_selectedProducerTracers = selectedTracers;
this->m_selectedProducerTracersUiField = selectedTracers;
}
@@ -1055,7 +1040,7 @@ void RimEclipseResultDefinition::setSelectedProducerTracers(const std::vector<QS
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::setSelectedSouringTracers(const std::vector<QString>& selectedTracers)
{
this->m_selectedSouringTracers = selectedTracers;
this->m_selectedSouringTracers = selectedTracers;
this->m_selectedSouringTracersUiField = selectedTracers;
}
@@ -1064,7 +1049,7 @@ void RimEclipseResultDefinition::setSelectedSouringTracers(const std::vector<QSt
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::updateUiFieldsFromActiveResult()
{
m_resultTypeUiField = m_resultType;
m_resultTypeUiField = m_resultType;
m_resultVariableUiField = resultVariable();
}
@@ -1073,8 +1058,8 @@ void RimEclipseResultDefinition::updateUiFieldsFromActiveResult()
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::isTernarySaturationSelected() const
{
bool isTernary = (m_resultType() == RiaDefines::DYNAMIC_NATIVE) &&
(m_resultVariable().compare(RiaDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0);
bool isTernary = (m_resultType() == RiaDefines::DYNAMIC_NATIVE) &&
(m_resultVariable().compare(RiaDefines::ternarySaturationResultName(), Qt::CaseInsensitive) == 0);
return isTernary;
}
@@ -1092,16 +1077,15 @@ bool RimEclipseResultDefinition::isCompletionTypeSelected() const
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::hasCategoryResult() const
{
if (this->m_resultType() == RiaDefines::FORMATION_NAMES
&& m_eclipseCase
&& m_eclipseCase->eclipseCaseData()
&& m_eclipseCase->eclipseCaseData()->activeFormationNames() ) return true;
if (this->m_resultType() == RiaDefines::FORMATION_NAMES && m_eclipseCase && m_eclipseCase->eclipseCaseData() &&
m_eclipseCase->eclipseCaseData()->activeFormationNames())
return true;
if (this->m_resultType() == RiaDefines::DYNAMIC_NATIVE
&& this->resultVariable() == RiaDefines::completionTypeResultName()) return true;
if (this->m_resultType() == RiaDefines::DYNAMIC_NATIVE && this->resultVariable() == RiaDefines::completionTypeResultName())
return true;
if (this->m_resultType() == RiaDefines::FLOW_DIAGNOSTICS
&& m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME) return true;
if (this->m_resultType() == RiaDefines::FLOW_DIAGNOSTICS && m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME)
return true;
if (!this->hasStaticResult()) return false;
@@ -1133,8 +1117,7 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
uiOrdering.add(&m_porosityModelUiField);
}
if ( m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS )
if (m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS)
{
uiOrdering.add(&m_flowSolutionUiField);
@@ -1156,7 +1139,7 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
uiOrdering.add(&m_phaseSelection);
if ( m_flowSolution() == nullptr )
if (m_flowSolution() == nullptr)
{
assignFlowSolutionFromCase();
}
@@ -1176,12 +1159,11 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
uiOrdering.add(&m_resultVariableUiField);
}
if ( m_resultTypeUiField() == RiaDefines::DYNAMIC_NATIVE )
if (m_resultTypeUiField() == RiaDefines::DYNAMIC_NATIVE)
{
caf::PdmUiGroup * timeLapseGr = uiOrdering.addNewGroup("Time Difference Options");
caf::PdmUiGroup* timeLapseGr = uiOrdering.addNewGroup("Time Difference Options");
timeLapseGr->add(&m_isTimeLapseResultUiField);
if ( m_isTimeLapseResultUiField() )
timeLapseGr->add(&m_timeLapseBaseTimestepUiField);
if (m_isTimeLapseResultUiField()) timeLapseGr->add(&m_timeLapseBaseTimestepUiField);
}
uiOrdering.skipRemainingFields(true);
@@ -1190,7 +1172,9 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
void RimEclipseResultDefinition::defineEditorAttribute(const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute)
{
if (m_resultTypeUiField() == RiaDefines::FLOW_DIAGNOSTICS)
{
@@ -1202,8 +1186,7 @@ void RimEclipseResultDefinition::defineEditorAttribute(const caf::PdmFieldHandle
listEditAttr->m_heightHint = 50;
}
}
else if (field == &m_syncInjectorToProducerSelection ||
field == &m_syncProducerToInjectorSelection)
else if (field == &m_syncInjectorToProducerSelection || field == &m_syncProducerToInjectorSelection)
{
caf::PdmUiToolButtonEditorAttribute* toolButtonAttr = dynamic_cast<caf::PdmUiToolButtonEditorAttribute*>(attribute);
if (toolButtonAttr)
@@ -1291,8 +1274,7 @@ void RimEclipseResultDefinition::assignFlowSolutionFromCase()
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::hasDualPorFractureResult()
{
if (m_eclipseCase
&& m_eclipseCase->eclipseCaseData())
if (m_eclipseCase && m_eclipseCase->eclipseCaseData())
{
return m_eclipseCase->eclipseCaseData()->hasFractureResults();
}
@@ -1319,7 +1301,7 @@ QString RimEclipseResultDefinition::flowDiagResUiText(bool shortLabel, int maxTr
if (!tracersString.isEmpty())
{
const QString postfix = "...";
const QString postfix = "...";
if (tracersString.size() > maxTracerStringLength + postfix.size())
{
@@ -1362,7 +1344,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
RigCaseCellResultsData* results = this->currentGridCellResults();
foreach(QString s, getResultNamesForCurrentUiResultType())
foreach (QString s, getResultNamesForCurrentUiResultType())
{
if (s == RiaDefines::completionTypeResultName() && results->timeStepDates().empty()) continue;
@@ -1380,20 +1362,24 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
cellFaceResultNames.sort();
// Cell Center result names
foreach(QString s, cellCenterResultNames)
foreach (QString s, cellCenterResultNames)
{
optionList.push_back(caf::PdmOptionItemInfo(convertToTimeDiffUiVarName(s), s));
}
// Ternary Result
bool hasAtLeastOneTernaryComponent = false;
if (cellCenterResultNames.contains("SOIL")) hasAtLeastOneTernaryComponent = true;
else if (cellCenterResultNames.contains("SGAS")) hasAtLeastOneTernaryComponent = true;
else if (cellCenterResultNames.contains("SWAT")) hasAtLeastOneTernaryComponent = true;
if (cellCenterResultNames.contains("SOIL"))
hasAtLeastOneTernaryComponent = true;
else if (cellCenterResultNames.contains("SGAS"))
hasAtLeastOneTernaryComponent = true;
else if (cellCenterResultNames.contains("SWAT"))
hasAtLeastOneTernaryComponent = true;
if (m_resultTypeUiField == RiaDefines::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent)
{
optionList.push_front(caf::PdmOptionItemInfo(RiaDefines::ternarySaturationResultName(), RiaDefines::ternarySaturationResultName()));
optionList.push_front(
caf::PdmOptionItemInfo(RiaDefines::ternarySaturationResultName(), RiaDefines::ternarySaturationResultName()));
}
// Cell Face result names
@@ -1402,10 +1388,10 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
RimEclipseFaultColors* rimEclipseFaultColors = nullptr;
this->firstAncestorOrThisOfType(rimEclipseFaultColors);
if ( rimEclipseFaultColors ) showDerivedResultsFirstInList = true;
if (rimEclipseFaultColors) showDerivedResultsFirstInList = true;
}
foreach(QString s, cellFaceResultNames)
foreach (QString s, cellFaceResultNames)
{
if (showDerivedResultsFirstInList)
{
@@ -1430,7 +1416,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForVariable
RimCellEdgeColors* cellEdge = nullptr;
this->firstAncestorOrThisOfType(cellEdge);
if ( propFilter || curve || cellEdge )
if (propFilter || curve || cellEdge)
{
removePerCellFaceOptionItems(optionList);
}
@@ -1456,7 +1442,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForSelected
for (const QString& tracerName : sortedTracers)
{
QString postfix;
QString postfix;
RimFlowDiagSolution::TracerStatusType status = flowSol->tracerStatusOverall(tracerName);
if (status == RimFlowDiagSolution::VARYING)
{
@@ -1478,10 +1464,10 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForSelected
QString RimEclipseResultDefinition::timeOfFlightString(bool shorter) const
{
QString tofString;
bool multipleSelected = false;
bool multipleSelected = false;
if (injectorSelectionState() != NONE_SELECTED && producerSelectionState() != NONE_SELECTED)
{
tofString = shorter ? "Res.Time" : "Residence Time";
tofString = shorter ? "Res.Time" : "Residence Time";
multipleSelected = true;
}
else if (injectorSelectionState() != NONE_SELECTED)
@@ -1497,8 +1483,8 @@ QString RimEclipseResultDefinition::timeOfFlightString(bool shorter) const
tofString = shorter ? "TOF" : "Time Of Flight";
}
multipleSelected = multipleSelected ||
injectorSelectionState() >= MULTIPLE_SELECTED || producerSelectionState() >= MULTIPLE_SELECTED;
multipleSelected =
multipleSelected || injectorSelectionState() >= MULTIPLE_SELECTED || producerSelectionState() >= MULTIPLE_SELECTED;
if (multipleSelected && !shorter)
{
@@ -1516,14 +1502,12 @@ QString RimEclipseResultDefinition::maxFractionTracerString(bool shorter) const
if (injectorSelectionState() >= ONE_SELECTED && producerSelectionState() == NONE_SELECTED)
{
mfString = shorter ? "FloodReg" : "Flooding Region";
if (injectorSelectionState() >= MULTIPLE_SELECTED)
mfString += "s";
if (injectorSelectionState() >= MULTIPLE_SELECTED) mfString += "s";
}
else if (injectorSelectionState() == NONE_SELECTED && producerSelectionState() >= ONE_SELECTED)
{
mfString = shorter ? "DrainReg" : "Drainage Region";
if (producerSelectionState() >= MULTIPLE_SELECTED)
mfString += "s";
if (producerSelectionState() >= MULTIPLE_SELECTED) mfString += "s";
}
else
{
@@ -1700,11 +1684,11 @@ RimEclipseResultDefinition::FlowTracerSelectionState RimEclipseResultDefinition:
{
return ALL_SELECTED;
}
else if (m_selectedInjectorTracers().size() == (size_t) 1)
else if (m_selectedInjectorTracers().size() == (size_t)1)
{
return ONE_SELECTED;
}
else if (m_selectedInjectorTracers().size() > (size_t) 1)
else if (m_selectedInjectorTracers().size() > (size_t)1)
{
return MULTIPLE_SELECTED;
}
@@ -1727,17 +1711,16 @@ RimEclipseResultDefinition::FlowTracerSelectionState RimEclipseResultDefinition:
{
return ALL_SELECTED;
}
else if (m_selectedProducerTracers().size() == (size_t) 1)
else if (m_selectedProducerTracers().size() == (size_t)1)
{
return ONE_SELECTED;
}
else if (m_selectedProducerTracers().size() > (size_t) 1)
else if (m_selectedProducerTracers().size() > (size_t)1)
{
return MULTIPLE_SELECTED;
}
}
return NONE_SELECTED;
}
//--------------------------------------------------------------------------------------------------