50 if( ( f = wxFopen( aOutFileName, wxT(
"wt" ) ) ) ==
nullptr )
52 wxString msg = wxString::Format(
_(
"Failed to create file '%s'." ), aOutFileName );
57 std::vector< SCH_REFERENCE > cmpList;
59 ret |= fprintf( f,
"( { %s created %s }\n",
78 std::vector<PIN_INFO> pins =
CreatePinList( symbol, sheet,
true );
87 footprint.Replace( wxT(
" " ), wxT(
"_" ) );
89 if( footprint.IsEmpty() )
90 footprint = wxT(
"$noname" );
92 ret |= fprintf( f,
" ( %s %s",
96 field = symbol->
GetRef( &sheet );
98 ret |= fprintf( f,
" %s",
TO_UTF8( field ) );
100 field = symbol->
GetValue(
true, &sheet,
false );
101 field.Replace( wxT(
" " ), wxT(
"_" ) );
103 ret |= fprintf( f,
" %s",
TO_UTF8( field ) );
105 ret |= fprintf( f,
"\n" );
110 if(
pin.num.IsEmpty() )
113 netName =
pin.netName;
114 netName.Replace( wxT(
" " ), wxT(
"_" ) );
119 ret |= fprintf( f,
" )\n" );
123 ret |= fprintf( f,
")\n*\n" );
A base class for most all the KiCad significant classes used in schematics and boards.
wxString AsString() const
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.
SCH_SYMBOL * findNextSymbol(EDA_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath)
Check if the given symbol should be processed for netlisting.
UNIQUE_STRINGS m_referencesAlreadyFound
Used for "multiple symbols per package" symbols to avoid processing a lib symbol more than once.
SCHEMATIC_IFACE * m_schematic
The schematic we're generating a netlist for.
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter) override
Write to specified output file.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
virtual SCH_SHEET_LIST Hierarchy() const =0
A helper to define a symbol's reference designator in a schematic.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const wxString GetValue(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const override
const wxString GetFootprintFieldText(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
bool GetExcludedFromBoard() const
void Clear()
Erase the record.
This file is part of the common library.
#define NETLIST_HEAD_STRING
Collection of utility functions for component reference designators (refdes)
wxString GetISO8601CurrentDateTime()
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition for symbol library class.