mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
parent
bfdc00edaf
commit
1a3a2f1ff5
@ -28,6 +28,7 @@
|
|||||||
#include "cafPdmUiDoubleSliderEditor.h"
|
#include "cafPdmUiDoubleSliderEditor.h"
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
#include "cvfMath.h"
|
#include "cvfMath.h"
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
@ -110,6 +111,7 @@ void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
|||||||
resultDefinition->fieldChangedByUi(changedField, oldValue, newValue);
|
resultDefinition->fieldChangedByUi(changedField, oldValue, newValue);
|
||||||
setToDefaultValues();
|
setToDefaultValues();
|
||||||
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
|
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
|
||||||
|
updateFilterName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( &lowerBound == changedField
|
if ( &lowerBound == changedField
|
||||||
@ -119,6 +121,7 @@ void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
|||||||
|| &filterMode == changedField)
|
|| &filterMode == changedField)
|
||||||
{
|
{
|
||||||
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
|
m_parentContainer->fieldChangedByUi(changedField, oldValue, newValue);
|
||||||
|
updateFilterName();
|
||||||
this->updateIconState();
|
this->updateIconState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,3 +258,15 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
|||||||
upperBound.setUiName(QString("Max (%1)").arg(max));
|
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);
|
void setParentContainer(RimEclipsePropertyFilterCollection* parentContainer);
|
||||||
RimEclipsePropertyFilterCollection* parentContainer();
|
RimEclipsePropertyFilterCollection* parentContainer();
|
||||||
void setToDefaultValues();
|
void setToDefaultValues();
|
||||||
|
void updateFilterName();
|
||||||
void computeResultValueRange();
|
void computeResultValueRange();
|
||||||
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
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);
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
RimEclipsePropertyFilterCollection* m_parentContainer;
|
RimEclipsePropertyFilterCollection* m_parentContainer;
|
||||||
double m_minimumResultValue;
|
double m_minimumResultValue;
|
||||||
double m_maximumResultValue;
|
double m_maximumResultValue;
|
||||||
|
@ -99,8 +99,7 @@ RimEclipsePropertyFilter* RimEclipsePropertyFilterCollection::createAndAppendPro
|
|||||||
propertyFilter->resultDefinition->setResultType(m_reservoirView->cellResult->resultType());
|
propertyFilter->resultDefinition->setResultType(m_reservoirView->cellResult->resultType());
|
||||||
propertyFilter->resultDefinition->loadResult();
|
propertyFilter->resultDefinition->loadResult();
|
||||||
propertyFilter->setToDefaultValues();
|
propertyFilter->setToDefaultValues();
|
||||||
|
propertyFilter->updateFilterName();
|
||||||
propertyFilter->name = m_reservoirView->cellResult->resultVariable() + QString(" (%1)").arg(propertyFilters().size());
|
|
||||||
|
|
||||||
|
|
||||||
return propertyFilter;
|
return propertyFilter;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "RigFemPartResultsCollection.h"
|
#include "RigFemPartResultsCollection.h"
|
||||||
#include "RigGeoMechCaseData.h"
|
#include "RigGeoMechCaseData.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimGeoMechPropertyFilter, "GeoMechPropertyFilter");
|
CAF_PDM_SOURCE_INIT(RimGeoMechPropertyFilter, "GeoMechPropertyFilter");
|
||||||
@ -79,6 +80,7 @@ void RimGeoMechPropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
|||||||
|| &filterMode == changedField)
|
|| &filterMode == changedField)
|
||||||
{
|
{
|
||||||
this->updateIconState();
|
this->updateIconState();
|
||||||
|
this->updateFilterName();
|
||||||
((RimView*)resultDefinition->reservoirView())->scheduleGeometryRegen(PROPERTY_FILTERED);
|
((RimView*)resultDefinition->reservoirView())->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||||
resultDefinition->reservoirView()->scheduleCreateDisplayModelAndRedraw();
|
resultDefinition->reservoirView()->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
@ -111,6 +113,7 @@ void RimGeoMechPropertyFilter::setToDefaultValues()
|
|||||||
|
|
||||||
lowerBound = m_minimumResultValue;
|
lowerBound = m_minimumResultValue;
|
||||||
upperBound = m_maximumResultValue;
|
upperBound = m_maximumResultValue;
|
||||||
|
this->updateFilterName();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -177,3 +180,27 @@ void RimGeoMechPropertyFilter::computeResultValueRange()
|
|||||||
lowerBound.setUiName(QString("Min (%1)").arg(min));
|
lowerBound.setUiName(QString("Min (%1)").arg(min));
|
||||||
upperBound.setUiName(QString("Max (%1)").arg(max));
|
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);
|
void setParentContainer(RimGeoMechPropertyFilterCollection* parentContainer);
|
||||||
RimGeoMechPropertyFilterCollection* parentContainer();
|
RimGeoMechPropertyFilterCollection* parentContainer();
|
||||||
void setToDefaultValues();
|
void setToDefaultValues();
|
||||||
|
void updateFilterName();
|
||||||
void computeResultValueRange();
|
void computeResultValueRange();
|
||||||
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
|
@ -98,9 +98,7 @@ RimGeoMechPropertyFilter* RimGeoMechPropertyFilterCollection::createAndAppendPro
|
|||||||
propertyFilter->resultDefinition->setResultAddress(m_reservoirView->cellResult()->resultAddress());
|
propertyFilter->resultDefinition->setResultAddress(m_reservoirView->cellResult()->resultAddress());
|
||||||
propertyFilter->resultDefinition->loadResult();
|
propertyFilter->resultDefinition->loadResult();
|
||||||
propertyFilter->setToDefaultValues();
|
propertyFilter->setToDefaultValues();
|
||||||
|
propertyFilter->updateFilterName();
|
||||||
RigFemResultAddress resAddr = m_reservoirView->cellResult()->resultAddress();
|
|
||||||
propertyFilter->name = QString::fromStdString(resAddr.fieldName + ", " + resAddr.componentName) + QString(" (%1)").arg(propertyFilters().size());
|
|
||||||
|
|
||||||
return propertyFilter;
|
return propertyFilter;
|
||||||
}
|
}
|
||||||
|
@ -2132,3 +2132,14 @@ void RiuMainWindow::setExpanded(const caf::PdmObject* pdmObject, bool expanded)
|
|||||||
m_treeView->setExpanded(mi, expanded);
|
m_treeView->setExpanded(mi, expanded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainWindow::forceProjectTreeRepaint()
|
||||||
|
{
|
||||||
|
// This is a hack to force the treeview redraw.
|
||||||
|
// Needed for some reason when changing names and icons in the model
|
||||||
|
m_treeView->scroll(0,1);
|
||||||
|
m_treeView->scroll(0,-1);
|
||||||
|
}
|
||||||
|
@ -84,6 +84,7 @@ public:
|
|||||||
|
|
||||||
void refreshAnimationActions();
|
void refreshAnimationActions();
|
||||||
void updateScaleValue();
|
void updateScaleValue();
|
||||||
|
void forceProjectTreeRepaint();
|
||||||
|
|
||||||
RimUiTreeModelPdm* uiPdmModel() { return m_treeModelPdm;}
|
RimUiTreeModelPdm* uiPdmModel() { return m_treeModelPdm;}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user