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",
67 for(
unsigned i = 0; i < sheetList.size(); i++ )
82 std::vector<PIN_INFO> pins =
CreatePinList( symbol, &sheet,
true );
92 footprint.Replace( wxT(
" " ), wxT(
"_" ) );
94 if( footprint.IsEmpty() )
95 footprint = wxT(
"$noname" );
97 ret |= fprintf( f,
" ( %s %s",
101 field = symbol->
GetRef( &sheet );
103 ret |= fprintf( f,
" %s",
TO_UTF8( field ) );
106 field.Replace( wxT(
" " ), wxT(
"_" ) );
108 ret |= fprintf( f,
" %s",
TO_UTF8( field ) );
110 ret |= fprintf( f,
"\n" );
115 if(
pin.num.IsEmpty() )
118 netName =
pin.netName;
119 netName.Replace( wxT(
" " ), wxT(
"_" ) );
124 ret |= fprintf( f,
" )\n" );
128 ret |= fprintf( f,
")\n*\n" );
A base class for most all the KiCad significant classes used in schematics and boards.
EE_TYPE OfType(KICAD_T aType) const
wxString AsString() const
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.
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.
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 GetSheets() const =0
A helper to define a symbol's reference designator in a schematic.
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
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 PathAsString() const
Return the path of time stamps which do not changes even when editing sheet parameters.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
bool GetIncludeOnBoard() const
const wxString GetFootprintFieldText(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const
const wxString GetValueFieldText(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
void Clear()
Erase the record.
This file is part of the common library.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
#define NETLIST_HEAD_STRING
Collection of utility functions for component reference designators (refdes)
Definition for symbol library class.