KiCad PCB EDA Suite
EDA_UNIT_UTILS Namespace Reference

Functions

bool IsImperialUnit (EDA_UNITS aUnit)
 
bool IsMetricUnit (EDA_UNITS aUnit)
 

Function Documentation

◆ IsImperialUnit()

bool EDA_UNIT_UTILS::IsImperialUnit ( EDA_UNITS  aUnit)

Definition at line 26 of file eda_units.cpp.

27 {
28  switch( aUnit )
29  {
30  case EDA_UNITS::INCHES:
31  case EDA_UNITS::MILS:
32  return true;
33 
34  default:
35  return false;
36  }
37 
38  return false;
39 }

References INCHES, and MILS.

Referenced by getTickFormatForScale(), EDA_DRAW_FRAME::GetUnitPair(), COMMON_TOOLS::SetLastUnits(), COMMON_TOOLS::SwitchUnits(), COMMON_TOOLS::ToggleUnits(), and PCB_EDIT_FRAME::UpdateViaSizeSelectBox().

◆ IsMetricUnit()

bool EDA_UNIT_UTILS::IsMetricUnit ( EDA_UNITS  aUnit)

Definition at line 42 of file eda_units.cpp.

43 {
44  switch( aUnit )
45  {
47  return true;
48 
49  default:
50  return false;
51  }
52 
53  return false;
54 }

References MILLIMETRES.

Referenced by COMMON_TOOLS::SetLastUnits(), and COMMON_TOOLS::SwitchUnits().