Eeschema: ensure the netlist data is up to date before generating the netlist

Fixes #4779
https://gitlab.com/kicad/code/kicad/issues/4779
This commit is contained in:
jean-pierre charras 2020-07-03 21:01:22 +02:00
parent 2f01dedb69
commit cf38d382c7
2 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,7 @@
#include <netlist_exporters/netlist_exporter_kicad.h>
#include <tools/ee_actions.h>
#include <tools/sch_editor_control.h>
#include <advanced_config.h>
SCH_ITEM* SCH_EDITOR_CONTROL::FindComponentAndItem( const wxString& aReference,
@ -467,6 +468,11 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
NETLIST_EXPORTER_KICAD exporter( &Schematic() );
STRING_FORMATTER formatter;
// TODO remove once real-time connectivity is a given
if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
// Ensure the netlist data is up to date:
RecalculateConnections( NO_CLEANUP );
exporter.Format( &formatter, GNL_ALL | GNL_OPT_KICAD );
payload = formatter.GetString();

View File

@ -48,6 +48,9 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
// Ensure all power symbols have a valid reference
Schematic().GetSheets().AnnotatePowerSymbols();
// Ensure the netlist data is up to date:
RecalculateConnections( NO_CLEANUP );
if( !ReadyToNetlist( false ) )
return false;