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-2017 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 
27 
28 #include <build_version.h>
29 #include <refdes_utils.h>
30 
31 #include <class_library.h>
32 #include <sch_base_frame.h>
33 #include <symbol_lib_table.h>
34 
35 
36 static bool sortPinsByNumber( LIB_PIN* aPin1, LIB_PIN* aPin2 );
37 
38 bool NETLIST_EXPORTER_GENERIC::WriteNetlist( const wxString& aOutFileName, unsigned aNetlistOptions )
39 {
40  // Prepare list of nets generation
41  for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
42  m_masterList->GetItem( ii )->m_Flag = 0;
43 
44  // output the XML format netlist.
45  wxXmlDocument xdoc;
46 
47  xdoc.SetRoot( makeRoot( GNL_ALL ) );
48 
49  return xdoc.Save( aOutFileName, 2 /* indent bug, today was ignored by wxXml lib */ );
50 }
51 
52 
54 {
55  XNODE* xroot = node( "export" );
56 
57  xroot->AddAttribute( "version", "D" );
58 
59  if( aCtl & GNL_HEADER )
60  // add the "design" header
61  xroot->AddChild( makeDesignHeader() );
62 
63  if( aCtl & GNL_COMPONENTS )
64  xroot->AddChild( makeComponents() );
65 
66  if( aCtl & GNL_PARTS )
67  xroot->AddChild( makeLibParts() );
68 
69  if( aCtl & GNL_LIBRARIES )
70  // must follow makeGenericLibParts()
71  xroot->AddChild( makeLibraries() );
72 
73  if( aCtl & GNL_NETS )
74  xroot->AddChild( makeListOfNets() );
75 
76  return xroot;
77 }
78 
79 
82 {
83  wxString value;
84  wxString datasheet;
85  wxString footprint;
86 
87  std::map< wxString, wxString > f;
88 };
89 
90 
92 {
93  COMP_FIELDS fields;
94 
95  if( comp->GetUnitCount() > 1 )
96  {
97  // Sadly, each unit of a component can have its own unique fields. This
98  // block finds the unit with the lowest number having a non blank field
99  // value and records it. Therefore user is best off setting fields
100  // into only the first unit. But this scavenger algorithm will find
101  // any non blank fields in all units and use the first non-blank field
102  // for each unique field name.
103 
104  wxString ref = comp->GetRef( aSheet );
105 
106  SCH_SHEET_LIST sheetList( g_RootSheet );
107  int minUnit = comp->GetUnit();
108 
109  for( unsigned i = 0; i < sheetList.size(); i++ )
110  {
111  for( EDA_ITEM* item = sheetList[i].LastDrawList(); item; item = item->Next() )
112  {
113  if( item->Type() != SCH_COMPONENT_T )
114  continue;
115 
116  SCH_COMPONENT* comp2 = (SCH_COMPONENT*) item;
117 
118  wxString ref2 = comp2->GetRef( &sheetList[i] );
119 
120  if( ref2.CmpNoCase( ref ) != 0 )
121  continue;
122 
123  int unit = comp2->GetUnit();
124 
125  // The lowest unit number wins. User should only set fields in any one unit.
126  // remark: IsVoid() returns true for empty strings or the "~" string (empty field value)
127  if( !comp2->GetField( VALUE )->IsVoid()
128  && ( unit < minUnit || fields.value.IsEmpty() ) )
129  fields.value = comp2->GetField( VALUE )->GetText();
130 
131  if( !comp2->GetField( FOOTPRINT )->IsVoid()
132  && ( unit < minUnit || fields.footprint.IsEmpty() ) )
133  fields.footprint = comp2->GetField( FOOTPRINT )->GetText();
134 
135  if( !comp2->GetField( DATASHEET )->IsVoid()
136  && ( unit < minUnit || fields.datasheet.IsEmpty() ) )
137  fields.datasheet = comp2->GetField( DATASHEET )->GetText();
138 
139  for( int fldNdx = MANDATORY_FIELDS; fldNdx < comp2->GetFieldCount(); ++fldNdx )
140  {
141  SCH_FIELD* f = comp2->GetField( fldNdx );
142 
143  if( f->GetText().size()
144  && ( unit < minUnit || fields.f.count( f->GetName() ) == 0 ) )
145  {
146  fields.f[ f->GetName() ] = f->GetText();
147  }
148  }
149 
150  minUnit = std::min( unit, minUnit );
151  }
152  }
153 
154  }
155  else
156  {
157  fields.value = comp->GetField( VALUE )->GetText();
158  fields.footprint = comp->GetField( FOOTPRINT )->GetText();
159  fields.datasheet = comp->GetField( DATASHEET )->GetText();
160 
161  for( int fldNdx = MANDATORY_FIELDS; fldNdx < comp->GetFieldCount(); ++fldNdx )
162  {
163  SCH_FIELD* f = comp->GetField( fldNdx );
164 
165  if( f->GetText().size() )
166  fields.f[ f->GetName() ] = f->GetText();
167  }
168  }
169 
170  // Do not output field values blank in netlist:
171  if( fields.value.size() )
172  xcomp->AddChild( node( "value", fields.value ) );
173  else // value field always written in netlist
174  xcomp->AddChild( node( "value", "~" ) );
175 
176  if( fields.footprint.size() )
177  xcomp->AddChild( node( "footprint", fields.footprint ) );
178 
179  if( fields.datasheet.size() )
180  xcomp->AddChild( node( "datasheet", fields.datasheet ) );
181 
182  if( fields.f.size() )
183  {
184  XNODE* xfields;
185  xcomp->AddChild( xfields = node( "fields" ) );
186 
187  // non MANDATORY fields are output alphabetically
188  for( std::map< wxString, wxString >::const_iterator it = fields.f.begin();
189  it != fields.f.end(); ++it )
190  {
191  XNODE* xfield;
192  xfields->AddChild( xfield = node( "field", it->second ) );
193  xfield->AddAttribute( "name", it->first );
194  }
195  }
196 
197 }
198 
199 
201 {
202  XNODE* xcomps = node( "components" );
203 
204  wxString timeStamp;
205 
207 
208  SCH_SHEET_LIST sheetList( g_RootSheet );
209 
210  // Output is xml, so there is no reason to remove spaces from the field values.
211  // And XML element names need not be translated to various languages.
212 
213  for( unsigned i = 0; i < sheetList.size(); i++ )
214  {
215  for( EDA_ITEM* schItem = sheetList[i].LastDrawList(); schItem; schItem = schItem->Next() )
216  {
217  SCH_COMPONENT* comp = findNextComponent( schItem, &sheetList[i] );
218 
219  if( !comp )
220  break; // No component left
221 
222  schItem = comp;
223 
224  XNODE* xcomp; // current component being constructed
225 
226  // Output the component's elements in order of expected access frequency.
227  // This may not always look best, but it will allow faster execution
228  // under XSL processing systems which do sequential searching within
229  // an element.
230 
231  xcomps->AddChild( xcomp = node( "comp" ) );
232  xcomp->AddAttribute( "ref", comp->GetRef( &sheetList[i] ) );
233 
234  addComponentFields( xcomp, comp, &sheetList[i] );
235 
236  XNODE* xlibsource;
237  xcomp->AddChild( xlibsource = node( "libsource" ) );
238 
239  // "logical" library name, which is in anticipation of a better search
240  // algorithm for parts based on "logical_lib.part" and where logical_lib
241  // is merely the library name minus path and extension.
242  PART_SPTR part = comp->GetPartRef().lock();
243 
244  if( part )
245  xlibsource->AddAttribute( "lib", part->GetLibId().GetLibNickname() );
246 
247  // We only want the symbol name, not the full LIB_ID.
248  xlibsource->AddAttribute( "part", comp->GetLibId().GetLibItemName() );
249 
250  xlibsource->AddAttribute( "description", comp->GetDescription() );
251 
252  XNODE* xsheetpath;
253 
254  xcomp->AddChild( xsheetpath = node( "sheetpath" ) );
255  xsheetpath->AddAttribute( "names", sheetList[i].PathHumanReadable() );
256  xsheetpath->AddAttribute( "tstamps", sheetList[i].Path() );
257 
258  timeStamp.Printf( "%8.8lX", (unsigned long)comp->GetTimeStamp() );
259  xcomp->AddChild( node( "tstamp", timeStamp ) );
260  }
261  }
262 
263  return xcomps;
264 }
265 
266 
268 {
269  SCH_SCREEN* screen;
270  XNODE* xdesign = node( "design" );
271  XNODE* xtitleBlock;
272  XNODE* xsheet;
273  XNODE* xcomment;
274  wxString sheetTxt;
275  wxFileName sourceFileName;
276 
277  // the root sheet is a special sheet, call it source
278  xdesign->AddChild( node( "source", g_RootSheet->GetScreen()->GetFileName() ) );
279 
280  xdesign->AddChild( node( "date", DateAndTime() ) );
281 
282  // which Eeschema tool
283  xdesign->AddChild( node( "tool", wxString( "Eeschema " ) + GetBuildVersion() ) );
284 
285  /*
286  Export the sheets information
287  */
288  SCH_SHEET_LIST sheetList( g_RootSheet );
289 
290  for( unsigned i = 0; i < sheetList.size(); i++ )
291  {
292  screen = sheetList[i].LastScreen();
293 
294  xdesign->AddChild( xsheet = node( "sheet" ) );
295 
296  // get the string representation of the sheet index number.
297  // Note that sheet->GetIndex() is zero index base and we need to increment the
298  // number by one to make it human readable
299  sheetTxt.Printf( "%u", i + 1 );
300  xsheet->AddAttribute( "number", sheetTxt );
301  xsheet->AddAttribute( "name", sheetList[i].PathHumanReadable() );
302  xsheet->AddAttribute( "tstamps", sheetList[i].Path() );
303 
304 
305  TITLE_BLOCK tb = screen->GetTitleBlock();
306 
307  xsheet->AddChild( xtitleBlock = node( "title_block" ) );
308 
309  xtitleBlock->AddChild( node( "title", tb.GetTitle() ) );
310  xtitleBlock->AddChild( node( "company", tb.GetCompany() ) );
311  xtitleBlock->AddChild( node( "rev", tb.GetRevision() ) );
312  xtitleBlock->AddChild( node( "date", tb.GetDate() ) );
313 
314  // We are going to remove the fileName directories.
315  sourceFileName = wxFileName( screen->GetFileName() );
316  xtitleBlock->AddChild( node( "source", sourceFileName.GetFullName() ) );
317 
318  xtitleBlock->AddChild( xcomment = node( "comment" ) );
319  xcomment->AddAttribute( "number", "1" );
320  xcomment->AddAttribute( "value", tb.GetComment1() );
321 
322  xtitleBlock->AddChild( xcomment = node( "comment" ) );
323  xcomment->AddAttribute( "number", "2" );
324  xcomment->AddAttribute( "value", tb.GetComment2() );
325 
326  xtitleBlock->AddChild( xcomment = node( "comment" ) );
327  xcomment->AddAttribute( "number", "3" );
328  xcomment->AddAttribute( "value", tb.GetComment3() );
329 
330  xtitleBlock->AddChild( xcomment = node( "comment" ) );
331  xcomment->AddAttribute( "number", "4" );
332  xcomment->AddAttribute( "value", tb.GetComment4() );
333  }
334 
335  return xdesign;
336 }
337 
338 
340 {
341  XNODE* xlibs = node( "libraries" ); // auto_ptr
342 
343  for( std::set<wxString>::iterator it = m_libraries.begin(); it!=m_libraries.end(); ++it )
344  {
345  wxString libNickname = *it;
346  XNODE* xlibrary;
347 
348  if( m_libTable->HasLibrary( libNickname ) )
349  {
350  xlibs->AddChild( xlibrary = node( "library" ) );
351  xlibrary->AddAttribute( "logical", libNickname );
352  xlibrary->AddChild( node( "uri", m_libTable->GetFullURI( libNickname ) ) );
353  }
354 
355  // @todo: add more fun stuff here
356  }
357 
358  return xlibs;
359 }
360 
361 
363 {
364  XNODE* xlibparts = node( "libparts" ); // auto_ptr
365 
366  LIB_PINS pinList;
367  LIB_FIELDS fieldList;
368 
369  m_libraries.clear();
370 
371  for( std::set<LIB_PART*>::iterator it = m_LibParts.begin(); it!=m_LibParts.end(); ++it )
372  {
373  LIB_PART* lcomp = *it;
374  wxString libNickname = lcomp->GetLibId().GetLibNickname();;
375 
376  // The library nickname will be empty if the cache library is used.
377  if( !libNickname.IsEmpty() )
378  m_libraries.insert( libNickname ); // inserts component's library if unique
379 
380  XNODE* xlibpart;
381  xlibparts->AddChild( xlibpart = node( "libpart" ) );
382  xlibpart->AddAttribute( "lib", libNickname );
383  xlibpart->AddAttribute( "part", lcomp->GetName() );
384 
385  if( lcomp->GetAliasCount() )
386  {
387  wxArrayString aliases = lcomp->GetAliasNames( false );
388  if( aliases.GetCount() )
389  {
390  XNODE* xaliases = node( "aliases" );
391  xlibpart->AddChild( xaliases );
392  for( unsigned i=0; i<aliases.GetCount(); ++i )
393  {
394  xaliases->AddChild( node( "alias", aliases[i] ) );
395  }
396  }
397  }
398 
399  //----- show the important properties -------------------------
400  if( !lcomp->GetAlias( 0 )->GetDescription().IsEmpty() )
401  xlibpart->AddChild( node( "description", lcomp->GetAlias( 0 )->GetDescription() ) );
402 
403  if( !lcomp->GetAlias( 0 )->GetDocFileName().IsEmpty() )
404  xlibpart->AddChild( node( "docs", lcomp->GetAlias( 0 )->GetDocFileName() ) );
405 
406  // Write the footprint list
407  if( lcomp->GetFootprints().GetCount() )
408  {
409  XNODE* xfootprints;
410  xlibpart->AddChild( xfootprints = node( "footprints" ) );
411 
412  for( unsigned i=0; i<lcomp->GetFootprints().GetCount(); ++i )
413  {
414  xfootprints->AddChild( node( "fp", lcomp->GetFootprints()[i] ) );
415  }
416  }
417 
418  //----- show the fields here ----------------------------------
419  fieldList.clear();
420  lcomp->GetFields( fieldList );
421 
422  XNODE* xfields;
423  xlibpart->AddChild( xfields = node( "fields" ) );
424 
425  for( unsigned i=0; i<fieldList.size(); ++i )
426  {
427  if( !fieldList[i].GetText().IsEmpty() )
428  {
429  XNODE* xfield;
430  xfields->AddChild( xfield = node( "field", fieldList[i].GetText() ) );
431  xfield->AddAttribute( "name", fieldList[i].GetName(false) );
432  }
433  }
434 
435  //----- show the pins here ------------------------------------
436  pinList.clear();
437  lcomp->GetPins( pinList, 0, 0 );
438 
439  /* we must erase redundant Pins references in pinList
440  * These redundant pins exist because some pins
441  * are found more than one time when a component has
442  * multiple parts per package or has 2 representations (DeMorgan conversion)
443  * For instance, a 74ls00 has DeMorgan conversion, with different pin shapes,
444  * and therefore each pin appears 2 times in the list.
445  * Common pins (VCC, GND) can also be found more than once.
446  */
447  sort( pinList.begin(), pinList.end(), sortPinsByNumber );
448  for( int ii = 0; ii < (int)pinList.size()-1; ii++ )
449  {
450  if( pinList[ii]->GetNumber() == pinList[ii+1]->GetNumber() )
451  { // 2 pins have the same number, remove the redundant pin at index i+1
452  pinList.erase(pinList.begin() + ii + 1);
453  ii--;
454  }
455  }
456 
457  if( pinList.size() )
458  {
459  XNODE* pins;
460 
461  xlibpart->AddChild( pins = node( "pins" ) );
462  for( unsigned i=0; i<pinList.size(); ++i )
463  {
464  XNODE* pin;
465 
466  pins->AddChild( pin = node( "pin" ) );
467  pin->AddAttribute( "num", pinList[i]->GetNumber() );
468  pin->AddAttribute( "name", pinList[i]->GetName() );
469  pin->AddAttribute( "type", pinList[i]->GetCanonicalElectricalTypeName() );
470 
471  // caution: construction work site here, drive slowly
472  }
473  }
474  }
475 
476  return xlibparts;
477 }
478 
479 
481 {
482  XNODE* xnets = node( "nets" ); // auto_ptr if exceptions ever get used.
483  wxString netCodeTxt;
484  wxString netName;
485  wxString ref;
486 
487  XNODE* xnet = 0;
488  int netCode;
489  int lastNetCode = -1;
490  int sameNetcodeCount = 0;
491 
492 
493  /* output:
494  <net code="123" name="/cfcard.sch/WAIT#">
495  <node ref="R23" pin="1"/>
496  <node ref="U18" pin="12"/>
497  </net>
498  */
499 
500  m_LibParts.clear(); // must call this function before using m_LibParts.
501 
502  for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
503  {
504  NETLIST_OBJECT* nitem = m_masterList->GetItem( ii );
505  SCH_COMPONENT* comp;
506 
507  // New net found, write net id;
508  if( ( netCode = nitem->GetNet() ) != lastNetCode )
509  {
510  sameNetcodeCount = 0; // item count for this net
511  netName = nitem->GetNetName();
512  lastNetCode = netCode;
513  }
514 
515  if( nitem->m_Type != NET_PIN )
516  continue;
517 
518  if( nitem->m_Flag != 0 ) // Redundant pin, skip it
519  continue;
520 
521  comp = nitem->GetComponentParent();
522 
523  // Get the reference for the net name and the main parent component
524  ref = comp->GetRef( &nitem->m_SheetPath );
525  if( ref[0] == wxChar( '#' ) )
526  continue;
527 
528  if( ++sameNetcodeCount == 1 )
529  {
530  xnets->AddChild( xnet = node( "net" ) );
531  netCodeTxt.Printf( "%d", netCode );
532  xnet->AddAttribute( "code", netCodeTxt );
533  xnet->AddAttribute( "name", netName );
534  }
535 
536  XNODE* xnode;
537  xnet->AddChild( xnode = node( "node" ) );
538  xnode->AddAttribute( "ref", ref );
539  xnode->AddAttribute( "pin", nitem->GetPinNumText() );
540  }
541 
542  return xnets;
543 }
544 
545 
546 XNODE* NETLIST_EXPORTER_GENERIC::node( const wxString& aName, const wxString& aTextualContent /* = wxEmptyString*/ )
547 {
548  XNODE* n = new XNODE( wxXML_ELEMENT_NODE, aName );
549 
550  if( aTextualContent.Len() > 0 ) // excludes wxEmptyString, the parameter's default value
551  n->AddChild( new XNODE( wxXML_TEXT_NODE, wxEmptyString, aTextualContent ) );
552 
553  return n;
554 }
555 
556 
557 static bool sortPinsByNumber( LIB_PIN* aPin1, LIB_PIN* aPin2 )
558 {
559  // return "lhs < rhs"
560  return UTIL::RefDesStringCompare( aPin1->GetNumber(), aPin2->GetNumber() ) < 0;
561 }
Class SCH_SHEET_LIST.
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions) override
Function WriteNetlist writes to specified output file.
Class SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:56
const wxString & GetFileName() const
Definition: sch_screen.h:131
SCH_COMPONENT * GetComponentParent() const
For Pins (NET_PINS):
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
PART_REF & GetPartRef()
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)
int GetNet() const
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
int GetUnitCount() const
Return the number of units per package of the symbol.
Collection of utility functions for component reference designators (refdes)
const wxString & GetComment4() const
Definition: title_block.h:124
const TITLE_BLOCK & GetTitleBlock() const
Definition: sch_screen.h:136
wxString GetDescription() const
Return information about the aliased parts.
SCH_SHEET_PATH m_SheetPath
void Clear()
Function Clear erases the record.
SCH_COMPONENT * findNextComponent(EDA_ITEM *aItem, SCH_SHEET_PATH *aSheetPath)
NETLIST_ITEM_T m_Type
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:279
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
NETLIST_OBJECT_LIST * m_masterList
Field Name Module PCB, i.e. "16DIP300".
bool IsVoid() const
Function IsVoid returns true if the field is either empty or holds "~".
Definition: sch_field.h:116
const wxString & GetDocFileName() const
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
int RefDesStringCompare(const wxString &aFirst, const wxString &aSecond)
Acts just like the strcmp function but treats numbers within the string text correctly for sorting.
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
wxArrayString GetAliasNames(bool aIncludeRoot=true) const
std::set< wxString > m_libraries
Set of library nicknames.
#define VALUE
int GetUnit() const
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
void addComponentFields(XNODE *xcomp, SCH_COMPONENT *comp, SCH_SHEET_PATH *aSheet)
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
const wxString & GetRevision() const
Definition: title_block.h:89
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
wxString GetFullURI(const wxString &aLibNickname, bool aExpandEnvVars=true) const
Return the full URI of the library mapped to aLibNickname.
std::shared_ptr< LIB_PART > PART_SPTR
shared pointer to LIB_PART
const wxString & GetCompany() const
Definition: title_block.h:99
XNODE * makeDesignHeader()
Function makeDesignHeader fills out a project "design" header into an XML node.
const wxString & GetComment3() const
Definition: title_block.h:123
const LIB_ID & GetLibId() const
Define a library symbol object.
Holder for multi-unit component fields.
timestamp_t GetTimeStamp() const
Definition: base_struct.h:207
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
wxString GetText(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:33
Class SCH_SHEET_PATH.
const wxString GetRef(const SCH_SHEET_PATH *aSheet)
Return the reference for the given sheet path.
wxArrayString & GetFootprints()
const wxString & GetPinNumText() const
Function GetPinNum returns a pin number in wxString form.
int GetFieldCount() const
Return the number of fields in this symbol.
Class XNODE holds an XML or S-expression element.
Definition: xnode.h:43
const wxString & GetDescription() override
const wxString & GetDate() const
Definition: title_block.h:79
const wxString & GetNumber() const
Definition: lib_pin.h:194
const wxString & GetComment2() const
Definition: title_block.h:122
NETLIST_OBJECT * GetItem(unsigned aIdx) const
Acces to an item in list.
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
Definition: lib_draw_item.h:61
const wxString & GetName() const
const wxString & GetComment1() const
Definition: title_block.h:121
wxString GetNetName(bool adoptTimestamp=false) const
Function GetNetName.
std::vector< LIB_FIELD > LIB_FIELDS
Definition: lib_field.h:259
wxString GetName(bool aUseDefaultName=true) const
Function GetName returns the field name.
Definition: sch_field.cpp:435
size_t i
Definition: json11.cpp:597
#define GNL_ALL
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
XNODE * makeLibraries()
Function makeLibraries fills out an XML node with a list of used libraries and returns it.
std::map< wxString, wxString > f
const wxString & GetTitle() const
Definition: title_block.h:65
size_t GetAliasCount() const
Definition for part library class.
static bool sortPinsByNumber(LIB_PIN *aPin1, LIB_PIN *aPin2)
const LIB_ID & GetLibId() const
XNODE * makeListOfNets()
Function makeListOfNets fills out an XML node with a list of nets and returns it.
wxString DateAndTime()
Definition: string.cpp:304
void GetFields(LIB_FIELDS &aList)
Return a list of fields within this part.
#define min(a, b)
Definition: auxiliary.h:85
XNODE * makeLibParts()
Function makeLibParts fills out an XML node with the unique library parts and returns it.