mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4168 Treat some properties as categories.
This commit is contained in:
@@ -226,6 +226,14 @@ void RimEclipseCellColors::updateLegendCategorySettings()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::uiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -274,7 +282,8 @@ public :
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
void RimEclipseCellColors::updateLegendData(RimEclipseCase* rimEclipseCase,
|
||||
int currentTimeStep,
|
||||
RimRegularLegendConfig* legendConfig,
|
||||
RimTernaryLegendConfig* ternaryLegendConfig)
|
||||
{
|
||||
@@ -285,22 +294,22 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
{
|
||||
if ( this->isFlowDiagOrInjectionFlooding() )
|
||||
{
|
||||
CVF_ASSERT(currentTimeStep >= 0);
|
||||
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
RigFlowDiagResults* flowResultsData = this->flowDiagSolution()->flowDiagResults();
|
||||
RigFlowDiagResultAddress resAddr = this->flowDiagResAddress();
|
||||
|
||||
int integerTimeStep = static_cast<int>(currentTimeStep);
|
||||
|
||||
flowResultsData->minMaxScalarValues(resAddr, integerTimeStep, &globalMin, &globalMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, integerTimeStep, &globalPosClosestToZero, &globalNegClosestToZero);
|
||||
flowResultsData->minMaxScalarValues(resAddr, currentTimeStep, &globalMin, &globalMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, currentTimeStep, &globalPosClosestToZero, &globalNegClosestToZero);
|
||||
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if ( this->hasDynamicResult() )
|
||||
{
|
||||
flowResultsData->minMaxScalarValues(resAddr, integerTimeStep, &localMin, &localMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, integerTimeStep, &localPosClosestToZero, &localNegClosestToZero);
|
||||
flowResultsData->minMaxScalarValues(resAddr, currentTimeStep, &localMin, &localMax);
|
||||
flowResultsData->posNegClosestToZero(resAddr, currentTimeStep, &localPosClosestToZero, &localNegClosestToZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -318,7 +327,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
localPosClosestToZero, localNegClosestToZero);
|
||||
legendConfig->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
|
||||
|
||||
if ( this->hasCategoryResult() )
|
||||
if ( this->hasCategoryResult() && m_reservoirView)
|
||||
{
|
||||
std::set<std::tuple<QString, int, cvf::Color3ub>, TupleCompare > categories;
|
||||
//std::set<std::tuple<QString, int, cvf::Color3ub> > categories;
|
||||
@@ -346,8 +355,6 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
}
|
||||
else
|
||||
{
|
||||
RimEclipseCase* rimEclipseCase = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimEclipseCase);
|
||||
CVF_ASSERT(rimEclipseCase);
|
||||
if ( !rimEclipseCase ) return;
|
||||
|
||||
@@ -366,7 +373,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
|
||||
double localMin, localMax;
|
||||
double localPosClosestToZero, localNegClosestToZero;
|
||||
if ( this->hasDynamicResult() )
|
||||
if ( this->hasDynamicResult() && currentTimeStep >= 0)
|
||||
{
|
||||
cellResultsData->minMaxCellScalarValues(this->eclipseResultAddress(), currentTimeStep, localMin, localMax);
|
||||
cellResultsData->posNegClosestToZero(this->eclipseResultAddress(), currentTimeStep, localPosClosestToZero, localNegClosestToZero);
|
||||
@@ -424,8 +431,6 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep,
|
||||
|
||||
// Ternary legend update
|
||||
{
|
||||
RimEclipseCase* rimEclipseCase = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimEclipseCase);
|
||||
CVF_ASSERT(rimEclipseCase);
|
||||
if ( !rimEclipseCase ) return;
|
||||
|
||||
@@ -525,16 +530,18 @@ RimTernaryLegendConfig* RimEclipseCellColors::ternaryLegendConfig()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCellColors::updateIconState()
|
||||
{
|
||||
RimViewController* viewController = m_reservoirView->viewController();
|
||||
if (viewController && viewController->isResultColorControlled())
|
||||
if (m_reservoirView)
|
||||
{
|
||||
updateUiIconFromState(false);
|
||||
RimViewController* viewController = m_reservoirView->viewController();
|
||||
if (viewController && viewController->isResultColorControlled())
|
||||
{
|
||||
updateUiIconFromState(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
updateUiIconFromState(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
updateUiIconFromState(true);
|
||||
}
|
||||
|
||||
uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user