38 const wxString& aNetlistFile,
39 const wxString& aFinalFile,
40 const wxString& aProjectPath )
48 wxString ret = aFormatString;
49 wxFileName in = aNetlistFile;
50 wxFileName out = aFinalFile;
51 wxString str_out = out.GetFullPath();
53 ret.Replace(
"%P", aProjectPath,
true );
54 ret.Replace(
"%B", out.GetName(),
true );
55 ret.Replace(
"%I", in.GetFullPath(),
true );
63 if( !str_out.StartsWith(
"\\\\" ) )
64 str_out.Replace(
"\\",
"/" );
67 ret.Replace(
"%O", str_out,
true );
75 wxCHECK( aItem,
nullptr );
76 wxCHECK( aSheetPath,
nullptr );
88 ref = symbol->
GetRef( aSheetPath );
90 if( ref[0] == wxChar(
'#' ) )
95 wxCHECK( screen,
nullptr );
99 wxCHECK( libSymbol,
nullptr );
118 bool aKeepUnconnectedPins )
120 std::vector<PIN_INFO> pins;
122 wxCHECK( aSymbol, pins );
124 wxString ref( aSymbol->
GetRef( aSheetPath ) );
128 if( ( ref[0] == wxChar(
'#' ) ) || aSymbol->
IsPower() )
156 const wxString& netName = conn->Name();
158 if( !aKeepUnconnectedPins )
166 pins.emplace_back(
pin->GetShownNumber(), netName );
172 std::sort( pins.begin(), pins.end(),
175 return StrNumCmp( lhs.num, rhs.num, true ) < 0;
190 for(
unsigned ii = 0; ii < aPins.size(); ii++ )
192 if( aPins[ii].num.empty() )
205 for(
unsigned jj = ii + 1; jj < aPins.size(); jj++ )
207 if( aPins[jj].num.empty() )
212 if( aPins[idxref].num != aPins[jj].num )
215 aPins[jj].num.clear();
223 std::vector<PIN_INFO>& aPins,
224 bool aKeepUnconnectedPins )
226 wxString ref = aSchSymbol->
GetRef( aSheetPath );
232 for(
unsigned i = 0; i < sheetList.size(); i++ )
240 ref2 = comp2->
GetRef( &sheet );
242 if( ref2.CmpNoCase( ref ) != 0 )
249 const wxString& netName = conn->Name();
251 if( !aKeepUnconnectedPins )
259 aPins.emplace_back(
pin->GetShownNumber(), netName );
Calculates the connectivity of a schematic and generates netlists.
CONNECTION_SUBGRAPH * FindSubgraphByName(const wxString &aNetName, const SCH_SHEET_PATH &aPath)
Returns 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::vector< SCH_ITEM * > & GetItems() const
Provides 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.
int GetUnitCount() const override
For items with units, return the number of units.
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,...
std::map< wxString, LIB_SYMBOL * > & GetLibSymbols()
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
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
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()
bool Lookup(const wxString &aString)
Definition for symbol library class.