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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Off 
VALUE 
NAME 
BOTH 

Definition at line 609 of file eagle_parser.h.

609 { // for 'display'
610 Off,
611 VALUE,
612 NAME,
613 BOTH,
614 };

Constructor & Destructor Documentation

◆ EATTR() [1/2]

EATTR::EATTR ( wxXmlNode *  aTree)

Definition at line 573 of file eagle_parser.cpp.

574{
575 /*
576 <!ELEMENT attribute EMPTY>
577 <!ATTLIST attribute
578 name %String; #REQUIRED
579 value %String; #IMPLIED
580 x %Coord; #IMPLIED
581 y %Coord; #IMPLIED
582 size %Dimension; #IMPLIED
583 layer %Layer; #IMPLIED
584 font %TextFont; #IMPLIED
585 ratio %Int; #IMPLIED
586 rot %Rotation; "R0"
587 display %AttributeDisplay; "value" -- only in <element> or <instance> context --
588 constant %Bool; "no" -- only in <device> context --
589 >
590 */
591
592 name = parseRequiredAttribute<wxString>( aTree, "name" );
593 value = parseOptionalAttribute<wxString>( aTree, "value" );
594
595 x = parseOptionalAttribute<ECOORD>( aTree, "x" );
596 y = parseOptionalAttribute<ECOORD>( aTree, "y" );
597 size = parseOptionalAttribute<ECOORD>( aTree, "size" );
598
599 layer = parseOptionalAttribute<int>( aTree, "layer" );
600 ratio = parseOptionalAttribute<double>( aTree, "ratio" );
601 rot = parseOptionalAttribute<EROT>( aTree, "rot" );
602
603 opt_wxString stemp = parseOptionalAttribute<wxString>( aTree, "display" );
604
605 // (off | value | name | both)
606 if( stemp == "off" )
608 else if( stemp == "name" )
610 else if( stemp == "both" )
612 else // "value" is the default
614
615 stemp = parseOptionalAttribute<wxString>( aTree, "align" );
616
617 align = stemp ? parseAlignment( *stemp ) : DEFAULT_ALIGNMENT;
618}
static int parseAlignment(const wxString &aAlignment)
constexpr auto DEFAULT_ALIGNMENT
opt_double ratio
Definition: eagle_parser.h:606
opt_wxString value
Definition: eagle_parser.h:601
opt_ecoord size
Definition: eagle_parser.h:604
opt_ecoord y
Definition: eagle_parser.h:603
wxString name
Definition: eagle_parser.h:600
opt_erot rot
Definition: eagle_parser.h:607
opt_int align
Definition: eagle_parser.h:616
opt_int display
Definition: eagle_parser.h:615
opt_ecoord x
Definition: eagle_parser.h:602
opt_int layer
Definition: eagle_parser.h:605

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

619{}

Member Data Documentation

◆ align

opt_int EATTR::align

◆ display

opt_int EATTR::display

◆ layer

opt_int EATTR::layer

Definition at line 605 of file eagle_parser.h.

Referenced by EATTR().

◆ name

wxString EATTR::name

◆ ratio

opt_double EATTR::ratio

Definition at line 606 of file eagle_parser.h.

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

◆ rot

opt_erot EATTR::rot

◆ size

opt_ecoord EATTR::size

Definition at line 604 of file eagle_parser.h.

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

◆ value

opt_wxString EATTR::value

Definition at line 601 of file eagle_parser.h.

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

◆ x

opt_ecoord EATTR::x

◆ y

opt_ecoord EATTR::y

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