KiCad PCB EDA Suite
PARAM_CFG_SEVERITIES Class Reference
Inheritance diagram for PARAM_CFG_SEVERITIES:
PARAM_CFG PARAM_CFG

Public Member Functions

 PARAM_CFG_SEVERITIES (ERC_SETTINGS *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...
 
 PARAM_CFG_SEVERITIES (BOARD *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

ERC_SETTINGSm_Pt_param
 Pointer to the parameter value. More...
 
BOARDm_Pt_param
 Pointer to the parameter value. More...
 

Detailed Description

Definition at line 107 of file eeschema_config.cpp.

Constructor & Destructor Documentation

◆ PARAM_CFG_SEVERITIES() [1/2]

PARAM_CFG_SEVERITIES::PARAM_CFG_SEVERITIES ( ERC_SETTINGS ptparam,
const wxChar *  group = nullptr 
)
inline

Definition at line 113 of file eeschema_config.cpp.

113  :
114  PARAM_CFG( wxEmptyString, PARAM_SEVERITIES, group )
115  {
116  m_Pt_param = ptparam;
117  }
ERC_SETTINGS * m_Pt_param
Pointer to the parameter value.
PARAM_CFG(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)

References m_Pt_param.

◆ PARAM_CFG_SEVERITIES() [2/2]

PARAM_CFG_SEVERITIES::PARAM_CFG_SEVERITIES ( BOARD ptparam,
const wxChar *  group = nullptr 
)
inline

Definition at line 62 of file board_design_settings.cpp.

62  :
63  PARAM_CFG( wxEmptyString, PARAM_SEVERITIES, group )
64  {
65  m_Pt_param = ptparam;
66  }
ERC_SETTINGS * m_Pt_param
Pointer to the parameter value.
PARAM_CFG(const wxString &ident, const paramcfg_id type, const wxChar *group=NULL, const wxString &legacy_ident=wxEmptyString)

References m_Pt_param.

Member Function Documentation

◆ ReadParam() [1/2]

void PARAM_CFG_SEVERITIES::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.

Definition at line 68 of file board_design_settings.cpp.

69  {
70  if( !m_Pt_param || !aConfig )
71  return;
72 
73  BOARD* board = m_Pt_param;
75  wxString oldPath = aConfig->GetPath();
76 
77  // Read legacy settings first so that modern settings will overwrite them
78  bool flag;
79 
80  if( aConfig->Read( wxT( "RequireCourtyardDefinitions" ), &flag, false ) )
81  {
82  if( flag )
84  else
86  }
87 
88  if( aConfig->Read( wxT( "ProhibitOverlappingCourtyards" ), &flag, false ) )
89  {
90  if( flag )
92  else
94  }
95 
104 
105  DRC_ITEM drc( 0 );
106  wxString severity;
107 
108  auto mapSeverity = []( const wxString& aSeverity )
109  {
110  if( aSeverity == wxT( "warning" ) )
111  return RPT_SEVERITY_WARNING;
112  else if( aSeverity == wxT( "ignore" ) )
113  return RPT_SEVERITY_IGNORE;
114  else
115  return RPT_SEVERITY_ERROR;
116  };
117 
118  for( int i = DRCE_FIRST; i <= DRCE_LAST; ++i )
119  {
120  wxString name = drc.GetErrorText( i, false );
121  name.Replace( wxT( " " ), wxT( "_" ) );
122 
123  if( aConfig->Read( name, &severity, wxEmptyString ) )
124  bds.m_DRCSeverities[i] = mapSeverity( severity );
125  }
126 
127  aConfig->SetPath( oldPath );
128  }
std::map< int, int > m_DRCSeverities
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
ERC_SETTINGS * m_Pt_param
Pointer to the parameter value.
Definition: drc.h:109
const char * name
Definition: DXF_plotter.cpp:60
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
footprint has no courtyard defined
Definition: drc.h:96
footprint courtyards overlap
Definition: drc.h:95
Definition: drc.h:41
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.

References CLEANUP_DANGLING_TRACK, CLEANUP_DANGLING_VIA, CLEANUP_DUPLICATE_TRACK, CLEANUP_MERGE_TRACKS, CLEANUP_REDUNDANT_VIA, CLEANUP_SHORT, CLEANUP_TRACK_IN_PAD, CLEANUP_ZERO_LENGTH_TRACK, DRCE_FIRST, DRCE_LAST, DRCE_MISSING_COURTYARD, DRCE_OVERLAPPING_FOOTPRINTS, BOARD::GetDesignSettings(), DRC_ITEM::GetErrorText(), BOARD_DESIGN_SETTINGS::m_DRCSeverities, m_Pt_param, name, RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_IGNORE, and RPT_SEVERITY_WARNING.

◆ ReadParam() [2/2]

void PARAM_CFG_SEVERITIES::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.

Definition at line 119 of file eeschema_config.cpp.

120  {
121  if( !m_Pt_param || !aConfig )
122  return;
123 
124  wxString oldPath = aConfig->GetPath();
125 
126  // Read legacy settings first so that modern settings will overwrite them
127  bool flag;
128 
129  if( aConfig->Read( wxT( "ERC_TestSimilarLabels" ), &flag, true ) )
130  {
131  if( flag )
133  else
135  }
136 
137  if( aConfig->Read( wxT( "ERC_CheckUniqueGlobalLabels" ), &flag, true ) )
138  {
139  if( flag )
141  else
143  }
144 
145  if( aConfig->Read( wxT( "ERC_CheckBusDriverConflicts" ), &flag, true ) )
146  {
147  if( flag )
149  else
151  }
152 
153  if( aConfig->Read( wxT( "ERC_CheckBusEntryConflicts" ), &flag, true ) )
154  {
155  if( flag )
157  else
159  }
160 
161  if( aConfig->Read( wxT( "ERC_CheckBusToBusConflicts" ), &flag, true ) )
162  {
163  if( flag )
165  else
167  }
168 
169  if( aConfig->Read( wxT( "ERC_CheckBusToNetConflicts" ), &flag, true ) )
170  {
171  if( flag )
173  else
175  }
176 
177  // TO DO: figure out what we're going to use as keys here so we can read/write these....
178 
179  aConfig->SetPath( oldPath );
180  }
ERC_SETTINGS * m_Pt_param
Pointer to the parameter value.
std::map< int, int > m_Severities
Definition: erc_settings.h:75

References ERCE_BUS_ENTRY_CONFLICT, ERCE_BUS_TO_BUS_CONFLICT, ERCE_BUS_TO_NET_CONFLICT, ERCE_DRIVER_CONFLICT, ERCE_GLOBLABEL, ERCE_SIMILAR_LABELS, m_Pt_param, ERC_SETTINGS::m_Severities, RPT_SEVERITY_ERROR, RPT_SEVERITY_IGNORE, and RPT_SEVERITY_WARNING.

◆ SaveParam() [1/2]

void PARAM_CFG_SEVERITIES::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.

Definition at line 130 of file board_design_settings.cpp.

131  {
132  if( !m_Pt_param || !aConfig )
133  return;
134 
135  BOARD* board = m_Pt_param;
137  wxString oldPath = aConfig->GetPath();
138  DRC_ITEM drc( 0 );
139 
140  auto mapSeverity = []( int aSeverity )
141  {
142  if( aSeverity == RPT_SEVERITY_IGNORE )
143  return wxT( "ignore" );
144  else if( aSeverity == RPT_SEVERITY_WARNING )
145  return wxT( "warning" );
146  else
147  return wxT( "error" );
148  };
149 
150  for( int i = DRCE_FIRST; i <= DRCE_LAST; ++i )
151  {
152  wxString name = drc.GetErrorText( i, false );
153  name.Replace( wxT( " " ), wxT( "_" ) );
154 
155  aConfig->Write( name, mapSeverity( bds.m_DRCSeverities[i] ) );
156  }
157 
158  aConfig->SetPath( oldPath );
159  }
std::map< int, int > m_DRCSeverities
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
ERC_SETTINGS * m_Pt_param
Pointer to the parameter value.
Definition: drc.h:109
const char * name
Definition: DXF_plotter.cpp:60
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
Definition: drc.h:41
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.

References DRCE_FIRST, DRCE_LAST, BOARD::GetDesignSettings(), DRC_ITEM::GetErrorText(), BOARD_DESIGN_SETTINGS::m_DRCSeverities, m_Pt_param, name, RPT_SEVERITY_IGNORE, and RPT_SEVERITY_WARNING.

◆ SaveParam() [2/2]

void PARAM_CFG_SEVERITIES::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.

Definition at line 182 of file eeschema_config.cpp.

183  {
184  if( !m_Pt_param || !aConfig )
185  return;
186 
187  wxString oldPath = aConfig->GetPath();
188 
189  // TO DO: figure out what we're going to use as keys here so we can read/write these....
190 
191  // TO DO: for now just write out the legacy ones so we don't lose them
192  // TO DO: remove this once the new scheme is in place
193  aConfig->Write( wxT( "ERC_TestSimilarLabels" ),
195  aConfig->Write( wxT( "ERC_CheckUniqueGlobalLabels" ),
197  aConfig->Write( wxT( "ERC_CheckBusDriverConflicts" ),
199  aConfig->Write( wxT( "ERC_CheckBusEntryConflicts" ),
201  aConfig->Write( wxT( "ERC_CheckBusToBusConflicts" ),
203  aConfig->Write( wxT( "ERC_CheckBusToNetConflicts" ),
205 
206  aConfig->SetPath( oldPath );
207  }
bool IsTestEnabled(int aErrorCode) const
Definition: erc_settings.h:68
ERC_SETTINGS * m_Pt_param
Pointer to the parameter value.

References ERCE_BUS_ENTRY_CONFLICT, ERCE_BUS_TO_BUS_CONFLICT, ERCE_BUS_TO_NET_CONFLICT, ERCE_DRIVER_CONFLICT, ERCE_GLOBLABEL, ERCE_SIMILAR_LABELS, ERC_SETTINGS::IsTestEnabled(), and m_Pt_param.

Member Data Documentation

◆ m_Group

wxString PARAM_CFG::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::PARAM_CFG().

◆ m_Ident

◆ m_Ident_legacy

wxString PARAM_CFG::m_Ident_legacy
inherited

◆ m_Pt_param [1/2]

BOARD* PARAM_CFG_SEVERITIES::m_Pt_param
protected

Pointer to the parameter value.

Definition at line 59 of file board_design_settings.cpp.

◆ m_Pt_param [2/2]

ERC_SETTINGS* PARAM_CFG_SEVERITIES::m_Pt_param
protected

Pointer to the parameter value.

Definition at line 110 of file eeschema_config.cpp.

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

◆ m_Setup

◆ m_Type

paramcfg_id PARAM_CFG::m_Type
inherited

Type of parameter.

Definition at line 103 of file config_params.h.

Referenced by dumpParamCfg(), PARAM_CFG::PARAM_CFG(), and PARAM_CFG_INT_WITH_SCALE::PARAM_CFG_INT_WITH_SCALE().


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