diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index da5cdb9a8f..09329f789c 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -852,7 +852,9 @@ void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event ) " PCBs from schematics, you need to launch Kicad shell" " and create a PCB project." ) ); return; - } else { + } + else + { KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB, true ); // a pcb frame can be already existing, but not yet used. @@ -871,17 +873,22 @@ void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event ) frame->Raise(); } + // Ensure the schematic is OK for a netlist creation + // (especially all components are annotated): + bool success = prepareForNetlist(); + + if( !success ) + return; + NETLIST_OBJECT_LIST* net_atoms = BuildNetListBase(); NETLIST_EXPORTER_KICAD exporter( net_atoms, Prj().SchLibs() ); STRING_FORMATTER formatter; exporter.Format( &formatter, GNL_ALL ); - Kiway().ExpressMail( FRAME_PCB, - MAIL_SCH_PCB_UPDATE, - formatter.GetString(), // an abbreviated "kicad" (s-expr) netlist - this - ); + // Now, send the "kicad" (s-expr) netlist to Pcbnew + Kiway().ExpressMail( FRAME_PCB, MAIL_SCH_PCB_UPDATE, + formatter.GetString(), this ); } void SCH_EDIT_FRAME::OnCreateNetlist( wxCommandEvent& event ) diff --git a/pcbnew/board_netlist_updater.cpp b/pcbnew/board_netlist_updater.cpp index ffe5cac447..0d32d02cdf 100644 --- a/pcbnew/board_netlist_updater.cpp +++ b/pcbnew/board_netlist_updater.cpp @@ -614,7 +614,6 @@ bool BOARD_NETLIST_UPDATER::testConnectivity( NETLIST& aNetlist ) bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist ) { wxString msg; - m_errorCount = 0; m_warningCount = 0; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 9aae464ace..18f69a9ae6 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -1114,7 +1114,9 @@ void PCB_EDIT_FRAME::OnUpdatePCBFromSch( wxCommandEvent& event ) " PCBs from schematics, you need to launch Kicad shell" " and create a PCB project." ) ); return; - } else { + } + else + { KIWAY_PLAYER* frame = Kiway().Player( FRAME_SCH, true ); wxFileName schfn = Prj().AbsolutePath( Prj().GetProjectName() ); @@ -1127,6 +1129,5 @@ void PCB_EDIT_FRAME::OnUpdatePCBFromSch( wxCommandEvent& event ) } Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_PCB_UPDATE_REQUEST, "", this ); - } }