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
75 void TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet );
76
82
88
95
100 int TestPinToPin();
101
107
115
120 int TestGroundPins();
121
127
133
138 int TestSimilarLabels();
139
144
149
155
160 int TestFootprintLinkIssues( KIFACE* aCvPcb, PROJECT* aProject );
161
167
173
177 int TestSimModelIssues();
178
182 int TestMissingUnits();
183
189
194
195 void RunTests( DS_PROXY_VIEW_ITEM* aDrawingSheet, SCH_EDIT_FRAME* aEditFrame,
196 KIFACE* aCvPcb, PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter );
197
198private:
206};
207
208
209#endif // ERC_H
Container for ERC settings.
int TestLibSymbolIssues()
Test symbols for changed library symbols and broken symbol library links.
Definition erc.cpp:1862
const NET_MAP & m_nets
Definition erc.h:204
int TestStackedPinNotation()
Checks for pin numbers that resemble stacked pin notation but are invalid.
Definition erc.cpp:1627
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:183
int TestPinToPin()
Checks the full netlist against the pin-to-pin connectivity requirements.
Definition erc.cpp:980
int TestSimilarLabels()
Checks for labels that differ only in capitalization.
Definition erc.cpp:1747
SCH_MULTI_UNIT_REFERENCE_MAP m_refMap
Definition erc.h:203
SCH_SCREENS m_screens
Definition erc.h:202
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:1984
int TestOffGridEndpoints()
Test pins and wire ends for being off grid.
Definition erc.cpp:2140
int TestDuplicateSheetNames(bool aCreateMarker)
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).
Definition erc.cpp:140
int TestSameLocalGlobalLabel()
Checks for global and local labels with the same name.
Definition erc.cpp:1663
int TestMultUnitPinConflicts()
Checks if shared pins on multi-unit symbols have been connected to different nets.
Definition erc.cpp:1426
int TestNoConnectPins()
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
Definition erc.cpp:889
int TestFootprintFilters()
Test symbols to ensure that assigned footprint passes any given footprint filters.
Definition erc.cpp:2070
int TestFieldNameWhitespace()
Check for field names with leading or trailing whitespace.
Definition erc.cpp:438
int TestDuplicatePinNets()
Checks if duplicate pin numbers within a symbol are connected to different nets.
Definition erc.cpp:1480
ERC_SETTINGS & m_settings
Definition erc.h:200
int TestFourWayJunction()
Test to see if there are potentially confusing 4-way junctions in the schematic.
Definition erc.cpp:810
int TestMissingNetclasses()
Tests for netclasses that are referenced but not defined.
Definition erc.cpp:702
int TestSimModelIssues()
Test SPICE models for various issues.
Definition erc.cpp:2222
SCH_SHEET_LIST m_sheetList
Definition erc.h:201
bool m_showAllErrors
Definition erc.h:205
int TestGroundPins()
Checks for ground-labeled pins not on a ground net while another pin is.
Definition erc.cpp:1559
SCHEMATIC * m_schematic
Definition erc.h:199
void RunTests(DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter)
Definition erc.cpp:2276
int TestMissingUnits()
Test for uninstantiated units of multi unit symbols.
Definition erc.cpp:568
int TestLabelMultipleWires()
Test to see if there are labels that are connected to more than one wire.
Definition erc.cpp:755
int TestMultiunitFootprints()
Test if all units of each multiunit symbol have the same footprint assigned.
Definition erc.cpp:507
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
Definition project.h:62
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:93
const wxString CommentERC_H[]
Definition erc.cpp:76
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