From 5cc1cda29f3073215290b2ae323ee69b9fd6dc61 Mon Sep 17 00:00:00 2001 From: Miles McCoo Date: Sun, 3 Dec 2017 11:19:42 +0100 Subject: [PATCH] BuildConnectivity and re-DisplayBoard in python Refresh function Refresh is used in the python domain to refresh the display with the current design. If something has changed, board connectivity likely needs rebuilding. If using GAL canvas, update its display db. --- pcbnew/swig/pcbnew_scripting_helpers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp index a5af6cdc5f..3dbedc32c9 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp @@ -39,6 +39,7 @@ #include #include #include +#include static PCB_EDIT_FRAME* s_PcbEditFrame = NULL; @@ -103,8 +104,15 @@ void Refresh() { if( s_PcbEditFrame ) { + auto board = s_PcbEditFrame->GetBoard(); + board->BuildConnectivity(); + if( s_PcbEditFrame->IsGalCanvasActive() ) + { + auto panel = static_cast( s_PcbEditFrame->GetGalCanvas() ); + panel->DisplayBoard(board); s_PcbEditFrame->GetGalCanvas()->Refresh(); + } else // first argument is erase background, second is a wxRect that // defines a reftresh area (all canvas if null)