From 77fe7d8325696fe6f5f86dc11b6630c7972f51ab Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Fri, 19 Apr 2019 22:53:16 -0400 Subject: [PATCH] Remove netlist QC code; it's outlived its usefulness --- .../netlist_exporter_kicad.cpp | 119 ------------------ 1 file changed, 119 deletions(-) diff --git a/eeschema/netlist_exporters/netlist_exporter_kicad.cpp b/eeschema/netlist_exporters/netlist_exporter_kicad.cpp index eac4206a6d..41b89c1ac7 100644 --- a/eeschema/netlist_exporters/netlist_exporter_kicad.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_kicad.cpp @@ -50,125 +50,6 @@ bool NETLIST_EXPORTER_KICAD::WriteNetlist( const wxString& aOutFileName, unsigne return false; } - /** - * Temporary QC measure: - * Generate the netlist again using the old algorithm and compare. - * In theory, if the schematic does not use any of the new bus techniques - * (bus aliases, bus groups, etc) they should match. If not, we can throw - * a warning and generate some debug output to fix the new netlister. - * - * This whole block can be removed once we are confident in the new code. - */ - - if( !m_graph->UsesNewBusFeatures() ) - { - auto old_nets = makeListOfNets( false ); - - bool different = false; - - for( auto it : m_graph->m_net_code_to_subgraphs_map ) - { - // auto code = it.first; - auto subgraphs = it.second; - auto net_name = subgraphs[0]->GetNetName(); - - std::set net_pins; - - for( auto subgraph : subgraphs ) - { - auto sheet = subgraph->m_sheet; - - for( auto item : subgraph->m_items ) - { - if( item->Type() == SCH_PIN_T ) - { - auto pin = static_cast( item ); - - if( pin->IsPowerConnection() || - (LIB_PART*)( pin->GetLibPin()->GetParent() )->IsPower() ) - continue; - - const wxString& refText = pin->GetParentComponent()->GetRef( &sheet ); - const wxString& pinText = pin->GetNumber(); - - net_pins.insert( refText + "-" + pinText ); - } - } - } - - bool found = false; - - // Yes this is slow, but it's a temporary debugging thing. - for( auto kid = old_nets->GetChildren(); kid; kid = kid->GetNext() ) - { - for( auto attr = kid->GetAttributes(); attr; attr = attr->GetNext() ) - { - if( attr->GetName() == "name" && attr->GetValue() == net_name ) - { - found = true; - - // Check members of this net - std::set old_net_pins; - - for( auto pin_node = kid->GetChildren(); - pin_node; pin_node = pin_node->GetNext() ) - { - wxString ref, pin; - - for( auto pin_attr = pin_node->GetAttributes(); - pin_attr; pin_attr = pin_attr->GetNext() ) - { - if( pin_attr->GetName() == "ref" ) - ref = pin_attr->GetValue(); - - if( pin_attr->GetName() == "pin" ) - pin = pin_attr->GetValue(); - } - - old_net_pins.insert( ref + "-" + pin ); - } - - std::vector difference( std::max( net_pins.size(), - old_net_pins.size() ) ); - - auto end = std::set_symmetric_difference( net_pins.begin(), - net_pins.end(), - old_net_pins.begin(), - old_net_pins.end(), - difference.begin() ); - - difference.resize( end - difference.begin() ); - - if( difference.size() > 0 ) - { - different = true; - } - } - } - } - - if( !found ) - { - different = true; - } - } - - if( different ) - { - try - { - FILE_OUTPUTFORMATTER formatter( aOutFileName + ".old_algo" ); - Format( &formatter, GNL_ALL ); - } - - catch( const IO_ERROR& ioe ) - { - DisplayError( NULL, ioe.What() ); - return false; - } - } - } - return true; }