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