Sim: Remove pins field in all inferred models with linear pin mapping
This commit is contained in:
parent
80c426f577
commit
3e0f4a47b0
|
@ -1005,13 +1005,21 @@ template void SIM_MODEL::WriteInferredDataFields( std::vector<LIB_FIELD>& aField
|
|||
template <typename T>
|
||||
void SIM_MODEL::WriteInferredDataFields( std::vector<T>& aFields, const std::string& aValue ) const
|
||||
{
|
||||
if( GetPinCount() == 2
|
||||
&& GetPin( 0 ).symbolPinNumber == "1"
|
||||
&& GetPin( 1 ).symbolPinNumber == "2" )
|
||||
bool removePinsField = true;
|
||||
|
||||
// Only write Sim_Pins field if the pins are not in the canonical order.
|
||||
for( int i = 0; i < GetPinCount(); ++i )
|
||||
{
|
||||
SetFieldValue( aFields, PINS_FIELD, "" );
|
||||
if( GetPin( i ).symbolPinNumber != fmt::format( "{}", i + 1 ) )
|
||||
{
|
||||
removePinsField = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( removePinsField )
|
||||
SetFieldValue( aFields, PINS_FIELD, "" );
|
||||
|
||||
SetFieldValue( aFields, VALUE_FIELD, aValue );
|
||||
SetFieldValue( aFields, DEVICE_TYPE_FIELD, "" );
|
||||
SetFieldValue( aFields, TYPE_FIELD, "" );
|
||||
|
|
Loading…
Reference in New Issue