KiCad PCB EDA Suite
netlist_exporter_generic.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 1992-2013 jp.charras at wanadoo.fr
5  * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.TXT for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include <build_version.h>
27 #include <sch_base_frame.h>
28 #include <class_library.h>
29 
30 #include <schframe.h>
32 
33 static bool sortPinsByNumber( LIB_PIN* aPin1, LIB_PIN* aPin2 );
34 
35 bool NETLIST_EXPORTER_GENERIC::WriteNetlist( const wxString& aOutFileName, unsigned aNetlistOptions )
36 {
37  // Prepare list of nets generation
38  for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
39  m_masterList->GetItem( ii )->m_Flag = 0;
40 
41  // output the XML format netlist.
42  wxXmlDocument xdoc;
43 
44  xdoc.SetRoot( makeRoot( GNL_ALL ) );
45 
46  return xdoc.Save( aOutFileName, 2 /* indent bug, today was ignored by wxXml lib */ );
47 }
48 
49 
51 {
52  XNODE* xroot = node( wxT( "export" ) );
53 
54  xroot->AddAttribute( wxT( "version" ), wxT( "D" ) );
55 
56  if( aCtl & GNL_HEADER )
57  // add the "design" header
58  xroot->AddChild( makeDesignHeader() );
59 
60  if( aCtl & GNL_COMPONENTS )
61  xroot->AddChild( makeComponents() );
62 
63  if( aCtl & GNL_PARTS )
64  xroot->AddChild( makeLibParts() );
65 
66  if( aCtl & GNL_LIBRARIES )
67  // must follow makeGenericLibParts()
68  xroot->AddChild( makeLibraries() );
69 
70  if( aCtl & GNL_NETS )
71  xroot->AddChild( makeListOfNets() );
72 
73  return xroot;
74 }
75 
76 
78 {
79  XNODE* xcomps = node( wxT( "components" ) );
80 
81  wxString timeStamp;
82 
83  // some strings we need many times, but don't want to construct more
84  // than once for performance. These are used within loops so the
85  // enclosing wxString constructor would fire on each loop iteration if
86  // they were in a nested scope.
87 
88  // these are actually constructor invocations, not assignments as it appears:
89  wxString sFields = wxT( "fields" );
90  wxString sField = wxT( "field" );
91  wxString sComponent = wxT( "comp" ); // use "part" ?
92  wxString sName = wxT( "name" );
93  wxString sRef = wxT( "ref" );
94  wxString sPins = wxT( "pins" );
95  wxString sPin = wxT( "pin" );
96  wxString sValue = wxT( "value" );
97  wxString sSheetPath = wxT( "sheetpath" );
98  wxString sFootprint = wxT( "footprint" );
99  wxString sDatasheet = wxT( "datasheet" );
100  wxString sTStamp = wxT( "tstamp" );
101  wxString sTStamps = wxT( "tstamps" );
102  wxString sTSFmt = wxT( "%8.8lX" ); // comp->m_TimeStamp
103  wxString sLibSource = wxT( "libsource" );
104  wxString sLibPart = wxT( "libpart" );
105  wxString sLib = wxT( "lib" );
106  wxString sPart = wxT( "part" );
107  wxString sNames = wxT( "names" );
108 
110 
111  SCH_SHEET_LIST sheetList( g_RootSheet );
112 
113  // Output is xml, so there is no reason to remove spaces from the field values.
114  // And XML element names need not be translated to various languages.
115 
116  for( unsigned i = 0; i < sheetList.size(); i++ )
117  {
118  for( EDA_ITEM* schItem = sheetList[i].LastDrawList(); schItem; schItem = schItem->Next() )
119  {
120  SCH_COMPONENT* comp = findNextComponentAndCreatePinList( schItem, &sheetList[i] );
121  if( !comp )
122  break; // No component left
123 
124  schItem = comp;
125 
126  XNODE* xcomp; // current component being constructed
127 
128  // Output the component's elements in order of expected access frequency.
129  // This may not always look best, but it will allow faster execution
130  // under XSL processing systems which do sequential searching within
131  // an element.
132 
133  xcomps->AddChild( xcomp = node( sComponent ) );
134  xcomp->AddAttribute( sRef, comp->GetRef( &sheetList[i] ) );
135 
136  xcomp->AddChild( node( sValue, comp->GetField( VALUE )->GetText() ) );
137 
138  if( !comp->GetField( FOOTPRINT )->IsVoid() )
139  xcomp->AddChild( node( sFootprint, comp->GetField( FOOTPRINT )->GetText() ) );
140 
141  if( !comp->GetField( DATASHEET )->IsVoid() )
142  xcomp->AddChild( node( sDatasheet, comp->GetField( DATASHEET )->GetText() ) );
143 
144  // Export all user defined fields within the component,
145  // which start at field index MANDATORY_FIELDS. Only output the <fields>
146  // container element if there are any <field>s.
147  if( comp->GetFieldCount() > MANDATORY_FIELDS )
148  {
149  XNODE* xfields;
150  xcomp->AddChild( xfields = node( sFields ) );
151 
152  for( int fldNdx = MANDATORY_FIELDS; fldNdx < comp->GetFieldCount(); ++fldNdx )
153  {
154  SCH_FIELD* f = comp->GetField( fldNdx );
155 
156  // only output a field if non empty and not just "~"
157  if( !f->IsVoid() )
158  {
159  XNODE* xfield;
160  xfields->AddChild( xfield = node( sField, f->GetText() ) );
161  xfield->AddAttribute( sName, f->GetName() );
162  }
163  }
164  }
165 
166  XNODE* xlibsource;
167  xcomp->AddChild( xlibsource = node( sLibSource ) );
168 
169  // "logical" library name, which is in anticipation of a better search
170  // algorithm for parts based on "logical_lib.part" and where logical_lib
171  // is merely the library name minus path and extension.
172  LIB_PART* part = m_libs->FindLibPart( comp->GetLibId() );
173  if( part )
174  xlibsource->AddAttribute( sLib, part->GetLib()->GetLogicalName() );
175 
176  // We only want the symbol name, not the full LIB_ID.
177  xlibsource->AddAttribute( sPart, comp->GetLibId().GetLibItemName() );
178 
179  XNODE* xsheetpath;
180 
181  xcomp->AddChild( xsheetpath = node( sSheetPath ) );
182  xsheetpath->AddAttribute( sNames, sheetList[i].PathHumanReadable() );
183  xsheetpath->AddAttribute( sTStamps, sheetList[i].Path() );
184 
185  timeStamp.Printf( sTSFmt, (unsigned long)comp->GetTimeStamp() );
186  xcomp->AddChild( node( sTStamp, timeStamp ) );
187  }
188  }
189 
190  return xcomps;
191 }
192 
193 
195 {
196  SCH_SCREEN* screen;
197  XNODE* xdesign = node( wxT( "design" ) );
198  XNODE* xtitleBlock;
199  XNODE* xsheet;
200  XNODE* xcomment;
201  wxString sheetTxt;
202  wxFileName sourceFileName;
203 
204  // the root sheet is a special sheet, call it source
205  xdesign->AddChild( node( wxT( "source" ), g_RootSheet->GetScreen()->GetFileName() ) );
206 
207  xdesign->AddChild( node( wxT( "date" ), DateAndTime() ) );
208 
209  // which Eeschema tool
210  xdesign->AddChild( node( wxT( "tool" ), wxT( "Eeschema " ) + GetBuildVersion() ) );
211 
212  /*
213  Export the sheets information
214  */
215  SCH_SHEET_LIST sheetList( g_RootSheet );
216 
217  for( unsigned i = 0; i < sheetList.size(); i++ )
218  {
219  screen = sheetList[i].LastScreen();
220 
221  xdesign->AddChild( xsheet = node( wxT( "sheet" ) ) );
222 
223  // get the string representation of the sheet index number.
224  // Note that sheet->GetIndex() is zero index base and we need to increment the
225  // number by one to make it human readable
226  sheetTxt.Printf( wxT( "%u" ), i + 1 );
227  xsheet->AddAttribute( wxT( "number" ), sheetTxt );
228  xsheet->AddAttribute( wxT( "name" ), sheetList[i].PathHumanReadable() );
229  xsheet->AddAttribute( wxT( "tstamps" ), sheetList[i].Path() );
230 
231 
232  TITLE_BLOCK tb = screen->GetTitleBlock();
233 
234  xsheet->AddChild( xtitleBlock = node( wxT( "title_block" ) ) );
235 
236  xtitleBlock->AddChild( node( wxT( "title" ), tb.GetTitle() ) );
237  xtitleBlock->AddChild( node( wxT( "company" ), tb.GetCompany() ) );
238  xtitleBlock->AddChild( node( wxT( "rev" ), tb.GetRevision() ) );
239  xtitleBlock->AddChild( node( wxT( "date" ), tb.GetDate() ) );
240 
241  // We are going to remove the fileName directories.
242  sourceFileName = wxFileName( screen->GetFileName() );
243  xtitleBlock->AddChild( node( wxT( "source" ), sourceFileName.GetFullName() ) );
244 
245  xtitleBlock->AddChild( xcomment = node( wxT( "comment" ) ) );
246  xcomment->AddAttribute( wxT("number"), wxT("1") );
247  xcomment->AddAttribute( wxT( "value" ), tb.GetComment1() );
248 
249  xtitleBlock->AddChild( xcomment = node( wxT( "comment" ) ) );
250  xcomment->AddAttribute( wxT("number"), wxT("2") );
251  xcomment->AddAttribute( wxT( "value" ), tb.GetComment2() );
252 
253  xtitleBlock->AddChild( xcomment = node( wxT( "comment" ) ) );
254  xcomment->AddAttribute( wxT("number"), wxT("3") );
255  xcomment->AddAttribute( wxT( "value" ), tb.GetComment3() );
256 
257  xtitleBlock->AddChild( xcomment = node( wxT( "comment" ) ) );
258  xcomment->AddAttribute( wxT("number"), wxT("4") );
259  xcomment->AddAttribute( wxT( "value" ), tb.GetComment4() );
260  }
261 
262  return xdesign;
263 }
264 
265 
267 {
268  XNODE* xlibs = node( wxT( "libraries" ) ); // auto_ptr
269 
270  for( std::set<void*>::iterator it = m_Libraries.begin(); it!=m_Libraries.end(); ++it )
271  {
272  PART_LIB* lib = (PART_LIB*) *it;
273  XNODE* xlibrary;
274 
275  xlibs->AddChild( xlibrary = node( wxT( "library" ) ) );
276  xlibrary->AddAttribute( wxT( "logical" ), lib->GetLogicalName() );
277  xlibrary->AddChild( node( wxT( "uri" ), lib->GetFullFileName() ) );
278 
279  // @todo: add more fun stuff here
280  }
281 
282  return xlibs;
283 }
284 
285 
287 {
288  XNODE* xlibparts = node( wxT( "libparts" ) ); // auto_ptr
289  wxString sLibpart = wxT( "libpart" );
290  wxString sLib = wxT( "lib" );
291  wxString sPart = wxT( "part" );
292  wxString sAliases = wxT( "aliases" );
293  wxString sAlias = wxT( "alias" );
294  wxString sPins = wxT( "pins" ); // key for library component pins list
295  wxString sPin = wxT( "pin" ); // key for one library component pin descr
296  wxString sPinNum = wxT( "num" ); // key for one library component pin num
297  wxString sPinName = wxT( "name" ); // key for one library component pin name
298  wxString sPinType = wxT( "type" ); // key for one library component pin electrical type
299  wxString sName = wxT( "name" );
300  wxString sField = wxT( "field" );
301  wxString sFields = wxT( "fields" );
302  wxString sDescr = wxT( "description" );
303  wxString sDocs = wxT( "docs" );
304  wxString sFprints = wxT( "footprints" );
305  wxString sFp = wxT( "fp" );
306 
307  LIB_PINS pinList;
308  LIB_FIELDS fieldList;
309 
310  m_Libraries.clear();
311 
312  for( std::set<LIB_PART*>::iterator it = m_LibParts.begin(); it!=m_LibParts.end(); ++it )
313  {
314  LIB_PART* lcomp = *it;
315  PART_LIB* library = lcomp->GetLib();
316 
317  m_Libraries.insert( library ); // inserts component's library if unique
318 
319  XNODE* xlibpart;
320  xlibparts->AddChild( xlibpart = node( sLibpart ) );
321  xlibpart->AddAttribute( sLib, library->GetLogicalName() );
322  xlibpart->AddAttribute( sPart, lcomp->GetName() );
323 
324  if( lcomp->GetAliasCount() )
325  {
326  wxArrayString aliases = lcomp->GetAliasNames( false );
327  if( aliases.GetCount() )
328  {
329  XNODE* xaliases = node( sAliases );
330  xlibpart->AddChild( xaliases );
331  for( unsigned i=0; i<aliases.GetCount(); ++i )
332  {
333  xaliases->AddChild( node( sAlias, aliases[i] ) );
334  }
335  }
336  }
337 
338  //----- show the important properties -------------------------
339  if( !lcomp->GetAlias( 0 )->GetDescription().IsEmpty() )
340  xlibpart->AddChild( node( sDescr, lcomp->GetAlias( 0 )->GetDescription() ) );
341 
342  if( !lcomp->GetAlias( 0 )->GetDocFileName().IsEmpty() )
343  xlibpart->AddChild( node( sDocs, lcomp->GetAlias( 0 )->GetDocFileName() ) );
344 
345  // Write the footprint list
346  if( lcomp->GetFootPrints().GetCount() )
347  {
348  XNODE* xfootprints;
349  xlibpart->AddChild( xfootprints = node( sFprints ) );
350 
351  for( unsigned i=0; i<lcomp->GetFootPrints().GetCount(); ++i )
352  {
353  xfootprints->AddChild( node( sFp, lcomp->GetFootPrints()[i] ) );
354  }
355  }
356 
357  //----- show the fields here ----------------------------------
358  fieldList.clear();
359  lcomp->GetFields( fieldList );
360 
361  XNODE* xfields;
362  xlibpart->AddChild( xfields = node( sFields ) );
363 
364  for( unsigned i=0; i<fieldList.size(); ++i )
365  {
366  if( !fieldList[i].GetText().IsEmpty() )
367  {
368  XNODE* xfield;
369  xfields->AddChild( xfield = node( sField, fieldList[i].GetText() ) );
370  xfield->AddAttribute( sName, fieldList[i].GetName(false) );
371  }
372  }
373 
374  //----- show the pins here ------------------------------------
375  pinList.clear();
376  lcomp->GetPins( pinList, 0, 0 );
377 
378  /* we must erase redundant Pins references in pinList
379  * These redundant pins exist because some pins
380  * are found more than one time when a component has
381  * multiple parts per package or has 2 representations (DeMorgan conversion)
382  * For instance, a 74ls00 has DeMorgan conversion, with different pin shapes,
383  * and therefore each pin appears 2 times in the list.
384  * Common pins (VCC, GND) can also be found more than once.
385  */
386  sort( pinList.begin(), pinList.end(), sortPinsByNumber );
387  for( int ii = 0; ii < (int)pinList.size()-1; ii++ )
388  {
389  if( pinList[ii]->GetNumber() == pinList[ii+1]->GetNumber() )
390  { // 2 pins have the same number, remove the redundant pin at index i+1
391  pinList.erase(pinList.begin() + ii + 1);
392  ii--;
393  }
394  }
395 
396  if( pinList.size() )
397  {
398  XNODE* pins;
399 
400  xlibpart->AddChild( pins = node( sPins ) );
401  for( unsigned i=0; i<pinList.size(); ++i )
402  {
403  XNODE* pin;
404 
405  pins->AddChild( pin = node( sPin ) );
406  pin->AddAttribute( sPinNum, pinList[i]->GetNumberString() );
407  pin->AddAttribute( sPinName, pinList[i]->GetName() );
408  pin->AddAttribute( sPinType, pinList[i]->GetCanonicalElectricalTypeName() );
409 
410  // caution: construction work site here, drive slowly
411  }
412  }
413  }
414 
415  return xlibparts;
416 }
417 
418 
420 {
421  XNODE* xnets = node( wxT( "nets" ) ); // auto_ptr if exceptions ever get used.
422  wxString netCodeTxt;
423  wxString netName;
424  wxString ref;
425 
426  wxString sNet = wxT( "net" );
427  wxString sName = wxT( "name" );
428  wxString sCode = wxT( "code" );
429  wxString sRef = wxT( "ref" );
430  wxString sPin = wxT( "pin" );
431  wxString sNode = wxT( "node" );
432  wxString sFmtd = wxT( "%d" );
433 
434  XNODE* xnet = 0;
435  int netCode;
436  int lastNetCode = -1;
437  int sameNetcodeCount = 0;
438 
439 
440  /* output:
441  <net code="123" name="/cfcard.sch/WAIT#">
442  <node ref="R23" pin="1"/>
443  <node ref="U18" pin="12"/>
444  </net>
445  */
446 
447  m_LibParts.clear(); // must call this function before using m_LibParts.
448 
449  for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
450  {
451  NETLIST_OBJECT* nitem = m_masterList->GetItem( ii );
452  SCH_COMPONENT* comp;
453 
454  // New net found, write net id;
455  if( ( netCode = nitem->GetNet() ) != lastNetCode )
456  {
457  sameNetcodeCount = 0; // item count for this net
458  netName = nitem->GetNetName();
459  lastNetCode = netCode;
460  }
461 
462  if( nitem->m_Type != NET_PIN )
463  continue;
464 
465  if( nitem->m_Flag != 0 ) // Redundant pin, skip it
466  continue;
467 
468  comp = nitem->GetComponentParent();
469 
470  // Get the reference for the net name and the main parent component
471  ref = comp->GetRef( &nitem->m_SheetPath );
472  if( ref[0] == wxChar( '#' ) )
473  continue;
474 
475  if( ++sameNetcodeCount == 1 )
476  {
477  xnets->AddChild( xnet = node( sNet ) );
478  netCodeTxt.Printf( sFmtd, netCode );
479  xnet->AddAttribute( sCode, netCodeTxt );
480  xnet->AddAttribute( sName, netName );
481  }
482 
483  XNODE* xnode;
484  xnet->AddChild( xnode = node( sNode ) );
485  xnode->AddAttribute( sRef, ref );
486  xnode->AddAttribute( sPin, nitem->GetPinNumText() );
487  }
488 
489  return xnets;
490 }
491 
492 
493 XNODE* NETLIST_EXPORTER_GENERIC::node( const wxString& aName, const wxString& aTextualContent /* = wxEmptyString*/ )
494 {
495  XNODE* n = new XNODE( wxXML_ELEMENT_NODE, aName );
496 
497  if( aTextualContent.Len() > 0 ) // excludes wxEmptyString, the parameter's default value
498  n->AddChild( new XNODE( wxXML_TEXT_NODE, wxEmptyString, aTextualContent ) );
499 
500  return n;
501 }
502 
503 
504 static bool sortPinsByNumber( LIB_PIN* aPin1, LIB_PIN* aPin2 )
505 {
506  // return "lhs < rhs"
507  return RefDesStringCompare( aPin1->GetNumberString(), aPin2->GetNumberString() ) < 0;
508 }
PART_LIB * GetLib()
Class SCH_SHEET_LIST.
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions) override
Function WriteNetlist writes to specified output file.
int RefDesStringCompare(const wxString &strFWord, const wxString &strSWord)
Function RefDesStringCompare acts just like the strcmp function but treats numbers within the string ...
Definition: string.cpp:365
Class SCH_FIELD instances are attached to a component and provide a place for the component's value...
Definition: sch_field.h:56
wxString GetNetName(bool adoptTimestamp=false) const
Function GetNetName.
wxString GetName(bool aUseDefaultName=true) const
Function GetName returns the field name.
Definition: sch_field.cpp:473
name of datasheet
XNODE * makeComponents()
Function makeComponents.
UNIQUE_STRINGS m_ReferencesAlreadyFound
Used for "multi parts per package" components, avoids processing a lib component more than once...
XNODE * node(const wxString &aName, const wxString &aTextualContent=wxEmptyString)
Function node is a convenience function that creates a new XNODE with an optional textual child...
LIB_ALIAS * GetAlias(size_t aIndex)
const wxString & GetCompany() const
NETLIST_OBJECT * GetItem(unsigned aIdx) const
Acces to an item in list.
wxString GetFullFileName()
Function GetFullFileName returns the full file library name with path and extension.
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors...
const wxString & GetFileName() const
const wxString GetLogicalName()
Function GetLogicalName returns the logical name of the library.
bool IsVoid() const
Function IsVoid returns true if the field is either empty or holds "~".
Definition: sch_field.h:116
const wxString & GetComment4() const
const wxString & GetDate() const
SCH_SHEET_PATH m_SheetPath
void Clear()
Function Clear erases the record.
wxString GetPinNumText()
Function GetPinNum returns a pin number in wxString form.
size_t GetAliasCount() const
NETLIST_ITEM_T m_Type
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:286
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
NETLIST_OBJECT_LIST * m_masterList
Field Name Module PCB, i.e. "16DIP300".
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
XNODE * makeRoot(int aCtl=GNL_ALL)
Function makeGenericRoot builds the entire document tree for the generic export.
std::set< LIB_PART *, LIB_PART_LESS_THAN > m_LibParts
unique library parts used. LIB_PART items are sorted by names
const wxString & GetTitle() const
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:54
SCH_FIELD * GetField(int aFieldNdx) const
Function GetField returns a field.
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
const wxString & GetName() const
const UTF8 & GetLibItemName() const
Function GetLibItemName.
Definition: lib_id.h:129
const wxString & GetRevision() const
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:130
XNODE * makeDesignHeader()
Function makeDesignHeader fills out a project "design" header into an XML node.
wxString GetDescription() const
Class LIB_PART defines a library part object.
SCH_COMPONENT * findNextComponentAndCreatePinList(EDA_ITEM *aItem, SCH_SHEET_PATH *aSheetPath)
Function findNextComponentAndCreatePinList finds a component from the DrawList and builds its pin lis...
LIB_PART * FindLibPart(const LIB_ID &aLibId, const wxString &aLibraryName=wxEmptyString)
Function FindLibPart searches all libraries in the list for a part.
const wxString & GetComment3() const
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
std::set< void * > m_Libraries
unique libraries used
SCH_COMPONENT * GetComponentParent() const
For Pins (NET_PINS):
const TITLE_BLOCK & GetTitleBlock() const
const wxString & GetComment2() const
time_t GetTimeStamp() const
Definition: base_struct.h:204
Class XNODE holds an XML or S-expression element.
Definition: xnode.h:43
Field Value of part, i.e. "3.3K".
wxString GetDocFileName() const
const wxString GetRef(const SCH_SHEET_PATH *sheet)
Function GetRef returns the reference, for the given sheet path.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:70
const wxString & GetComment1() const
int GetFieldCount() const
Function GetFieldCount returns the number of fields in this component.
std::vector< LIB_FIELD > LIB_FIELDS
Definition: lib_field.h:261
wxArrayString GetAliasNames(bool aIncludeRoot=true) const
#define GNL_ALL
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:68
const LIB_ID & GetLibId() const
wxArrayString & GetFootPrints()
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
XNODE * makeLibraries()
Function makeLibraries fills out an XML node with a list of used libraries and returns it...
PART_LIBS * m_libs
yes ownership, connected items flat list
Definition for part library class.
static bool sortPinsByNumber(LIB_PIN *aPin1, LIB_PIN *aPin2)
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
static unsigned long timeStamp(CPTREE &aTree)
Make a unique time stamp.
XNODE * makeListOfNets()
Function makeListOfNets fills out an XML node with a list of nets and returns it. ...
wxString DateAndTime()
Function DateAndTime.
Definition: string.cpp:229
void GetFields(LIB_FIELDS &aList)
Function GetFields returns a list of fields withing this part.
XNODE * makeLibParts()
Function makeLibParts fills out an XML node with the unique library parts and returns it...
wxString GetNumberString() const
Definition: lib_pin.h:175