mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8779 Summary Multi Plot : Sync time axis properties across sub plots
This commit is contained in:
parent
6ecb1a8ea0
commit
a0507c85f4
@ -50,8 +50,7 @@ CAF_PDM_SOURCE_INIT( RimPlotAxisProperties, "SummaryYAxisProperties" );
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
: settingsChanged( this )
|
||||
, logarithmicChanged( this )
|
||||
: logarithmicChanged( this )
|
||||
, axisPositionChanged( this )
|
||||
, m_enableTitleTextSettings( true )
|
||||
, m_isRangeSettingsEnabled( true )
|
||||
|
@ -51,7 +51,6 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
caf::Signal<> settingsChanged;
|
||||
caf::Signal<bool> logarithmicChanged;
|
||||
caf::Signal<RimPlotAxisProperties*, RiuPlotAxis, RiuPlotAxis> axisPositionChanged;
|
||||
|
||||
|
@ -45,6 +45,14 @@ void RimPlotAxisPropertiesInterface::LegendTickmarkCountEnum::setUp()
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotAxisPropertiesInterface::RimPlotAxisPropertiesInterface()
|
||||
: settingsChanged( this )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -47,6 +47,11 @@ public:
|
||||
};
|
||||
using LegendTickmarkCountEnum = caf::AppEnum<LegendTickmarkCount>;
|
||||
|
||||
caf::Signal<> settingsChanged;
|
||||
|
||||
public:
|
||||
RimPlotAxisPropertiesInterface();
|
||||
|
||||
virtual std::vector<RimPlotAxisAnnotation*> annotations() const = 0;
|
||||
virtual void appendAnnotation( RimPlotAxisAnnotation* annotation ) = 0;
|
||||
virtual void removeAllAnnotations() = 0;
|
||||
|
@ -138,6 +138,8 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
|
||||
else
|
||||
{
|
||||
auto* timeAxisProperties = new RimSummaryTimeAxisProperties;
|
||||
timeAxisProperties->settingsChanged.connect( this, &RimSummaryPlot::axisSettingsChanged );
|
||||
|
||||
m_axisProperties.push_back( timeAxisProperties );
|
||||
}
|
||||
|
||||
@ -1770,6 +1772,7 @@ void RimSummaryPlot::axisSettingsChanged( const caf::SignalEmitter* emitter )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::axisLogarithmicChanged( const caf::SignalEmitter* emitter, bool isLogarithmic )
|
||||
{
|
||||
axisChanged.send( this );
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
@ -2274,6 +2277,11 @@ void RimSummaryPlot::initAfterRead()
|
||||
{
|
||||
connectAxisSignals( plotAxisProperties );
|
||||
}
|
||||
auto* timeAxis = dynamic_cast<RimSummaryTimeAxisProperties*>( axisProperties.p() );
|
||||
if ( timeAxis )
|
||||
{
|
||||
timeAxis->settingsChanged.connect( this, &RimSummaryPlot::axisSettingsChanged );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto curve : summaryCurves() )
|
||||
|
@ -669,6 +669,8 @@ void RimSummaryTimeAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
}
|
||||
|
||||
rimSummaryPlot->updateAxes();
|
||||
|
||||
settingsChanged.send();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user