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

Public Member Functions

 PARAM_CFG_DIFFPAIRDIMENSIONS (std::vector< DIFF_PAIR_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< DIFF_PAIR_DIMENSION > * m_Pt_param
 Pointer to the parameter value. More...
 

Detailed Description

Definition at line 242 of file board_design_settings.cpp.

Constructor & Destructor Documentation

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

Definition at line 248 of file board_design_settings.cpp.

249  :
250  PARAM_CFG_BASE( wxEmptyString, PARAM_DIFFPAIRDIMENSIONS, group )
251  {
252  m_Pt_param = ptparam;
253  }
PARAM_CFG_BASE(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)
std::vector< DIFF_PAIR_DIMENSION > * m_Pt_param
Pointer to the parameter value.

Member Function Documentation

void PARAM_CFG_DIFFPAIRDIMENSIONS::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 255 of file board_design_settings.cpp.

References dPairGapKey, dPairViaGapKey, and dPairWidthKey.

256  {
257  if( !m_Pt_param || !aConfig )
258  return;
259 
260  m_Pt_param->clear();
261 
262  for( int index = 1; ; ++index )
263  {
264  double width, gap, viagap;
265 
266  wxString key = dPairWidthKey;
267 
268  if( !aConfig->Read( key << index, &width ) )
269  break;
270 
271  key = dPairGapKey;
272  gap = aConfig->ReadDouble( key << index, 0.0 );
273 
274  key = dPairViaGapKey;
275  viagap = aConfig->ReadDouble( key << index, 0.0 );
276 
277  m_Pt_param->emplace_back( DIFF_PAIR_DIMENSION( Millimeter2iu( width ),
278  Millimeter2iu( gap ),
279  Millimeter2iu( viagap ) ) );
280  }
281  }
Struct DIFF_PAIR_DIMENSION is a small helper container to handle a stock of specific differential pai...
#define dPairGapKey
#define dPairWidthKey
#define dPairViaGapKey
std::vector< DIFF_PAIR_DIMENSION > * m_Pt_param
Pointer to the parameter value.
void PARAM_CFG_DIFFPAIRDIMENSIONS::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 283 of file board_design_settings.cpp.

References dPairGapKey, dPairViaGapKey, and dPairWidthKey.

284  {
285  if( !m_Pt_param || !aConfig )
286  return;
287 
288  for( size_t index = 1; index <= m_Pt_param->size(); ++index )
289  {
290  wxString key = dPairWidthKey;
291  aConfig->Write( key << index, Iu2Millimeter( m_Pt_param->at( index - 1 ).m_Width ) );
292  key = dPairGapKey;
293  aConfig->Write( key << index, Iu2Millimeter( m_Pt_param->at( index - 1 ).m_Gap ) );
294  key = dPairViaGapKey;
295  aConfig->Write( key << index, Iu2Millimeter( m_Pt_param->at( index - 1 ).m_ViaGap ) );
296  }
297  }
#define dPairGapKey
#define dPairWidthKey
#define dPairViaGapKey
std::vector< DIFF_PAIR_DIMENSION > * m_Pt_param
Pointer to the parameter value.

Member Data Documentation

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().

wxString PARAM_CFG_BASE::m_Ident_legacy
inherited
std::vector<DIFF_PAIR_DIMENSION>* PARAM_CFG_DIFFPAIRDIMENSIONS::m_Pt_param
protected

Pointer to the parameter value.

Definition at line 245 of file board_design_settings.cpp.

bool PARAM_CFG_BASE::m_Setup
inherited
paramcfg_id PARAM_CFG_BASE::m_Type
inherited

Type of parameter.

Definition at line 103 of file config_params.h.

Referenced by PARAM_CFG_BASE::PARAM_CFG_BASE(), and PARAM_CFG_INT_WITH_SCALE::PARAM_CFG_INT_WITH_SCALE().


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