mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
9437 fix missing summary sub plot update
Summary plot: fix missing sub plot title updates. Janitor: improve RiuPlotWidget interface.
This commit is contained in:
parent
14db528c98
commit
99553382f5
@ -209,6 +209,7 @@ void RimSummaryMultiPlot::insertPlot( RimPlot* plot, size_t index )
|
|||||||
sumPlot->axisChanged.connect( this, &RimSummaryMultiPlot::onSubPlotAxisChanged );
|
sumPlot->axisChanged.connect( this, &RimSummaryMultiPlot::onSubPlotAxisChanged );
|
||||||
sumPlot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
|
sumPlot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
|
||||||
sumPlot->plotZoomedByUser.connect( this, &RimSummaryMultiPlot::onSubPlotZoomed );
|
sumPlot->plotZoomedByUser.connect( this, &RimSummaryMultiPlot::onSubPlotZoomed );
|
||||||
|
sumPlot->titleChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
|
||||||
|
|
||||||
bool isMinMaxOverridden = m_axisRangeAggregation() != AxisRangeAggregation::NONE;
|
bool isMinMaxOverridden = m_axisRangeAggregation() != AxisRangeAggregation::NONE;
|
||||||
setAutoValueStatesForPlot( sumPlot, isMinMaxOverridden, m_autoAdjustAppearance() );
|
setAutoValueStatesForPlot( sumPlot, isMinMaxOverridden, m_autoAdjustAppearance() );
|
||||||
@ -550,9 +551,9 @@ void RimSummaryMultiPlot::updatePlotWindowTitle()
|
|||||||
setMultiPlotTitle( title );
|
setMultiPlotTitle( title );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_autoSubPlotTitle )
|
|
||||||
{
|
|
||||||
for ( auto plot : summaryPlots() )
|
for ( auto plot : summaryPlots() )
|
||||||
|
{
|
||||||
|
if ( m_autoSubPlotTitle )
|
||||||
{
|
{
|
||||||
auto subPlotNameHelper = plot->plotTitleHelper();
|
auto subPlotNameHelper = plot->plotTitleHelper();
|
||||||
|
|
||||||
@ -563,12 +564,12 @@ void RimSummaryMultiPlot::updatePlotWindowTitle()
|
|||||||
auto plotName = subPlotNameHelper->aggregatedPlotTitle( *m_nameHelper );
|
auto plotName = subPlotNameHelper->aggregatedPlotTitle( *m_nameHelper );
|
||||||
plot->setPlotTitleVisible( true );
|
plot->setPlotTitleVisible( true );
|
||||||
plot->setDescription( plotName );
|
plot->setDescription( plotName );
|
||||||
|
}
|
||||||
plot->updatePlotTitle();
|
plot->updatePlotTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !m_viewer.isNull() ) m_viewer->scheduleTitleUpdate();
|
if ( !m_viewer.isNull() ) m_viewer->scheduleTitleUpdate();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -715,6 +716,7 @@ void RimSummaryMultiPlot::initAfterRead()
|
|||||||
plot->axisChanged.connect( this, &RimSummaryMultiPlot::onSubPlotAxisChanged );
|
plot->axisChanged.connect( this, &RimSummaryMultiPlot::onSubPlotAxisChanged );
|
||||||
plot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
|
plot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
|
||||||
plot->plotZoomedByUser.connect( this, &RimSummaryMultiPlot::onSubPlotZoomed );
|
plot->plotZoomedByUser.connect( this, &RimSummaryMultiPlot::onSubPlotZoomed );
|
||||||
|
plot->titleChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
|
||||||
}
|
}
|
||||||
updateStepDimensionFromDefault();
|
updateStepDimensionFromDefault();
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
|
|||||||
, curvesChanged( this )
|
, curvesChanged( this )
|
||||||
, axisChanged( this )
|
, axisChanged( this )
|
||||||
, plotZoomedByUser( this )
|
, plotZoomedByUser( this )
|
||||||
|
, titleChanged( this )
|
||||||
, m_isValid( true )
|
, m_isValid( true )
|
||||||
{
|
{
|
||||||
CAF_PDM_InitScriptableObject( "Summary Plot", ":/SummaryPlotLight16x16.png", "", "A Summary Plot" );
|
CAF_PDM_InitScriptableObject( "Summary Plot", ":/SummaryPlotLight16x16.png", "", "A Summary Plot" );
|
||||||
@ -1485,6 +1486,8 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|||||||
c->updateCurveNameNoLegendUpdate();
|
c->updateCurveNameNoLegendUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
titleChanged.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( changedField == &m_showPlotLegends ) updateLegend();
|
if ( changedField == &m_showPlotLegends ) updateLegend();
|
||||||
|
@ -82,6 +82,7 @@ public:
|
|||||||
caf::Signal<> curvesChanged;
|
caf::Signal<> curvesChanged;
|
||||||
caf::Signal<RimSummaryPlot*> axisChanged;
|
caf::Signal<RimSummaryPlot*> axisChanged;
|
||||||
caf::Signal<> plotZoomedByUser;
|
caf::Signal<> plotZoomedByUser;
|
||||||
|
caf::Signal<> titleChanged;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RimSummaryPlot( bool isCrossPlot = false );
|
RimSummaryPlot( bool isCrossPlot = false );
|
||||||
|
@ -115,8 +115,8 @@ public:
|
|||||||
|
|
||||||
virtual void setPlotTitle( const QString& plotTitle ) = 0;
|
virtual void setPlotTitle( const QString& plotTitle ) = 0;
|
||||||
const QString& plotTitle() const;
|
const QString& plotTitle() const;
|
||||||
void setPlotTitleEnabled( bool enabled );
|
virtual void setPlotTitleEnabled( bool enabled ) = 0;
|
||||||
bool plotTitleEnabled() const;
|
virtual bool plotTitleEnabled() const = 0;
|
||||||
virtual void setPlotTitleFontSize( int titleFontSize ) = 0;
|
virtual void setPlotTitleFontSize( int titleFontSize ) = 0;
|
||||||
|
|
||||||
virtual void setLegendFontSize( int fontSize ) = 0;
|
virtual void setLegendFontSize( int fontSize ) = 0;
|
||||||
|
@ -112,8 +112,8 @@ public:
|
|||||||
|
|
||||||
void setPlotTitle( const QString& plotTitle ) override;
|
void setPlotTitle( const QString& plotTitle ) override;
|
||||||
const QString& plotTitle() const;
|
const QString& plotTitle() const;
|
||||||
void setPlotTitleEnabled( bool enabled );
|
void setPlotTitleEnabled( bool enabled ) override;
|
||||||
bool plotTitleEnabled() const;
|
bool plotTitleEnabled() const override;
|
||||||
void setPlotTitleFontSize( int titleFontSize ) override;
|
void setPlotTitleFontSize( int titleFontSize ) override;
|
||||||
|
|
||||||
void setLegendFontSize( int fontSize ) override;
|
void setLegendFontSize( int fontSize ) override;
|
||||||
|
@ -101,8 +101,8 @@ public:
|
|||||||
|
|
||||||
void setPlotTitle( const QString& plotTitle ) override;
|
void setPlotTitle( const QString& plotTitle ) override;
|
||||||
const QString& plotTitle() const;
|
const QString& plotTitle() const;
|
||||||
void setPlotTitleEnabled( bool enabled );
|
void setPlotTitleEnabled( bool enabled ) override;
|
||||||
bool plotTitleEnabled() const;
|
bool plotTitleEnabled() const override;
|
||||||
void setPlotTitleFontSize( int titleFontSize ) override;
|
void setPlotTitleFontSize( int titleFontSize ) override;
|
||||||
|
|
||||||
void setLegendFontSize( int fontSize ) override;
|
void setLegendFontSize( int fontSize ) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user