KiCad PCB EDA Suite
UNIT_SELECTOR_LEN Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_LEN:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_LEN (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
 
virtual double GetUnitScale () override
 Function GetUnitScale. More...
 
wxString GetUnitName ()
 

Detailed Description

Definition at line 57 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_LEN()

UNIT_SELECTOR_LEN::UNIT_SELECTOR_LEN ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos,
const wxSize &  size,
const wxArrayString &  choices,
long  style = 0 
)

Definition at line 29 of file unit_selector.cpp.

32  : UNIT_SELECTOR( parent, id, pos, size, choices, style )
33 {
34  Append( _( "mm" ) );
35  Append( _( "um" ) );
36  Append( _( "cm" ) );
37  Append( _( "mil" ) );
38  Append( _( "inch" ) );
39 }
UNIT_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
Definition: unit_selector.h:37
#define _(s)
Definition: 3d_actions.cpp:33

References _.

Member Function Documentation

◆ GetUnitName()

wxString UNIT_SELECTOR::GetUnitName ( )
inlineinherited

Definition at line 51 of file unit_selector.h.

52  {
53  return GetStringSelection();
54  }

Referenced by PCB_CALCULATOR_FRAME::TWDisplayValues().

◆ GetUnitScale()

double UNIT_SELECTOR_LEN::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

Returns
the scaling factor to convert users units to normalized units (meter)

Implements UNIT_SELECTOR.

Definition at line 47 of file unit_selector.cpp.

48 {
49  switch( GetCurrentSelection() )
50  {
51  case 0: return UNIT_MM; break;
52  case 1: return UNIT_MICRON; break;
53  case 2: return UNIT_CM; break;
54  case 3: return UNIT_MIL; break;
55  case 4: return UNIT_INCH; break;
56  }
57  return 1.0;
58 }
#define UNIT_INCH
Definition: units_scales.h:34
#define UNIT_CM
Definition: units_scales.h:32
#define UNIT_MICRON
Definition: units_scales.h:33
#define UNIT_MIL
Definition: units_scales.h:35
#define UNIT_MM
Definition: units_scales.h:31

References UNIT_CM, UNIT_INCH, UNIT_MICRON, UNIT_MIL, and UNIT_MM.

Referenced by PCB_CALCULATOR_FRAME::OnBoardClassesUnitsSelection(), PCB_CALCULATOR_FRAME::OnElectricalSpacingRefresh(), PCB_CALCULATOR_FRAME::OnElectricalSpacingUnitsSelection(), PCB_CALCULATOR_FRAME::OnTWCalculateFromExtWidth(), PCB_CALCULATOR_FRAME::OnTWCalculateFromIntWidth(), PCB_CALCULATOR_FRAME::onUpdateViaCalcErrorText(), PCB_CALCULATOR_FRAME::OnViaCalculate(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and PCB_CALCULATOR_FRAME::TWDisplayValues().


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