Inform user (and bail on UpdatePCB) if annotation failed.

Fixes https://gitlab.com/kicad/code/kicad/issues/7310
This commit is contained in:
Jeff Young 2021-03-01 16:53:12 +00:00
parent 5bc2285aef
commit f4cc9b86e3
2 changed files with 14 additions and 22 deletions

View File

@ -1374,18 +1374,26 @@ 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." ) );
return false; //Not in standalone mode
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
}
Raise(); //Show
Raise(); // Show
std::string payload( aAnnotateMessage );
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;

View File

@ -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.
*