KiCad PCB EDA Suite
UNIT_SELECTOR_TIME Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_TIME:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_TIME (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 204 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_TIME()

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

Definition at line 311 of file unit_selector.cpp.

313 :
314 UNIT_SELECTOR( parent, id, pos, size, choices, style )
315{
316 Append( _( "ns" ) );
317 Append( _( "ps" ) );
318}
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_TIME::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

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

Implements UNIT_SELECTOR.

Definition at line 325 of file unit_selector.cpp.

326{
327 switch( GetCurrentSelection() )
328 {
329 case 0: return UNIT_NSECOND; break;
330 case 1: return UNIT_PSECOND; break;
331 }
332 return 1.0;
333}
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
#define UNIT_NSECOND
Definition: units_scales.h:73
#define UNIT_PSECOND
Definition: units_scales.h:74

References GetCurrentSelection(), UNIT_NSECOND, and UNIT_PSECOND.

Referenced by PANEL_WAVELENGTH::OnPeriodChange(), and PANEL_WAVELENGTH::update().


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