KiCad PCB EDA Suite
class_drc_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) 2007 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 /******************************************************************/
26 /* class_drc_erc_item.cpp - DRC_ITEM class functions for eeschema */
27 /******************************************************************/
28 #include <fctsys.h>
29 #include <common.h>
30 
31 #include <class_drc_item.h>
32 #include <erc.h>
33 #include <base_units.h>
34 
35 wxString DRC_ITEM::GetErrorText() const
36 {
37  switch( m_ErrorCode )
38  {
39  case ERCE_UNSPECIFIED:
40  return wxString( _("ERC err unspecified") );
42  return wxString( _("Duplicate sheet names within a given sheet") );
44  return wxString( _("Pin not connected (and no connect symbol found on this pin)") );
46  return wxString( _("Pin connected to some others pins but no pin to drive it") );
48  return wxString( _("Conflict problem between pins. Severity: warning") );
50  return wxString( _("Conflict problem between pins. Severity: error") );
52  return wxString( _("Mismatch between hierarchical labels and pins sheets"));
54  return wxString( _("A no connect symbol is connected to more than 1 pin"));
55  case ERCE_GLOBLABEL:
56  return wxString( _("Global label not connected to any other global label") );
58  return wxString( _("Labels are similar (lower/upper case difference only)") );
60  return wxString( _("Global labels are similar (lower/upper case difference only)") );
61 
62  default:
63  return wxString( wxT("Unkown.") );
64  }
65 }
66 
67 wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
68 {
69  wxString ret;
70  ret << aPos;
71  return ret;
72 }
#define ERCE_SIMILAR_LABELS
Definition: erc.h:61
#define ERCE_HIERACHICAL_LABEL
Definition: erc.h:58
Implementation of conversion functions that require both schematic and board internal units...
wxString GetErrorText() const
Function GetErrorText returns the string form of a drc error code.
#define ERCE_PIN_NOT_DRIVEN
Definition: erc.h:55
#define ERCE_PIN_NOT_CONNECTED
Definition: erc.h:54
#define ERCE_SIMILAR_GLBL_LABELS
Definition: erc.h:62
#define ERCE_GLOBLABEL
Definition: erc.h:60
#define ERCE_DUPLICATE_SHEET_NAME
Definition: erc.h:53
#define ERCE_PIN_TO_PIN_ERROR
Definition: erc.h:57
The common library.
#define ERCE_NOCONNECT_CONNECTED
Definition: erc.h:59
#define ERCE_PIN_TO_PIN_WARNING
Definition: erc.h:56
#define ERCE_UNSPECIFIED
DRC error codes:
Definition: erc.h:52
static wxString ShowCoord(const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
int m_ErrorCode
the error code's numeric value