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.
This commit is contained in:
parent
8f0e6469ca
commit
5cc1cda29f
|
@ -39,6 +39,7 @@
|
||||||
#include <io_mgr.h>
|
#include <io_mgr.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <pcb_draw_panel_gal.h>
|
||||||
|
|
||||||
static PCB_EDIT_FRAME* s_PcbEditFrame = NULL;
|
static PCB_EDIT_FRAME* s_PcbEditFrame = NULL;
|
||||||
|
|
||||||
|
@ -103,8 +104,15 @@ void Refresh()
|
||||||
{
|
{
|
||||||
if( s_PcbEditFrame )
|
if( s_PcbEditFrame )
|
||||||
{
|
{
|
||||||
|
auto board = s_PcbEditFrame->GetBoard();
|
||||||
|
board->BuildConnectivity();
|
||||||
|
|
||||||
if( s_PcbEditFrame->IsGalCanvasActive() )
|
if( s_PcbEditFrame->IsGalCanvasActive() )
|
||||||
|
{
|
||||||
|
auto panel = static_cast<PCB_DRAW_PANEL_GAL*>( s_PcbEditFrame->GetGalCanvas() );
|
||||||
|
panel->DisplayBoard(board);
|
||||||
s_PcbEditFrame->GetGalCanvas()->Refresh();
|
s_PcbEditFrame->GetGalCanvas()->Refresh();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
// first argument is erase background, second is a wxRect that
|
// first argument is erase background, second is a wxRect that
|
||||||
// defines a reftresh area (all canvas if null)
|
// defines a reftresh area (all canvas if null)
|
||||||
|
|
Loading…
Reference in New Issue