@ -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 )