22#ifndef NETLIST_EXPORTER_H
23#define NETLIST_EXPORTER_H
30#include <unordered_map>
53 bool Lookup(
const wxString& aString )
55 std::pair<us_iterator, bool> pair =
m_set.insert( aString );
77 PIN_INFO(
const wxString& aPinNumber,
const wxString& aNetName,
const wxString& aPinName,
78 const wxString& aSourcePin = wxEmptyString ) :
101 wxASSERT( aSchematic );
111 bool WriteNetlist(
const wxString& aOutFileName,
unsigned aNetlistOptions,
REPORTER& aReporter );
142 static wxString
MakeCommandLine(
const wxString& aFormatString,
const wxString& aNetlistFile,
143 const wxString& aFinalFile,
144 const wxString& aProjectDirectory );
159 virtual bool writeNetlist(
const wxString& aOutFileName,
unsigned aNetlistOptions,
160 REPORTER& aReporter ) {
return false; }
166 std::vector<std::pair<SCH_PIN*, SCH_SHEET_PATH>>
pins;
210 const wxString& aNetName );
215 const std::set<wxString>&
footprintPads(
const wxString& aFootprintId )
const;
224 std::vector<PIN_INFO>& aPins );
A base class for most all the KiCad significant classes used in schematics and boards.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Define a library symbol object.
CONNECTIVITY_SCOPE(NETLIST_EXPORTER_BASE &aExporter)
CONNECTIVITY_SCOPE(const CONNECTIVITY_SCOPE &)=delete
CONNECTIVITY_SCOPE & operator=(const CONNECTIVITY_SCOPE &)=delete
NETLIST_EXPORTER_BASE & m_exporter
SCHEMATIC * m_schematic
The schematic we're generating a netlist for.
virtual bool writeNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter)
virtual ~NETLIST_EXPORTER_BASE()=default
std::optional< wxString > itemNetName(const SCH_ITEM &aItem, const SCH_SHEET_PATH &aPath) const
const std::set< wxString > & footprintPads(const wxString &aFootprintId) const
void findAllUnitsOfSymbol(SCH_SYMBOL *aSchSymbol, const SCH_SHEET_PATH &aSheetPath, std::vector< PIN_INFO > &aPins)
Find all units for symbols with multiple symbols per package.
void rebuildConnectivity()
SCH_SYMBOL * findNextSymbol(EDA_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath)
Check if the given symbol should be processed for netlisting.
std::map< wxString, std::set< wxString > > m_footprintPadCache
unsigned m_connectivityDepth
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.
std::vector< wxString > resolvePadNumbers(const SCH_PIN *aPin, const SCH_SHEET_PATH &aSheetPath) const
Resolve aPin to its effective pad number(s) for every netlist path (issue #2282).
NETLIST_EXPORTER_BASE(SCHEMATIC *aSchematic)
std::map< SCH_SHEET_PATH, std::unordered_map< KIID, wxString > > m_exportItemNets
UNIQUE_STRINGS m_referencesAlreadyFound
Used for "multiple symbols per package" symbols to avoid processing a lib symbol more than once.
SCH_SHEET_LIST m_exportSheets
std::vector< EXPORT_NET > m_exportNets
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter)
Write to specified output file.
void SetKiway(KIWAY *aKiway)
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.
void appendResolvedPins(std::vector< PIN_INFO > &aPins, const SCH_PIN *aPin, const SCH_SHEET_PATH &aSheetPath, const wxString &aNetName)
Resolve aPin to its pad number(s) and append a PIN_INFO for each (issue #2282).
std::vector< PIN_INFO > CreatePinList(SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath)
Find a symbol from the DrawList and builds its pin list.
A pure virtual class used to derive REPORTER objects from.
Holds all the data relating to one schematic.
Base class for any item which can be embedded within the SCHEMATIC container class,...
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Track unique wxStrings and is useful in telling if a string has been seen before.
std::set< wxString > m_set
set of wxStrings already found
void Clear()
Erase the record.
bool Lookup(const wxString &aString)
std::set< wxString >::iterator us_iterator
Used by std:set<LIB_SYMBOL*> instantiation which uses LIB_SYMBOL name as its key.
bool operator()(LIB_SYMBOL *const &libsymbol1, LIB_SYMBOL *const &libsymbol2) const
std::vector< std::pair< SCH_PIN *, SCH_SHEET_PATH > > pins
PIN_INFO(const wxString &aPinNumber, const wxString &aNetName, const wxString &aPinName, const wxString &aSourcePin=wxEmptyString)
wxString num
Resolved footprint pad number.
wxString srcPin
Original symbol pin number that mapped to this pad (issue #2282).