From e8ae3533d119306193958823ba718c4a055f82e0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 20 Jul 2023 20:49:43 +0100 Subject: [PATCH] Set format on all matching signals. --- eeschema/sim/simulator_frame_ui.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index 5f04653d6a..584c88be37 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -302,15 +302,31 @@ void CURSORS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent ) void CURSORS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event ) { + auto getSignalName = + [this]( int row ) -> wxString + { + wxString signal = m_grid->GetCellValue( row, COL_CURSOR_SIGNAL ); + + if( signal.EndsWith( "[2 - 1]" ) ) + signal = signal.Left( signal.size() - 7 ); + + return signal; + }; + if( event.GetId() == MYID_FORMAT_VALUE ) { - int cursorId = m_menuRow; - int cursorAxis = m_menuCol - COL_CURSOR_X; - SPICE_VALUE_FORMAT format = m_parent->GetCursorFormat( cursorId, cursorAxis ); + int axis = m_menuCol - COL_CURSOR_X; + SPICE_VALUE_FORMAT format = m_parent->GetCursorFormat( m_menuRow, axis ); DIALOG_SIM_FORMAT_VALUE formatDialog( m_parent, &format ); if( formatDialog.ShowModal() == wxID_OK ) - m_parent->SetCursorFormat( cursorId, cursorAxis, format ); + { + for( int row = 0; row < m_grid->GetNumberRows(); ++row ) + { + if( getSignalName( row ) == getSignalName( m_menuRow ) ) + m_parent->SetCursorFormat( row, axis, format ); + } + } } else {