mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
#1035 Connected the Flow Diag solver, and added the statistics needed for legend. Now many things work .
This commit is contained in:
1 parent
3c55a86650
commit
003271ff54
15 files changed
+962
-23
No files matched your search
@@ -76,6 +76,9 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <limits.h>
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
|
||||
|
||||
|
||||
@@ -947,6 +950,7 @@ void RimEclipseView::updateLegends()
|
||||
CVF_ASSERT(results);
|
||||
|
||||
updateMinMaxValuesAndAddLegendToView(QString("Cell Results: \n"), this->cellResult(), results);
|
||||
|
||||
if (this->faultResultSettings()->showCustomFaultResult() && this->faultResultSettings()->hasValidCustomResult())
|
||||
{
|
||||
updateMinMaxValuesAndAddLegendToView(QString("Fault Results: \n"), this->currentFaultResultColors(), results);
|
||||
@@ -994,7 +998,43 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel, R
|
||||
{
|
||||
if (resultColors->resultType() == RimDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
// Todo
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
RigFlowDiagResults* cellResultsData = resultColors->flowDiagSolution()->flowDiagResults();
|
||||
RigFlowDiagResultAddress resAddr = resultColors->flowDiagResAddress();
|
||||
|
||||
cellResultsData->minMaxScalarValues(resAddr, m_currentTimeStep, &globalMin, &globalMax);
|
||||
cellResultsData->posNegClosestToZero(resAddr, m_currentTimeStep, &globalPosClosestToZero, &globalNegClosestToZero);
|
||||
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if ( resultColors->hasDynamicResult() )
|
||||
{
|
||||
cellResultsData->minMaxScalarValues(resAddr, m_currentTimeStep, &localMin, &localMax);
|
||||
cellResultsData->posNegClosestToZero(resAddr, m_currentTimeStep, &localPosClosestToZero, &localNegClosestToZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
localMin = globalMin;
|
||||
localMax = globalMax;
|
||||
|
||||
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() )
|
||||
{
|
||||
resultColors->legendConfig()->setIntegerCategories(cellResultsData->uniqueCellScalarValues(resAddr, m_currentTimeStep));
|
||||
}
|
||||
|
||||
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->legend());
|
||||
resultColors->legendConfig()->setTitle(cvfqt::Utils::toString(legendLabel + resultColors->resultVariable()));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user