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 <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( "export" );
53 
54  xroot->AddAttribute( "version", "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 
79 {
80  wxString value;
81  wxString datasheet;
82  wxString footprint;
83 
84  std::map< wxString, wxString > f;
85 };
86 
87 
89 {
90  if( comp->GetUnitCount() > 1 )
91  {
92  // Sadly, each unit of a component can have its own unique fields. This block
93  // finds the last non blank field and records it. Last guy wins and the order
94  // of units occuring in a schematic hierarchy is variable. Therefore user
95  // is best off setting fields into only one unit. But this scavenger algorithm
96  // will find any non blank fields in all units and use the last non-blank field
97  // for each unique field name.
98 
99  COMP_FIELDS fields;
100  wxString ref = comp->GetRef( aSheet );
101 
102  SCH_SHEET_LIST sheetList( g_RootSheet );
103 
104  for( unsigned i = 0; i < sheetList.size(); i++ )
105  {
106  for( EDA_ITEM* item = sheetList[i].LastDrawList(); item; item = item->Next() )
107  {
108  if( item->Type() != SCH_COMPONENT_T )
109  continue;
110 
111  SCH_COMPONENT* comp2 = (SCH_COMPONENT*) item;
112 
113  wxString ref2 = comp2->GetRef( &sheetList[i] );
114 
115  if( ref2.CmpNoCase( ref ) != 0 )
116  continue;
117 
118  // The last guy wins. User should only set fields in any one unit.
119 
120  if( !comp2->GetField( VALUE )->IsVoid() )
121  fields.value = comp2->GetField( VALUE )->GetText();
122 
123  if( !comp2->GetField( FOOTPRINT )->IsVoid() )
124  fields.footprint = comp2->GetField( FOOTPRINT )->GetText();
125 
126  if( !comp2->GetField( DATASHEET )->IsVoid() )
127  fields.datasheet = comp2->GetField( DATASHEET )->GetText();
128 
129  for( int fldNdx = MANDATORY_FIELDS; fldNdx < comp2->GetFieldCount(); ++fldNdx )
130  {
131  SCH_FIELD* f = comp2->GetField( fldNdx );
132 
133  if( f->GetText().size() )
134  {
135  fields.f[ f->GetName() ] = f->GetText();
136  }
137  }
138  }
139  }
140 
141  xcomp->AddChild( node( "value", fields.value ) );
142 
143  if( fields.footprint.size() )
144  xcomp->AddChild( node( "footprint", fields.footprint ) );
145 
146  if( fields.datasheet.size() )
147  xcomp->AddChild( node( "datasheet", fields.datasheet ) );
148 
149  if( fields.f.size() )
150  {
151  XNODE* xfields;
152  xcomp->AddChild( xfields = node( "fields" ) );
153 
154  // non MANDATORY fields are output alphabetically
155  for( std::map< wxString, wxString >::const_iterator it = fields.f.begin();
156  it != fields.f.end(); ++it )
157  {
158  XNODE* xfield;
159  xfields->AddChild( xfield = node( "field", it->second ) );
160  xfield->AddAttribute( "name", it->first );
161  }
162  }
163  }
164  else
165  {
166  xcomp->AddChild( node( "value", comp->GetField( VALUE )->GetText() ) );
167 
168  if( !comp->GetField( FOOTPRINT )->IsVoid() )
169  xcomp->AddChild( node( "footprint", comp->GetField( FOOTPRINT )->GetText() ) );
170 
171  if( !comp->GetField( DATASHEET )->IsVoid() )
172  xcomp->AddChild( node( "datasheet", comp->GetField( DATASHEET )->GetText() ) );
173 
174  // Export all user defined fields within the component,
175  // which start at field index MANDATORY_FIELDS. Only output the <fields>
176  // container element if there are any <field>s.
177  if( comp->GetFieldCount() > MANDATORY_FIELDS )
178  {
179  XNODE* xfields;
180  xcomp->AddChild( xfields = node( "fields" ) );
181 
182  for( int fldNdx = MANDATORY_FIELDS; fldNdx < comp->GetFieldCount(); ++fldNdx )
183  {
184  SCH_FIELD* f = comp->GetField( fldNdx );
185 
186  // only output a field if non empty and not just "~"
187  if( !f->IsVoid() )
188  {
189  XNODE* xfield;
190  xfields->AddChild( xfield = node( "field", f->GetText() ) );
191  xfield->AddAttribute( "name", f->GetName() );
192  }
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  if( !comp )
218  break; // No component left
219 
220  schItem = comp;
221 
222  XNODE* xcomp; // current component being constructed
223 
224  // Output the component's elements in order of expected access frequency.
225  // This may not always look best, but it will allow faster execution
226  // under XSL processing systems which do sequential searching within
227  // an element.
228 
229  xcomps->AddChild( xcomp = node( "comp" ) );
230  xcomp->AddAttribute( "ref", comp->GetRef( &sheetList[i] ) );
231 
232  addComponentFields( xcomp, comp, &sheetList[i] );
233 
234  XNODE* xlibsource;
235  xcomp->AddChild( xlibsource = node( "libsource" ) );
236 
237  // "logical" library name, which is in anticipation of a better search
238  // algorithm for parts based on "logical_lib.part" and where logical_lib
239  // is merely the library name minus path and extension.
240  LIB_PART* part = m_libs->FindLibPart( comp->GetLibId() );
241  if( part )
242  xlibsource->AddAttribute( "lib", part->GetLib()->GetLogicalName() );
243 
244  // We only want the symbol name, not the full LIB_ID.
245  xlibsource->AddAttribute( "part", FROM_UTF8( comp->GetLibId().GetLibItemName() ) );
246 
247  XNODE* xsheetpath;
248 
249  xcomp->AddChild( xsheetpath = node( "sheetpath" ) );
250  xsheetpath->AddAttribute( "names", sheetList[i].PathHumanReadable() );
251  xsheetpath->AddAttribute( "tstamps", sheetList[i].Path() );
252 
253  timeStamp.Printf( "%8.8lX", (unsigned long)comp->GetTimeStamp() );
254  xcomp->AddChild( node( "tstamp", timeStamp ) );
255  }
256  }
257 
258  return xcomps;
259 }
260 
261 
263 {
264  SCH_SCREEN* screen;
265  XNODE* xdesign = node( "design" );
266  XNODE* xtitleBlock;
267  XNODE* xsheet;
268  XNODE* xcomment;
269  wxString sheetTxt;
270  wxFileName sourceFileName;
271 
272  // the root sheet is a special sheet, call it source
273  xdesign->AddChild( node( "source", g_RootSheet->GetScreen()->GetFileName() ) );
274 
275  xdesign->AddChild( node( "date", DateAndTime() ) );
276 
277  // which Eeschema tool
278  xdesign->AddChild( node( "tool", wxString( "Eeschema " ) + GetBuildVersion() ) );
279 
280  /*
281  Export the sheets information
282  */
283  SCH_SHEET_LIST sheetList( g_RootSheet );
284 
285  for( unsigned i = 0; i < sheetList.size(); i++ )
286  {
287  screen = sheetList[i].LastScreen();
288 
289  xdesign->AddChild( xsheet = node( "sheet" ) );
290 
291  // get the string representation of the sheet index number.
292  // Note that sheet->GetIndex() is zero index base and we need to increment the
293  // number by one to make it human readable
294  sheetTxt.Printf( "%u", i + 1 );
295  xsheet->AddAttribute( "number", sheetTxt );
296  xsheet->AddAttribute( "name", sheetList[i].PathHumanReadable() );
297  xsheet->AddAttribute( "tstamps", sheetList[i].Path() );
298 
299 
300  TITLE_BLOCK tb = screen->GetTitleBlock();
301 
302  xsheet->AddChild( xtitleBlock = node( "title_block" ) );
303 
304  xtitleBlock->AddChild( node( "title", tb.GetTitle() ) );
305  xtitleBlock->AddChild( node( "company", tb.GetCompany() ) );
306  xtitleBlock->AddChild( node( "rev", tb.GetRevision() ) );
307  xtitleBlock->AddChild( node( "date", tb.GetDate() ) );
308 
309  // We are going to remove the fileName directories.
310  sourceFileName = wxFileName( screen->GetFileName() );
311  xtitleBlock->AddChild( node( "source", sourceFileName.GetFullName() ) );
312 
313  xtitleBlock->AddChild( xcomment = node( "comment" ) );
314  xcomment->AddAttribute( "number", "1" );
315  xcomment->AddAttribute( "value", tb.GetComment1() );
316 
317  xtitleBlock->AddChild( xcomment = node( "comment" ) );
318  xcomment->AddAttribute( "number", "2" );
319  xcomment->AddAttribute( "value", tb.GetComment2() );
320 
321  xtitleBlock->AddChild( xcomment = node( "comment" ) );
322  xcomment->AddAttribute( "number", "3" );
323  xcomment->AddAttribute( "value", tb.GetComment3() );
324 
325  xtitleBlock->AddChild( xcomment = node( "comment" ) );
326  xcomment->AddAttribute( "number", "4" );
327  xcomment->AddAttribute( "value", tb.GetComment4() );
328  }
329 
330  return xdesign;
331 }
332 
333 
335 {
336  XNODE* xlibs = node( "libraries" ); // auto_ptr
337 
338  for( std::set<void*>::iterator it = m_Libraries.begin(); it!=m_Libraries.end(); ++it )
339  {
340  PART_LIB* lib = (PART_LIB*) *it;
341  XNODE* xlibrary;
342 
343  xlibs->AddChild( xlibrary = node( "library" ) );
344  xlibrary->AddAttribute( "logical", lib->GetLogicalName() );
345  xlibrary->AddChild( node( "uri", lib->GetFullFileName() ) );
346 
347  // @todo: add more fun stuff here
348  }
349 
350  return xlibs;
351 }
352 
353 
355 {
356  XNODE* xlibparts = node( "libparts" ); // auto_ptr
357 
358  LIB_PINS pinList;
359  LIB_FIELDS fieldList;
360 
361  m_Libraries.clear();
362 
363  for( std::set<LIB_PART*>::iterator it = m_LibParts.begin(); it!=m_LibParts.end(); ++it )
364  {
365  LIB_PART* lcomp = *it;
366  PART_LIB* library = lcomp->GetLib();
367 
368  m_Libraries.insert( library ); // inserts component's library if unique
369 
370  XNODE* xlibpart;
371  xlibparts->AddChild( xlibpart = node( "libpart" ) );
372  xlibpart->AddAttribute( "lib", library->GetLogicalName() );
373  xlibpart->AddAttribute( "part", lcomp->GetName() );
374 
375  if( lcomp->GetAliasCount() )
376  {
377  wxArrayString aliases = lcomp->GetAliasNames( false );
378  if( aliases.GetCount() )
379  {
380  XNODE* xaliases = node( "aliases" );
381  xlibpart->AddChild( xaliases );
382  for( unsigned i=0; i<aliases.GetCount(); ++i )
383  {
384  xaliases->AddChild( node( "alias", aliases[i] ) );
385  }
386  }
387  }
388 
389  //----- show the important properties -------------------------
390  if( !lcomp->GetAlias( 0 )->GetDescription().IsEmpty() )
391  xlibpart->AddChild( node( "description", lcomp->GetAlias( 0 )->GetDescription() ) );
392 
393  if( !lcomp->GetAlias( 0 )->GetDocFileName().IsEmpty() )
394  xlibpart->AddChild( node( "docs", lcomp->GetAlias( 0 )->GetDocFileName() ) );
395 
396  // Write the footprint list
397  if( lcomp->GetFootPrints().GetCount() )
398  {
399  XNODE* xfootprints;
400  xlibpart->AddChild( xfootprints = node( "footprints" ) );
401 
402  for( unsigned i=0; i<lcomp->GetFootPrints().GetCount(); ++i )
403  {
404  xfootprints->AddChild( node( "fp", lcomp->GetFootPrints()[i] ) );
405  }
406  }
407 
408  //----- show the fields here ----------------------------------
409  fieldList.clear();
410  lcomp->GetFields( fieldList );
411 
412  XNODE* xfields;
413  xlibpart->AddChild( xfields = node( "fields" ) );
414 
415  for( unsigned i=0; i<fieldList.size(); ++i )
416  {
417  if( !fieldList[i].GetText().IsEmpty() )
418  {
419  XNODE* xfield;
420  xfields->AddChild( xfield = node( "field", fieldList[i].GetText() ) );
421  xfield->AddAttribute( "name", fieldList[i].GetName(false) );
422  }
423  }
424 
425  //----- show the pins here ------------------------------------
426  pinList.clear();
427  lcomp->GetPins( pinList, 0, 0 );
428 
429  /* we must erase redundant Pins references in pinList
430  * These redundant pins exist because some pins
431  * are found more than one time when a component has
432  * multiple parts per package or has 2 representations (DeMorgan conversion)
433  * For instance, a 74ls00 has DeMorgan conversion, with different pin shapes,
434  * and therefore each pin appears 2 times in the list.
435  * Common pins (VCC, GND) can also be found more than once.
436  */
437  sort( pinList.begin(), pinList.end(), sortPinsByNumber );
438  for( int ii = 0; ii < (int)pinList.size()-1; ii++ )
439  {
440  if( pinList[ii]->GetNumber() == pinList[ii+1]->GetNumber() )
441  { // 2 pins have the same number, remove the redundant pin at index i+1
442  pinList.erase(pinList.begin() + ii + 1);
443  ii--;
444  }
445  }
446 
447  if( pinList.size() )
448  {
449  XNODE* pins;
450 
451  xlibpart->AddChild( pins = node( "pins" ) );
452  for( unsigned i=0; i<pinList.size(); ++i )
453  {
454  XNODE* pin;
455 
456  pins->AddChild( pin = node( "pin" ) );
457  pin->AddAttribute( "num", pinList[i]->GetNumberString() );
458  pin->AddAttribute( "name", pinList[i]->GetName() );
459  pin->AddAttribute( "type", pinList[i]->GetCanonicalElectricalTypeName() );
460 
461  // caution: construction work site here, drive slowly
462  }
463  }
464  }
465 
466  return xlibparts;
467 }
468 
469 
471 {
472  XNODE* xnets = node( "nets" ); // auto_ptr if exceptions ever get used.
473  wxString netCodeTxt;
474  wxString netName;
475  wxString ref;
476 
477  XNODE* xnet = 0;
478  int netCode;
479  int lastNetCode = -1;
480  int sameNetcodeCount = 0;
481 
482 
483  /* output:
484  <net code="123" name="/cfcard.sch/WAIT#">
485  <node ref="R23" pin="1"/>
486  <node ref="U18" pin="12"/>
487  </net>
488  */
489 
490  m_LibParts.clear(); // must call this function before using m_LibParts.
491 
492  for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
493  {
494  NETLIST_OBJECT* nitem = m_masterList->GetItem( ii );
495  SCH_COMPONENT* comp;
496 
497  // New net found, write net id;
498  if( ( netCode = nitem->GetNet() ) != lastNetCode )
499  {
500  sameNetcodeCount = 0; // item count for this net
501  netName = nitem->GetNetName();
502  lastNetCode = netCode;
503  }
504 
505  if( nitem->m_Type != NET_PIN )
506  continue;
507 
508  if( nitem->m_Flag != 0 ) // Redundant pin, skip it
509  continue;
510 
511  comp = nitem->GetComponentParent();
512 
513  // Get the reference for the net name and the main parent component
514  ref = comp->GetRef( &nitem->m_SheetPath );
515  if( ref[0] == wxChar( '#' ) )
516  continue;
517 
518  if( ++sameNetcodeCount == 1 )
519  {
520  xnets->AddChild( xnet = node( "net" ) );
521  netCodeTxt.Printf( "%d", netCode );
522  xnet->AddAttribute( "code", netCodeTxt );
523  xnet->AddAttribute( "name", netName );
524  }
525 
526  XNODE* xnode;
527  xnet->AddChild( xnode = node( "node" ) );
528  xnode->AddAttribute( "ref", ref );
529  xnode->AddAttribute( "pin", nitem->GetPinNumText() );
530  }
531 
532  return xnets;
533 }
534 
535 
536 XNODE* NETLIST_EXPORTER_GENERIC::node( const wxString& aName, const wxString& aTextualContent /* = wxEmptyString*/ )
537 {
538  XNODE* n = new XNODE( wxXML_ELEMENT_NODE, aName );
539 
540  if( aTextualContent.Len() > 0 ) // excludes wxEmptyString, the parameter's default value
541  n->AddChild( new XNODE( wxXML_TEXT_NODE, wxEmptyString, aTextualContent ) );
542 
543  return n;
544 }
545 
546 
547 static bool sortPinsByNumber( LIB_PIN* aPin1, LIB_PIN* aPin2 )
548 {
549  // return "lhs < rhs"
550  return RefDesStringCompare( aPin1->GetNumberString(), aPin2->GetNumberString() ) < 0;
551 }
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
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes...
Definition: macros.h:53
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.
unsigned long timeStamp(wxXmlNode *aTree)
Make a unique time stamp.
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
int GetUnitCount() const
Return the number of units per package of the symbol.
void Clear()
Function Clear erases the record.
wxString GetPinNumText()
Function GetPinNum returns a pin number in wxString form.
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: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
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 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.
Holder for multi-unit component fields.
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
Class SCH_SHEET_PATH.
const wxString GetRef(const SCH_SHEET_PATH *aSheet)
Return the reference for the given sheet path.
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
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
Return the number of fields in this symbol.
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:69
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...
std::map< wxString, wxString > f
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...
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:176