mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
more text in UI
This commit is contained in:
parent
6cdfb7da09
commit
516fd9a929
@ -31,7 +31,9 @@ RimPlotCellFilterCollection::RimPlotCellFilterCollection()
|
||||
CAF_PDM_InitObject("Plot Cell Filters", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_cellFilters, "CellFilters", "Cell Filters", "", "", "");
|
||||
// m_crossPlotCurveSets.uiCapability()->setUiHidden(true);
|
||||
m_cellFilters.uiCapability()->setUiHidden(true);
|
||||
|
||||
setName("Filter Collection");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -59,6 +59,8 @@ RimPlotCellPropertyFilter::RimPlotCellPropertyFilter()
|
||||
void RimPlotCellPropertyFilter::setResultDefinition(caf::PdmObject* resultDefinition)
|
||||
{
|
||||
m_resultDefinition = resultDefinition;
|
||||
|
||||
updateName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -80,6 +82,45 @@ RimEclipseResultDefinition* RimPlotCellPropertyFilter::eclipseResultDefinition()
|
||||
return dynamic_cast<RimEclipseResultDefinition*>(pdmObj);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCellPropertyFilter::findOrComputeMinMaxResultValues(double& minimumValue, double& maximumValue)
|
||||
{
|
||||
RimEclipseResultDefinition* resDef = eclipseResultDefinition();
|
||||
if (resDef)
|
||||
{
|
||||
RimEclipseCase* eclCase = resDef->eclipseCase();
|
||||
if (!eclCase) return;
|
||||
|
||||
RigEclipseCaseData* eclipseCaseData = eclCase->eclipseCaseData();
|
||||
if (!eclipseCaseData) return;
|
||||
|
||||
resDef->loadResult();
|
||||
|
||||
RigCaseCellResultsData* cellResultsData = resDef->currentGridCellResults();
|
||||
if (!cellResultsData) return;
|
||||
|
||||
cellResultsData->minMaxCellScalarValues(resDef->eclipseResultAddress(), minimumValue, maximumValue);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCellPropertyFilter::updateName()
|
||||
{
|
||||
QString name = "Property filter - ";
|
||||
|
||||
RimEclipseResultDefinition* resDef = eclipseResultDefinition();
|
||||
if (resDef)
|
||||
{
|
||||
name += resDef->resultVariableUiName();
|
||||
}
|
||||
|
||||
setName(name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -160,3 +201,28 @@ void RimPlotCellPropertyFilter::updateCellVisibilityFromFilter(size_t timeStepIn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCellPropertyFilter::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (field == &m_lowerBound || field == &m_upperBound)
|
||||
{
|
||||
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(attribute);
|
||||
if (!myAttr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double minimumValue = 0.0;
|
||||
double maximumValue = 0.0;
|
||||
|
||||
findOrComputeMinMaxResultValues(minimumValue, maximumValue);
|
||||
|
||||
myAttr->m_minimum = minimumValue;
|
||||
myAttr->m_maximum = maximumValue;
|
||||
}
|
||||
}
|
||||
|
@ -38,20 +38,25 @@ class RimPlotCellPropertyFilter : public RimPlotCellFilter
|
||||
public:
|
||||
RimPlotCellPropertyFilter();
|
||||
|
||||
// Currently supported result definition is RimEclipseResultDefinition, but the interface is designed to also support
|
||||
// RimGeoMechResultDefinition
|
||||
void setResultDefinition(caf::PdmObject* resultDefinition);
|
||||
|
||||
void setValueRange(double lowerBound, double upperBound);
|
||||
|
||||
protected:
|
||||
void updateCellVisibilityFromFilter(size_t timeStepIndex, cvf::UByteArray* visibleCells) override;
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute) override;
|
||||
|
||||
private:
|
||||
RimEclipseResultDefinition* eclipseResultDefinition();
|
||||
void findOrComputeMinMaxResultValues(double& minimumValue, double& maximumValue);
|
||||
void updateName();
|
||||
|
||||
private:
|
||||
caf::PdmChildField<caf::PdmObject*> m_resultDefinition;
|
||||
caf::PdmField<double> m_lowerBound;
|
||||
caf::PdmField<double> m_upperBound;
|
||||
|
||||
cvf::ref<cvf::UByteArray> m_visibleCells;
|
||||
};
|
||||
|
@ -121,6 +121,7 @@ RimGridCrossPlotCurveSet::RimGridCrossPlotCurveSet()
|
||||
CAF_PDM_InitField(&m_customColor, "CustomColor", cvf::Color3f(cvf::Color3f::BLACK), "Custom Color", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_plotCellFilterCollection, "PlotCellFilterCollection", "Cell Filters", "", "", "");
|
||||
m_plotCellFilterCollection.uiCapability()->setUiTreeHidden(true);
|
||||
m_plotCellFilterCollection = new RimPlotCellFilterCollection;
|
||||
|
||||
setDefaults();
|
||||
|
Loading…
Reference in New Issue
Block a user