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
47namespace SCH_CONNECTIVITY
48{
49struct MULTI_UNIT_GROUP;
50}
51
60{
61public:
62
63 ERC_TESTER( SCHEMATIC* aSchematic, bool aShowAllErrors = false );
64
74 int TestDuplicateSheetNames( bool aCreateMarker );
75
84 int TestPinMap( KIFACE* aCvPcb, PROJECT* aProject );
85
91 void TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet );
92
98
103
109
115 int TestNoConnectPins();
116
121 int TestPinToPin();
122
128
136
137 // Report enabled checks over owned published connectivity without preparing symbol checks.
138 static int TestConnectivity( SCHEMATIC& aSchematic );
139
144 int TestGroundPins();
145
151
157
162 int TestSimilarLabels();
163
168
173
179
184 int TestFootprintLinkIssues( KIFACE* aCvPcb, PROJECT* aProject );
185
191
197
201 int TestSimModelIssues();
202
206 int TestMissingUnits();
207
213
221 int TestVariantSymbols();
222
223 void RunTests( DS_PROXY_VIEW_ITEM* aDrawingSheet, SCH_EDIT_FRAME* aEditFrame,
224 KIFACE* aCvPcb, PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter );
225
226private:
227 std::vector<SCH_CONNECTIVITY::MULTI_UNIT_GROUP> multiUnitSources() const;
228
236};
237
238
239#endif // ERC_H
Container for ERC settings.
int TestLibSymbolIssues()
Test symbols for changed library symbols and broken symbol library links.
Definition erc.cpp:2768
const NET_MAP & m_nets
Definition erc.h:234
int TestStackedPinNotation()
Checks for pin numbers that resemble stacked pin notation but are invalid.
Definition erc.cpp:2613
ERC_TESTER(SCHEMATIC *aSchematic, bool aShowAllErrors=false)
Definition erc.cpp:337
void TestTextVars(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Check for any unresolved text variable references.
Definition erc.cpp:648
int TestPinToPin()
Checks the full netlist against the pin-to-pin connectivity requirements.
Definition erc.cpp:1709
int TestSimilarLabels()
Checks for labels that differ only in capitalization.
Definition erc.cpp:2696
SCH_MULTI_UNIT_REFERENCE_MAP m_refMap
Definition erc.h:233
SCH_SCREENS m_screens
Definition erc.h:232
int TestEmptyLabelNames()
Check for labels with empty or whitespace-only names.
Definition erc.cpp:759
int TestFootprintLinkIssues(KIFACE *aCvPcb, PROJECT *aProject)
Test footprint links against the current footprint libraries.
Definition erc.cpp:2950
static int TestConnectivity(SCHEMATIC &aSchematic)
Definition erc.cpp:2260
int TestOffGridEndpoints()
Test pins and wire ends for being off grid.
Definition erc.cpp:3049
int TestDuplicateSheetNames(bool aCreateMarker)
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).
Definition erc.cpp:350
int TestSameLocalGlobalLabel()
Checks for global and local labels with the same name.
Definition erc.cpp:2655
int TestMultUnitPinConflicts()
Checks if shared pins on multi-unit symbols have been connected to different nets.
Definition erc.cpp:2145
int TestNoConnectPins()
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
Definition erc.cpp:1288
int TestFootprintFilters()
Test symbols to ensure that assigned footprint passes any given footprint filters.
Definition erc.cpp:3011
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:417
int TestFieldNameWhitespace()
Check for field names with leading or trailing whitespace.
Definition erc.cpp:804
int TestDuplicatePinNets()
Checks if duplicate pin numbers within a symbol are connected to different nets.
Definition erc.cpp:2446
ERC_SETTINGS & m_settings
Definition erc.h:230
int TestFourWayJunction()
Test to see if there are potentially confusing 4-way junctions in the schematic.
Definition erc.cpp:1195
int TestMissingNetclasses()
Tests for netclasses that are referenced but not defined.
Definition erc.cpp:1051
int TestSimModelIssues()
Test SPICE models for various issues.
Definition erc.cpp:3138
SCH_SHEET_LIST m_sheetList
Definition erc.h:231
bool m_showAllErrors
Definition erc.h:235
int TestGroundPins()
Checks for ground-labeled pins not on a ground net while another pin is.
Definition erc.cpp:2529
SCHEMATIC * m_schematic
Definition erc.h:229
std::vector< SCH_CONNECTIVITY::MULTI_UNIT_GROUP > multiUnitSources() const
Definition erc.cpp:889
void RunTests(DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter)
Definition erc.cpp:3338
int TestMissingUnits()
Test for uninstantiated units of multi unit symbols.
Definition erc.cpp:970
int TestLabelMultipleWires()
Test to see if there are labels that are connected to more than one wire.
Definition erc.cpp:1124
int TestVariantSymbols()
Test all variant symbol overrides for resolution and pin compatibility.
Definition erc.cpp:3185
int TestMultiunitFootprints()
Test if all units of each multiunit symbol have the same footprint assigned.
Definition erc.cpp:923
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:149
Schematic editor (Eeschema) main window.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition sch_screen.h:818
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_NAME_CODE_CACHE_KEY with all the subgraphs in that net.
const wxString CommentERC_V[]
Definition erc.cpp:290
const wxString CommentERC_H[]
Definition erc.cpp:273
Value keys and the key session of the schematic connectivity engine.
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.
Implement a participant in the KIWAY alchemy.
Definition kiway.h:153
All placed units that share one reference, with the unit table of the library symbol.