From 94cb00392e570e9a9657ade2b1516ee5442a5497 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 30 Jan 2024 14:14:00 +0000 Subject: [PATCH] Repair connectivity if bus aliases changed. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16503 --- eeschema/eeschema_config.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index ecdcea32dc..6bd7538722 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -79,6 +79,15 @@ bool SCH_EDIT_FRAME::LoadProjectSettings() void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage ) { + SCH_SCREENS screens( Schematic().Root() ); + std::vector> oldAliases; + + for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() ) + { + for( const std::shared_ptr& alias : screen->GetBusAliases() ) + oldAliases.push_back( alias ); + } + DIALOG_SCHEMATIC_SETUP dlg( this ); if( !aInitialPage.IsEmpty() ) @@ -104,6 +113,18 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage ) GetCanvas()->GetView()->MarkDirty(); GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT ); + + std::vector> newAliases; + + for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() ) + { + for( const std::shared_ptr& alias : screen->GetBusAliases() ) + newAliases.push_back( alias ); + } + + if( oldAliases != newAliases ) + RecalculateConnections( nullptr, GLOBAL_CLEANUP ); + RefreshOperatingPointDisplay(); GetCanvas()->Refresh(); }