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)
 
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)

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_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}
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
#define UNIT_GHZ
Definition: units_scales.h:41
#define UNIT_MHZ
Definition: units_scales.h:42
#define UNIT_KHZ
Definition: units_scales.h:43

References GetCurrentSelection(), UNIT_GHZ, UNIT_KHZ, and UNIT_MHZ.

Referenced by PANEL_CABLE_SIZE::OnFrequencyChange(), PANEL_WAVELENGTH::OnFrequencyChange(), PANEL_CABLE_SIZE::printAll(), and PANEL_WAVELENGTH::update().


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