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() )
169 const wxString& netName = conn->Name();
171 if( !aKeepUnconnectedPins )
179 pins.emplace_back(
pin->GetShownNumber(), netName );
185 std::sort( pins.begin(), pins.end(),
188 return StrNumCmp( lhs.num, rhs.num, true ) < 0;
203 for(
unsigned ii = 0; ii < aPins.size(); ii++ )
205 if( aPins[ii].num.empty() )
218 for(
unsigned jj = ii + 1; jj < aPins.size(); jj++ )
220 if( aPins[jj].num.empty() )
225 if( aPins[idxref].num != aPins[jj].num )
228 aPins[jj].num.clear();
236 std::vector<PIN_INFO>& aPins,
237 bool aKeepUnconnectedPins )
239 wxString ref = aSchSymbol->
GetRef( &aSheetPath );
250 ref2 = comp2->
GetRef( &sheet );
252 if( ref2.CmpNoCase( ref ) != 0 )
259 const wxString& netName = conn->Name();
261 if( !aKeepUnconnectedPins )
269 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
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.
SCHEMATIC_IFACE * m_schematic
The schematic we're generating a netlist for.
virtual CONNECTION_GRAPH * ConnectionGraph() const =0
virtual SCH_SHEET_LIST Hierarchy() 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...
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.