KiCad PCB EDA Suite
HYPERLYNX_PAD_STACK Class Reference

Public Member Functions

 HYPERLYNX_PAD_STACK (BOARD *aBoard, const D_PAD *aPad)
 
 HYPERLYNX_PAD_STACK (BOARD *aBoard, const VIA *aVia)
 
 ~HYPERLYNX_PAD_STACK ()
 
bool isThrough () const
 
bool operator== (const HYPERLYNX_PAD_STACK &other) const
 
bool isSMD () const
 
PCB_LAYER_ID getSMDLayer () const
 
void SetId (int id)
 
int GetId () const
 
int IsSupportedByExporter () const
 
bool isEmpty () const
 

Private Attributes

BOARDm_board
 
int m_id
 
int m_drill
 
PAD_SHAPE_T m_shape
 
int m_sx
 
int m_sy
 
double m_angle
 
LSET m_layers
 
PAD_ATTR_T m_type
 

Friends

class HYPERLYNX_EXPORTER
 

Detailed Description

Definition at line 51 of file export_hyperlynx.cpp.

Constructor & Destructor Documentation

◆ HYPERLYNX_PAD_STACK() [1/2]

HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK ( BOARD aBoard,
const D_PAD aPad 
)

Definition at line 226 of file export_hyperlynx.cpp.

227 {
228  m_board = aBoard;
229  m_sx = aPad->GetSize().x;
230  m_sy = aPad->GetSize().y;
231  m_angle = 180.0 - ( aPad->GetOrientation() / 10.0 );
232 
233  if( m_angle < 0.0 )
234  {
235  m_angle += 360.0;
236  }
237 
238  m_layers = aPad->GetLayerSet();
239  m_drill = aPad->GetDrillSize().x;
240  m_shape = aPad->GetShape();
242 }
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:426
double GetOrientation() const
Function GetOrientation returns the rotation angle of the pad in tenths of degrees,...
Definition: class_pad.h:406
const wxSize & GetDrillSize() const
Definition: class_pad.h:290
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:221
const wxSize & GetSize() const
Definition: class_pad.h:284

References D_PAD::GetDrillSize(), D_PAD::GetLayerSet(), D_PAD::GetOrientation(), D_PAD::GetShape(), D_PAD::GetSize(), m_angle, m_board, m_drill, m_layers, m_shape, m_sx, m_sy, m_type, and PAD_ATTRIB_STANDARD.

◆ HYPERLYNX_PAD_STACK() [2/2]

HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK ( BOARD aBoard,
const VIA aVia 
)

Definition at line 245 of file export_hyperlynx.cpp.

