mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove settings settings from plot editor
Remove appearance and name settings
This commit is contained in:
parent
0604eea74b
commit
b165488828
@ -36,7 +36,6 @@
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimSummaryCurveAutoName.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
@ -98,10 +97,7 @@ RimSummaryCurve* createCurve( RimSummaryCase* summaryCase, const RifEclipseSumma
|
||||
if ( pos != std::string::npos )
|
||||
{
|
||||
// https://github.com/OPM/ResInsight/issues/12157
|
||||
|
||||
RimSummaryCurveAutoName settings;
|
||||
settings.enableVectorName( true );
|
||||
curve->applyCurveAutoNameSettings( settings );
|
||||
curve->enableVectorNameInCurveName( true );
|
||||
}
|
||||
|
||||
return curve;
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveAutoName.h"
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
@ -87,14 +87,6 @@ RicSummaryPlotEditorUi::RicSummaryPlotEditorUi()
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault( &m_targetPlot, "TargetPlot", "Target Plot" );
|
||||
|
||||
CAF_PDM_InitField( &m_useAutoAppearanceAssignment, "UseAutoAppearanceAssignment", true, "Auto" );
|
||||
CAF_PDM_InitField( &m_appearanceApplyButton, "AppearanceApplyButton", false, "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_caseAppearanceType, "CaseAppearanceType", "Case" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_variableAppearanceType, "VariableAppearanceType", "Vector" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellAppearanceType, "WellAppearanceType", "Well" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_groupAppearanceType, "GroupAppearanceType", "Group" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_regionAppearanceType, "RegionAppearanceType", "Region" );
|
||||
|
||||
m_previewPlot = std::make_unique<RimSummaryPlot>();
|
||||
m_previewPlot->setLegendPosition( RiuPlotWidget::Legend::TOP );
|
||||
|
||||
@ -113,14 +105,6 @@ RicSummaryPlotEditorUi::RicSummaryPlotEditorUi()
|
||||
m_okButtonField.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
|
||||
m_okButtonField.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
m_appearanceApplyButton = false;
|
||||
m_appearanceApplyButton.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
|
||||
m_appearanceApplyButton.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LEFT );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_curveNameConfig, "SummaryCurveNameConfig", "SummaryCurveNameConfig" );
|
||||
m_curveNameConfig = new RimSummaryCurveAutoName();
|
||||
m_curveNameConfig.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
|
||||
m_summaryCurveSelectionEditor = std::make_unique<RiuSummaryVectorSelectionWidgetCreator>();
|
||||
|
||||
m_summaryCurveSelectionEditor->summaryAddressSelection()->setFieldChangedHandler( [this]() { selectionEditorFieldChanged(); } );
|
||||
@ -152,8 +136,7 @@ void RicSummaryPlotEditorUi::updateFromSummaryPlot( RimSummaryPlot* targetPlot,
|
||||
resetAllFields();
|
||||
}
|
||||
|
||||
m_targetPlot = targetPlot;
|
||||
m_useAutoAppearanceAssignment = true;
|
||||
m_targetPlot = targetPlot;
|
||||
|
||||
if ( m_targetPlot )
|
||||
{
|
||||
@ -184,8 +167,6 @@ void RicSummaryPlotEditorUi::updateFromSummaryMultiPlot( RimSummaryMultiPlot*
|
||||
{
|
||||
resetAllFields();
|
||||
|
||||
m_useAutoAppearanceAssignment = true;
|
||||
|
||||
m_plotContainer = summaryMultiPlot;
|
||||
|
||||
setDefaultCurveSelection( defaultSources );
|
||||
@ -249,16 +230,6 @@ void RicSummaryPlotEditorUi::fieldChangedByUi( const caf::PdmFieldHandle* change
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||
mainPlotWindow->updateMultiPlotToolBar();
|
||||
}
|
||||
else if ( changedField == &m_useAutoAppearanceAssignment && m_useAutoAppearanceAssignment )
|
||||
{
|
||||
updateAppearanceEditor();
|
||||
}
|
||||
else if ( changedField == &m_appearanceApplyButton )
|
||||
{
|
||||
applyAppearanceToAllPreviewCurves();
|
||||
m_previewPlot->loadDataAndUpdate();
|
||||
m_appearanceApplyButton = false;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -288,39 +259,6 @@ QList<caf::PdmOptionItemInfo> RicSummaryPlotEditorUi::calculateValueOptions( con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotEditorUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
// Appearance settings
|
||||
caf::PdmUiGroup* appearanceGroup =
|
||||
uiOrdering.addNewGroupWithKeyword( "Curve Appearance Assignment", RiuSummaryCurveDefinitionKeywords::appearance() );
|
||||
|
||||
caf::PdmUiGroup* appearanceSubGroup = appearanceGroup->addNewGroup( "Appearance Type Assignment" );
|
||||
appearanceSubGroup->setCollapsedByDefault();
|
||||
|
||||
appearanceSubGroup->add( &m_useAutoAppearanceAssignment );
|
||||
appearanceSubGroup->add( &m_caseAppearanceType );
|
||||
appearanceSubGroup->add( &m_variableAppearanceType );
|
||||
appearanceSubGroup->add( &m_wellAppearanceType );
|
||||
appearanceSubGroup->add( &m_groupAppearanceType );
|
||||
appearanceSubGroup->add( &m_regionAppearanceType );
|
||||
|
||||
appearanceGroup->add( &m_appearanceApplyButton );
|
||||
|
||||
// Appearance option sensitivity
|
||||
{
|
||||
m_caseAppearanceType.uiCapability()->setUiReadOnly( m_useAutoAppearanceAssignment );
|
||||
m_variableAppearanceType.uiCapability()->setUiReadOnly( m_useAutoAppearanceAssignment );
|
||||
m_wellAppearanceType.uiCapability()->setUiReadOnly( m_useAutoAppearanceAssignment );
|
||||
m_groupAppearanceType.uiCapability()->setUiReadOnly( m_useAutoAppearanceAssignment );
|
||||
m_regionAppearanceType.uiCapability()->setUiReadOnly( m_useAutoAppearanceAssignment );
|
||||
}
|
||||
|
||||
// Name config
|
||||
caf::PdmUiGroup* autoNameGroup =
|
||||
uiOrdering.addNewGroupWithKeyword( "Plot and Curve Name Configuration", RiuSummaryCurveDefinitionKeywords::nameConfig() );
|
||||
autoNameGroup->setCollapsedByDefault();
|
||||
|
||||
m_curveNameConfig->uiOrdering( uiConfigName, *autoNameGroup );
|
||||
|
||||
// Fields to be displayed directly in UI
|
||||
uiOrdering.add( &m_targetPlot );
|
||||
uiOrdering.add( &m_okButtonField );
|
||||
uiOrdering.add( &m_applyButtonField );
|
||||
@ -445,7 +383,6 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
|
||||
}
|
||||
|
||||
RimSummaryCurveAppearanceCalculator curveLookCalc( summaryCurveDefsToDisplay );
|
||||
initCurveAppearanceCalculator( curveLookCalc );
|
||||
|
||||
// Delete curves
|
||||
if ( !curveSetsToDelete.empty() )
|
||||
@ -523,16 +460,14 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
|
||||
}
|
||||
else
|
||||
{
|
||||
RimSummaryCurve* curve = new RimSummaryCurve();
|
||||
auto curve = RiaSummaryPlotTools::createCurve( currentCase, curveDef.summaryAddressY() );
|
||||
|
||||
if ( speedCheatsRequired )
|
||||
{
|
||||
stashedErrorBarsAndLegendVisibility[curve] = std::make_pair( curve->errorBarsVisible(), curve->showInLegend() );
|
||||
curve->setErrorBarsVisible( false );
|
||||
curve->setShowInLegend( false );
|
||||
}
|
||||
curve->setSummaryCaseY( currentCase );
|
||||
curve->setSummaryAddressY( curveDef.summaryAddressY() );
|
||||
curve->applyCurveAutoNameSettings( *m_curveNameConfig() );
|
||||
if ( currentCase && currentCase->isObservedData() ) curve->setSymbolSkipDistance( 0 );
|
||||
|
||||
m_previewPlot->addCurveNoUpdate( curve );
|
||||
@ -588,14 +523,6 @@ void RicSummaryPlotEditorUi::defineEditorAttribute( const caf::PdmFieldHandle* f
|
||||
attrib->m_buttonText = "OK";
|
||||
}
|
||||
}
|
||||
else if ( &m_appearanceApplyButton == field )
|
||||
{
|
||||
caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>( attribute );
|
||||
if ( attrib )
|
||||
{
|
||||
attrib->m_buttonText = "Apply";
|
||||
}
|
||||
}
|
||||
else if ( &m_targetPlot == field )
|
||||
{
|
||||
caf::PdmUiComboBoxEditorAttribute* attrib = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||
@ -652,8 +579,6 @@ void RicSummaryPlotEditorUi::populateCurveCreator( const RimSummaryPlot& sourceS
|
||||
}
|
||||
|
||||
m_summaryCurveSelectionEditor->summaryAddressSelection()->setSelectedCurveDefinitions( curveDefs );
|
||||
|
||||
updateAppearanceEditor();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -762,37 +687,6 @@ void RicSummaryPlotEditorUi::resetAllFields()
|
||||
m_targetPlot = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotEditorUi::initCurveAppearanceCalculator( RimSummaryCurveAppearanceCalculator& curveAppearanceCalc )
|
||||
{
|
||||
if ( !m_useAutoAppearanceAssignment() )
|
||||
{
|
||||
curveAppearanceCalc.assignDimensions( m_caseAppearanceType(),
|
||||
m_variableAppearanceType(),
|
||||
m_wellAppearanceType(),
|
||||
m_groupAppearanceType(),
|
||||
m_regionAppearanceType() );
|
||||
}
|
||||
else
|
||||
{
|
||||
RimSummaryCurveAppearanceCalculator::CurveAppearanceType caseAppearance;
|
||||
RimSummaryCurveAppearanceCalculator::CurveAppearanceType variAppearance;
|
||||
RimSummaryCurveAppearanceCalculator::CurveAppearanceType wellAppearance;
|
||||
RimSummaryCurveAppearanceCalculator::CurveAppearanceType gropAppearance;
|
||||
RimSummaryCurveAppearanceCalculator::CurveAppearanceType regiAppearance;
|
||||
|
||||
curveAppearanceCalc.getDimensions( &caseAppearance, &variAppearance, &wellAppearance, &gropAppearance, ®iAppearance );
|
||||
|
||||
m_caseAppearanceType = caseAppearance;
|
||||
m_variableAppearanceType = variAppearance;
|
||||
m_wellAppearanceType = wellAppearance;
|
||||
m_groupAppearanceType = gropAppearance;
|
||||
m_regionAppearanceType = regiAppearance;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -801,7 +695,6 @@ void RicSummaryPlotEditorUi::applyAppearanceToAllPreviewCurves()
|
||||
std::set<RiaSummaryCurveDefinition> allCurveDefs = m_previewPlot->summaryAndEnsembleCurveDefinitions();
|
||||
|
||||
RimSummaryCurveAppearanceCalculator curveLookCalc( allCurveDefs );
|
||||
initCurveAppearanceCalculator( curveLookCalc );
|
||||
|
||||
// Summary curves
|
||||
for ( auto& curve : m_previewPlot->summaryCurves() )
|
||||
@ -821,17 +714,6 @@ void RicSummaryPlotEditorUi::applyAppearanceToAllPreviewCurves()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotEditorUi::updateAppearanceEditor()
|
||||
{
|
||||
std::set<RiaSummaryCurveDefinition> allCurveDefs = m_previewPlot->summaryAndEnsembleCurveDefinitions();
|
||||
|
||||
RimSummaryCurveAppearanceCalculator curveLookCalc( allCurveDefs );
|
||||
initCurveAppearanceCalculator( curveLookCalc );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -876,7 +758,6 @@ void RicSummaryPlotEditorUi::updateCurveNames()
|
||||
{
|
||||
for ( RimSummaryCurve* curve : m_previewPlot->summaryCurves() )
|
||||
{
|
||||
curve->applyCurveAutoNameSettings( *m_curveNameConfig() );
|
||||
curve->updateCurveNameNoLegendUpdate();
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RiuSummaryVectorSelectionWidgetCreator.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
@ -39,8 +38,8 @@ class PdmObject;
|
||||
};
|
||||
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCurve;
|
||||
class RimSummaryMultiPlot;
|
||||
class RimSummaryCurveAutoName;
|
||||
class RimSummaryPlot;
|
||||
class RiaSummaryCurveDefinition;
|
||||
class RimEnsembleCurveSet;
|
||||
@ -57,9 +56,6 @@ class RicSummaryPlotEditorUi : public caf::PdmObject
|
||||
public:
|
||||
static const QString CONFIGURATION_NAME;
|
||||
|
||||
private:
|
||||
using AppearanceTypeAppEnum = caf::AppEnum<RimSummaryCurveAppearanceCalculator::CurveAppearanceType>;
|
||||
|
||||
public:
|
||||
RicSummaryPlotEditorUi();
|
||||
~RicSummaryPlotEditorUi() override;
|
||||
@ -96,9 +92,7 @@ private:
|
||||
void setDefaultCurveSelection( const std::vector<caf::PdmObject*>& defaultCases );
|
||||
|
||||
void resetAllFields();
|
||||
void initCurveAppearanceCalculator( RimSummaryCurveAppearanceCalculator& curveAppearanceCalc );
|
||||
void applyAppearanceToAllPreviewCurves();
|
||||
void updateAppearanceEditor();
|
||||
void createNewPlot();
|
||||
bool isObservedData( RimSummaryCase* sumCase ) const;
|
||||
|
||||
@ -110,16 +104,6 @@ private:
|
||||
|
||||
std::unique_ptr<RimSummaryPlot> m_previewPlot;
|
||||
|
||||
caf::PdmField<bool> m_useAutoAppearanceAssignment;
|
||||
caf::PdmField<bool> m_appearanceApplyButton;
|
||||
caf::PdmField<AppearanceTypeAppEnum> m_caseAppearanceType;
|
||||
caf::PdmField<AppearanceTypeAppEnum> m_variableAppearanceType;
|
||||
caf::PdmField<AppearanceTypeAppEnum> m_wellAppearanceType;
|
||||
caf::PdmField<AppearanceTypeAppEnum> m_groupAppearanceType;
|
||||
caf::PdmField<AppearanceTypeAppEnum> m_regionAppearanceType;
|
||||
|
||||
caf::PdmChildField<RimSummaryCurveAutoName*> m_curveNameConfig;
|
||||
|
||||
caf::PdmField<bool> m_okButtonField;
|
||||
caf::PdmField<bool> m_applyButtonField;
|
||||
caf::PdmField<bool> m_closeButtonField;
|
||||
|
@ -103,14 +103,6 @@ void RicSummaryPlotEditorWidgetCreator::recursivelyConfigureAndUpdateTopLevelUiO
|
||||
|
||||
m_firstRowLayout->addWidget( addrWidget );
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = findGroupByKeyword( topLevelUiItems, RiuSummaryCurveDefinitionKeywords::appearance(), uiConfigName );
|
||||
auto appearanceGroupBox = createGroupBoxWithContent( appearanceGroup, uiConfigName );
|
||||
m_lowerLeftLayout->addWidget( appearanceGroupBox );
|
||||
|
||||
caf::PdmUiGroup* nameConfigGroup = findGroupByKeyword( topLevelUiItems, RiuSummaryCurveDefinitionKeywords::nameConfig(), uiConfigName );
|
||||
auto nameConfigGroupBox = createGroupBoxWithContent( nameConfigGroup, uiConfigName );
|
||||
m_lowerLeftLayout->addWidget( nameConfigGroupBox );
|
||||
|
||||
QMinimizePanel* curveGroup = getOrCreateCurveTreeGroup();
|
||||
m_lowerLeftLayout->addWidget( curveGroup, 1 );
|
||||
m_lowerLeftLayout->addStretch( 0 );
|
||||
|
@ -31,7 +31,6 @@ class RifSummaryReaderInterface;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryFilter_OBSOLETE;
|
||||
class RiuQwtPlotCurve;
|
||||
class RimSummaryCurveAutoName;
|
||||
|
||||
class RimSummaryAddress : public caf::PdmObject
|
||||
{
|
||||
|
@ -1024,9 +1024,9 @@ void RimSummaryCurve::updatePlotAxis()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::applyCurveAutoNameSettings( const RimSummaryCurveAutoName& autoNameSettings )
|
||||
void RimSummaryCurve::enableVectorNameInCurveName( bool enable )
|
||||
{
|
||||
m_curveNameConfig->applySettings( autoNameSettings );
|
||||
m_curveNameConfig->enableVectorName( enable );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
void setIsEnsembleCurve( bool isEnsembleCurve );
|
||||
|
||||
void updatePlotAxis();
|
||||
void applyCurveAutoNameSettings( const RimSummaryCurveAutoName& autoNameSettings );
|
||||
void enableVectorNameInCurveName( bool enable );
|
||||
|
||||
QString curveExportDescription( const RifEclipseSummaryAddress& address ) const override;
|
||||
void setCurveAppearanceFromCaseType();
|
||||
|
@ -167,25 +167,6 @@ QString RimSummaryCurveAutoName::curveNameX( const RifEclipseSummaryAddress& sum
|
||||
return curveName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveAutoName::applySettings( const RimSummaryCurveAutoName& other )
|
||||
{
|
||||
m_caseName = other.m_caseName;
|
||||
m_vectorName = other.m_vectorName;
|
||||
m_longVectorName = other.m_longVectorName;
|
||||
m_unit = other.m_unit;
|
||||
m_regionNumber = other.m_regionNumber;
|
||||
m_groupName = other.m_groupName;
|
||||
m_wellName = other.m_wellName;
|
||||
m_wellSegmentNumber = other.m_wellSegmentNumber;
|
||||
m_wellCompletionNumber = other.m_wellCompletionNumber;
|
||||
m_lgrName = other.m_lgrName;
|
||||
m_aquiferNumber = other.m_aquiferNumber;
|
||||
m_connection = other.m_connection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -36,7 +36,6 @@ public:
|
||||
const RimSummaryNameHelper* currentNameHelper,
|
||||
const RimSummaryNameHelper* plotNameHelper ) const;
|
||||
|
||||
void applySettings( const RimSummaryCurveAutoName& other );
|
||||
void enableVectorName( bool enable );
|
||||
|
||||
private:
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryCurvesData.h"
|
||||
#include "RimSummaryEnsemble.h"
|
||||
|
@ -37,6 +37,4 @@ public:
|
||||
static QString completions() { return "CompletionsKeyword"; };
|
||||
static QString lgrWells() { return "LgrWellsKeyword"; };
|
||||
static QString wellSegments() { return "WellSegmentsKeyword"; };
|
||||
static QString appearance() { return "AppearanceKeyword"; };
|
||||
static QString nameConfig() { return "NameConfigKeyword"; };
|
||||
};
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
class RimSummaryCase;
|
||||
class RimSummaryEnsemble;
|
||||
class RimSummaryCurveAutoName;
|
||||
class RimSummaryPlot;
|
||||
class RiaSummaryCurveDefinition;
|
||||
class RiaCurveSetDefinition;
|
||||
|
Loading…
Reference in New Issue
Block a user