72 wxFAIL_MSG( wxT(
"Unknown pad check code" ) );
93 _HKI(
"Missing connection between items" ),
94 wxT(
"unconnected_items" ) );
97 _HKI(
"Items shorting two nets" ),
98 wxT(
"shorting_items" ) );
101 _HKI(
"Items not allowed" ),
102 wxT(
"items_not_allowed" ) );
105 wxT(
"text_on_edge_cuts" ) );
108 _HKI(
"Clearance violation" ),
109 wxT(
"clearance" ) );
112 _HKI(
"Creepage violation" ),
116 _HKI(
"Tracks crossing" ),
117 wxT(
"tracks_crossing" ) );
120 _HKI(
"Board edge clearance violation" ),
121 wxT(
"copper_edge_clearance" ) );
124 _HKI(
"Copper outside board outline" ),
125 wxT(
"copper_outside_board" ) );
128 _HKI(
"Isolated copper fill" ),
129 wxT(
"isolated_copper" ) );
132 _HKI(
"Thermal relief connection to zone incomplete" ),
133 wxT(
"starved_thermal" ) );
136 _HKI(
"Via is not connected or connected on only one layer" ),
137 wxT(
"via_dangling" ) );
140 _HKI(
"Track has unconnected end" ),
141 wxT(
"track_dangling" ) );
144 _HKI(
"Hole clearance violation" ),
145 wxT(
"hole_clearance" ) );
148 _HKI(
"Drilled hole too close to other hole" ),
149 wxT(
"hole_to_hole" ) );
152 _HKI(
"Drilled holes co-located" ),
153 wxT(
"holes_co_located" ) );
156 _HKI(
"Copper connection too narrow" ),
157 wxT(
"connection_width" ) );
160 _HKI(
"Track width" ),
161 wxT(
"track_width" ) );
164 _HKI(
"Track angle" ),
165 wxT(
"track_angle" ) );
168 _HKI(
"Track segment length" ),
169 wxT(
"track_segment_length" ) );
172 _HKI(
"Annular width" ),
173 wxT(
"annular_width" ) );
176 _HKI(
"Hole size out of range" ),
177 wxT(
"drill_out_of_range" ) );
180 _HKI(
"Via diameter" ),
181 wxT(
"via_diameter" ) );
184 _HKI(
"Padstack is questionable" ),
188 _HKI(
"Padstack is not valid" ),
189 wxT(
"padstack_invalid" ) );
192 _HKI(
"Micro via hole size out of range" ),
193 wxT(
"microvia_drill_out_of_range" ) );
196 _HKI(
"Microvia stack has malformed span" ),
197 wxT(
"malformed_microvia_stack_span" ) );
200 wxT(
"microvia_stack_not_filled" ) );
203 wxT(
"microvia_stack_depth" ) );
206 wxT(
"hole_aspect_ratio" ) );
209 wxT(
"microvia_crosses_core" ) );
212 _HKI(
"Courtyards overlap" ),
213 wxT(
"courtyards_overlap" ) );
216 _HKI(
"Footprint has no courtyard defined" ),
217 wxT(
"missing_courtyard" ) );
220 _HKI(
"Footprint has malformed courtyard" ),
221 wxT(
"malformed_courtyard" ) );
224 _HKI(
"PTH inside courtyard" ),
225 wxT(
"pth_inside_courtyard" ) );
228 _HKI(
"NPTH inside courtyard" ),
229 wxT(
"npth_inside_courtyard" ) );
232 _HKI(
"Item on a disabled copper layer" ),
233 wxT(
"item_on_disabled_layer" ) );
236 _HKI(
"Board has malformed outline" ),
237 wxT(
"invalid_outline" ) );
240 _HKI(
"Duplicate footprints" ),
241 wxT(
"duplicate_footprints" ) );
244 _HKI(
"Missing footprint" ),
245 wxT(
"missing_footprint" ) );
248 _HKI(
"Extra footprint" ),
249 wxT(
"extra_footprint" ) );
252 _HKI(
"Pad net doesn't match schematic" ),
253 wxT(
"net_conflict" ) );
256 _HKI(
"Footprint attributes don't match symbol" ),
257 wxT(
"footprint_symbol_mismatch" ) );
260 _HKI(
"Footprint doesn't match symbol's footprint filters" ),
261 wxT(
"footprint_filters_mismatch" ) );
264 _HKI(
"Footprint field does not match symbol field" ),
265 wxT(
"footprint_symbol_field_mismatch" ) );
268 _HKI(
"Via-stitching zones overlap for same net" ),
269 wxT(
"via_stitch_overlap" ) );
272 _HKI(
"Footprint not found in libraries" ),
273 wxT(
"lib_footprint_issues" ) );
276 _HKI(
"Footprint doesn't match copy in library" ),
277 wxT(
"lib_footprint_mismatch" ) );
280 _HKI(
"Unresolved text variable" ),
281 wxT(
"unresolved_variable" ) );
284 _HKI(
"Assertion failure" ),
285 wxT(
"assertion_failure" ) );
289 wxT(
"generic_warning" ) );
293 wxT(
"generic_error" ) );
296 _HKI(
"Copper sliver" ),
297 wxT(
"copper_sliver" ) );
300 _HKI(
"Solder mask aperture bridges items with different nets" ),
301 wxT(
"solder_mask_bridge" ) );
304 _HKI(
"Silkscreen clipped by solder mask" ),
305 wxT(
"silk_over_copper" ) );
308 _HKI(
"Silkscreen clipped by board edge" ),
309 wxT(
"silk_edge_clearance" ) );
312 _HKI(
"Silkscreen clearance" ),
313 wxT(
"silk_overlap" ) );
316 _HKI(
"Text height out of range" ),
317 wxT(
"text_height" ) );
320 _HKI(
"Text thickness out of range" ),
321 wxT(
"text_thickness" ) );
324 _HKI(
"Track length out of range" ),
325 wxT(
"length_out_of_range" ) );
328 _HKI(
"Net chain stub length out of range" ),
329 wxT(
"net_chain_stub_length" ) );
332 _HKI(
"Net chain routed without continuous copper on the required reference layer" ),
333 wxT(
"net_chain_return_path" ) );
336 _HKI(
"Net chain nets do not have consistent tuning profile assignment" ),
337 wxT(
"net_chain_tuning_profiles" ) );
340 _HKI(
"Skew between tracks out of range" ),
341 wxT(
"skew_out_of_range" ) );
345 _HKI(
"Too many or too few vias on a connection" ),
346 wxT(
"too_many_vias" ) );
349 _HKI(
"Differential pair gap out of range" ),
350 wxT(
"diff_pair_gap_out_of_range" ) );
353 _HKI(
"Differential uncoupled length too long" ),
354 wxT(
"diff_pair_uncoupled_length_too_long" ) );
357 _HKI(
"Footprint is not valid" ),
358 wxT(
"footprint" ) );
361 _HKI(
"Footprint component type doesn't match footprint pads" ),
362 wxT(
"footprint_type_mismatch" ) );
365 _HKI(
"Through hole pad has no hole" ),
366 wxT(
"through_hole_pad_without_hole" ) );
369 _HKI(
"Footprint with pads is scaled (physical part size unchanged)" ),
370 wxT(
"footprint_scaled_with_pads" ) );
373 _HKI(
"Mirrored text on front layer" ),
374 wxT(
"mirrored_text_on_front_layer" ) );
377 _HKI(
"Non-Mirrored text on back layer" ),
378 wxT(
"nonmirrored_text_on_back_layer" ) );
381 _HKI(
"Missing tuning profile" ),
382 wxT(
"missing_tuning_profile" ) );
385 _HKI(
"Tuning profile track geometries" ),
386 wxT(
"tuning_profile_track_geometries" ) );
389 _HKI(
"Track connected to post-machined or backdrilled layer" ),
390 wxT(
"track_on_post_machined_layer" ) );
393 _HKI(
"Track endpoint not centered on via" ),
394 wxT(
"track_not_centered_on_via" ) );
581 for(
const std::reference_wrapper<RC_ITEM>& item :
allItemTypes )
583 if( aErrorKey == item.get().GetSettingsKey() )
584 return std::make_shared<DRC_ITEM>(
static_cast<const DRC_ITEM&
>( item.get() ) );
619 return wxString::Format( aTranslate ?
_(
"Rule: %s" ) : wxString( wxT(
"Rule: %s" ) ),
m_violatingRule->m_Name );
621 return aTranslate ?
_(
"Local override" ) : wxString( wxT(
"Local override" ) );
635 for(
int layer : it->GetLayerSet() )
637 if(
pad->FlashLayer( layer ) )
645 return it->GetLayerSet();
650 aViolationLayers =
LSET();
680 aPrincipalLayer = markerLayer;
686 if( a || b || c || d )
694 LSET layersList = getActiveLayers( it );
695 aViolationLayers &= layersList;
698 aPrincipalLayer = layersList.
Seq().front();
703 if( aViolationLayers.count() )
704 aPrincipalLayer = aViolationLayers.
Seq().front();
705 else if( aPrincipalLayer >= 0 )
706 aViolationLayers.
set( aPrincipalLayer );
729 return a->GetSeverity() > b->GetSeverity();
745 return static_cast<int>( std::ranges::count_if(
m_board->Markers(),
748 return alg::contains( m_markerTypes, marker->GetMarkerType() )
749 && ( marker->GetSeverity() & aSeverity ) > 0;
758 return marker ? marker->
GetRCItem() :
nullptr;
774 return m_board.ResolveItem( aKiid,
true );
BASE_SET & set(size_t pos)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
EDA_ITEM * doResolveItemById(const KIID &aKiid) const override
The actual resolution logic for an item by its KIID, must be implemented against the actual item stor...
Information pertinent to a Pcbnew printed circuit board.
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
void SetSeverities(int aSeverities) override
std::vector< MARKER_BASE::MARKER_T > m_markerTypes
void DeleteItem(int aIndex, bool aDeep) override
Remove (and optionally deletes) the indexed item from the list.
int GetSeverities() const override
int GetCount(int aSeverity=-1) const override
std::vector< PCB_MARKER * > m_filteredMarkers
std::shared_ptr< RC_ITEM > GetItem(int aIndex) const override
Retrieve a RC_ITEM by index.
static DRC_ITEM viaStitchOverlap
static DRC_ITEM lengthOutOfRange
KIID GetAuxItem3ID() const override
static DRC_ITEM viaDiameter
static DRC_ITEM silkEdgeClearance
static DRC_ITEM trackWidth
static DRC_ITEM heading_DFM
static DRC_ITEM annularWidth
static DRC_ITEM pthInsideCourtyard
static DRC_ITEM microviaStackDepth
static DRC_ITEM trackSegmentLength
static DRC_ITEM schematicParity
static DRC_ITEM netConflict
static void GetViolationLayers(BOARD *aBoard, const std::shared_ptr< RC_ITEM > &aItem, PCB_MARKER *aMarker, PCB_LAYER_ID &aPrincipalLayer, LSET &aViolationLayers)
Work out which layer to focus on and which layers a violation involves.
static DRC_ITEM copperSliver
static DRC_ITEM trackNotCenteredOnVia
static DRC_ITEM holeNearHole
static DRC_ITEM heading_signal_integrity
static DRC_ITEM courtyardsOverlap
static DRC_ITEM textThicknessOutOfRange
static DRC_ITEM trackOnPostMachinedLayer
static DRC_ITEM connectionWidth
static DRC_ITEM footprint
static DRC_ITEM unresolvedVariable
static DRC_ITEM assertionFailure
static DRC_ITEM npthInsideCourtyard
static DRC_ITEM footprintFilters
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
static DRC_ITEM textOnEdgeCuts
static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
A list of all DRC_ITEM types which are valid error codes.
static DRC_ITEM tuningProfileImplicitRules
static DRC_ITEM starvedThermal
static DRC_ITEM footprintScaledWithPads
static DRC_ITEM heading_deprecated
static DRC_ITEM shortingItems
static DRC_ITEM tracksCrossing
static DRC_ITEM missingCourtyard
static DRC_ITEM skewOutOfRange
static DRC_ITEM trackDangling
static DRC_ITEM netChainStubTooLong
static DRC_ITEM viaDangling
static DRC_ITEM genericError
static DRC_ITEM netChainReturnPathBreak
static DRC_ITEM drillTooSmall
static DRC_ITEM holesCoLocated
static DRC_ITEM missingFootprint
static DRC_ITEM textHeightOutOfRange
static DRC_ITEM diffPairGapOutOfRange
static DRC_ITEM heading_electrical
static DRC_ITEM itemOnDisabledLayer
static DRC_ITEM mirroredTextOnFrontLayer
static DRC_ITEM heading_readability
static DRC_ITEM microviaStackNotFilled
static DRC_ITEM itemsNotAllowed
static DRC_ITEM holeAspectRatio
DRC_ITEM(int aErrorCode=0, const wxString &aTitle="", const wxString &aSettingsKey="")
static DRC_ITEM extraFootprint
static DRC_ITEM diffPairUncoupledLengthTooLong
static DRC_ITEM netChainTuningProfiles
KIID GetAuxItem2ID() const override
static DRC_ITEM unconnectedItems
static DRC_ITEM clearance
DRC_RULE * m_violatingRule
static DRC_ITEM missingTuningProfile
static DRC_ITEM libFootprintMismatch
static DRC_ITEM microviaCrossesCore
static DRC_ITEM malformedMicroviaStackSpan
static DRC_ITEM viaCountOutOfRange
static DRC_ITEM copperOutsideBoard
static DRC_ITEM edgeClearance
static DRC_ITEM silkMaskClearance
static DRC_ITEM unMirroredTextOnBackLayer
static DRC_ITEM genericWarning
static DRC_ITEM schematicFieldsParity
static DRC_ITEM invalidOutline
static DRC_ITEM isolatedCopper
static DRC_ITEM malformedCourtyard
static DRC_ITEM heading_internal
static DRC_ITEM holeClearance
static DRC_ITEM libFootprintIssues
static DRC_ITEM padstackInvalid
static DRC_ITEM trackAngle
static DRC_ITEM heading_schematic_parity
static DRC_ITEM microviaDrillTooSmall
wxString GetViolatingRuleDesc(bool aTranslate) const override
static DRC_ITEM solderMaskBridge
static DRC_ITEM heading_misc
static DRC_ITEM footprintTypeMismatch
static DRC_ITEM footprintTHPadhasNoHole
static DRC_ITEM silkClearance
static DRC_ITEM duplicateFootprints
A base class for most all the KiCad significant classes used in schematics and boards.
EDA_ITEM_FLAGS GetFlags() const
LSET is a set of PCB_LAYER_IDs.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
static const LSET & AllLayersMask()
std::shared_ptr< RC_ITEM > GetRCItem() const
int m_errorCode
The error code's numeric value.
std::vector< KIID > m_ids
int ConvertPadCheckToDrcCode(PAD_UTILS::PAD_CHECK_CODE aCode)
Map a granular PAD_UTILS::PAD_CHECK_CODE to the DRC error code used to report it at the DRC level (in...
@ DRCE_DISABLED_LAYER_ITEM
@ DRCE_FOOTPRINT_SCALED_WITH_PADS
@ DRCE_DP_UNCOUPLED_LENGTH_TOO_LONG
@ DRCE_TUNING_PROFILE_IMPLICIT_RULES
@ DRCE_MICROVIA_STACK_DEPTH
@ DRCE_SILK_EDGE_CLEARANCE
@ DRCE_SILK_MASK_CLEARANCE
@ DRCE_DP_GAP_OUT_OF_RANGE
@ DRCE_MIRRORED_TEXT_ON_FRONT_LAYER
@ DRCE_LIB_FOOTPRINT_ISSUES
@ DRCE_VIA_STITCH_OVERLAP
@ DRCE_MICROVIA_CROSSES_CORE
@ DRCE_OVERLAPPING_FOOTPRINTS
@ DRCE_TRACK_ON_POST_MACHINED_LAYER
@ DRCE_NET_CHAIN_STUB_TOO_LONG
@ DRCE_MALFORMED_MICROVIA_STACK_SPAN
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_NET_CHAIN_RETURN_PATH_BREAK
@ DRCE_TRACK_SEGMENT_LENGTH
@ DRCE_SCHEMATIC_FIELDS_PARITY
@ DRCE_MICROVIA_STACK_NOT_FILLED
@ DRCE_TRACK_NOT_CENTERED_ON_VIA
@ DRCE_COPPER_OUTSIDE_BOARD
@ DRCE_NET_CHAIN_TUNING_PROFILES
@ DRCE_MISSING_TUNING_PROFILE
@ DRCE_DRILLED_HOLES_TOO_CLOSE
@ DRCE_MICROVIA_DRILL_OUT_OF_RANGE
@ DRCE_MALFORMED_COURTYARD
@ DRCE_UNRESOLVED_VARIABLE
@ DRCE_FOOTPRINT_TYPE_MISMATCH
@ DRCE_DUPLICATE_FOOTPRINT
@ DRCE_DRILLED_HOLES_COLOCATED
@ DRCE_LENGTH_OUT_OF_RANGE
@ DRCE_LIB_FOOTPRINT_MISMATCH
@ DRCE_PAD_TH_WITH_NO_HOLE
@ DRCE_UNMIRRORED_TEXT_ON_BACK_LAYER
@ DRCE_VIA_COUNT_OUT_OF_RANGE
#define MALFORMED_F_COURTYARD
#define MALFORMED_B_COURTYARD
Some functions to handle hotkeys in KiCad.
PCB_LAYER_ID
A quick note on layer IDs:
PAD_CHECK_CODE
A specific pad check finding reason.
@ TRAPEZOID_DELTA_TOO_LARGE
@ ROUNDRECT_RADIUS_NEGATIVE
@ NEGATIVE_MASK_CLEARANCE_TOO_LARGE
@ NEGATIVE_PASTE_MARGIN_TOO_LARGE
@ CUSTOM_SHAPE_NOT_SINGLE_POLYGON
@ PTH_HOLE_LEAVES_NO_COPPER
@ ROUNDRECT_RADIUS_TOO_LARGE
@ NEGATIVE_LOCAL_CLEARANCE
@ PTH_HOLE_NOT_INSIDE_COPPER
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
@ PCB_PAD_T
class PAD, a pad in a footprint