KiCad PCB EDA Suite
TRANSLINE_PRM Class Reference

A class to handle one parameter of transline. More...

#include <transline_ident.h>

Public Member Functions

 TRANSLINE_PRM (PRM_TYPE aType, PRMS_ID aId, const char *aKeywordCfg="", const wxString &aDlgLabel=wxEmptyString, const wxString &aToolTip=wxEmptyString, double aValue=0.0, bool aConvUnit=false)
 
double ToUserUnit ()
 
double FromUserUnit ()
 

Public Attributes

PRM_TYPE m_Type
 
PRMS_ID m_Id
 
std::string m_KeyWord
 
wxString m_DlgLabel
 
wxString m_ToolTip
 
double m_Value
 
double m_NormalizedValue
 
bool m_ConvUnit
 
void * m_ValueCtrl
 
void * m_UnitCtrl
 
int m_UnitSelection
 

Detailed Description

A class to handle one parameter of transline.

Definition at line 62 of file transline_ident.h.

Constructor & Destructor Documentation

◆ TRANSLINE_PRM()

TRANSLINE_PRM::TRANSLINE_PRM ( PRM_TYPE  aType,
PRMS_ID  aId,
const char *  aKeywordCfg = "",
const wxString &  aDlgLabel = wxEmptyString,
const wxString &  aToolTip = wxEmptyString,
double  aValue = 0.0,
bool  aConvUnit = false 
)
Parameters
aKeywordCfgis the keyword used in config to identify the parameter only ASCII7 keyword is valid.
aDlgLabelis a I18n string used to identify the parameter in dialog. usually aDlgLabel is same as aKeywordCfg, but translatable.

Definition at line 45 of file transline_ident.cpp.

48 {
49  m_Type = aType;
50  m_Id = aId;
51  m_DlgLabel = aDlgLabel;
52  m_KeyWord = aKeywordCfg;
53  m_ToolTip = aToolTip;
54  m_Value = aValue;
55  m_ConvUnit = aConvUnit;
56  m_ValueCtrl = nullptr;
57  m_UnitCtrl = nullptr;
58  m_UnitSelection = 0;
60  }
double m_NormalizedValue
wxString m_DlgLabel
wxString m_ToolTip
std::string m_KeyWord

References m_ConvUnit, m_DlgLabel, m_Id, m_KeyWord, m_NormalizedValue, m_ToolTip, m_Type, m_UnitCtrl, m_UnitSelection, m_Value, and m_ValueCtrl.

Member Function Documentation

◆ FromUserUnit()

double TRANSLINE_PRM::FromUserUnit ( )

Definition at line 72 of file transline_ident.cpp.

73 {
74  if( m_UnitCtrl )
75  return ( (UNIT_SELECTOR*) m_UnitCtrl )->GetUnitScale();
76  else
77  return 1.0;
78 }

References m_UnitCtrl.

◆ ToUserUnit()

double TRANSLINE_PRM::ToUserUnit ( )

Definition at line 63 of file transline_ident.cpp.

64 {
65  if( m_UnitCtrl && m_ConvUnit )
66  return 1.0 / ( (UNIT_SELECTOR*) m_UnitCtrl )->GetUnitScale();
67  else
68  return 1.0;
69 }

References m_ConvUnit, and m_UnitCtrl.

Referenced by PANEL_TRANSLINE::SetPrmValue().

Member Data Documentation

◆ m_ConvUnit

bool TRANSLINE_PRM::m_ConvUnit

◆ m_DlgLabel

wxString TRANSLINE_PRM::m_DlgLabel

Definition at line 82 of file transline_ident.h.

Referenced by TRANSLINE_PRM(), and PANEL_TRANSLINE::TranslineTypeSelection().

◆ m_Id

◆ m_KeyWord

std::string TRANSLINE_PRM::m_KeyWord

Definition at line 81 of file transline_ident.h.

Referenced by TRANSLINE_PRM().

◆ m_NormalizedValue

double TRANSLINE_PRM::m_NormalizedValue

◆ m_ToolTip

wxString TRANSLINE_PRM::m_ToolTip

Definition at line 83 of file transline_ident.h.

Referenced by TRANSLINE_PRM(), and PANEL_TRANSLINE::TranslineTypeSelection().

◆ m_Type

PRM_TYPE TRANSLINE_PRM::m_Type

Definition at line 79 of file transline_ident.h.

Referenced by TRANSLINE_PRM(), and PANEL_TRANSLINE::TranslineTypeSelection().

◆ m_UnitCtrl

◆ m_UnitSelection

int TRANSLINE_PRM::m_UnitSelection

◆ m_Value

◆ m_ValueCtrl


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