From 82d40298310462b6fcb613879c65abd0a5deb4c2 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 18 Mar 2019 18:38:55 -0400 Subject: [PATCH] Clean up cruft in netlist export --- eeschema/netlist_exporters/netlist_exporter_generic.cpp | 6 ++++-- eeschema/netlist_exporters/netlist_exporter_generic.h | 8 ++------ eeschema/netlist_exporters/netlist_exporter_kicad.cpp | 5 +---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/eeschema/netlist_exporters/netlist_exporter_generic.cpp b/eeschema/netlist_exporters/netlist_exporter_generic.cpp index 173365332e..3861c8588e 100644 --- a/eeschema/netlist_exporters/netlist_exporter_generic.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_generic.cpp @@ -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; diff --git a/eeschema/netlist_exporters/netlist_exporter_generic.h b/eeschema/netlist_exporters/netlist_exporter_generic.h index 6bf91c6955..dbcfbf7892 100644 --- a/eeschema/netlist_exporters/netlist_exporter_generic.h +++ b/eeschema/netlist_exporters/netlist_exporter_generic.h @@ -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 diff --git a/eeschema/netlist_exporters/netlist_exporter_kicad.cpp b/eeschema/netlist_exporters/netlist_exporter_kicad.cpp index b1326a7f70..84094328e7 100644 --- a/eeschema/netlist_exporters/netlist_exporter_kicad.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_kicad.cpp @@ -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;