mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6201 Select parameters that go into a tornado plot
This commit is contained in:
parent
ad59f79dea
commit
ae23e2f252
@ -38,6 +38,7 @@
|
||||
|
||||
#include "cafFontTools.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
|
||||
#include "qwt_plot_barchart.h"
|
||||
|
||||
@ -80,6 +81,10 @@ RimCorrelationPlot::RimCorrelationPlot()
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_selectedParametersList, "SelectedParameters", "Select Parameters", "", "", "" );
|
||||
m_selectedParametersList.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
m_selectedParametersList.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
|
||||
setDeletable( true );
|
||||
}
|
||||
|
||||
@ -102,10 +107,15 @@ void RimCorrelationPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
|
||||
{
|
||||
RimAbstractCorrelationPlot::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
if ( changedField == &m_correlationFactor || changedField == &m_showAbsoluteValues ||
|
||||
changedField == &m_sortByAbsoluteValues )
|
||||
changedField == &m_sortByAbsoluteValues || changedField == &m_excludeParametersWithoutVariation ||
|
||||
changedField == &m_selectedParametersList )
|
||||
{
|
||||
this->loadDataAndUpdate();
|
||||
this->updateConnectedEditors();
|
||||
if ( changedField == &m_excludeParametersWithoutVariation )
|
||||
{
|
||||
selectAllParameters();
|
||||
}
|
||||
loadDataAndUpdate();
|
||||
updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,12 +126,14 @@ void RimCorrelationPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
{
|
||||
caf::PdmUiGroup* correlationGroup = uiOrdering.addNewGroup( "Correlation Factor Settings" );
|
||||
correlationGroup->add( &m_correlationFactor );
|
||||
correlationGroup->add( &m_excludeParametersWithoutVariation );
|
||||
correlationGroup->add( &m_selectedParametersList );
|
||||
|
||||
correlationGroup->add( &m_showAbsoluteValues );
|
||||
if ( !m_showAbsoluteValues() )
|
||||
{
|
||||
correlationGroup->add( &m_sortByAbsoluteValues );
|
||||
}
|
||||
correlationGroup->add( &m_excludeParametersWithoutVariation );
|
||||
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector" );
|
||||
|
||||
@ -151,6 +163,18 @@ QList<caf::PdmOptionItemInfo> RimCorrelationPlot::calculateValueOptions( const c
|
||||
QList<caf::PdmOptionItemInfo> options =
|
||||
RimAbstractCorrelationPlot::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
|
||||
|
||||
if ( fieldNeedingOptions == &m_selectedParametersList )
|
||||
{
|
||||
std::set<EnsembleParameter> params = variationSortedEnsembleParameters();
|
||||
for ( auto param : params )
|
||||
{
|
||||
if ( !m_excludeParametersWithoutVariation() || param.variationBin > EnsembleParameter::NO_VARIATION )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( param.uiName(), param.name ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
@ -259,10 +283,10 @@ void RimCorrelationPlot::addDataToChartBuilder( RiuGroupedBarChartBuilder& chart
|
||||
{
|
||||
caseValuesAtTimestep.push_back( closestValue );
|
||||
|
||||
for ( auto parameter : ensembleParameters() )
|
||||
for ( auto parameterName : m_selectedParametersList() )
|
||||
{
|
||||
if ( parameter.isNumeric() && parameter.isValid() &&
|
||||
( !m_excludeParametersWithoutVariation || parameter.normalizedStdDeviation() > 1.0e-5 ) )
|
||||
auto parameter = ensemble->ensembleParameter( parameterName );
|
||||
if ( parameter.isNumeric() && parameter.isValid() )
|
||||
{
|
||||
double paramValue = parameter.values[caseIdx].toDouble();
|
||||
parameterValues[parameter.name].push_back( paramValue );
|
||||
@ -383,3 +407,19 @@ void RimCorrelationPlot::setSortByAbsoluteValues( bool sortByAbsoluteValues )
|
||||
{
|
||||
m_sortByAbsoluteValues = sortByAbsoluteValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCorrelationPlot::selectAllParameters()
|
||||
{
|
||||
m_selectedParametersList.v().clear();
|
||||
std::set<EnsembleParameter> params = variationSortedEnsembleParameters();
|
||||
for ( auto param : params )
|
||||
{
|
||||
if ( !m_excludeParametersWithoutVariation() || param.variationBin > EnsembleParameter::NO_VARIATION )
|
||||
{
|
||||
m_selectedParametersList.v().push_back( param.name );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
|
||||
bool sortByAbsoluteValues() const;
|
||||
void setSortByAbsoluteValues( bool sortByAbsoluteValues );
|
||||
void selectAllParameters();
|
||||
|
||||
signals:
|
||||
void tornadoItemSelected( const EnsembleParameter&, const RiaSummaryCurveDefinition& curveDef );
|
||||
@ -85,4 +86,5 @@ private:
|
||||
caf::PdmField<bool> m_showAbsoluteValues;
|
||||
caf::PdmField<bool> m_sortByAbsoluteValues;
|
||||
caf::PdmField<bool> m_excludeParametersWithoutVariation;
|
||||
caf::PdmField<std::vector<QString>> m_selectedParametersList;
|
||||
};
|
||||
|
@ -57,6 +57,7 @@ RimCorrelationPlot* RimCorrelationPlotCollection::createCorrelationPlot( bool de
|
||||
plot->setAsPlotMdiWindow();
|
||||
|
||||
if ( defaultToFirstEnsembleFopt ) applyFirstEnsembleFieldAddressesToPlot( plot, "FOPT" );
|
||||
plot->selectAllParameters();
|
||||
|
||||
m_correlationPlots.push_back( plot );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user