246 {
247  m_board = aBoard;
248  m_sx = m_sy = aVia->GetWidth();
249  m_angle = 0;
251  m_drill = aVia->GetDrillValue();
254 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
int GetWidth() const
Definition: class_track.h:103

References LSET::AllCuMask(), VIA::GetDrillValue(), TRACK::GetWidth(), m_angle, m_board, m_drill, m_layers, m_shape, m_sx, m_sy, m_type, PAD_ATTRIB_STANDARD, and PAD_SHAPE_CIRCLE.

◆ ~HYPERLYNX_PAD_STACK()

HYPERLYNX_PAD_STACK::~HYPERLYNX_PAD_STACK ( )
inline

Definition at line 58 of file export_hyperlynx.cpp.

58 {};

Member Function Documentation

◆ GetId()

int HYPERLYNX_PAD_STACK::GetId ( ) const
inline

Definition at line 111 of file export_hyperlynx.cpp.

112  {
113  return m_id;
114  }

References m_id.

◆ getSMDLayer()

PCB_LAYER_ID HYPERLYNX_PAD_STACK::getSMDLayer ( ) const
inline

Definition at line 96 of file export_hyperlynx.cpp.

97  {
98  for( auto l : LSET::AllCuMask().Seq() )
99  {
100  if( m_layers[l] )
101  return l;
102  }
103  return F_Cu;
104  }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676

References LSET::AllCuMask(), F_Cu, and m_layers.

◆ isEmpty()

bool HYPERLYNX_PAD_STACK::isEmpty ( ) const
inline

Definition at line 128 of file export_hyperlynx.cpp.

129  {
130  LSET layerMask = LSET::AllCuMask() & m_board->GetEnabledLayers();
131  LSET outLayers = m_layers & layerMask;
132 
133  return outLayers.none();
134  }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
Class LSET is a set of PCB_LAYER_IDs.

References LSET::AllCuMask(), BOARD::GetEnabledLayers(), m_board, and m_layers.

◆ isSMD()

bool HYPERLYNX_PAD_STACK::isSMD ( ) const
inline

Definition at line 91 of file export_hyperlynx.cpp.

92  {
93  return m_type == PAD_ATTRIB_SMD;
94  }
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:62

References m_type, and PAD_ATTRIB_SMD.

◆ IsSupportedByExporter()

int HYPERLYNX_PAD_STACK::IsSupportedByExporter ( ) const
inline

Definition at line 116 of file export_hyperlynx.cpp.

117  {
118  switch( m_shape )
119  {
120  case PAD_SHAPE_CIRCLE:
121  case PAD_SHAPE_OVAL:
122  case PAD_SHAPE_ROUNDRECT:
123  case PAD_SHAPE_RECT: return true;
124  default: return false;
125  }
126  }

References m_shape, PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, and PAD_SHAPE_ROUNDRECT.

◆ isThrough()

bool HYPERLYNX_PAD_STACK::isThrough ( ) const
inline

Definition at line 60 of file export_hyperlynx.cpp.

61  {
63  }
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:66

References m_type, PAD_ATTRIB_HOLE_NOT_PLATED, and PAD_ATTRIB_STANDARD.

Referenced by operator==().

◆ operator==()

bool HYPERLYNX_PAD_STACK::operator== ( const HYPERLYNX_PAD_STACK other) const
inline

Definition at line 65 of file export_hyperlynx.cpp.

66  {
67  if( m_shape != other.m_shape )
68  return false;
69 
70  if( m_type != other.m_type )
71  return false;
72 
73  if( isThrough() && other.isThrough() && m_drill != other.m_drill )
74  return false;
75 
76  if( m_sx != other.m_sx )
77  return false;
78 
79  if( m_sy != other.m_sy )
80  return false;
81 
82  if( m_layers != other.m_layers )
83  return false;
84 
85  if( m_angle != other.m_angle )
86  return false;
87 
88  return true;
89  }

References isThrough(), m_angle, m_drill, m_layers, m_shape, m_sx, m_sy, and m_type.

◆ SetId()

void HYPERLYNX_PAD_STACK::SetId ( int  id)
inline

Definition at line 106 of file export_hyperlynx.cpp.

107  {
108  m_id = id;
109  }

References m_id.

Referenced by HYPERLYNX_EXPORTER::addPadStack().

Friends And Related Function Documentation

◆ HYPERLYNX_EXPORTER

friend class HYPERLYNX_EXPORTER
friend

Definition at line 54 of file export_hyperlynx.cpp.

Member Data Documentation

◆ m_angle

double HYPERLYNX_PAD_STACK::m_angle
private

◆ m_board

BOARD* HYPERLYNX_PAD_STACK::m_board
private

Definition at line 137 of file export_hyperlynx.cpp.

Referenced by HYPERLYNX_PAD_STACK(), and isEmpty().

◆ m_drill

int HYPERLYNX_PAD_STACK::m_drill
private

◆ m_id

int HYPERLYNX_PAD_STACK::m_id
private

Definition at line 138 of file export_hyperlynx.cpp.

Referenced by GetId(), SetId(), and HYPERLYNX_EXPORTER::writeSinglePadStack().

◆ m_layers

LSET HYPERLYNX_PAD_STACK::m_layers
private

◆ m_shape

PAD_SHAPE_T HYPERLYNX_PAD_STACK::m_shape
private

◆ m_sx

int HYPERLYNX_PAD_STACK::m_sx
private

◆ m_sy

int HYPERLYNX_PAD_STACK::m_sy
private

◆ m_type

PAD_ATTR_T HYPERLYNX_PAD_STACK::m_type
private

Definition at line 144 of file export_hyperlynx.cpp.

Referenced by HYPERLYNX_PAD_STACK(), isSMD(), isThrough(), and operator==().


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