KiCad PCB EDA Suite
HYPERLYNX_PAD_STACK Class Reference

Public Member Functions

 HYPERLYNX_PAD_STACK (BOARD *aBoard, const PAD *aPad)
 
 HYPERLYNX_PAD_STACK (BOARD *aBoard, const PCB_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 m_shape
 
int m_sx
 
int m_sy
 
double m_angle
 
LSET m_layers
 
PAD_ATTRIB 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 PAD aPad 
)

Definition at line 230 of file export_hyperlynx.cpp.

231 {
232  m_board = aBoard;
233  m_sx = aPad->GetSize().x;
234  m_sy = aPad->GetSize().y;
235  m_angle = 180.0 - ( aPad->GetOrientation() / 10.0 );
236 
237  if( m_angle < 0.0 )
238  {
239  m_angle += 360.0;
240  }
241 
242  m_layers = aPad->GetLayerSet();
243  m_drill = aPad->GetDrillSize().x;
244  m_shape = aPad->GetShape();
246  m_id = 0;
247 }
Plated through hole pad.
const wxSize & GetDrillSize() const
Definition: pad.h:243
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
Definition: pad.h:349
const wxSize & GetSize() const
Definition: pad.h:233
PAD_SHAPE GetShape() const
Definition: pad.h:170
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pad.h:368

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

◆ HYPERLYNX_PAD_STACK() [2/2]

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

Definition at line 250 of file export_hyperlynx.cpp.

251 {
252  m_board = aBoard;
253  m_sx = aVia->GetWidth();
254  m_sy = aVia->GetWidth();
255  m_angle = 0;
257  m_drill = aVia->GetDrillValue();
260  m_id = 0;
261 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
int GetWidth() const
Definition: pcb_track.h:102
Plated through hole pad.
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
Definition: pcb_track.cpp:193

References LSET::AllCuMask(), CIRCLE, PCB_VIA::GetDrillValue(), PCB_TRACK::GetWidth(), m_angle, m_board, m_drill, m_id, m_layers, m_shape, m_sx, m_sy, m_type, and PTH.

◆ ~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)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
Definition: layer_ids.h:71

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)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:467
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:504

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)

References m_type, and 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:
123  case PAD_SHAPE::RECT: return true;
124  default: return false;
125  }
126  }

References CIRCLE, m_shape, OVAL, RECT, and ROUNDRECT.

◆ isThrough()

bool HYPERLYNX_PAD_STACK::isThrough ( ) const
inline

Definition at line 60 of file export_hyperlynx.cpp.

61  {
63  }
Plated through hole pad.
like PAD_PTH, but not plated

References m_type, NPTH, and PTH.

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

◆ m_layers

LSET HYPERLYNX_PAD_STACK::m_layers
private

◆ m_shape

PAD_SHAPE 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_ATTRIB 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: