KiCad PCB EDA Suite
EATTR Struct Reference

Parse 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

wxString name
 
opt_wxString value
 
opt_ecoord x
 
opt_ecoord y
 
opt_ecoord size
 
opt_int layer
 
opt_double ratio
 
opt_erot rot
 
opt_int display
 
opt_int align
 

Detailed Description

Parse an Eagle "attribute" XML element.

Note
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 594 of file eagle_parser.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Off 
VALUE 
NAME 
BOTH 

Definition at line 605 of file eagle_parser.h.

605  { // for 'display'
606  Off,
607  VALUE,
608  NAME,
609  BOTH,
610  };

Constructor & Destructor Documentation

◆ EATTR() [1/2]

EATTR::EATTR ( wxXmlNode *  aTree)

Definition at line 481 of file eagle_parser.cpp.

482 {
483  /*
484  <!ELEMENT attribute EMPTY>
485  <!ATTLIST attribute
486  name %String; #REQUIRED
487  value %String; #IMPLIED
488  x %Coord; #IMPLIED
489  y %Coord; #IMPLIED
490  size %Dimension; #IMPLIED
491  layer %Layer; #IMPLIED
492  font %TextFont; #IMPLIED
493  ratio %Int; #IMPLIED
494  rot %Rotation; "R0"
495  display %AttributeDisplay; "value" -- only in <element> or <instance> context --
496  constant %Bool; "no" -- only in <device> context --
497  >
498  */
499 
500  name = parseRequiredAttribute<wxString>( aTree, "name" );
501  value = parseOptionalAttribute<wxString>( aTree, "value" );
502 
503  x = parseOptionalAttribute<ECOORD>( aTree, "x" );
504  y = parseOptionalAttribute<ECOORD>( aTree, "y" );
505  size = parseOptionalAttribute<ECOORD>( aTree, "size" );
506 
507  layer = parseOptionalAttribute<int>( aTree, "layer" );
508  ratio = parseOptionalAttribute<double>( aTree, "ratio" );
509  rot = parseOptionalAttribute<EROT>( aTree, "rot" );
510 
511  opt_wxString stemp = parseOptionalAttribute<wxString>( aTree, "display" );
512 
513  // (off | value | name | both)
514  if( stemp == "off" )
516  else if( stemp == "name" )
518  else if( stemp == "both" )
520  else // "value" is the default
522 
523  stemp = parseOptionalAttribute<wxString>( aTree, "align" );
524 
525  align = stemp ? parseAlignment( *stemp ) : DEFAULT_ALIGNMENT;
526 }
opt_erot rot
Definition: eagle_parser.h:603
opt_int align
Definition: eagle_parser.h:612
wxString name
Definition: eagle_parser.h:596
opt_ecoord y
Definition: eagle_parser.h:599
opt_wxString value
Definition: eagle_parser.h:597
static int parseAlignment(const wxString &aAlignment)
opt_ecoord x
Definition: eagle_parser.h:598
opt_int layer
Definition: eagle_parser.h:601
constexpr auto DEFAULT_ALIGNMENT
opt_double ratio
Definition: eagle_parser.h:602
opt_int display
Definition: eagle_parser.h:611
opt_ecoord size
Definition: eagle_parser.h:600

References align, BOTH, DEFAULT_ALIGNMENT, display, layer, name, NAME, Off, parseAlignment(), ratio, rot, size, value, VALUE, x, and y.

◆ EATTR() [2/2]

EATTR::EATTR ( )
inline

Definition at line 615 of file eagle_parser.h.

615 {}

Member Data Documentation

◆ align

opt_int EATTR::align

Definition at line 612 of file eagle_parser.h.

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

◆ display

opt_int EATTR::display

Definition at line 611 of file eagle_parser.h.

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

◆ layer

opt_int EATTR::layer

Definition at line 601 of file eagle_parser.h.

Referenced by EATTR().

◆ name

wxString EATTR::name

Definition at line 596 of file eagle_parser.h.

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

◆ ratio

opt_double EATTR::ratio

Definition at line 602 of file eagle_parser.h.

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

◆ rot

opt_erot EATTR::rot

Definition at line 603 of file eagle_parser.h.

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

◆ size

opt_ecoord EATTR::size

Definition at line 600 of file eagle_parser.h.

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

◆ value

opt_wxString EATTR::value

Definition at line 597 of file eagle_parser.h.

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

◆ x

opt_ecoord EATTR::x

Definition at line 598 of file eagle_parser.h.

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

◆ y

opt_ecoord EATTR::y

Definition at line 599 of file eagle_parser.h.

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


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