KiCad PCB EDA Suite
EATTR Struct Reference

Class EATTR parses an Eagle "attribute" XML element. More...

#include <eagle_parser.h>

Public Types

enum  { Off, VALUE, NAME, BOTH }
 

Public Member Functions

 EATTR (wxXmlNode *aTree)
 
 EATTR ()
 

Public Attributes

string name
 
opt_string value
 
opt_double x
 
opt_double y
 
opt_double size
 
opt_int layer
 
opt_double ratio
 
opt_erot rot
 
opt_int display
 

Detailed Description

Class EATTR parses an Eagle "attribute" XML element.

Note that an attribute element is different than an XML element attribute. The attribute element is a full XML node in and of itself, and has attributes of its own. Blame Eagle.

Definition at line 473 of file eagle_parser.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Off 
VALUE 
NAME 
BOTH 

Definition at line 484 of file eagle_parser.h.

484  { // for 'display'
485  Off,
486  VALUE,
487  NAME,
488  BOTH,
489  };

Constructor & Destructor Documentation

EATTR::EATTR ( wxXmlNode *  aTree)

Definition at line 257 of file eagle_parser.cpp.

References BOTH, display, layer, name, NAME, Off, ratio, rot, size, value, VALUE, x, and y.

258 {
259  /*
260  <!ELEMENT attribute EMPTY>
261  <!ATTLIST attribute
262  name %String; #REQUIRED
263  value %String; #IMPLIED
264  x %Coord; #IMPLIED
265  y %Coord; #IMPLIED
266  size %Dimension; #IMPLIED
267  layer %Layer; #IMPLIED
268  font %TextFont; #IMPLIED
269  ratio %Int; #IMPLIED
270  rot %Rotation; "R0"
271  display %AttributeDisplay; "value" -- only in <element> or <instance> context --
272  constant %Bool; "no" -- only in <device> context --
273  >
274  */
275 
276  name = parseRequiredAttribute<string>( aTree, "name" );
277  value = parseOptionalAttribute<string>( aTree, "value" );
278 
279  x = parseOptionalAttribute<double>( aTree, "x" );
280  y = parseOptionalAttribute<double>( aTree, "y" );
281  size = parseOptionalAttribute<double>( aTree, "size" );
282 
283  // KiCad cannot currently put a TEXTE_MODULE on a different layer than the MODULE
284  // Eagle can it seems.
285  layer = parseOptionalAttribute<int>( aTree, "layer" );
286  ratio = parseOptionalAttribute<double>( aTree, "ratio" );
287  rot = parseOptionalAttribute<EROT>( aTree, "rot" );
288 
289  opt_string stemp = parseOptionalAttribute<string>( aTree, "display" );
290 
291  // (off | value | name | both)
292  if( stemp == "off" )
294  else if( stemp == "value" )
296  else if( stemp == "name" )
298  else if( stemp == "both" )
300 }
opt_double size
Definition: eagle_parser.h:479
opt_erot rot
Definition: eagle_parser.h:482
string name
Definition: eagle_parser.h:475
opt_string value
Definition: eagle_parser.h:476
opt_double x
Definition: eagle_parser.h:477
opt_int layer
Definition: eagle_parser.h:480
opt_double ratio
Definition: eagle_parser.h:481
opt_int display
Definition: eagle_parser.h:490
opt_double y
Definition: eagle_parser.h:478
EATTR::EATTR ( )
inline

Definition at line 493 of file eagle_parser.h.

493 {}

Member Data Documentation

opt_int EATTR::display

Definition at line 490 of file eagle_parser.h.

Referenced by EATTR(), and EAGLE_PLUGIN::loadElements().

opt_int EATTR::layer

Definition at line 480 of file eagle_parser.h.

Referenced by EATTR().

string EATTR::name

Definition at line 475 of file eagle_parser.h.

Referenced by EATTR(), and EAGLE_PLUGIN::loadElements().

opt_double EATTR::ratio

Definition at line 481 of file eagle_parser.h.

Referenced by EATTR(), and EAGLE_PLUGIN::orientModuleText().

opt_erot EATTR::rot

Definition at line 482 of file eagle_parser.h.

Referenced by EATTR(), and EAGLE_PLUGIN::orientModuleText().

opt_double EATTR::size

Definition at line 479 of file eagle_parser.h.

Referenced by EATTR(), and EAGLE_PLUGIN::orientModuleText().

opt_string EATTR::value
opt_double EATTR::x

Definition at line 477 of file eagle_parser.h.

Referenced by EATTR(), and EAGLE_PLUGIN::orientModuleText().

opt_double EATTR::y

Definition at line 478 of file eagle_parser.h.

Referenced by EATTR(), and EAGLE_PLUGIN::orientModuleText().


The documentation for this struct was generated from the following files: