KiCad PCB EDA Suite
EPAD Struct Reference

Eagle thru hol pad. More...

Public Types

enum  {
  SQUARE, ROUND, OCTAGON, LONG,
  OFFSET
}
 

Public Member Functions

 EPAD (CPTREE &aPad)
 

Public Attributes

string name
 
double x
 
double y
 
double drill
 
opt_double diameter
 
opt_int shape
 
opt_erot rot
 
opt_bool stop
 
opt_bool thermals
 
opt_bool first
 

Detailed Description

Eagle thru hol pad.

Definition at line 674 of file eagle_plugin.cpp.

Member Enumeration Documentation

anonymous enum
Enumerator
SQUARE 
ROUND 
OCTAGON 
LONG 
OFFSET 

Definition at line 683 of file eagle_plugin.cpp.

Constructor & Destructor Documentation

EPAD::EPAD ( CPTREE aPad)

Definition at line 699 of file eagle_plugin.cpp.

References LONG, OCTAGON, OFFSET, parseOptionalBool(), parseOptionalEROT(), ROUND, and SQUARE.

700 {
701  CPTREE& attribs = aPad.get_child( "<xmlattr>" );
702 
703  /*
704  <!ELEMENT pad EMPTY>
705  <!ATTLIST pad
706  name %String; #REQUIRED
707  x %Coord; #REQUIRED
708  y %Coord; #REQUIRED
709  drill %Dimension; #REQUIRED
710  diameter %Dimension; "0"
711  shape %PadShape; "round"
712  rot %Rotation; "R0"
713  stop %Bool; "yes"
714  thermals %Bool; "yes"
715  first %Bool; "no"
716  >
717  */
718 
719  // #REQUIRED says DTD, throw exception if not found
720  name = attribs.get<string>( "name" );
721  x = attribs.get<double>( "x" );
722  y = attribs.get<double>( "y" );
723  drill = attribs.get<double>( "drill" );
724 
725  diameter = attribs.get_optional<double>( "diameter" );
726 
727  opt_string s = attribs.get_optional<string>( "shape" );
728  if( s )
729  {
730  // (square | round | octagon | long | offset)
731  if( !s->compare( "square" ) )
733  else if( !s->compare( "round" ) )
734  shape = EPAD::ROUND;
735  else if( !s->compare( "octagon" ) )
737  else if( !s->compare( "long" ) )
738  shape = EPAD::LONG;
739  else if( !s->compare( "offset" ) )
741  }
742 
743  rot = parseOptionalEROT( attribs );
744  stop = parseOptionalBool( attribs, "stop" );
745  thermals = parseOptionalBool( attribs, "thermals" );
746  first = parseOptionalBool( attribs, "first" );
747 }
opt_double diameter
const PTREE CPTREE
Definition: eagle_plugin.h:63
static opt_erot parseOptionalEROT(CPTREE &attribs)
Eagle "rot" fields are optional, handle that by returning opt_erot.
static opt_bool parseOptionalBool(CPTREE &attribs, const char *aName)
Function parseOptionalBool returns an opt_bool and sets it true or false according to the presence an...
opt_bool stop
opt_bool thermals
double x
opt_erot rot
string name
double drill
opt_bool first
opt_int shape
double y

Member Data Documentation

opt_double EPAD::diameter

Definition at line 680 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::packagePad().

double EPAD::drill

Definition at line 679 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::packagePad().

opt_bool EPAD::first

Definition at line 694 of file eagle_plugin.cpp.

string EPAD::name

Definition at line 676 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::packagePad().

opt_erot EPAD::rot

Definition at line 691 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::packagePad().

opt_int EPAD::shape

Definition at line 690 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::packagePad().

opt_bool EPAD::stop

Definition at line 692 of file eagle_plugin.cpp.

opt_bool EPAD::thermals

Definition at line 693 of file eagle_plugin.cpp.

double EPAD::x

Definition at line 677 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::packagePad().

double EPAD::y

Definition at line 678 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::packagePad().


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