KiCad PCB EDA Suite
UNIT_SELECTOR_SPEED Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_SPEED:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_SPEED (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 190 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_SPEED()

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

Definition at line 283 of file unit_selector.cpp.

285 :
286 UNIT_SELECTOR( parent, id, pos, size, choices, style )
287{
288 Append( _( "m/s" ) );
289 Append( _( "ft/s" ) );
290 Append( _( "km/h" ) );
291 Append( _( "mi/h" ) );
292}
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_SPEED::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

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

Implements UNIT_SELECTOR.

Definition at line 299 of file unit_selector.cpp.

300{
301 switch( GetCurrentSelection() )
302 {
303 case 0: return UNIT_METER_PER_SECOND; break;
304 case 1: return UNIT_FEET_PER_SECOND; break;
305 case 2: return UNIT_KILOMETER_PER_HOUR; break;
306 case 3: return UNIT_MILES_PER_HOUR; break;
307 }
308 return 1.0;
309}
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
#define UNIT_MILES_PER_HOUR
Definition: units_scales.h:68
#define UNIT_METER_PER_SECOND
Definition: units_scales.h:65
#define UNIT_KILOMETER_PER_HOUR
Definition: units_scales.h:66
#define UNIT_FEET_PER_SECOND
Definition: units_scales.h:67

References GetCurrentSelection(), UNIT_FEET_PER_SECOND, UNIT_KILOMETER_PER_HOUR, UNIT_METER_PER_SECOND, and UNIT_MILES_PER_HOUR.

Referenced by PANEL_WAVELENGTH::update().


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