KiCad PCB EDA Suite
UNIT_SELECTOR_RESISTOR Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_RESISTOR:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_RESISTOR (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 117 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_RESISTOR()

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

Definition at line 149 of file unit_selector.cpp.

152  : UNIT_SELECTOR( parent, id, pos, size, choices, style )
153 {
154  Append( _( "Ohm" ) );
155  Append( _( "kOhm" ) );
156 }
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_RESISTOR::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

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

Implements UNIT_SELECTOR.

Definition at line 164 of file unit_selector.cpp.

165 {
166  switch( GetCurrentSelection() )
167  {
168  case 0: return UNIT_OHM; break;
169  case 1: return UNIT_KOHM; break;
170  }
171  return 1.0;
172 }
#define UNIT_OHM
Definition: units_scales.h:45
#define UNIT_KOHM
Definition: units_scales.h:46

References UNIT_KOHM, and UNIT_OHM.

Referenced by PCB_CALCULATOR_FRAME::OnViaCalculate().


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