KiCad PCB EDA Suite
erc_settings.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2018 CERN
5  * @author Jon Evans <jon@craftyjon.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef _ERC_SETTINGS_H
22 #define _ERC_SETTINGS_H
23 
24 #include <erc.h>
25 #include <widgets/ui_common.h>
26 
27 
28 class PARAM_CFG;
29 
30 
38 {
39 public:
41  {
42  for( int i = ERCE_FIRST; i <= ERCE_LAST; ++i )
44 
46  }
47 
48  void LoadDefaults()
49  {
56  }
57 
58  bool operator==( const ERC_SETTINGS& other ) const
59  {
60  return ( other.m_Severities == m_Severities );
61  }
62 
63  bool operator!=( const ERC_SETTINGS& other ) const
64  {
65  return !( other == *this );
66  }
67 
68  bool IsTestEnabled( int aErrorCode ) const
69  {
70  return m_Severities.at( aErrorCode ) != RPT_SEVERITY_IGNORE;
71  }
72 
73  std::vector<PARAM_CFG*> GetProjectFileParameters();
74 
75  std::map<int, int> m_Severities;
76 };
77 
78 #endif
Definition: erc.h:55
bool IsTestEnabled(int aErrorCode) const
Definition: erc_settings.h:68
Definition: erc.h:75
bool operator==(const ERC_SETTINGS &other) const
Definition: erc_settings.h:58
Functions to provide common constants and other functions to assist in making a consistent UI.
std::map< int, int > m_Severities
Definition: erc_settings.h:75
Container for ERC settings.
Definition: erc_settings.h:37
std::vector< PARAM_CFG * > GetProjectFileParameters()
void LoadDefaults()
Definition: erc_settings.h:48
PARAM_CFG is a base class which establishes the interface functions ReadParam and SaveParam,...
Definition: config_params.h:98
bool operator!=(const ERC_SETTINGS &other) const
Definition: erc_settings.h:63