KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pth_hole_size.h File Reference
#include <vector>
#include <wx/string.h>

Go to the source code of this file.

Classes

struct  PTH_LEAD_DEF
 
struct  PTH_HOLE_SIZE_RESULT
 
class  PTH_HOLE_SIZE_STANDARD
 A source of hole size rules for a plated through hole. More...
 

Enumerations

enum class  PTH_LEAD_SHAPE { ROUND , SQUARE , RECTANGULAR }
 
enum class  PTH_HOLE_ROUNDING { NEAREST , UP }
 

Functions

int ComputeRecommendedPthHoleSize (const PTH_HOLE_SIZE_RESULT &aRange, int aRoundingStep, PTH_HOLE_ROUNDING aRounding)
 Choose a recommended hole within an allowable range.
 
const PTH_HOLE_SIZE_STANDARDFindPthHoleSizeStandard (const wxString &aId)
 Find a hole size standard in the registry by its ID (e.g.
 
const std::vector< const PTH_HOLE_SIZE_STANDARD * > & GetPthHoleSizeStandards ()
 

Enumeration Type Documentation

◆ PTH_HOLE_ROUNDING

enum class PTH_HOLE_ROUNDING
strong
Enumerator
NEAREST 
UP 

Definition at line 38 of file pth_hole_size.h.

◆ PTH_LEAD_SHAPE

enum class PTH_LEAD_SHAPE
strong
Enumerator
ROUND 
SQUARE 
RECTANGULAR 

Definition at line 29 of file pth_hole_size.h.

Function Documentation

◆ ComputeRecommendedPthHoleSize()

int ComputeRecommendedPthHoleSize ( const PTH_HOLE_SIZE_RESULT & aRange,
int aRoundingStep,
PTH_HOLE_ROUNDING aRounding )

Choose a recommended hole within an allowable range.

The midpoint of the range is rounded onto the rounding grid: to the nearest multiple of the step, or always up to the next multiple. The result is never below the range minimum.

Parameters
aRangeis the allowable hole size range (m_holeMin and m_holeMax).
aRoundingStepis the rounding grid. A value of 0 or less returns the exact midpoint of the range.
aRoundingselects how the midpoint is rounded onto the grid.
Returns
the recommended hole size.

Definition at line 129 of file pth_hole_size.cpp.

References PTH_HOLE_SIZE_RESULT::m_holeMax, PTH_HOLE_SIZE_RESULT::m_holeMin, and UP.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and PANEL_PTH_SIZE::recalculate().

◆ FindPthHoleSizeStandard()

const PTH_HOLE_SIZE_STANDARD * FindPthHoleSizeStandard ( const wxString & aId)

Find a hole size standard in the registry by its ID (e.g.

"IPC-2222B").

The caller does not own the returned pointer.

Parameters
aIdis the standard ID.
Returns
the standard, or nullptr if the ID is not known.

Definition at line 152 of file pth_hole_size.cpp.

References GetPthHoleSizeStandards().

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ GetPthHoleSizeStandards()

const std::vector< const PTH_HOLE_SIZE_STANDARD * > & GetPthHoleSizeStandards ( )
Returns
the available hole size standards, in the order they should be offered in the UI. The pointers are non-owning and remain valid for the program lifetime.

Definition at line 164 of file pth_hole_size.cpp.

Referenced by FindPthHoleSizeStandard(), PANEL_PTH_SIZE::populateStandardChoice(), and PANEL_PTH_SIZE::updateStandard().