mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 09:00:20 -05:00
#12269 User interface improvements
- set significant digits to 4 - cache the parameter filter values - move the parameter filter above plot settings
This commit is contained in:
1 parent
48141d1c39
commit
27951cf20c
3 files changed
+78
-13
No files matched your search
@@ -355,7 +355,12 @@ void RimCorrelationReportPlot::onLoadDataAndUpdate()
|
||||
void RimCorrelationReportPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
m_correlationMatrixPlot->uiOrdering( "report", uiOrdering );
|
||||
|
||||
auto filterGroup = uiOrdering.addNewGroup( "Filter" );
|
||||
m_parameterResultCrossPlot->appendFilterFields( *filterGroup );
|
||||
|
||||
auto plotGroup = uiOrdering.addNewGroup( "Plot Settings" );
|
||||
plotGroup->setCollapsedByDefault();
|
||||
plotGroup->add( &m_titleFontSize );
|
||||
plotGroup->add( &m_subTitleFontSize );
|
||||
plotGroup->add( &m_labelFontSize );
|
||||
@@ -364,9 +369,6 @@ void RimCorrelationReportPlot::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
plotGroup->add( &m_axisValueFontSize );
|
||||
m_correlationMatrixPlot->legendConfig()->uiOrdering( "ColorsOnly", *plotGroup );
|
||||
|
||||
auto filterGroup = uiOrdering.addNewGroup( "Filter" );
|
||||
m_parameterResultCrossPlot->appendFilterFields( *filterGroup );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
|
||||
+62
-9
@@ -60,6 +60,8 @@ CAF_PDM_SOURCE_INIT( RimParameterResultCrossPlot, "ParameterResultCrossPlot" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimParameterResultCrossPlot::RimParameterResultCrossPlot()
|
||||
: RimAbstractCorrelationPlot()
|
||||
, m_xValueRange( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() )
|
||||
, m_yValueRange( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
CAF_PDM_InitObject( "ParameterResultCross Plot", ":/CorrelationCrossPlot16x16.png" );
|
||||
|
||||
@@ -98,9 +100,12 @@ RimParameterResultCrossPlot::~RimParameterResultCrossPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimParameterResultCrossPlot::setEnsembleParameter( const QString& ensembleParameter )
|
||||
{
|
||||
writeDataToCache();
|
||||
|
||||
m_ensembleParameter = ensembleParameter;
|
||||
|
||||
updateValueRanges();
|
||||
updateFilterRanges();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -165,7 +170,11 @@ void RimParameterResultCrossPlot::defineUiOrdering( QString uiConfigName, caf::P
|
||||
caf::PdmUiGroup* crossPlotGroup = uiOrdering.addNewGroup( "Cross Plot Parameters" );
|
||||
crossPlotGroup->add( &m_ensembleParameter );
|
||||
|
||||
auto filterGroup = uiOrdering.addNewGroup( "Filter" );
|
||||
appendFilterFields( *filterGroup );
|
||||
|
||||
caf::PdmUiGroup* plotGroup = uiOrdering.addNewGroup( "Plot Settings" );
|
||||
plotGroup->setCollapsedByDefault();
|
||||
plotGroup->add( &m_showPlotTitle );
|
||||
plotGroup->add( &m_useAutoPlotTitle );
|
||||
plotGroup->add( &m_description );
|
||||
@@ -177,9 +186,6 @@ void RimParameterResultCrossPlot::defineUiOrdering( QString uiConfigName, caf::P
|
||||
|
||||
m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle() );
|
||||
|
||||
auto filterGroup = uiOrdering.addNewGroup( "Filter" );
|
||||
appendFilterFields( *filterGroup );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
@@ -210,8 +216,8 @@ void RimParameterResultCrossPlot::defineEditorAttribute( const caf::PdmFieldHand
|
||||
{
|
||||
if ( auto attr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute ) )
|
||||
{
|
||||
attr->m_decimals = 2;
|
||||
attr->m_sliderTickCount = 100;
|
||||
attr->m_decimals = 4;
|
||||
attr->m_sliderTickCount = 20;
|
||||
|
||||
attr->m_minimum = m_yValueRange.first;
|
||||
attr->m_maximum = m_yValueRange.second;
|
||||
@@ -221,8 +227,8 @@ void RimParameterResultCrossPlot::defineEditorAttribute( const caf::PdmFieldHand
|
||||
{
|
||||
if ( auto attr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute ) )
|
||||
{
|
||||
attr->m_decimals = 2;
|
||||
attr->m_sliderTickCount = 100;
|
||||
attr->m_decimals = 4;
|
||||
attr->m_sliderTickCount = 20;
|
||||
|
||||
attr->m_minimum = m_xValueRange.first;
|
||||
attr->m_maximum = m_xValueRange.second;
|
||||
@@ -268,7 +274,14 @@ void RimParameterResultCrossPlot::onLoadDataAndUpdate()
|
||||
m_rectAnnotation->attach( m_plotWidget->qwtPlot() );
|
||||
}
|
||||
|
||||
updateValueRanges();
|
||||
if ( m_xValueRange.first != std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
writeDataToCache();
|
||||
}
|
||||
|
||||
updateAxes();
|
||||
|
||||
updatePlotTitle();
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
@@ -374,9 +387,25 @@ void RimParameterResultCrossPlot::updateValueRanges()
|
||||
|
||||
m_xValueRange = { parameterMin - parameterRange * 0.1, parameterMax + parameterRange * 0.1 };
|
||||
m_yValueRange = { summaryMin - summaryRange * 0.1, summaryMax + summaryRange * 0.1 };
|
||||
}
|
||||
|
||||
m_summaryFilterRange = { m_yValueRange.first, m_yValueRange.second };
|
||||
m_parameterFilterRange = { m_xValueRange.first, m_xValueRange.second };
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimParameterResultCrossPlot::updateFilterRanges()
|
||||
{
|
||||
const auto hashValue = hashFromCurrentData();
|
||||
if ( m_filterValueRangeCache.contains( hashValue ) )
|
||||
{
|
||||
const auto& cachedRanges = m_filterValueRangeCache[hashValue];
|
||||
m_parameterFilterRange = { cachedRanges[0], cachedRanges[1] };
|
||||
m_summaryFilterRange = { cachedRanges[2], cachedRanges[3] };
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryFilterRange = m_yValueRange;
|
||||
m_parameterFilterRange = m_xValueRange;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -461,6 +490,30 @@ std::vector<RimParameterResultCrossPlot::CaseData> RimParameterResultCrossPlot::
|
||||
return caseData;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimParameterResultCrossPlot::hashFromCurrentData() const
|
||||
{
|
||||
return RiaHashTools::hash( m_ensembleParameter().toStdString(),
|
||||
m_xValueRange.first,
|
||||
m_xValueRange.second,
|
||||
m_yValueRange.first,
|
||||
m_yValueRange.second );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimParameterResultCrossPlot::writeDataToCache()
|
||||
{
|
||||
const auto hashValue = hashFromCurrentData();
|
||||
m_filterValueRangeCache[hashValue] = { m_parameterFilterRange().first,
|
||||
m_parameterFilterRange().second,
|
||||
m_summaryFilterRange().first,
|
||||
m_summaryFilterRange().second };
|
||||
}
|
||||
|
||||
namespace internal
|
||||
{
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
|
||||
#include "RimAbstractCorrelationPlot.h"
|
||||
|
||||
#include <array>
|
||||
#include <map>
|
||||
|
||||
class RiuQwtPlotRectAnnotation;
|
||||
|
||||
//==================================================================================================
|
||||
@@ -53,7 +56,9 @@ private:
|
||||
QString asciiDataForPlotExport() const override;
|
||||
void updatePlotTitle() override;
|
||||
void createPoints();
|
||||
void updateValueRanges();
|
||||
|
||||
void updateValueRanges();
|
||||
void updateFilterRanges();
|
||||
|
||||
QString excludedCasesText() const;
|
||||
|
||||
@@ -66,6 +71,9 @@ private:
|
||||
|
||||
std::vector<CaseData> createCaseData() const;
|
||||
|
||||
size_t hashFromCurrentData() const;
|
||||
void writeDataToCache();
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_ensembleParameter;
|
||||
|
||||
@@ -78,4 +86,6 @@ private:
|
||||
std::pair<double, double> m_yValueRange;
|
||||
|
||||
std::unique_ptr<RiuQwtPlotRectAnnotation> m_rectAnnotation;
|
||||
|
||||
std::map<size_t, std::array<double, 4>> m_filterValueRangeCache;
|
||||
};
|
||||
Reference in new issue
Block a user