Clean up cruft in netlist export

This commit is contained in:
Jon Evans 2019-03-18 18:38:55 -04:00 committed by Wayne Stambaugh
parent e98debfeb2
commit 82d4029831
3 changed files with 7 additions and 12 deletions

View File

@ -480,7 +480,7 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeLibParts()
}
XNODE* NETLIST_EXPORTER_GENERIC::makeListOfNets()
XNODE* NETLIST_EXPORTER_GENERIC::makeListOfNets( bool aUseGraph )
{
XNODE* xnets = node( "nets" ); // auto_ptr if exceptions ever get used.
wxString netCodeTxt;
@ -502,8 +502,10 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeListOfNets()
m_LibParts.clear(); // must call this function before using m_LibParts.
if( m_use_graph && m_graph )
if( aUseGraph )
{
wxASSERT( m_graph );
for( auto it : m_graph->m_net_code_to_subgraphs_map )
{
bool added = false;

View File

@ -67,17 +67,13 @@ private:
protected:
CONNECTION_GRAPH* m_graph;
// TODO(JE) Remove if not needed
bool m_use_graph;
public:
NETLIST_EXPORTER_GENERIC( SCH_EDIT_FRAME* aFrame,
NETLIST_OBJECT_LIST* aMasterList,
CONNECTION_GRAPH* aGraph = nullptr ) :
NETLIST_EXPORTER( aMasterList ),
m_libTable( aFrame->Prj().SchSymbolLibTable() ),
m_graph( aGraph ),
m_use_graph( true )
m_graph( aGraph )
{}
/**
@ -135,7 +131,7 @@ protected:
* fills out an XML node with a list of nets and returns it.
* @return XNODE* - the list of nets nodes
*/
XNODE* makeListOfNets();
XNODE* makeListOfNets( bool aUseGraph = true );
/**
* Function makeLibraries

View File

@ -38,8 +38,6 @@ bool NETLIST_EXPORTER_KICAD::WriteNetlist( const wxString& aOutFileName, unsigne
{
wxASSERT( m_graph );
m_use_graph = true;
try
{
FILE_OUTPUTFORMATTER formatter( aOutFileName );
@ -64,8 +62,7 @@ bool NETLIST_EXPORTER_KICAD::WriteNetlist( const wxString& aOutFileName, unsigne
if( !m_graph->UsesNewBusFeatures() )
{
m_use_graph = false;
auto old_nets = makeListOfNets();
auto old_nets = makeListOfNets( false );
bool different = false;