Sort pins in numeric order before attempting to match to SPICE model.

Fixes https://gitlab.com/kicad/code/kicad/issues/13164
This commit is contained in:
Jeff Young 2022-12-16 14:17:54 +00:00
parent 24786fe0e9
commit 08a8a20794
1 changed files with 6 additions and 0 deletions

View File

@ -1394,6 +1394,12 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
// use indexes.
std::vector<LIB_PIN*> sourcePins = aSymbol.GetAllLibPins();
std::sort( sourcePins.begin(), sourcePins.end(),
[]( const LIB_PIN* lhs, const LIB_PIN* rhs )
{
return StrNumCmp( lhs->GetNumber(), rhs->GetNumber(), true ) < 0;
} );
for( unsigned ii = 0; ii < sourcePins.size(); ++ii )
{
if( ii > 0 )