KiCad PCB EDA Suite
UNIT_SELECTOR_FREQUENCY Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_FREQUENCY:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_FREQUENCY (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 87 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_FREQUENCY()

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

Definition at line 95 of file unit_selector.cpp.

97  :
98  UNIT_SELECTOR( parent, id, pos, size, choices, style )
99 {
100  Append( _( "GHz" ) );
101  Append( _( "MHz" ) );
102  Append( _( "kHz" ) );
103  Append( _( "Hz" ) );
104 }
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_FREQUENCY::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

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

Implements UNIT_SELECTOR.

Definition at line 111 of file unit_selector.cpp.

112 {
113  switch( GetCurrentSelection() )
114  {
115  case 0: return UNIT_GHZ;
116  case 1: return UNIT_MHZ;
117  case 2: return UNIT_KHZ;
118  case 3: return 1.0;
119  }
120  return 1.0;
121 }
#define UNIT_GHZ
Definition: units_scales.h:38
#define UNIT_MHZ
Definition: units_scales.h:39
#define UNIT_KHZ
Definition: units_scales.h:40

References UNIT_GHZ, UNIT_KHZ, and UNIT_MHZ.


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