KiCad PCB EDA Suite
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) 2007 Dick Hollenbeck, [email protected]
5  * Copyright (C) 2018-2020 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  *
20  * or you may search the website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
25 #ifndef DRC_ITEM_H
26 #define DRC_ITEM_H
28 #include <rc_item.h>
30 class PCB_BASE_FRAME;
31 class DRC_RULE;
36  DRCE_UNCONNECTED_ITEMS = DRCE_FIRST, // items are unconnected
37  DRCE_SHORTING_ITEMS, // items short two nets but are not a net-tie
38  DRCE_ALLOWED_ITEMS, // a disallowed item has been used
39  DRCE_TEXT_ON_EDGECUTS, // text or dimension on Edge.Cuts layer
40  DRCE_CLEARANCE, // items are too close together
41  DRCE_TRACKS_CROSSING, // tracks are crossing
42  DRCE_EDGE_CLEARANCE, // a copper item is too close to the board edge
43  DRCE_ZONES_INTERSECT, // copper area outlines intersect
44  DRCE_ZONE_HAS_EMPTY_NET, // copper area has a net but no pads in nets, which is suspicious
45  DRCE_DANGLING_VIA, // via which isn't connected to anything
46  DRCE_DANGLING_TRACK, // track with at least one end not connected to anything
47  DRCE_DRILLED_HOLES_TOO_CLOSE, // overlapping drilled holes break drill bits
48  DRCE_DRILLED_HOLES_COLOCATED, // two holes at the same location
50  DRCE_TRACK_WIDTH, // Track width is too small or too large
51  DRCE_ANNULAR_WIDTH, // Via size and drill leave annular ring too small
52  DRCE_DRILL_OUT_OF_RANGE, // Too small via or pad drill
53  DRCE_VIA_DIAMETER, // Via diameter checks (min/max)
54  DRCE_PADSTACK, // something is wrong with a pad or via stackup
55  DRCE_MICROVIA_DRILL_OUT_OF_RANGE, // Too small micro via drill
56  DRCE_OVERLAPPING_FOOTPRINTS, // footprint courtyards overlap
57  DRCE_MISSING_COURTYARD, // footprint has no courtyard defined
58  DRCE_MALFORMED_COURTYARD, // footprint has a courtyard but malformed
59  // (not convertible to a closed polygon with holes)
62  DRCE_DISABLED_LAYER_ITEM, // item on a disabled layer
63  DRCE_INVALID_OUTLINE, // invalid board outline
65  DRCE_MISSING_FOOTPRINT, // footprint not found for netlist item
66  DRCE_DUPLICATE_FOOTPRINT, // more than one footprints found for netlist item
67  DRCE_EXTRA_FOOTPRINT, // netlist item not found for footprint
68  DRCE_NET_CONFLICT, // pad net doesn't match netlist
70  DRCE_FOOTPRINT_TYPE_MISMATCH, // footprint attribute does not match actual pads
71  DRCE_PAD_TH_WITH_NO_HOLE, // footprint has Plated Through-Hole with no hole
74  DRCE_SILK_MASK_CLEARANCE, // silkscreen clipped by mask (potentially leaving it
75  // over pads, exposed copper, etc.)
76  DRCE_OVERLAPPING_SILK, // silk to silk clearance error
85 };
88 class DRC_ITEM : public RC_ITEM
89 {
90 public:
95  static std::shared_ptr<DRC_ITEM> Create( int aErrorCode );
103  static std::shared_ptr<DRC_ITEM> Create( const wxString& aErrorKey );
105  static std::vector<std::reference_wrapper<RC_ITEM>> GetItemsWithSeverities()
106  {
107  return allItemTypes;
108  }
110  void SetViolatingRule ( DRC_RULE *aRule ) { m_violatingRule = aRule; }
113  wxString GetViolatingRuleDesc() const override;
115  void SetViolatingTest( DRC_TEST_PROVIDER *aProvider ) { m_violatingTest = aProvider; }
118  KIID GetAuxItem2ID() const override;
119  KIID GetAuxItem3ID() const override;
121 private:
122  DRC_ITEM( int aErrorCode = 0, const wxString& aTitle = "", const wxString& aSettingsKey = "" )
123  {
124  m_errorCode = aErrorCode;
125  m_errorTitle = aTitle;
126  m_settingsKey = aSettingsKey;
127  m_parent = nullptr;
128  }
131  static std::vector<std::reference_wrapper<RC_ITEM>> allItemTypes;
181 private:
184 };
186 #endif // DRC_ITEM_H
static DRC_ITEM extraFootprint
Definition: drc_item.h:168
DRC_TEST_PROVIDER * m_violatingTest
Definition: drc_item.h:183
static DRC_ITEM heading_signal_integrity
Definition: drc_item.h:136
void SetViolatingTest(DRC_TEST_PROVIDER *aProvider)
Definition: drc_item.h:115
static DRC_ITEM itemOnDisabledLayer
Definition: drc_item.h:164
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
Definition: drc_item.cpp:266
static DRC_ITEM heading_electrical
Definition: drc_item.h:133
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:171
static DRC_ITEM missingCourtyard
Definition: drc_item.h:160
void SetViolatingRule(DRC_RULE *aRule)
Definition: drc_item.h:110
static DRC_ITEM holesCoLocated
Definition: drc_item.h:151
A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
Definition: rc_item.h:74
static DRC_ITEM invalidOutline
Definition: drc_item.h:165
static DRC_ITEM holeNearHole
Definition: drc_item.h:150
static DRC_ITEM silkMaskClearance
Definition: drc_item.h:171
static DRC_ITEM clearance
Definition: drc_item.h:143
static DRC_ITEM heading_schematic_parity
Definition: drc_item.h:135
static DRC_ITEM unconnectedItems
Definition: drc_item.h:139
static DRC_ITEM missingFootprint
Definition: drc_item.h:167
DRC_TEST_PROVIDER * GetViolatingTest() const
Definition: drc_item.h:116
static DRC_ITEM footprintTHPadhasNoHole
Definition: drc_item.h:179
static DRC_ITEM itemsNotAllowed
Definition: drc_item.h:141
Definition: drc_item.h:34
static DRC_ITEM heading_misc
Definition: drc_item.h:137
static DRC_ITEM microviaDrillTooSmall
Definition: drc_item.h:158
KIID GetAuxItem3ID() const override
Definition: drc_item.cpp:343
Definition: kiid.h:44
wxString GetViolatingRuleDesc() const override
Definition: drc_item.cpp:355
static DRC_ITEM diffPairUncoupledLengthTooLong
Definition: drc_item.h:177
static DRC_ITEM heading_DFM
Definition: drc_item.h:134
int m_errorCode
The error code's numeric value.
Definition: rc_item.h:168
static DRC_ITEM tracksCrossing
Definition: drc_item.h:144
static DRC_ITEM npthInsideCourtyard
Definition: drc_item.h:163
static DRC_ITEM malformedCourtyard
Definition: drc_item.h:161
static DRC_ITEM footprintTypeMismatch
Definition: drc_item.h:178
static DRC_ITEM edgeClearance
Definition: drc_item.h:145
static DRC_ITEM courtyardsOverlap
Definition: drc_item.h:159
KIID GetAuxItem2ID() const override
Definition: drc_item.cpp:331
static DRC_ITEM shortingItems
Definition: drc_item.h:140
static DRC_ITEM diffPairGapOutOfRange
Definition: drc_item.h:176
static DRC_ITEM drillTooSmall
Definition: drc_item.h:155
static DRC_ITEM duplicateFootprints
Definition: drc_item.h:166
DRC_RULE * m_violatingRule
Definition: drc_item.h:182
static DRC_ITEM textOnEdgeCuts
Definition: drc_item.h:142
static DRC_ITEM zoneHasEmptyNet
Definition: drc_item.h:147
static DRC_ITEM zonesIntersect
Definition: drc_item.h:146
DRC_ITEM(int aErrorCode=0, const wxString &aTitle="", const wxString &aSettingsKey="")
Definition: drc_item.h:122
static DRC_ITEM viaDangling
Definition: drc_item.h:148
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out #DRC_ITEMs and po...
static DRC_ITEM trackWidth
Definition: drc_item.h:153
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: rc_item.h:172
static DRC_ITEM annularWidth
Definition: drc_item.h:154
DRC_RULE * GetViolatingRule() const
Definition: drc_item.h:111
static DRC_ITEM silkOverlaps
Definition: drc_item.h:172
static DRC_ITEM holeClearance
Definition: drc_item.h:152
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
Definition: drc_item.h:105
static DRC_ITEM trackDangling
Definition: drc_item.h:149
static DRC_ITEM lengthOutOfRange
Definition: drc_item.h:173
static DRC_ITEM tooManyVias
Definition: drc_item.h:175
static DRC_ITEM unresolvedVariable
Definition: drc_item.h:170
static DRC_ITEM viaDiameter
Definition: drc_item.h:156
static DRC_ITEM skewOutOfRange
Definition: drc_item.h:174
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
static DRC_ITEM netConflict
Definition: drc_item.h:169
static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
A list of all DRC_ITEM types which are valid error codes.
Definition: drc_item.h:131
static DRC_ITEM pthInsideCourtyard
Definition: drc_item.h:162
static DRC_ITEM padstack
Definition: drc_item.h:157
wxString m_errorTitle
The string describing the type of error.
Definition: rc_item.h:170