kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #24923
[PATCH 07/16] Kill unused NETLIST_EXPORTER_GENERIC::writeListOfNets
This function is unused, and looks similar to the tree builder above, so it
might likely be left over from a refactoring effort.
---
.../netlist_exporters/netlist_exporter_generic.cpp | 73 ----------------------
.../netlist_exporters/netlist_exporter_generic.h | 7 ---
2 files changed, 80 deletions(-)
diff --git a/eeschema/netlist_exporters/netlist_exporter_generic.cpp b/eeschema/netlist_exporters/netlist_exporter_generic.cpp
index 420d8e3..398e62f 100644
--- a/eeschema/netlist_exporters/netlist_exporter_generic.cpp
+++ b/eeschema/netlist_exporters/netlist_exporter_generic.cpp
@@ -489,79 +489,6 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeListOfNets()
}
-bool NETLIST_EXPORTER_GENERIC::writeListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjectsList )
-{
- int ret = 0;
- int netCode;
- int lastNetCode = -1;
- int sameNetcodeCount = 0;
- wxString netName;
- wxString ref;
- wxString netcodeName;
- char firstItemInNet[256];
-
- for( unsigned ii = 0; ii < aObjectsList.size(); ii++ )
- {
- SCH_COMPONENT* comp;
- NETLIST_OBJECT* nitem = aObjectsList[ii];
-
- // New net found, write net id;
- if( ( netCode = nitem->GetNet() ) != lastNetCode )
- {
- sameNetcodeCount = 0; // Items count for this net
- netName = nitem->GetNetName();
-
- netcodeName.Printf( wxT( "Net %d " ), netCode );
- netcodeName << wxT( "\"" ) << netName << wxT( "\"" );
-
- // Add the netname without prefix, in cases we need only the
- // "short" netname
- netcodeName += wxT( " \"" ) + nitem->GetShortNetName() + wxT( "\"" );
- lastNetCode = netCode;
- }
-
- if( nitem->m_Type != NET_PIN )
- continue;
-
- if( nitem->m_Flag != 0 ) // Redundant pin, skip it
- continue;
-
- comp = nitem->GetComponentParent();
-
- // Get the reference for the net name and the main parent component
- ref = comp->GetRef( &nitem->m_SheetPath );
- if( ref[0] == wxChar( '#' ) )
- continue; // Pseudo component (Like Power symbol)
-
- // Print the pin list for this net, use special handling if
- // 2 or more items are connected:
-
- // if first item for this net found, defer printing this connection
- // until a second item will is found
- if( ++sameNetcodeCount == 1 )
- {
- snprintf( firstItemInNet, sizeof(firstItemInNet), " %s %.4s\n",
- TO_UTF8( ref ),
- (const char*) &aObjectsList[ii]->m_PinNum );
- }
-
- // Second item for this net found, print the Net name, and the
- // first item
- if( sameNetcodeCount == 2 )
- {
- ret |= fprintf( f, "%s\n", TO_UTF8( netcodeName ) );
- ret |= fputs( firstItemInNet, f );
- }
-
- if( sameNetcodeCount >= 2 )
- ret |= fprintf( f, " %s %.4s\n", TO_UTF8( ref ),
- (const char*) &nitem->m_PinNum );
- }
-
- return ret >= 0;
-}
-
-
XNODE* NETLIST_EXPORTER_GENERIC::node( const wxString& aName, const wxString& aTextualContent /* = wxEmptyString*/ )
{
XNODE* n = new XNODE( wxXML_ELEMENT_NODE, aName );
diff --git a/eeschema/netlist_exporters/netlist_exporter_generic.h b/eeschema/netlist_exporters/netlist_exporter_generic.h
index 89d57d5..71d3e51 100644
--- a/eeschema/netlist_exporters/netlist_exporter_generic.h
+++ b/eeschema/netlist_exporters/netlist_exporter_generic.h
@@ -80,13 +80,6 @@ protected:
XNODE* node( const wxString& aName, const wxString& aTextualContent = wxEmptyString );
/**
- * Function writeGENERICListOfNets
- * writes out nets (ranked by Netcode), and elements that are
- * connected as part of that net.
- */
- bool writeListOfNets( FILE* f, NETLIST_OBJECT_LIST& aObjectsList );
-
- /**
* Function makeGenericRoot
* builds the entire document tree for the generic export. This is factored
* out here so we can write the tree in either S-expression file format
Follow ups
References