mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1035 Top level systems now access the Flow Diag data. There are none yet, so rendered gray.
This commit is contained in:
parent
342855df56
commit
7222d50645
@ -208,6 +208,9 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
if (isResultsInfoRelevant)
|
||||
{
|
||||
size_t scalarIndex = eclipseView->cellResult()->scalarResultIndex();
|
||||
if (scalarIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
|
||||
if (m_statisticsCellRange == ALL_CELLS)
|
||||
{
|
||||
if (m_statisticsTimeRange == ALL_TIMESTEPS)
|
||||
@ -256,6 +259,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
histogram = &(m_visibleCellStatistics->cellScalarValuesHistogram(currentTimeStep));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,7 +368,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
|
||||
if (showHistogram())
|
||||
{
|
||||
if (isResultsInfoRelevant)
|
||||
if (isResultsInfoRelevant && histogram)
|
||||
{
|
||||
eclipseView->viewer()->showHistogram(true);
|
||||
eclipseView->viewer()->setHistogram(min, max, *histogram);
|
||||
|
@ -506,6 +506,8 @@ void RimEclipseResultDefinition::loadResult()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::hasStaticResult() const
|
||||
{
|
||||
if (this->resultType() == RimDefines::FLOW_DIAGNOSTICS) return false;
|
||||
|
||||
const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
|
||||
size_t gridScalarResultIndex = this->scalarResultIndex();
|
||||
|
||||
@ -524,7 +526,11 @@ bool RimEclipseResultDefinition::hasStaticResult() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::hasResult() const
|
||||
{
|
||||
if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults())
|
||||
if (this->resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
if (m_flowSolution() && !m_resultVariable().isEmpty()) return true;
|
||||
}
|
||||
else if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults())
|
||||
{
|
||||
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults()->cellResults();
|
||||
size_t gridScalarResultIndex = gridCellResults->findScalarResultIndex(m_resultType(), m_resultVariable());
|
||||
@ -546,6 +552,10 @@ bool RimEclipseResultDefinition::hasDynamicResult() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (m_resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults())
|
||||
{
|
||||
|
@ -992,47 +992,54 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
|
||||
{
|
||||
if (resultColors->hasResult())
|
||||
{
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), globalMin, globalMax);
|
||||
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), globalPosClosestToZero, globalNegClosestToZero);
|
||||
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if (resultColors->hasDynamicResult())
|
||||
if (resultColors->resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), m_currentTimeStep, localMin, localMax);
|
||||
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), m_currentTimeStep, localPosClosestToZero, localNegClosestToZero);
|
||||
// Todo
|
||||
}
|
||||
else
|
||||
{
|
||||
localMin = globalMin;
|
||||
localMax = globalMax;
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), globalMin, globalMax);
|
||||
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), globalPosClosestToZero, globalNegClosestToZero);
|
||||
|
||||
localPosClosestToZero = globalPosClosestToZero;
|
||||
localNegClosestToZero = globalNegClosestToZero;
|
||||
}
|
||||
|
||||
CVF_ASSERT(resultColors->legendConfig());
|
||||
|
||||
resultColors->legendConfig()->setClosestToZeroValues(globalPosClosestToZero, globalNegClosestToZero, localPosClosestToZero, localNegClosestToZero);
|
||||
resultColors->legendConfig()->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
|
||||
|
||||
if (resultColors->hasCategoryResult())
|
||||
{
|
||||
if(resultColors->resultType() != RimDefines::FORMATION_NAMES)
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if ( resultColors->hasDynamicResult() )
|
||||
{
|
||||
resultColors->legendConfig()->setIntegerCategories(cellResultsData->uniqueCellScalarValues(resultColors->scalarResultIndex()));
|
||||
cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), m_currentTimeStep, localMin, localMax);
|
||||
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), m_currentTimeStep, localPosClosestToZero, localNegClosestToZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::vector<QString>& fnVector = eclipseCase()->reservoirData()->activeFormationNames()->formationNames();
|
||||
resultColors->legendConfig()->setNamedCategoriesInverse(fnVector);
|
||||
}
|
||||
}
|
||||
localMin = globalMin;
|
||||
localMax = globalMax;
|
||||
|
||||
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->legend());
|
||||
resultColors->legendConfig()->setTitle(cvfqt::Utils::toString(legendLabel + resultColors->resultVariable()));
|
||||
localPosClosestToZero = globalPosClosestToZero;
|
||||
localNegClosestToZero = globalNegClosestToZero;
|
||||
}
|
||||
|
||||
CVF_ASSERT(resultColors->legendConfig());
|
||||
|
||||
resultColors->legendConfig()->setClosestToZeroValues(globalPosClosestToZero, globalNegClosestToZero, localPosClosestToZero, localNegClosestToZero);
|
||||
resultColors->legendConfig()->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
|
||||
|
||||
if ( resultColors->hasCategoryResult() )
|
||||
{
|
||||
if ( resultColors->resultType() != RimDefines::FORMATION_NAMES )
|
||||
{
|
||||
resultColors->legendConfig()->setIntegerCategories(cellResultsData->uniqueCellScalarValues(resultColors->scalarResultIndex()));
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::vector<QString>& fnVector = eclipseCase()->reservoirData()->activeFormationNames()->formationNames();
|
||||
resultColors->legendConfig()->setNamedCategoriesInverse(fnVector);
|
||||
}
|
||||
}
|
||||
|
||||
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->legend());
|
||||
resultColors->legendConfig()->setTitle(cvfqt::Utils::toString(legendLabel + resultColors->resultVariable()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user