KiCad PCB EDA Suite
PARAM_CFG_VIADIMENSIONS Class Reference
Inheritance diagram for PARAM_CFG_VIADIMENSIONS:
PARAM_CFG_BASE

Public Member Functions

 PARAM_CFG_VIADIMENSIONS (std::vector< VIA_DIMENSION > *ptparam, const wxChar *group=nullptr)
 
void ReadParam (wxConfigBase *aConfig) const override
 Function ReadParam reads the value of the parameter stored in aConfig. More...
 
void SaveParam (wxConfigBase *aConfig) const override
 Function SaveParam saves the value of the parameter stored in aConfig. More...
 

Public Attributes

wxString m_Ident
 Keyword in config data. More...
 
paramcfg_id m_Type
 Type of parameter. More...
 
wxString m_Group
 Group name (this is like a path in the config data) More...
 
bool m_Setup
 Install or Project based parameter, true == install. More...
 
wxString m_Ident_legacy
 

Protected Attributes

std::vector< VIA_DIMENSION > * m_Pt_param
 Pointer to the parameter value. More...
 

Detailed Description

Definition at line 198 of file board_design_settings.cpp.

Constructor & Destructor Documentation

◆ PARAM_CFG_VIADIMENSIONS()

PARAM_CFG_VIADIMENSIONS::PARAM_CFG_VIADIMENSIONS ( std::vector< VIA_DIMENSION > *  ptparam,
const wxChar *  group = nullptr 
)
inline

Definition at line 204 of file board_design_settings.cpp.

204  :
205  PARAM_CFG_BASE( wxEmptyString, PARAM_VIADIMENSIONS, group )
206  {
207  m_Pt_param = ptparam;
208  }
std::vector< VIA_DIMENSION > * m_Pt_param
Pointer to the parameter value.
PARAM_CFG_BASE(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)

References m_Pt_param.

Member Function Documentation

◆ ReadParam()

void PARAM_CFG_VIADIMENSIONS::ReadParam ( wxConfigBase *  aConfig) const
inlineoverridevirtual

Function ReadParam reads the value of the parameter stored in aConfig.

Parameters
aConfig= the wxConfigBase that holds the parameter

Reimplemented from PARAM_CFG_BASE.

Definition at line 210 of file board_design_settings.cpp.

211  {
212  if( !m_Pt_param || !aConfig )
213  return;
214 
215  m_Pt_param->clear();
216 
217  for( int index = 1; ; ++index )
218  {
219  double diameter = 0.0, drill = 0.0;
220 
221  wxString key = ViaDiameterKey;
222 
223  if( !aConfig->Read( key << index, &diameter ) )
224  break;
225 
226  key = ViaDrillKey;
227  drill = aConfig->ReadDouble( key << index, 0.0 );
228 
229  m_Pt_param->emplace_back( VIA_DIMENSION( Millimeter2iu( diameter ),
230  Millimeter2iu( drill ) ) );
231  }
232  }
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
std::vector< VIA_DIMENSION > * m_Pt_param
Pointer to the parameter value.
#define ViaDiameterKey
#define ViaDrillKey

References m_Pt_param, ViaDiameterKey, and ViaDrillKey.

◆ SaveParam()

void PARAM_CFG_VIADIMENSIONS::SaveParam ( wxConfigBase *  aConfig) const
inlineoverridevirtual

Function SaveParam saves the value of the parameter stored in aConfig.

Parameters
aConfig= the wxConfigBase that can store the parameter

Reimplemented from PARAM_CFG_BASE.

Definition at line 234 of file board_design_settings.cpp.

235  {
236  if( !m_Pt_param || !aConfig )
237  return;
238 
239  for( size_t index = 1; index <= m_Pt_param->size(); ++index )
240  {
241  wxString key = ViaDiameterKey;
242  aConfig->Write( key << index, Iu2Millimeter( m_Pt_param->at( index - 1 ).m_Diameter ) );
243  key = ViaDrillKey;
244  aConfig->Write( key << index, Iu2Millimeter( m_Pt_param->at( index - 1 ).m_Drill ) );
245  }
246  }
std::vector< VIA_DIMENSION > * m_Pt_param
Pointer to the parameter value.
#define ViaDiameterKey
#define ViaDrillKey

References m_Pt_param, ViaDiameterKey, and ViaDrillKey.

Member Data Documentation

◆ m_Group

wxString PARAM_CFG_BASE::m_Group
inherited

Group name (this is like a path in the config data)

Definition at line 104 of file config_params.h.

Referenced by PARAM_CFG_BASE::PARAM_CFG_BASE().

◆ m_Ident

◆ m_Ident_legacy

wxString PARAM_CFG_BASE::m_Ident_legacy
inherited

◆ m_Pt_param

std::vector<VIA_DIMENSION>* PARAM_CFG_VIADIMENSIONS::m_Pt_param
protected

Pointer to the parameter value.

Definition at line 201 of file board_design_settings.cpp.

Referenced by PARAM_CFG_VIADIMENSIONS(), ReadParam(), and SaveParam().

◆ m_Setup

bool PARAM_CFG_BASE::m_Setup
inherited

◆ m_Type

paramcfg_id PARAM_CFG_BASE::m_Type
inherited

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