KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.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, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef ERC_H
23#define ERC_H
24
25#include <erc/erc_settings.h>
26#include <sch_sheet_path.h>
27#include <sch_screen.h>
28#include <sch_reference_list.h>
29#include <connection_graph.h>
30#include <vector>
31#include <map>
32
33
34class SCHEMATIC;
36class SCH_EDIT_FRAME;
38struct KIFACE;
39class PROJECT;
40class SCH_RULE_AREA;
41
42
43extern const wxString CommentERC_H[];
44extern const wxString CommentERC_V[];
45
46
48{
49public:
50
51 ERC_TESTER( SCHEMATIC* aSchematic, bool aShowAllErrors = false ) :
52 m_schematic( aSchematic ),
53 m_settings( aSchematic->ErcSettings() ),
54 m_sheetList( aSchematic->BuildSheetListSortedByPageNumbers() ),
55 m_screens( aSchematic->Root() ),
56 m_nets( aSchematic->ConnectionGraph()->GetNetMap() ),
57 m_showAllErrors( aShowAllErrors )
58 {
59 m_sheetList.GetMultiUnitSymbols( m_refMap, SYMBOL_FILTER_ALL );
60 }
61
70 int TestDuplicateSheetNames( bool aCreateMarker );
71
80 int TestPinMap( KIFACE* aCvPcb, PROJECT* aProject );
81
85 void TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet );
86
92
97
103
109 int TestNoConnectPins();
110
115 int TestPinToPin();
116
122
130
135 int TestGroundPins();
136
142
148
153 int TestSimilarLabels();
154
159
164
170
175 int TestFootprintLinkIssues( KIFACE* aCvPcb, PROJECT* aProject );
176
182
188
192 int TestSimModelIssues();
193
197 int TestMissingUnits();
198
204
209
217 int TestVariantSymbols();
218
219 void RunTests( DS_PROXY_VIEW_ITEM* aDrawingSheet, SCH_EDIT_FRAME* aEditFrame,
220 KIFACE* aCvPcb, PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter );
221
222private:
230};
231
232
233#endif // ERC_H
Container for ERC settings.
int TestLibSymbolIssues()
Test symbols for changed library symbols and broken symbol library links.
Definition erc.cpp:2135
const NET_MAP & m_nets
Definition erc.h:228
int TestStackedPinNotation()
Checks for pin numbers that resemble stacked pin notation but are invalid.
Definition erc.cpp:1900
ERC_TESTER(SCHEMATIC *aSchematic, bool aShowAllErrors=false)
Definition erc.h:51
void TestTextVars(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Check for any unresolved text variable references.
Definition erc.cpp:389
int TestPinToPin()
Checks the full netlist against the pin-to-pin connectivity requirements.
Definition erc.cpp:1253
int TestSimilarLabels()
Checks for labels that differ only in capitalization.
Definition erc.cpp:2020
SCH_MULTI_UNIT_REFERENCE_MAP m_refMap
Definition erc.h:227
SCH_SCREENS m_screens
Definition erc.h:226
int TestEmptyLabelNames()
Check for labels with empty or whitespace-only names.
Definition erc.cpp:672
int RunRuleAreaERC()
Tests for rule area ERC issues.
int TestFootprintLinkIssues(KIFACE *aCvPcb, PROJECT *aProject)
Test footprint links against the current footprint libraries.
Definition erc.cpp:2257
int TestOffGridEndpoints()
Test pins and wire ends for being off grid.
Definition erc.cpp:2413
int TestDuplicateSheetNames(bool aCreateMarker)
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).
Definition erc.cpp:145
int TestSameLocalGlobalLabel()
Checks for global and local labels with the same name.
Definition erc.cpp:1936
int TestMultUnitPinConflicts()
Checks if shared pins on multi-unit symbols have been connected to different nets.
Definition erc.cpp:1699
int TestNoConnectPins()
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
Definition erc.cpp:1162
int TestFootprintFilters()
Test symbols to ensure that assigned footprint passes any given footprint filters.
Definition erc.cpp:2343
int TestPinMap(KIFACE *aCvPcb, PROJECT *aProject)
Check pin-to-pad maps (issue #2282): stale pin references, duplicate pad targets, bad pads and unmapp...
Definition erc.cpp:188
int TestFieldNameWhitespace()
Check for field names with leading or trailing whitespace.
Definition erc.cpp:711
int TestDuplicatePinNets()
Checks if duplicate pin numbers within a symbol are connected to different nets.
Definition erc.cpp:1753
ERC_SETTINGS & m_settings
Definition erc.h:224
int TestFourWayJunction()
Test to see if there are potentially confusing 4-way junctions in the schematic.
Definition erc.cpp:1083
int TestMissingNetclasses()
Tests for netclasses that are referenced but not defined.
Definition erc.cpp:975
int TestSimModelIssues()
Test SPICE models for various issues.
Definition erc.cpp:2495
SCH_SHEET_LIST m_sheetList
Definition erc.h:225
bool m_showAllErrors
Definition erc.h:229
int TestGroundPins()
Checks for ground-labeled pins not on a ground net while another pin is.
Definition erc.cpp:1832
SCHEMATIC * m_schematic
Definition erc.h:223
void RunTests(DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter)
Definition erc.cpp:2667
int TestMissingUnits()
Test for uninstantiated units of multi unit symbols.
Definition erc.cpp:841
int TestLabelMultipleWires()
Test to see if there are labels that are connected to more than one wire.
Definition erc.cpp:1028
int TestVariantSymbols()
Test all variant symbol overrides for resolution and pin compatibility.
Definition erc.cpp:2549
int TestMultiunitFootprints()
Test if all units of each multiunit symbol have the same footprint assigned.
Definition erc.cpp:780
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
Definition project.h:63
Holds all the data relating to one schematic.
Definition schematic.h:90
Schematic editor (Eeschema) main window.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition sch_screen.h:746
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
std::unordered_map< NET_NAME_CODE_CACHE_KEY, std::vector< CONNECTION_SUBGRAPH * > > NET_MAP
Associate a #NET_CODE_NAME with all the subgraphs in that net.
const wxString CommentERC_V[]
Definition erc.cpp:98
const wxString CommentERC_H[]
Definition erc.cpp:81
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
std::map< wxString, SCH_REFERENCE_LIST > SCH_MULTI_UNIT_REFERENCE_MAP
Container to map reference designators for multi-unit parts.
@ SYMBOL_FILTER_ALL
Implement a participant in the KIWAY alchemy.
Definition kiway.h:152