Remove netlist QC code; it's outlived its usefulness
This commit is contained in:
parent
5b226f6c96
commit
77fe7d8325
|
@ -50,125 +50,6 @@ bool NETLIST_EXPORTER_KICAD::WriteNetlist( const wxString& aOutFileName, unsigne
|
||||||
return false;
|
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<wxString> 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<SCH_PIN*>( 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<wxString> 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<wxString> 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue