mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
@@ -28,6 +28,7 @@
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
#include "cvfAssert.h"
|
||||
#include "cvfMath.h"
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
|
||||
namespace caf
|
||||
@@ -110,6 +111,7 @@ void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
resultDefinition->fieldChangedByUi(changedField, oldValue, newValue);
|
||||
setToDefaultValues();
|
||||
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
|
||||
updateFilterName();
|
||||
}
|
||||
|
||||
if ( &lowerBound == changedField
|
||||
@@ -119,6 +121,7 @@ void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
|| &filterMode == changedField)
|
||||
{
|
||||
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
|
||||
updateFilterName();
|
||||
this->updateIconState();
|
||||
}
|
||||
}
|
||||
@@ -255,3 +258,15 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
upperBound.setUiName(QString("Max (%1)").arg(max));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::updateFilterName()
|
||||
{
|
||||
QString newFiltername;
|
||||
newFiltername = resultDefinition->resultVariable() + " ("
|
||||
+ QString::number(lowerBound()) + " .. " + QString::number(upperBound) + ")";
|
||||
this->name = newFiltername;
|
||||
RiuMainWindow::instance()->forceProjectTreeRepaint();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
void setParentContainer(RimEclipsePropertyFilterCollection* parentContainer);
|
||||
RimEclipsePropertyFilterCollection* parentContainer();
|
||||
void setToDefaultValues();
|
||||
void updateFilterName();
|
||||
void computeResultValueRange();
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
@@ -59,6 +60,7 @@ protected:
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||
|
||||
private:
|
||||
|
||||
RimEclipsePropertyFilterCollection* m_parentContainer;
|
||||
double m_minimumResultValue;
|
||||
double m_maximumResultValue;
|
||||
|
||||
@@ -99,8 +99,7 @@ RimEclipsePropertyFilter* RimEclipsePropertyFilterCollection::createAndAppendPro
|
||||
propertyFilter->resultDefinition->setResultType(m_reservoirView->cellResult->resultType());
|
||||
propertyFilter->resultDefinition->loadResult();
|
||||
propertyFilter->setToDefaultValues();
|
||||
|
||||
propertyFilter->name = m_reservoirView->cellResult->resultVariable() + QString(" (%1)").arg(propertyFilters().size());
|
||||
propertyFilter->updateFilterName();
|
||||
|
||||
|
||||
return propertyFilter;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimGeoMechPropertyFilter, "GeoMechPropertyFilter");
|
||||
@@ -79,6 +80,7 @@ void RimGeoMechPropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
|| &filterMode == changedField)
|
||||
{
|
||||
this->updateIconState();
|
||||
this->updateFilterName();
|
||||
((RimView*)resultDefinition->reservoirView())->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
resultDefinition->reservoirView()->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
@@ -111,6 +113,7 @@ void RimGeoMechPropertyFilter::setToDefaultValues()
|
||||
|
||||
lowerBound = m_minimumResultValue;
|
||||
upperBound = m_maximumResultValue;
|
||||
this->updateFilterName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -177,3 +180,27 @@ void RimGeoMechPropertyFilter::computeResultValueRange()
|
||||
lowerBound.setUiName(QString("Min (%1)").arg(min));
|
||||
upperBound.setUiName(QString("Max (%1)").arg(max));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechPropertyFilter::updateFilterName()
|
||||
{
|
||||
RigFemResultAddress resultAddress = resultDefinition->resultAddress();
|
||||
QString newFiltername;
|
||||
QString posName;
|
||||
|
||||
switch (resultAddress.resultPosType)
|
||||
{
|
||||
case RIG_NODAL: posName = "N"; break;
|
||||
case RIG_ELEMENT_NODAL: posName = "EN"; break;
|
||||
case RIG_INTEGRATION_POINT: posName = "IP"; break;
|
||||
}
|
||||
|
||||
newFiltername = posName + ", " + QString::fromStdString(resultAddress.fieldName + ", " + resultAddress.componentName) + " ("
|
||||
+ QString::number(lowerBound()) + " .. " + QString::number(upperBound) + ")";
|
||||
this->name = newFiltername;
|
||||
|
||||
RiuMainWindow::instance()->forceProjectTreeRepaint();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
void setParentContainer(RimGeoMechPropertyFilterCollection* parentContainer);
|
||||
RimGeoMechPropertyFilterCollection* parentContainer();
|
||||
void setToDefaultValues();
|
||||
void updateFilterName();
|
||||
void computeResultValueRange();
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
|
||||
@@ -98,10 +98,8 @@ RimGeoMechPropertyFilter* RimGeoMechPropertyFilterCollection::createAndAppendPro
|
||||
propertyFilter->resultDefinition->setResultAddress(m_reservoirView->cellResult()->resultAddress());
|
||||
propertyFilter->resultDefinition->loadResult();
|
||||
propertyFilter->setToDefaultValues();
|
||||
|
||||
RigFemResultAddress resAddr = m_reservoirView->cellResult()->resultAddress();
|
||||
propertyFilter->name = QString::fromStdString(resAddr.fieldName + ", " + resAddr.componentName) + QString(" (%1)").arg(propertyFilters().size());
|
||||
|
||||
propertyFilter->updateFilterName();
|
||||
|
||||
return propertyFilter;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user