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 );
84 wxCHECK( aItem,
nullptr );
85 wxCHECK( aSheetPath,
nullptr );
97 ref = symbol->
GetRef( aSheetPath );
99 if( ref[0] == wxChar(
'#' ) )
104 wxCHECK( screen,
nullptr );
130 bool aKeepUnconnectedPins )
132 std::vector<PIN_INFO> pins;
134 wxCHECK( aSymbol, pins );
136 wxString ref( aSymbol->
GetRef( aSheetPath ) );
140 if( ( ref[0] == wxChar(
'#' ) ) || aSymbol->
IsPower() )
168 const wxString& netName = conn->Name();
170 if( !aKeepUnconnectedPins )
178 pins.emplace_back(
pin->GetShownNumber(), netName );
184 std::sort( pins.begin(), pins.end(),
187 return StrNumCmp( lhs.num, rhs.num, true ) < 0;
202 for(
unsigned ii = 0; ii < aPins.size(); ii++ )
204 if( aPins[ii].num.empty() )
217 for(
unsigned jj = ii + 1; jj < aPins.size(); jj++ )
219 if( aPins[jj].num.empty() )
224 if( aPins[idxref].num != aPins[jj].num )
227 aPins[jj].num.clear();
235 std::vector<PIN_INFO>& aPins,
236 bool aKeepUnconnectedPins )
238 wxString ref = aSchSymbol->
GetRef( aSheetPath );
244 for(
unsigned i = 0; i < sheetList.size(); i++ )
252 ref2 = comp2->
GetRef( &sheet );
254 if( ref2.CmpNoCase( ref ) != 0 )
261 const wxString& netName = conn->Name();
263 if( !aKeepUnconnectedPins )
271 aPins.emplace_back(
pin->GetShownNumber(), netName );
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
void findAllUnitsOfSymbol(SCH_SYMBOL *aSchSymbol, SCH_SHEET_PATH *aSheetPath, std::vector< PIN_INFO > &aPins, bool aKeepUnconnectedPins)
Find all units for symbols with multiple symbols per package.
std::set< LIB_SYMBOL *, LIB_SYMBOL_LESS_THAN > m_libParts
unique library symbols used. LIB_SYMBOL items are sorted by names
std::vector< PIN_INFO > CreatePinList(SCH_SYMBOL *aSymbol, SCH_SHEET_PATH *aSheetPath, bool aKeepUnconnectedPins)
Find a symbol from the DrawList and builds its pin list.
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.
SCH_SYMBOL * findNextSymbol(EDA_ITEM *aItem, SCH_SHEET_PATH *aSheetPath)
Check if the given symbol should be processed for netlisting.
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.
SCHEMATIC_IFACE * m_schematic
The schematic we're generating a netlist for.
virtual CONNECTION_GRAPH * ConnectionGraph() const =0
virtual SCH_SHEET_LIST GetSheets() const =0
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...
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...
SCH_SCREEN * LastScreen()
wxString GetSchSymbolLibraryName() const
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) 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
bool Lookup(const wxString &aString)
bool operator()(LIB_SYMBOL *const &libsymbol1, LIB_SYMBOL *const &libsymbol2) const
Definition for symbol library class.