KiCad PCB EDA Suite
UNIT_SELECTOR_VOLTAGE Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_VOLTAGE:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_VOLTAGE (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 162 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_VOLTAGE()

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

Definition at line 250 of file unit_selector.cpp.

252 :
253 UNIT_SELECTOR( parent, id, pos, size, choices, style )
254{
255 Append( _( "mV" ) );
256 Append( _( "V" ) );
257}
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_VOLTAGE::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

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

Implements UNIT_SELECTOR.

Definition at line 240 of file unit_selector.cpp.

241{
242 switch( GetCurrentSelection() )
243 {
244 case 0: return UNIT_MILLIVOLT; break;
245 case 1: return UNIT_VOLT; break;
246 }
247 return 1.0;
248}
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
#define UNIT_MILLIVOLT
Definition: units_scales.h:58
#define UNIT_VOLT
Definition: units_scales.h:57

References GetCurrentSelection(), UNIT_MILLIVOLT, and UNIT_VOLT.

Referenced by PANEL_CABLE_SIZE::OnVDropChange(), and PANEL_CABLE_SIZE::printAll().


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