#1986 Flooded PV: Add function isFlowDiagOrInjectionFlooding and replace

This commit is contained in:
Unknown
2017-10-18 11:31:19 +02:00
committed by Rebecca Cox
parent d9170e064b
commit 314bb71ea4
5 changed files with 23 additions and 10 deletions

View File

@@ -300,7 +300,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
}
}
}
else if (eclipseView->cellResult()->resultType() == RiaDefines::FLOW_DIAGNOSTICS || eclipseView->cellResult->resultType() == RiaDefines::INJECTION_FLOODING)
else if (eclipseView->cellResult()->isFlowDiagOrInjectionFlooding())
{
if (m_statisticsTimeRange == CURRENT_TIMESTEP || m_statisticsTimeRange == ALL_TIMESTEPS) // All timesteps is ignored
{

View File

@@ -252,7 +252,7 @@ void RimEclipsePropertyFilter::updateReadOnlyStateOfAllFields()
//--------------------------------------------------------------------------------------------------
void RimEclipsePropertyFilter::updateRangeLabel()
{
if (resultDefinition->resultType() == RiaDefines::FLOW_DIAGNOSTICS || resultDefinition->resultType() == RiaDefines::INJECTION_FLOODING)
if (resultDefinition->isFlowDiagOrInjectionFlooding())
{
m_rangeLabelText = "Current Timestep";
}
@@ -348,7 +348,7 @@ void RimEclipsePropertyFilter::computeResultValueRange()
clearCategories();
if (resultDefinition->resultType() == RiaDefines::FLOW_DIAGNOSTICS || resultDefinition->resultType() == RiaDefines::INJECTION_FLOODING)
if (resultDefinition->isFlowDiagOrInjectionFlooding())
{
RimView* view;
this->firstAncestorOrThisOfType(view);
@@ -423,7 +423,7 @@ void RimEclipsePropertyFilter::updateFromCurrentTimeStep()
//
// If the user manually has set a filter value, this value is left untouched
if (resultDefinition->resultType() != RiaDefines::FLOW_DIAGNOSTICS && resultDefinition->resultType() != RiaDefines::INJECTION_FLOODING)
if (!resultDefinition->isFlowDiagOrInjectionFlooding())
{
return;
}

View File

@@ -718,7 +718,7 @@ size_t RimEclipseResultDefinition::scalarResultIndex() const
{
size_t gridScalarResultIndex = cvf::UNDEFINED_SIZE_T;
if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS || m_resultType() == RiaDefines::INJECTION_FLOODING) return cvf::UNDEFINED_SIZE_T;
if (isFlowDiagOrInjectionFlooding()) return cvf::UNDEFINED_SIZE_T;
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
if (gridCellResults )
@@ -734,7 +734,7 @@ size_t RimEclipseResultDefinition::scalarResultIndex() const
//--------------------------------------------------------------------------------------------------
RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
{
CVF_ASSERT(m_resultType() == RiaDefines::FLOW_DIAGNOSTICS || m_resultType() == RiaDefines::INJECTION_FLOODING);
CVF_ASSERT(isFlowDiagOrInjectionFlooding());
if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS)
{
@@ -885,7 +885,7 @@ QString RimEclipseResultDefinition::resultVariableUiShortName() const
//--------------------------------------------------------------------------------------------------
void RimEclipseResultDefinition::loadResult()
{
if (m_resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->resultType() == RiaDefines::INJECTION_FLOODING) return; // Will load automatically on access
if (isFlowDiagOrInjectionFlooding()) return; // Will load automatically on access
RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
if (gridCellResults)
@@ -901,7 +901,7 @@ void RimEclipseResultDefinition::loadResult()
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::hasStaticResult() const
{
if (this->resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->resultType() == RiaDefines::INJECTION_FLOODING) return false;
if (isFlowDiagOrInjectionFlooding()) return false;
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
size_t gridScalarResultIndex = this->scalarResultIndex();
@@ -921,7 +921,7 @@ bool RimEclipseResultDefinition::hasStaticResult() const
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::hasResult() const
{
if (this->resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->resultType() == RiaDefines::INJECTION_FLOODING)
if (isFlowDiagOrInjectionFlooding())
{
if (m_flowSolution() && !m_resultVariable().isEmpty()) return true;
}
@@ -1092,6 +1092,18 @@ bool RimEclipseResultDefinition::hasCategoryResult() const
return this->resultVariable().contains("NUM", Qt::CaseInsensitive);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::isFlowDiagOrInjectionFlooding() const
{
if (this->m_resultType() == RiaDefines::FLOW_DIAGNOSTICS || this->m_resultType() == RiaDefines::INJECTION_FLOODING)
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///

View File

@@ -88,6 +88,7 @@ public:
bool isTernarySaturationSelected() const;
bool isCompletionTypeSelected() const;
bool hasCategoryResult() const;
bool isFlowDiagOrInjectionFlooding() const;
RigCaseCellResultsData* currentGridCellResults() const;

View File

@@ -221,7 +221,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultDefinition
size_t timeStepIndex,
RimEclipseResultDefinition* resultDefinition)
{
if (resultDefinition->resultType() == RiaDefines::FLOW_DIAGNOSTICS || resultDefinition->resultType() == RiaDefines::INJECTION_FLOODING)
if (resultDefinition->isFlowDiagOrInjectionFlooding())
{
RimFlowDiagSolution* flowSol = resultDefinition->flowDiagSolution();
if (!flowSol) return new RigHugeValResultAccessor;;