Inform user (and bail on UpdatePCB) if annotation failed.
Fixes https://gitlab.com/kicad/code/kicad/issues/7310
This commit is contained in:
parent
5bc2285aef
commit
f4cc9b86e3
|
@ -1374,9 +1374,10 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, const wxStrin
|
|||
{
|
||||
if( !TestStandalone() )
|
||||
{
|
||||
DisplayError( this, _( "Cannot update the PCB because PCB editor is opened in stand-alone "
|
||||
"mode. In order to create or update PCBs from schematics, you "
|
||||
"must launch the KiCad project manager and create a project." ) );
|
||||
DisplayErrorMessage( this, _( "Cannot update the PCB because PCB editor is opened in "
|
||||
"stand-alone mode. In order to create or update PCBs from "
|
||||
"schematics, you must launch the KiCad project manager and "
|
||||
"create a project." ) );
|
||||
return false; // Not in standalone mode
|
||||
}
|
||||
|
||||
|
@ -1386,6 +1387,13 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, const wxStrin
|
|||
|
||||
Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_GET_NETLIST, payload, this );
|
||||
|
||||
if( payload == aAnnotateMessage )
|
||||
{
|
||||
Raise();
|
||||
DisplayErrorMessage( this, aAnnotateMessage );
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
auto lineReader = new STRING_LINE_READER( payload, _( "Eeschema netlist" ) );
|
||||
|
@ -1394,6 +1402,7 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, const wxStrin
|
|||
}
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
Raise();
|
||||
assert( false ); // should never happen
|
||||
return false;
|
||||
}
|
||||
|
@ -1402,18 +1411,6 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, const wxStrin
|
|||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::DoUpdatePCBFromNetlist( NETLIST& aNetlist, bool aUseTimestamps )
|
||||
{
|
||||
BOARD_NETLIST_UPDATER updater( this, GetBoard() );
|
||||
updater.SetLookupByTimestamp( aUseTimestamps );
|
||||
updater.SetDeleteUnusedComponents( false );
|
||||
updater.SetReplaceFootprints( true );
|
||||
updater.SetDeleteSinglePadNets( false );
|
||||
updater.SetWarnPadNoNetInNetlist( false );
|
||||
updater.UpdateNetlist( aNetlist );
|
||||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::RunEeschema()
|
||||
{
|
||||
wxString msg;
|
||||
|
|
|
@ -764,11 +764,6 @@ public:
|
|||
*/
|
||||
bool TestStandalone( void );
|
||||
|
||||
/**
|
||||
* An automated version of UpdatePCBFromNetlist which skips the UI dialog.
|
||||
*/
|
||||
void DoUpdatePCBFromNetlist( NETLIST& aNetlist, bool aUseTimestamps );
|
||||
|
||||
/**
|
||||
* Read a netlist from a file into a #NETLIST object.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue