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 (C) 2009-2023 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
26#ifndef ERC_H
27#define ERC_H
28
29#include <erc/erc_settings.h>
30#include <sch_sheet_path.h>
31#include <sch_screen.h>
32#include <sch_reference_list.h>
33#include <connection_graph.h>
34#include <vector>
35#include <map>
36
37
38class SCHEMATIC;
40class SCH_EDIT_FRAME;
42struct KIFACE;
43class PROJECT;
44class SCH_RULE_AREA;
45
46
47extern const wxString CommentERC_H[];
48extern const wxString CommentERC_V[];
49
50
52{
53public:
54
55 ERC_TESTER( SCHEMATIC* aSchematic ) :
56 m_schematic( aSchematic ),
57 m_settings( aSchematic->ErcSettings() ),
58 m_sheetList( aSchematic->BuildSheetListSortedByPageNumbers() ),
59 m_screens( aSchematic->Root() ),
60 m_nets( aSchematic->ConnectionGraph()->GetNetMap() )
61 {
63 }
64
73 int TestDuplicateSheetNames( bool aCreateMarker );
74
78 void TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet );
79
89
95
101 int TestNoConnectPins();
102
107 int TestPinToPin();
108
114
120
125 int TestSimilarLabels();
126
131
136
142
147 int TestFootprintLinkIssues( KIFACE* aCvPcb, PROJECT* aProject );
148
154
160
164 int TestSimModelIssues();
165
169 int TestMissingUnits();
170
176
181
182 void RunTests( DS_PROXY_VIEW_ITEM* aDrawingSheet, SCH_EDIT_FRAME* aEditFrame,
183 KIFACE* aCvPcb, PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter );
184
185private:
192};
193
194
195#endif // ERC_H
Container for ERC settings.
Definition: erc_settings.h:135
Definition: erc.h:52
int TestLibSymbolIssues()
Test symbols for changed library symbols and broken symbol library links.
Definition: erc.cpp:1367
const NET_MAP & m_nets
Definition: erc.h:191
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:908
int TestSimilarLabels()
Checks for labels that differ only in capitalization.
Definition: erc.cpp:1259
SCH_MULTI_UNIT_REFERENCE_MAP m_refMap
Definition: erc.h:190
SCH_SCREENS m_screens
Definition: erc.h:189
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:1485
int TestOffGridEndpoints()
Test pins and wire ends for being off grid.
Definition: erc.cpp:1635
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:1204
int TestMultUnitPinConflicts()
Checks if shared pins on multi-unit symbols have been connected to different nets.
Definition: erc.cpp:1147
int TestConflictingBusAliases()
Check that there are no conflicting bus alias definitions in the schematic.
Definition: erc.cpp:434
int TestNoConnectPins()
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
Definition: erc.cpp:839
int TestFootprintFilters()
Test symbols to ensure that assigned footprint passes any given footprint filters.
Definition: erc.cpp:1565
ERC_SETTINGS & m_settings
Definition: erc.h:187
int TestFourWayJunction()
Test to see if there are potentially confusing 4-way junctions in the schematic.
Definition: erc.cpp:785
int TestMissingNetclasses()
Tests for netclasses that are referenced but not defined.
Definition: erc.cpp:677
int TestSimModelIssues()
Test SPICE models for various issues.
Definition: erc.cpp:1698
ERC_TESTER(SCHEMATIC *aSchematic)
Definition: erc.h:55
SCH_SHEET_LIST m_sheetList
Definition: erc.h:188
SCHEMATIC * m_schematic
Definition: erc.h:186
void RunTests(DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter)
Definition: erc.cpp:1751
int TestMissingUnits()
Test for uninstantiated units of multi unit symbols.
Definition: erc.cpp:540
int TestLabelMultipleWires()
Test to see if there are labels that are connected to more than one wire.
Definition: erc.cpp:730
int TestMultiunitFootprints()
Test if all units of each multiunit symbol have the same footprint assigned.
Definition: erc.cpp:479
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
Definition: project.h:64
Holds all the data relating to one schematic.
Definition: schematic.h:77
Schematic editor (Eeschema) main window.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:712
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void GetMultiUnitSymbols(SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols=true) const
Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the li...
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.
Implement a participant in the KIWAY alchemy.
Definition: kiway.h:152