53 if( ( f = wxFopen( aOutFileName, wxT(
"wt" ) ) ) ==
nullptr )
55 wxString msg = wxString::Format(
_(
"Failed to create file '%s'." ), aOutFileName );
60 std::vector< SCH_REFERENCE > cmpList;
62 ret |= fprintf( f,
"( { %s created %s }\n",
73 std::vector<EDA_ITEM*> sheetItems;
76 sheetItems.push_back( item );
80 return item1->
m_Uuid < item2->m_Uuid;
83 std::sort( sheetItems.begin(), sheetItems.end(), pred );
96 std::vector<PIN_INFO> pins =
CreatePinList( symbol, sheet,
true );
105 footprint.Replace( wxT(
" " ), wxT(
"_" ) );
107 if( footprint.IsEmpty() )
108 footprint = wxT(
"$noname" );
110 ret |= fprintf( f,
" ( %s %s",
114 field = symbol->
GetRef( &sheet );
116 ret |= fprintf( f,
" %s",
TO_UTF8( field ) );
118 field = symbol->
GetValue(
true, &sheet,
false );
119 field.Replace( wxT(
" " ), wxT(
"_" ) );
121 ret |= fprintf( f,
" %s",
TO_UTF8( field ) );
123 ret |= fprintf( f,
"\n" );
128 if(
pin.num.IsEmpty() )
131 netName =
pin.netName;
132 netName.Replace( wxT(
" " ), wxT(
"_" ) );
137 ret |= fprintf( f,
" )\n" );
141 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.