From 1170fb2e18a6e9456e576268c84e6d219d2885ef Mon Sep 17 00:00:00 2001 From: Fabien Corona Date: Wed, 22 Feb 2023 18:49:06 +0100 Subject: [PATCH] sim - don't create measurement duplicates --- eeschema/sim/sim_plot_frame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 51ce4b4c21..6dc607390a 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -1465,6 +1465,13 @@ void SIM_PLOT_FRAME::RemoveTuner( TUNER_SLIDER* aTuner, bool aErase ) void SIM_PLOT_FRAME::AddMeasurement( const wxString& aCmd ) { + // -1 because the last one is for user inpu + for ( int i = 0; i < m_measurementsGrid->GetNumberRows(); i++ ) + { + if ( m_measurementsGrid->GetCellValue( i, COL_MEASUREMENT ) == aCmd ) + return; // Don't create duplicates + } + SIM_PLOT_PANEL* plotPanel = GetCurrentPlot(); if( !plotPanel )