47                                                 const wxString& aNetlistFile,
 
   48                                                 const wxString& aFinalFile,
 
   49                                                 const wxString& aProjectPath )
 
   57    wxString   ret  = aFormatString;
 
   58    wxFileName in   = aNetlistFile;
 
   59    wxFileName out  = aFinalFile;
 
   60    wxString str_out  = out.GetFullPath();
 
   62    ret.Replace( 
"%P", aProjectPath, 
true );
 
   63    ret.Replace( 
"%B", out.GetName(), 
true );
 
   64    ret.Replace( 
"%I", in.GetFullPath(), 
true );
 
   72    if( !str_out.StartsWith( 
"\\\\" ) )
 
   73        str_out.Replace( 
"\\", 
"/" );
 
   76    ret.Replace( 
"%O", str_out, 
true );
 
 
   85    wxCHECK( aItem, 
nullptr );
 
   97    ref = symbol->
GetRef( &aSheetPath );
 
   99    if( ref[0] == wxChar( 
'#' ) )
 
  104    wxCHECK( screen, 
nullptr );
 
 
  130                                                            bool aKeepUnconnectedPins )
 
  132    std::vector<PIN_INFO> pins;
 
  137    wxString ref( aSymbol->
GetRef( &aSheetPath ) );
 
  141    if( ( ref[0] == wxChar( 
'#' ) ) || aSymbol->
IsPower() )
 
  158        wxLogTrace( 
traceStackedPins, 
"CreatePinList(multi): ref='%s' pins=%zu", aSymbol->
GetRef( &aSheetPath ), pins.size() );
 
  169                const wxString& netName = conn->Name();
 
  171                if( !aKeepUnconnectedPins )     
 
  180                std::vector<wxString> numbers = 
pin->GetStackedPinNumbers( &valid );
 
  181                wxString              baseName = 
pin->GetShownName();
 
  183                            wxString::Format( 
"CreatePinList(single): ref='%s' pinNameBase='%s' shownNum='%s' net='%s' " 
  184                                              "valid=%d expand=%zu",
 
  185                                              ref, baseName, 
pin->GetShownNumber(), netName, valid, numbers.size() ) );
 
  187                for( 
const wxString& num : numbers )
 
  189                    wxString pinName = baseName.IsEmpty() ? num : baseName + wxT( 
"_" ) + num;
 
  191                                wxString::Format( 
" -> emit pin num='%s' name='%s' net='%s'", num, pinName, netName ) );
 
  192                    pins.emplace_back( num, netName, pinName );
 
  199    std::sort( pins.begin(), pins.end(),
 
  202                   return StrNumCmp( lhs.num, rhs.num, true ) < 0;
 
 
  217    for( 
unsigned ii = 0; ii < aPins.size(); ii++ )
 
  219        if( aPins[ii].num.empty() ) 
 
  232        for( 
unsigned jj = ii + 1; jj < aPins.size(); jj++ )
 
  234            if(  aPins[jj].num.empty() )   
 
  239            if( aPins[idxref].num != aPins[jj].num )
 
  242            aPins[jj].num.clear();
 
 
  250                                                  std::vector<PIN_INFO>& aPins,
 
  251                                                  bool aKeepUnconnectedPins )
 
  253    wxString ref = aSchSymbol->
GetRef( &aSheetPath );
 
  264            ref2 = comp2->
GetRef( &sheet );
 
  266            if( ref2.CmpNoCase( ref ) != 0 )
 
  273                    const wxString& netName = conn->Name();
 
  275                    if( !aKeepUnconnectedPins )     
 
  284                    std::vector<wxString> numbers = 
pin->GetStackedPinNumbers( &valid );
 
  285                    wxString                     baseName = 
pin->GetShownName();
 
  287                               wxString::Format( 
"CreatePinList(multi): ref='%s' pinNameBase='%s' shownNum='%s' net='%s' valid=%d expand=%zu",
 
  288                                                 ref2, baseName, 
pin->GetShownNumber(), netName, valid, numbers.size() ) );
 
  290                    for( 
const wxString& num : numbers )
 
  292                        wxString pinName = baseName.IsEmpty() ? num : baseName + wxT( 
"_" ) + num;
 
  294                                    wxString::Format( 
" -> emit pin num='%s' name='%s' net='%s'", num, pinName, netName ) );
 
  295                        aPins.emplace_back( num, netName, pinName );
 
 
Calculate the connectivity of a schematic and generates netlists.
 
CONNECTION_SUBGRAPH * FindSubgraphByName(const wxString &aNetName, const SCH_SHEET_PATH &aPath)
Return the subgraph for a given net name on a given sheet.
 
A subgraph is a set of items that are electrically connected on a single sheet.
 
const std::set< SCH_ITEM * > & GetItems() const
Provide a read-only reference to the items in the subgraph.
 
const SCH_ITEM * GetNoConnect() const
 
A base class for most all the KiCad significant classes used in schematics and boards.
 
KICAD_T Type() const
Returns the type of object.
 
Define a library symbol object.
 
const LIB_ID & GetLibId() const override
 
int GetUnitCount() const override
 
SCHEMATIC * m_schematic
The schematic we're generating a netlist for.
 
std::vector< PIN_INFO > CreatePinList(SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath, bool aKeepUnconnectedPins)
Find a symbol from the DrawList and builds its pin list.
 
void findAllUnitsOfSymbol(SCH_SYMBOL *aSchSymbol, const SCH_SHEET_PATH &aSheetPath, std::vector< PIN_INFO > &aPins, bool aKeepUnconnectedPins)
Find all units for symbols with multiple symbols per package.
 
SCH_SYMBOL * findNextSymbol(EDA_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath)
Check if the given symbol should be processed for netlisting.
 
std::set< LIB_SYMBOL *, LIB_SYMBOL_LESS_THAN > m_libParts
unique library symbols used. LIB_SYMBOL items are sorted by names
 
void eraseDuplicatePins(std::vector< PIN_INFO > &pins)
Erase duplicate pins.
 
UNIQUE_STRINGS m_referencesAlreadyFound
Used for "multiple symbols per package" symbols to avoid processing a lib symbol more than once.
 
static wxString MakeCommandLine(const wxString &aFormatString, const wxString &aNetlistFile, const wxString &aFinalFile, const wxString &aProjectDirectory)
Build up a string that describes a command line for executing a child process.
 
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
 
Base class for any item which can be embedded within the SCHEMATIC container class,...
 
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols() const
Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this...
 
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
 
SCH_SCREEN * LastScreen()
 
wxString GetSchSymbolLibraryName() const
 
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
 
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
 
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
 
bool IsPower() const override
 
const wxChar *const traceStackedPins
Flag to enable debug output for stacked pins handling in symbol/pin code.
 
bool operator()(LIB_SYMBOL *const &libsymbol1, LIB_SYMBOL *const &libsymbol2) const
 
wxLogTrace helper definitions.