Don't include power symbol pin when exporting netlist.

The netlist exporter was never updated to exclude symbols that are
tagged as power symbols.  Only the legacy power symbol name prefix
('#') was used as the power symbol check.  Power symbols no longer
require the '#' name prefix.
This commit is contained in:
Wayne Stambaugh 2023-05-05 08:53:29 -04:00
parent 18dd623122
commit fb6b8eaeea
3 changed files with 15 additions and 4 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2017 jp.charras at wanadoo.fr
* Copyright (C) 2013-2017 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -117,13 +117,15 @@ std::vector<PIN_INFO> NETLIST_EXPORTER_BASE::CreatePinList( SCH_SYMBOL* aSymbol,
SCH_SHEET_PATH* aSheetPath,
bool aKeepUnconnectedPins )
{
wxString ref( aSymbol->GetRef( aSheetPath ) );
std::vector<PIN_INFO> pins;
wxCHECK( aSymbol, pins );
wxString ref( aSymbol->GetRef( aSheetPath ) );
// Power symbols and other symbols which have the reference starting with "#" are not
// included in netlist (pseudo or virtual symbols)
if( ref[0] == wxChar( '#' ) )
if( ( ref[0] == wxChar( '#' ) ) || aSymbol->IsPower() )
return pins;
// if( aSymbol->m_FlagControlMulti == 1 )

View File

@ -2397,3 +2397,10 @@ bool SCH_SYMBOL::IsSymbolLikePowerGlobalLabel() const
return pin_list[0]->GetType() == ELECTRICAL_PINTYPE::PT_POWER_IN;
}
bool SCH_SYMBOL::IsPower() const
{
wxCHECK( m_part, false );
return m_part->IsPower();
}

View File

@ -766,6 +766,8 @@ public:
*/
bool IsSymbolLikePowerGlobalLabel() const;
bool IsPower() const;
private:
BOX2I doGetBoundingBox( bool aIncludePins, bool aIncludeFields ) const;