Browse Source

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.
newinvert
Wayne Stambaugh 2 years ago
parent
commit
fb6b8eaeea
  1. 10
      eeschema/netlist_exporters/netlist_exporter_base.cpp
  2. 7
      eeschema/sch_symbol.cpp
  3. 2
      eeschema/sch_symbol.h

10
eeschema/netlist_exporters/netlist_exporter_base.cpp

@ -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 )

7
eeschema/sch_symbol.cpp

@ -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();
}

2
eeschema/sch_symbol.h

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

Loading…
Cancel
Save