From 827942c560160c4af8f878f8cd8f4f69077aebce Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 3 Oct 2023 12:55:19 +0100 Subject: [PATCH] Clarity. --- eeschema/sim/legacy_workbook.cpp | 2 +- eeschema/sim/sim_plot_tab.cpp | 2 +- eeschema/sim/sim_plot_tab.h | 2 +- eeschema/sim/simulator_frame_ui.cpp | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eeschema/sim/legacy_workbook.cpp b/eeschema/sim/legacy_workbook.cpp index c4097af2a2..cd026dd2cb 100644 --- a/eeschema/sim/legacy_workbook.cpp +++ b/eeschema/sim/legacy_workbook.cpp @@ -324,7 +324,7 @@ bool SIMULATOR_FRAME_UI::loadLegacyWorkbook( const wxString& aPath ) else { wxString vectorName = vectorNameFromSignalName( plotTab, signalName, nullptr ); - TRACE* trace = plotTab->AddTrace( vectorName, (int) traceType ); + TRACE* trace = plotTab->GetOrAddTrace( vectorName, (int) traceType ); if( version >= 4 && trace ) parseTraceParams( plotTab, trace, signalName, param ); diff --git a/eeschema/sim/sim_plot_tab.cpp b/eeschema/sim/sim_plot_tab.cpp index 519eb38b35..00818b9371 100644 --- a/eeschema/sim/sim_plot_tab.cpp +++ b/eeschema/sim/sim_plot_tab.cpp @@ -826,7 +826,7 @@ void SIM_PLOT_TAB::UpdateTraceStyle( TRACE* trace ) } -TRACE* SIM_PLOT_TAB::AddTrace( const wxString& aVectorName, int aType ) +TRACE* SIM_PLOT_TAB::GetOrAddTrace( const wxString& aVectorName, int aType ) { TRACE* trace = GetTrace( aVectorName, aType ); diff --git a/eeschema/sim/sim_plot_tab.h b/eeschema/sim/sim_plot_tab.h index c89202c038..4d1ffa38d1 100644 --- a/eeschema/sim/sim_plot_tab.h +++ b/eeschema/sim/sim_plot_tab.h @@ -344,7 +344,7 @@ public: ///< Getter for math plot window mpWindow* GetPlotWin() const { return m_plotWin; } - TRACE* AddTrace( const wxString& aVectorName, int aType ); + TRACE* GetOrAddTrace( const wxString& aVectorName, int aType ); void SetTraceData( TRACE* aTrace, std::vector& aX, std::vector& aY ); diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index b6f4eeedcf..8a117ad2d4 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -1703,7 +1703,7 @@ void SIMULATOR_FRAME_UI::updateTrace( const wxString& aVectorName, int aTraceTyp for( size_t idx = 0; idx <= outer; idx++ ) { - if( TRACE* trace = aPlotTab->AddTrace( aVectorName, aTraceType ) ) + if( TRACE* trace = aPlotTab->GetOrAddTrace( aVectorName, aTraceType ) ) { if( data_y.size() >= size ) { @@ -1720,7 +1720,7 @@ void SIMULATOR_FRAME_UI::updateTrace( const wxString& aVectorName, int aTraceTyp offset += inner; } } - else if( TRACE* trace = aPlotTab->AddTrace( aVectorName, aTraceType ) ) + else if( TRACE* trace = aPlotTab->GetOrAddTrace( aVectorName, aTraceType ) ) { if( data_y.size() >= size ) aPlotTab->SetTraceData( trace, *aDataX, data_y ); @@ -2023,7 +2023,7 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath ) { wxString signalName = trace_js[ "signal" ]; wxString vectorName = vectorNameFromSignalName( plotTab, signalName, nullptr ); - TRACE* trace = plotTab->AddTrace( vectorName, trace_js[ "trace_type" ] ); + TRACE* trace = plotTab->GetOrAddTrace( vectorName, trace_js[ "trace_type" ] ); if( trace ) {