Commit a0fb4ed0 authored by Maciej Suminski's avatar Maciej Suminski

Bruteforce module update after a netlist reload.

parent a6917280
...@@ -1475,7 +1475,7 @@ public: ...@@ -1475,7 +1475,7 @@ public:
/** /**
* Function ReadPcbNetlist * Function ReadPcbNetlist
* reads \a aNetlistFileName and ppdates the footprints (load missing footprints and * reads \a aNetlistFileName and updates the footprints (load missing footprints and
* delete on demand extra footprints) on the board. * delete on demand extra footprints) on the board.
* Update connectivity info, references, values and "TIME STAMP" * Update connectivity info, references, values and "TIME STAMP"
* *
......
...@@ -27,9 +27,11 @@ ...@@ -27,9 +27,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <boost/bind.hpp>
#include <fctsys.h> #include <fctsys.h>
#include <pgm_base.h> #include <pgm_base.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
#include <class_draw_panel_gal.h>
#include <confirm.h> #include <confirm.h>
#include <dialog_helpers.h> #include <dialog_helpers.h>
#include <wxPcbStruct.h> #include <wxPcbStruct.h>
...@@ -59,6 +61,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, ...@@ -59,6 +61,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
wxString msg; wxString msg;
NETLIST netlist; NETLIST netlist;
NETLIST_READER* netlistReader; NETLIST_READER* netlistReader;
KIGFX::VIEW* view = GetGalCanvas()->GetView();
netlist.SetIsDryRun( aIsDryRun ); netlist.SetIsDryRun( aIsDryRun );
netlist.SetFindByTimeStamp( aSelectByTimeStamp ); netlist.SetFindByTimeStamp( aSelectByTimeStamp );
...@@ -93,6 +96,16 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, ...@@ -93,6 +96,16 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
if( !netlist.IsDryRun() ) if( !netlist.IsDryRun() )
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
if( !netlist.IsDryRun() )
{
// Remove old modules
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
{
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) );
view->Remove( module );
}
}
netlist.SortByReference(); netlist.SortByReference();
GetBoard()->ReplaceNetlist( netlist, aDeleteSinglePadNets, aReporter ); GetBoard()->ReplaceNetlist( netlist, aDeleteSinglePadNets, aReporter );
...@@ -104,6 +117,13 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, ...@@ -104,6 +117,13 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
SetCurItem( NULL ); SetCurItem( NULL );
// Reload modules
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
{
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
GetGalCanvas()->GetView()->Add( module );
}
if( aDeleteUnconnectedTracks && GetBoard()->m_Track ) if( aDeleteUnconnectedTracks && GetBoard()->m_Track )
{ {
// Remove erroneous tracks. This should probably pushed down to the #BOARD object. // Remove erroneous tracks. This should probably pushed down to the #BOARD object.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment