Refresh track & via net names after netlist update

Fixes: lp:1749411
* https://bugs.launchpad.net/kicad/+bug/1749411
This commit is contained in:
Maciej Suminski 2018-02-15 09:49:53 +01:00
parent 4012aa70da
commit 1e054071fc
2 changed files with 17 additions and 5 deletions

View File

@ -37,14 +37,15 @@
#include <class_drawpanel.h>
#include <class_board.h>
#include <ratsnest_data.h>
#include <view/view.h>
#include <functional>
using namespace std::placeholders;
DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST *aNetlist ) :
DIALOG_UPDATE_PCB_BASE ( aParent ),
m_frame (aParent),
m_netlist (aNetlist)
DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST* aNetlist ) :
DIALOG_UPDATE_PCB_BASE( aParent ),
m_frame( aParent ),
m_netlist( aNetlist )
{
m_messagePanel->SetLabel( _("Changes to be applied:") );
m_messagePanel->SetLazyUpdate( true );
@ -98,7 +99,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
BOARD_NETLIST_UPDATER updater( m_frame, m_frame->GetBoard() );
updater.SetReporter ( &reporter );
updater.SetIsDryRun( aDryRun);
updater.SetIsDryRun( aDryRun );
updater.SetLookupByTimestamp( m_matchByTimestamp->GetValue() );
updater.SetDeleteUnusedComponents ( true );
updater.SetReplaceFootprints( true );
@ -113,6 +114,13 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
m_frame->SetCurItem( NULL );
m_frame->SetMsgPanel( board );
// Update rendered tracks and vias net labels
auto view = m_frame->GetGalCanvas()->GetView();
// TODO is there a way to extract information about which nets were modified?
for( auto track : board->Tracks() )
view->Update( track );
std::vector<MODULE*> newFootprints = updater.GetAddedComponents();
// Spread new footprints.

View File

@ -169,6 +169,10 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
// Rebuild the board connectivity:
board->GetConnectivity()->Build( board );
// TODO is there a way to extract information about which nets were modified?
for( auto track : board->Tracks() )
view->Update( track );
SetMsgPanel( board );
m_canvas->Refresh();
}