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)
 
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( wxT( "mm" ) );
67 Append( wxT( "µm" ) );
68 Append( wxT( "cm" ) );
69 Append( wxT( "mil" ) );
70 Append( wxT( "inch" ) );
71 Append( wxT( "oz/ft²" ) );
72}
UNIT_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
Definition: unit_selector.h:37

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 PANEL_TRACK_WIDTH::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}
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
#define UNIT_OZSQFT
Definition: units_scales.h:39
#define UNIT_MICRON
Definition: units_scales.h:35
#define UNIT_MM
Definition: units_scales.h:34
#define UNIT_MIL
Definition: units_scales.h:37
#define UNIT_INCH
Definition: units_scales.h:36
#define UNIT_CM
Definition: units_scales.h:33

References GetCurrentSelection(), UNIT_CM, UNIT_INCH, UNIT_MICRON, UNIT_MIL, UNIT_MM, and UNIT_OZSQFT.

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


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