#1035 Top level systems now access the Flow Diag data. There are none yet, so rendered gray.

This commit is contained in:
Jacob Støren
2016-12-16 14:53:56 +01:00
parent 342855df56
commit 7222d50645
3 changed files with 54 additions and 33 deletions

View File

@@ -208,6 +208,9 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
if (isResultsInfoRelevant) if (isResultsInfoRelevant)
{ {
size_t scalarIndex = eclipseView->cellResult()->scalarResultIndex(); size_t scalarIndex = eclipseView->cellResult()->scalarResultIndex();
if (scalarIndex != cvf::UNDEFINED_SIZE_T)
{
if (m_statisticsCellRange == ALL_CELLS) if (m_statisticsCellRange == ALL_CELLS)
{ {
if (m_statisticsTimeRange == ALL_TIMESTEPS) if (m_statisticsTimeRange == ALL_TIMESTEPS)
@@ -256,6 +259,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
histogram = &(m_visibleCellStatistics->cellScalarValuesHistogram(currentTimeStep)); histogram = &(m_visibleCellStatistics->cellScalarValuesHistogram(currentTimeStep));
} }
} }
}
} }
} }
@@ -364,7 +368,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
if (showHistogram()) if (showHistogram())
{ {
if (isResultsInfoRelevant) if (isResultsInfoRelevant && histogram)
{ {
eclipseView->viewer()->showHistogram(true); eclipseView->viewer()->showHistogram(true);
eclipseView->viewer()->setHistogram(min, max, *histogram); eclipseView->viewer()->setHistogram(min, max, *histogram);

View File

@@ -506,6 +506,8 @@ void RimEclipseResultDefinition::loadResult()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::hasStaticResult() const bool RimEclipseResultDefinition::hasStaticResult() const
{ {
if (this->resultType() == RimDefines::FLOW_DIAGNOSTICS) return false;
const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults(); const RimReservoirCellResultsStorage* gridCellResults = this->currentGridCellResults();
size_t gridScalarResultIndex = this->scalarResultIndex(); size_t gridScalarResultIndex = this->scalarResultIndex();
@@ -524,7 +526,11 @@ bool RimEclipseResultDefinition::hasStaticResult() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimEclipseResultDefinition::hasResult() 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(); const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults()->cellResults();
size_t gridScalarResultIndex = gridCellResults->findScalarResultIndex(m_resultType(), m_resultVariable()); size_t gridScalarResultIndex = gridCellResults->findScalarResultIndex(m_resultType(), m_resultVariable());
@@ -546,6 +552,10 @@ bool RimEclipseResultDefinition::hasDynamicResult() const
{ {
return true; return true;
} }
else if (m_resultType() == RimDefines::FLOW_DIAGNOSTICS)
{
return true;
}
if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults()) if (this->currentGridCellResults() && this->currentGridCellResults()->cellResults())
{ {

View File

@@ -992,47 +992,54 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
{ {
if (resultColors->hasResult()) if (resultColors->hasResult())
{ {
double globalMin, globalMax; if (resultColors->resultType() == RimDefines::FLOW_DIAGNOSTICS)
double globalPosClosestToZero, globalNegClosestToZero;
cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), globalMin, globalMax);
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), globalPosClosestToZero, globalNegClosestToZero);
double localMin, localMax;
double localPosClosestToZero, localNegClosestToZero;
if (resultColors->hasDynamicResult())
{ {
cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), m_currentTimeStep, localMin, localMax); // Todo
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), m_currentTimeStep, localPosClosestToZero, localNegClosestToZero);
} }
else else
{ {
localMin = globalMin; double globalMin, globalMax;
localMax = globalMax; double globalPosClosestToZero, globalNegClosestToZero;
cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), globalMin, globalMax);
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), globalPosClosestToZero, globalNegClosestToZero);
localPosClosestToZero = globalPosClosestToZero; double localMin, localMax;
localNegClosestToZero = globalNegClosestToZero; double localPosClosestToZero, localNegClosestToZero;
} if ( resultColors->hasDynamicResult() )
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())); cellResultsData->minMaxCellScalarValues(resultColors->scalarResultIndex(), m_currentTimeStep, localMin, localMax);
cellResultsData->posNegClosestToZero(resultColors->scalarResultIndex(), m_currentTimeStep, localPosClosestToZero, localNegClosestToZero);
} }
else else
{ {
const std::vector<QString>& fnVector = eclipseCase()->reservoirData()->activeFormationNames()->formationNames(); localMin = globalMin;
resultColors->legendConfig()->setNamedCategoriesInverse(fnVector); localMax = globalMax;
}
}
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->legend()); localPosClosestToZero = globalPosClosestToZero;
resultColors->legendConfig()->setTitle(cvfqt::Utils::toString(legendLabel + resultColors->resultVariable())); 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()));
}
} }