KiCad PCB EDA Suite
UNIT_SELECTOR_LINEAR_RESISTANCE Class Reference

#include <unit_selector.h>

Inheritance diagram for UNIT_SELECTOR_LINEAR_RESISTANCE:
UNIT_SELECTOR

Public Member Functions

 UNIT_SELECTOR_LINEAR_RESISTANCE (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 132 of file unit_selector.h.

Constructor & Destructor Documentation

◆ UNIT_SELECTOR_LINEAR_RESISTANCE()

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

Definition at line 175 of file unit_selector.cpp.

178 : UNIT_SELECTOR( parent, id, pos, size, choices, style )
179{
180 Append( wxT( "Ω/m" ) );
181 Append( wxT( "Ω/km" ) );
182 Append( wxT( "Ω/ft" ) );
183 Append( wxT( "Ω/1000ft" ) );
184}
UNIT_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
Definition: unit_selector.h:37

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_LINEAR_RESISTANCE::GetUnitScale ( )
overridevirtual

Function GetUnitScale.

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

Implements UNIT_SELECTOR.

Definition at line 192 of file unit_selector.cpp.

193{
194 switch( GetCurrentSelection() )
195 {
196 case 0: return UNIT_OHM_PER_METER; break;
197 case 1: return UNIT_OHM_PER_KILOMETER; break;
198 case 2: return UNIT_OHM_PER_FEET; break;
199 case 3: return UNIT_OHM_PER_1000FEET; break;
200 }
201 return 1.0;
202}
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
#define UNIT_OHM_PER_METER
Definition: units_scales.h:51
#define UNIT_OHM_PER_FEET
Definition: units_scales.h:53
#define UNIT_OHM_PER_1000FEET
Definition: units_scales.h:54
#define UNIT_OHM_PER_KILOMETER
Definition: units_scales.h:52

References GetCurrentSelection(), UNIT_OHM_PER_1000FEET, UNIT_OHM_PER_FEET, UNIT_OHM_PER_KILOMETER, and UNIT_OHM_PER_METER.

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


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