KiCad PCB EDA Suite
UNIT_SELECTOR_THICKNESS Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_THICKNESS:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_THICKNESS (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 72 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_THICKNESS()

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

Definition at line 61 of file unit_selector.cpp.

64  : UNIT_SELECTOR( parent, id, pos, size, choices, style )
65 {
66  Append( _( "mm" ) );
67  Append( _( "um" ) );
68  Append( _( "cm" ) );
69  Append( _( "mil" ) );
70  Append( _( "inch" ) );
71  Append( _( "oz/ft^2" ) );
72 }
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_THICKNESS::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

Returns
the scaling factor to convert users units to normalized units (meter) including oz/ft^2

Implements UNIT_SELECTOR.

Definition at line 80 of file unit_selector.cpp.

81 {
82  switch( GetCurrentSelection() )
83  {
84  case 0: return UNIT_MM; break;
85  case 1: return UNIT_MICRON; break;
86  case 2: return UNIT_CM; break;
87  case 3: return UNIT_MIL; break;
88  case 4: return UNIT_INCH; break;
89  case 5: return UNIT_OZSQFT; break;
90  }
91  return 1.0;
92 }
#define UNIT_OZSQFT
Definition: units_scales.h:36
#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, UNIT_MM, and UNIT_OZSQFT.

Referenced by PCB_CALCULATOR_FRAME::OnTWCalculateFromCurrent(), PCB_CALCULATOR_FRAME::OnTWCalculateFromExtWidth(), and PCB_CALCULATOR_FRAME::OnTWCalculateFromIntWidth().


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