Back out unordered_map change for SCH_ITEM.

We're sensitive to the ordering in this one.

Also fixes a problem with the unit tests when KICAD_SPICE=OFF.
This commit is contained in:
Jeff Young 2022-08-03 14:27:02 +01:00
parent e4b6da287f
commit ced55583a6
3 changed files with 25 additions and 19 deletions

View File

@ -418,7 +418,7 @@ int ERC_TESTER::TestNoConnectPins()
} }
} }
for( auto& pair : pinMap ) for( const std::pair<const VECTOR2I, std::vector<SCH_PIN*>>& pair : pinMap )
{ {
if( pair.second.size() > 1 ) if( pair.second.size() > 1 )
{ {

View File

@ -484,7 +484,7 @@ protected:
// to store a initial pos of the item or mouse cursor // to store a initial pos of the item or mouse cursor
/// Store pointers to other items that are connected to this one, per sheet. /// Store pointers to other items that are connected to this one, per sheet.
std::unordered_map<SCH_SHEET_PATH, SCH_ITEM_SET, SHEET_PATH_HASH, SHEET_PATH_CMP> m_connected_items; std::map<SCH_SHEET_PATH, SCH_ITEM_SET, SHEET_PATH_CMP> m_connected_items;
/// Store connectivity information, per sheet. /// Store connectivity information, per sheet.
std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> m_connection_map; std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> m_connection_map;

View File

@ -85,33 +85,39 @@ public:
{ {
// Our simulator is actually Ngspice. // Our simulator is actually Ngspice.
NGSPICE* ngspice = dynamic_cast<NGSPICE*>( m_simulator.get() ); NGSPICE* ngspice = dynamic_cast<NGSPICE*>( m_simulator.get() );
ngspice->SetReporter( m_reporter.get() );
if( ngspice )
ngspice->SetReporter( m_reporter.get() );
wxFFile file( GetNetlistPath( true ), "rt" ); wxFFile file( GetNetlistPath( true ), "rt" );
wxString netlist; wxString netlist;
file.ReadAll( &netlist ); file.ReadAll( &netlist );
//ngspice->Init();
ngspice->Command( "set ngbehavior=ps" );
ngspice->Command( "setseed 1" );
ngspice->Command( "set filetype=ascii" );
ngspice->Command( "set numdgt=3" );
ngspice->Command( "set wr_singlescale" );
ngspice->Command( "set wr_vecnames" );
ngspice->LoadNetlist( netlist.ToStdString() );
ngspice->Run();
wxString vectors; if( ngspice )
for( const wxString& vector : m_testedVectors ) {
vectors << vector << " "; //ngspice->Init();
ngspice->Command( "set ngbehavior=ps" );
ngspice->Command( "setseed 1" );
ngspice->Command( "set filetype=ascii" );
ngspice->Command( "set numdgt=3" );
ngspice->Command( "set wr_singlescale" );
ngspice->Command( "set wr_vecnames" );
ngspice->LoadNetlist( netlist.ToStdString() );
ngspice->Run();
// We need to make sure that the number of points always the same.
ngspice->Command( wxString::Format( "linearize %s", vectors ).ToStdString() );
ngspice->Command( wxString vectors;
wxString::Format( "wrdata %s %s", GetResultsPath( true ), vectors ).ToStdString() ); for( const wxString& vector : m_testedVectors )
vectors << vector << " ";
// We need to make sure that the number of points always the same.
ngspice->Command( wxString::Format( "linearize %s", vectors ).ToStdString() );
ngspice->Command(
wxString::Format( "wrdata %s %s", GetResultsPath( true ), vectors ).ToStdString() );
}
FILE_LINE_READER refReader( GetResultsPath() ); FILE_LINE_READER refReader( GetResultsPath() );
FILE_LINE_READER resultReader( GetResultsPath( true ) ); FILE_LINE_READER resultReader( GetResultsPath( true ) );