KiCad PCB EDA Suite
erc_item.cpp
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) 2020 KiCad Developers, see change_log.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 
25 #include <fctsys.h>
26 #include "wx/html/m_templ.h"
27 #include "wx/html/styleparams.h"
28 #include <erc.h>
29 #include <erc_item.h>
30 #include <i18n_utility.h>
31 
32 wxString ERC_ITEM::GetErrorText( int aErrorCode, bool aTranslate ) const
33 {
34  wxString msg;
35 
36  if( aErrorCode < 0 )
37  aErrorCode = m_errorCode;
38 
39  switch( aErrorCode )
40  {
41  case ERCE_UNSPECIFIED:
42  msg = _HKI("ERC err unspecified" );
43  break;
45  msg = _HKI("Duplicate sheet names within a given sheet" );
46  break;
48  msg = _HKI("Pin not connected" );
49  break;
51  msg = _HKI( "Pin connected to other pins, but not driven by any pin" );
52  break;
55  msg = _HKI("Conflict problem between pins" );
56  break;
58  msg = _HKI("Mismatch between hierarchical labels and pins sheets" );
59  break;
61  msg = _HKI("A pin with a \"no connection\" flag is connected" );
62  break;
64  msg = _HKI("Unconnected \"no connection\" flag" );
65  break;
67  msg = _HKI("Label not connected anywhere else in the schematic" );
68  break;
70  msg = _HKI("Labels are similar (lower/upper case difference only)" );
71  break;
73  msg = _HKI("Different footprint assigned in another unit of the same component" );
74  break;
76  msg = _HKI("Different net assigned to a shared pin in another unit of the same component" );
77  break;
79  msg = _HKI("Conflict between bus alias definitions across schematic sheets" );
80  break;
82  msg = _HKI( "More than one name given to this bus or net" );
83  break;
85  msg = _HKI( "Net is graphically connected to a bus but not a bus member" );
86  break;
88  msg = _HKI( "Label attached to bus item does not describe a bus" );
89  break;
91  msg = _HKI( "Buses are graphically connected but share no bus members" );
92  break;
94  msg = _HKI( "Invalid connection between bus and net items" );
95  break;
96  case ERCE_GLOBLABEL:
97  msg = _HKI( "Global label not connected anywhere else in the schematic" );
98  break;
100  msg = _HKI( "Unresolved text variable" );
101  break;
102  default:
103  wxFAIL_MSG( "Missing ERC error description" );
104  msg = _HKI( "Unknown ERC violation" );
105  break;
106  }
107 
108  if( aTranslate )
109  return wxGetTranslation( msg );
110  else
111  return msg;
112 }
wxString GetErrorText(int aErrorCode=-1, bool aTranslate=true) const override
Function GetErrorText returns the string form of an erc error code.
Definition: erc_item.cpp:32
int m_errorCode
Definition: rc_item.h:80
Some functions to handle hotkeys in KiCad.
#define _HKI(x)