22#ifndef NETLIST_EXPORTER_H
23#define NETLIST_EXPORTER_H
31#include <unordered_map>
54 bool Lookup(
const wxString& aString )
56 std::pair<us_iterator, bool> pair =
m_set.insert( aString );
78 PIN_INFO(
const wxString& aPinNumber,
const wxString& aNetName,
const wxString& aPinName,
79 const wxString& aSourcePin = wxEmptyString ) :
106 wxASSERT( aSchematic );
116 bool WriteNetlist(
const wxString& aOutFileName,
unsigned aNetlistOptions,
REPORTER& aReporter );
147 static wxString
MakeCommandLine(
const wxString& aFormatString,
const wxString& aNetlistFile,
148 const wxString& aFinalFile,
149 const wxString& aProjectDirectory );
173 std::vector<std::pair<SCH_PIN*, SCH_SHEET_PATH>>
pins;
230 const wxString& aNetName );
235 const std::set<wxString>&
footprintPads(
const wxString& aFootprintId )
const;
244 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
NETLIST_EXPORTER_BASE(SCHEMATIC *aSchematic, KIWAY *aKiway)
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()
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).
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
EXPORT_EXCLUSION boardExclusion() const
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter)
Write to specified output file.
wxString m_exportVariant
The schematic we're generating a netlist for.
SCH_SYMBOL * findNextSymbol(EDA_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath, const EXPORT_EXCLUSION &aExcluded=nullptr)
Check if the given symbol should be processed for netlisting.
KIWAY * m_kiway
The variant of the schematic to export.
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).
bool packageOwnedElsewhere(const SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath, const EXPORT_EXCLUSION &aExcluded) const
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.
wxString GetCurrentVariant() const
Return the current variant being edited.
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
std::function< bool(const SCH_SYMBOL *, const SCH_SHEET_PATH &)> EXPORT_EXCLUSION
An abstract class used for the netlist exporters that Eeschema supports.
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).