Result Selection: Result is not changed before user actively selects in the list.

Changig type or porosity model only changes what variables are shown as accessible.
This is also applied to property filters.
Dual porosity support is also added to property filtered. Forgotten before.
p4#: 21499
This commit is contained in:
Jacob Støren
2013-04-30 13:41:53 +02:00
parent 445b6edfbd
commit 60f86cfc3f
11 changed files with 198 additions and 66 deletions

View File

@@ -56,10 +56,12 @@ RimCellPropertyFilter::RimCellPropertyFilter()
resultDefinition = new RimResultDefinition();
// Take ownership of the fields in RimResultDefinition to be able to trap fieldChangedByUi in this class
resultDefinition->resultType.setOwnerObject(this);
resultDefinition->resultVariable.setOwnerObject(this);
resultDefinition->resultType.setUiName("");
resultDefinition->resultVariable.setUiName("");
resultDefinition->m_resultTypeUiField.setOwnerObject(this);
resultDefinition->m_resultTypeUiField.setUiName("");
resultDefinition->m_porosityModelUiField.setOwnerObject(this);
resultDefinition->m_porosityModelUiField.setUiName("");
resultDefinition->m_resultVariableUiField.setOwnerObject(this);
resultDefinition->m_resultVariableUiField.setUiName("");
// Set to hidden to avoid this item to been displayed as a child item
// Fields in this object are displayed using defineUiOrdering()
@@ -89,17 +91,28 @@ RimCellPropertyFilter::~RimCellPropertyFilter()
//--------------------------------------------------------------------------------------------------
void RimCellPropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &name)
if (&name == changedField)
{
}
else if (&(resultDefinition->resultType) == changedField || &(resultDefinition->resultVariable) == changedField)
if ( &(resultDefinition->m_resultTypeUiField) == changedField
|| &(resultDefinition->m_porosityModelUiField) == changedField)
{
resultDefinition->fieldChangedByUi(changedField, oldValue, newValue);
}
if ( &(resultDefinition->m_resultVariableUiField) == changedField )
{
resultDefinition->fieldChangedByUi(changedField, oldValue, newValue);
setDefaultValues();
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
}
else
if ( &lowerBound == changedField
|| &upperBound == changedField
|| &evaluationRegion == changedField
|| &active == changedField
|| &filterMode == changedField)
{
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
this->updateIconState();
@@ -143,7 +156,7 @@ void RimCellPropertyFilter::setDefaultValues()
size_t scalarIndex = resultDefinition->gridScalarIndex();
if (scalarIndex != cvf::UNDEFINED_SIZE_T)
{
RimReservoirCellResultsStorage* results = m_parentContainer->reservoirView()->currentGridCellResults();
RimReservoirCellResultsStorage* results = resultDefinition->currentGridCellResults();
if (results)
{
results->cellResults()->minMaxCellScalarValues(scalarIndex, min, max);
@@ -170,8 +183,9 @@ void RimCellPropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd
// Fields declared in RimResultDefinition
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
group1->add(&(resultDefinition->resultType));
group1->add(&(resultDefinition->resultVariable));
group1->add(&(resultDefinition->m_resultTypeUiField));
group1->add(&(resultDefinition->m_porosityModelUiField));
group1->add(&(resultDefinition->m_resultVariableUiField));
// Fields declared in RimCellFilter
uiOrdering.add(&active);