KiCad PCB EDA Suite
erc.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) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2009-2015 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
30 #ifndef _ERC_H
31 #define _ERC_H
32 
33 
34 //class EDA_DRAW_PANEL;
35 class NETLIST_OBJECT;
37 
38 /* For ERC markers: error types (used in diags, and to set the color):
39 */
41 {
42  OK = 0,
43  WAR, // Error: severity = warning
44  ERR, // Error: severity = error
45  UNC // Error: unconnected pin
46 };
47 
48 extern const wxString CommentERC_H[];
49 extern const wxString CommentERC_V[];
50 
52 #define ERCE_UNSPECIFIED 0
53 #define ERCE_DUPLICATE_SHEET_NAME 1 // duplicate sheet names within a given sheet
54 #define ERCE_PIN_NOT_CONNECTED 2 // pin not connected and not no connect symbol
55 #define ERCE_PIN_NOT_DRIVEN 3 // pin connected to some others pins but no pin to drive it
56 #define ERCE_PIN_TO_PIN_WARNING 4 // pin connected to an other pin: warning level
57 #define ERCE_PIN_TO_PIN_ERROR 5 // pin connected to an other pin: error level
58 #define ERCE_HIERACHICAL_LABEL 6 // mismatch between hierarchical labels and pins sheets
59 #define ERCE_NOCONNECT_CONNECTED 7 // a no connect symbol is connected to more than 1 pin
60 #define ERCE_GLOBLABEL 8 // global label not connected to any other global label
61 #define ERCE_SIMILAR_LABELS 9 // 2 labels are equal fir case insensitive comparisons
62 #define ERCE_SIMILAR_GLBL_LABELS 10 // 2 labels are equal fir case insensitive comparisons
63 
64 /* Minimal connection table */
65 #define NPI 4 // Net with Pin isolated, this pin has type Not Connected and must be left N.C.
66 #define DRV 3 // Net driven by a signal (a pin output for instance)
67 #define NET_NC 2 // Net "connected" to a "NoConnect symbol"
68 #define NOD 1 // Net not driven ( Such as 2 or more connected inputs )
69 #define NOC 0 // initial state of a net: no connection
70 
71 
78 bool WriteDiagnosticERC( const wxString& aFullFileName );
79 
85 void Diagnose( NETLIST_OBJECT* NetItemRef, NETLIST_OBJECT* NetItemTst,
86  int MinConnexion, int Diag );
87 
98  unsigned aNetItemRef, unsigned aNetStart,
99  int* aMinConnexion );
100 
109 int TestDuplicateSheetNames( bool aCreateMarker );
110 
111 
112 #endif // _ERC_H
Definition: erc.h:43
const wxString CommentERC_H[]
Definition: erc.cpp:87
void TestOthersItems(NETLIST_OBJECT_LIST *aList, unsigned aNetItemRef, unsigned aNetStart, int *aMinConnexion)
Perform ERC testing for electrical conflicts between NetItemRef and other items (mainly pin) on the s...
Definition: erc.cpp:372
Class NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected item...
Definition: erc.h:42
Definition: erc.h:44
Definition: erc.h:45
const wxString CommentERC_V[]
Definition: erc.cpp:103
int TestDuplicateSheetNames(bool aCreateMarker)
Function TestDuplicateSheetNames( ) inside a given sheet, one cannot have sheets with duplicate names...
Definition: erc.cpp:177
bool WriteDiagnosticERC(const wxString &aFullFileName)
Function WriteDiagnosticERC save the ERC errors to aFullFileName.
Definition: erc.cpp:525
errortype
Definition: erc.h:40
void Diagnose(NETLIST_OBJECT *NetItemRef, NETLIST_OBJECT *NetItemTst, int MinConnexion, int Diag)
Performs ERC testing and creates an ERC marker to show the ERC problem for aNetItemRef or between aNe...
Definition: erc.cpp:228