KiCad PCB EDA Suite
UNIT_SELECTOR_LEN_CABLE Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_LEN_CABLE:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_LEN_CABLE (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 147 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_LEN_CABLE()

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

Definition at line 205 of file unit_selector.cpp.

207 :
208 UNIT_SELECTOR( parent, id, pos, size, choices, style )
209{
210 Append( _( "cm" ) );
211 Append( _( "m" ) );
212 Append( _( "km" ) );
213 Append( _( "inch" ) );
214 Append( _( "feet" ) );
215}
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)

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 PANEL_TRACK_WIDTH::TWDisplayValues().

◆ GetUnitScale()

double UNIT_SELECTOR_LEN_CABLE::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

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

Implements UNIT_SELECTOR.

Definition at line 222 of file unit_selector.cpp.

223{
224 switch( GetCurrentSelection() )
225 {
226 case 0: return UNIT_CM; break;
227 case 1: return UNIT_M; break;
228 case 2: return UNIT_KM; break;
229 case 3: return UNIT_INCH; break;
230 case 4: return UNIT_FEET; break;
231 }
232 return 1.0;
233}
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
#define UNIT_M
Definition: units_scales.h:32
#define UNIT_INCH
Definition: units_scales.h:36
#define UNIT_FEET
Definition: units_scales.h:38
#define UNIT_CM
Definition: units_scales.h:33
#define UNIT_KM
Definition: units_scales.h:31

References GetCurrentSelection(), UNIT_CM, UNIT_FEET, UNIT_INCH, UNIT_KM, and UNIT_M.

Referenced by PANEL_CABLE_SIZE::OnLengthChange(), PANEL_WAVELENGTH::OnWavelengthMediumChange(), PANEL_WAVELENGTH::OnWavelengthVacuumChange(), PANEL_CABLE_SIZE::printAll(), and PANEL_WAVELENGTH::update().


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