Clear grouping for Grid Cross Plot if the grouping isn't valid when changing case

This commit is contained in:
Gaute Lindkvist
2019-03-26 11:21:25 +01:00
parent 97d71acaf8
commit 9bb657c642
2 changed files with 14 additions and 6 deletions

View File

@@ -44,6 +44,7 @@
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCurve.h"
#include "RimGridView.h"
#include "RimFormationNames.h"
#include "RimProject.h"
#include "RimRegularLegendConfig.h"
#include "RimTools.h"
@@ -810,6 +811,11 @@ void RimGridCrossPlotCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* chang
m_yAxisProperty->updateConnectedEditors();
m_groupingProperty->updateConnectedEditors();
if (m_grouping == GROUP_BY_FORMATION && !eclipseCase->activeFormationNames())
{
m_grouping = NO_GROUPING;
}
destroyCurves();
loadDataAndUpdate(true);
}

View File

@@ -126,14 +126,16 @@ RigEclipseCrossPlotResult RigEclipseCrossPlotDataExtractor::extract(RigEclipseCa
}
else if (groupingType == GROUP_BY_FORMATION)
{
CVF_ASSERT(activeFormationNames);
int category = 0;
size_t i(cvf::UNDEFINED_SIZE_T), j(cvf::UNDEFINED_SIZE_T), k(cvf::UNDEFINED_SIZE_T);
if (mainGrid->ijkFromCellIndex(globalCellIdx, &i, &j, &k))
if (activeFormationNames)
{
category = activeFormationNames->formationIndexFromKLayerIdx(k);
int category = 0;
size_t i(cvf::UNDEFINED_SIZE_T), j(cvf::UNDEFINED_SIZE_T), k(cvf::UNDEFINED_SIZE_T);
if (mainGrid->ijkFromCellIndex(globalCellIdx, &i, &j, &k))
{
category = activeFormationNames->formationIndexFromKLayerIdx(k);
}
result.groupValuesDiscrete.push_back(category);
}
result.groupValuesDiscrete.push_back(category);
}
else if (groupingType == GROUP_BY_RESULT)
{