KiCad PCB EDA Suite
Loading...
Searching...
No Matches
erc_item.cpp
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20
21#include "wx/html/m_templ.h"
22#include "wx/html/styleparams.h"
23#include <erc/erc.h>
24#include <eda_draw_frame.h>
25#include <marker_base.h>
26#include <schematic.h>
27#include <sch_edit_frame.h>
28#include <i18n_utility.h>
29#include <units_provider.h>
30
31
32// These, being statically-defined, require specialized I18N handling.
33// We don't translate on initialization and instead do it in the getters.
34
35// NOTE: Avoid changing the settings key for an ERC item after it has been created
36
37ERC_ITEM ERC_ITEM::heading_connections( 0, _HKI( "Connections" ), "" );
38ERC_ITEM ERC_ITEM::heading_conflicts( 0, _HKI( "Conflicts" ), "" );
39ERC_ITEM ERC_ITEM::heading_misc( 0, _HKI( "Miscellaneous" ), "" );
41
43 _HKI( "Duplicate sheet names within a given sheet" ),
44 wxT( "duplicate_sheet_names" ) );
45
47 _HKI( "Symbol pin or wire end off connection grid" ),
48 wxT( "endpoint_off_grid" ) );
49
51 _HKI( "Pin not connected" ),
52 wxT( "pin_not_connected" ) );
53
55 _HKI( "Input pin not driven by any Output pins" ),
56 wxT( "pin_not_driven" ) );
57
59 _HKI( "Input Power pin not driven by any Output Power pins" ),
60 wxT( "power_pin_not_driven" ) );
61
63 _HKI( "Duplicate pins with different nets" ),
64 wxT( "duplicate_pins" ) );
65
67 _HKI( "Wired hidden power input pin also connects globally by name" ),
68 wxT( "wired_implicit_power" ) );
69
71 _HKI( "Conflict problem between pins" ),
72 wxT( "pin_to_pin" ) );
73
75 _HKI( "Conflict problem between pins" ),
76 wxT( "pin_to_pin" ) );
77
79 _HKI( "Warning" ),
80 wxT( "generic-warning" ) );
81
83 _HKI( "Error" ),
84 wxT( "generic-error" ) );
85
87 _HKI( "Mismatch between hierarchical labels and sheet pins" ),
88 wxT( "hier_label_mismatch" ) );
89
91 _HKI( "Four connection points are joined together" ),
92 wxT( "four_way_junction" ) );
93
95 _HKI( "Label connects more than one wire" ),
96 wxT( "label_multiple_wires" ) );
97
99 _HKI( "A pin with a \"no connection\" flag is connected" ),
100 wxT( "no_connect_connected" ) );
101
103 _HKI( "Unconnected \"no connection\" flag" ),
104 wxT( "no_connect_dangling" ) );
105
107 _HKI( "Label not connected" ),
108 wxT( "label_dangling" ) );
109
111 _HKI( "Label connected to only one pin" ),
112 wxT( "isolated_pin_label" ) );
113
115 _HKI( "Labels are similar"),
116 wxT( "similar_labels" ) );
117
119 _HKI( "Power pins are similar"),
120 wxT( "similar_power" ) );
121
123 _HKI( "Power pin and label are similar"),
124 wxT( "similar_label_and_power" ) );
125
127 _HKI( "Global label only appears once in the schematic"),
128 wxT( "single_global_label" ) );
129
131 _HKI( "Local and global labels have same name" ),
132 wxT( "same_local_global_label" ) );
133
135 _HKI( "Local and global power symbols have same name" ),
136 wxT( "same_local_global_power" ) );
137
139 _HKI( "Different footprint assigned in another unit of the symbol" ),
140 wxT( "different_unit_footprint" ) );
141
143 _HKI( "Different net assigned to a shared pin in another unit of the symbol" ),
144 wxT( "different_unit_net" ) );
145
147 _HKI( "Conflict between bus alias definitions across schematic sheets" ),
148 wxT( "bus_definition_conflict" ) );
149
151 _HKI( "More than one name given to this bus or net" ),
152 wxT( "multiple_net_names" ) );
153
155 _HKI( "Net is graphically connected to a bus but not a bus member" ),
156 wxT( "net_not_bus_member" ) );
157
159 _HKI( "Buses are graphically connected but share no bus members" ),
160 wxT( "bus_to_bus_conflict" ) );
161
163 _HKI( "Invalid connection between bus and net items" ),
164 wxT( "bus_to_net_conflict" ) );
165
167 _HKI( "Ground pin not connected to ground net" ),
168 wxT( "ground_pin_not_ground" ) );
169
171 _HKI( "Pin name resembles stacked pin" ),
172 wxT( "stacked_pin_name" ) );
173
175 _HKI( "Field name has leading or trailing whitespace" ),
176 wxT( "field_name_whitespace" ) );
177
178ERC_ITEM ERC_ITEM::emptyLabelName( ERCE_EMPTY_LABEL_NAME, _HKI( "Label has an empty name" ),
179 wxT( "empty_label_name" ) );
180
181ERC_ITEM ERC_ITEM::emptyPowerValue( ERCE_EMPTY_POWER_VALUE, _HKI( "Power symbol has an empty value" ),
182 wxT( "empty_power_value" ) );
183
185 _HKI( "Pin map references a pad that does not exist on the footprint" ),
186 wxT( "pin_map_bad_pad" ) );
187
189 _HKI( "Connected pin is not mapped to any footprint pad" ),
190 wxT( "pin_map_unmapped_pin" ) );
191
193 _HKI( "Two symbol pins are mapped to the same footprint pad" ),
194 wxT( "pin_map_duplicate_pad" ) );
195
197 _HKI( "Pin map references a pin number that no longer exists on the symbol" ),
198 wxT( "pin_map_stale_pin" ) );
199
201 _HKI( "Unresolved text variable" ),
202 wxT( "unresolved_variable" ) );
203
205 _HKI( "Undefined netclass" ),
206 wxT( "undefined_netclass" ) );
207
209 _HKI( "SPICE model issue" ),
210 wxT( "simulation_model_issue" ) );
211
213 _HKI( "Wires not connected to anything" ),
214 wxT( "wire_dangling" ) );
215
217 _HKI( "Library symbol issue" ),
218 wxT( "lib_symbol_issues" ) );
219
221 _HKI( "Symbol doesn't match copy in library" ),
222 wxT( "lib_symbol_mismatch" ) );
223
225 _HKI( "Footprint link issue" ),
226 wxT( "footprint_link_issues" ) );
227
229 _HKI( "Assigned footprint doesn't match footprint filters" ),
230 wxT( "footprint_filter" ) );
231
233 _HKI( "Symbol is not annotated" ),
234 wxT( "unannotated" ) );
235
237 _HKI( "Symbol has more units than are defined" ),
238 wxT( "extra_units" ) );
239
241 _HKI( "Symbol has units that are not placed" ),
242 wxT( "missing_unit" ) );
243
245 _HKI( "Symbol has input pins that are not placed" ),
246 wxT( "missing_input_pin" ) );
247
249 _HKI( "Symbol has bidirectional pins that are not placed" ),
250 wxT( "missing_bidi_pin" ) );
251
253 _HKI( "Symbol has power input pins that are not placed" ),
254 wxT( "missing_power_pin" ) );
255
257 _HKI( "Units of same symbol have different values" ),
258 wxT( "unit_value_mismatch" ) );
259
261 _HKI( "Duplicate reference designators" ),
262 wxT( "duplicate_reference" ) );
263
265 _HKI( "Bus Entry needed" ),
266 wxT( "bus_entry_needed" ) );
267
269 _HKI( "Unconnected wire endpoint" ),
270 wxT( "unconnected_wire_endpoint" ) );
271
273 _HKI( "Variant symbol not found in libraries" ),
274 wxT( "variant_symbol_invalid" ) );
275
277 _HKI( "Variant symbol is not pin-compatible" ),
278 wxT( "variant_symbol_incompatible" ) );
279
280std::vector<std::reference_wrapper<RC_ITEM>> ERC_ITEM::allItemTypes(
287
293
298 // Commented out until the logic for this element is coded
299 // TODO: Add bus label syntax checking
300 // ERC_ITEM::busLabelSyntax,
305
306 // ERC_ITEM types with no user-editable severities
307 // NOTE: this MUST be the last grouping in the list!
310
311
312std::shared_ptr<ERC_ITEM> ERC_ITEM::Create( int aErrorCode )
313{
314 switch( aErrorCode )
315 {
316 case ERCE_DUPLICATE_SHEET_NAME: return std::make_shared<ERC_ITEM>( duplicateSheetName );
317 case ERCE_ENDPOINT_OFF_GRID: return std::make_shared<ERC_ITEM>( endpointOffGrid );
318 case ERCE_PIN_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( pinNotConnected );
319 case ERCE_PIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( pinNotDriven );
320 case ERCE_POWERPIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( powerpinNotDriven );
321 case ERCE_WIRED_IMPLICIT_POWER: return std::make_shared<ERC_ITEM>( wiredImplicitPower );
322 case ERCE_DUPLICATE_PIN_ERROR: return std::make_shared<ERC_ITEM>( duplicatePinError );
323 case ERCE_PIN_TO_PIN_WARNING: return std::make_shared<ERC_ITEM>( pinTableWarning );
324 case ERCE_PIN_TO_PIN_ERROR: return std::make_shared<ERC_ITEM>( pinTableError );
325 case ERCE_GENERIC_WARNING: return std::make_shared<ERC_ITEM>( genericWarning );
326 case ERCE_GENERIC_ERROR: return std::make_shared<ERC_ITEM>( genericError );
327 case ERCE_HIERACHICAL_LABEL: return std::make_shared<ERC_ITEM>( hierLabelMismatch );
328 case ERCE_NOCONNECT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectConnected );
329 case ERCE_NOCONNECT_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectDangling );
330 case ERCE_FOUR_WAY_JUNCTION: return std::make_shared<ERC_ITEM>( fourWayJunction );
331 case ERCE_LABEL_MULTIPLE_WIRES: return std::make_shared<ERC_ITEM>( labelMultipleWires );
332 case ERCE_LABEL_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( labelDangling );
333 case ERCE_SIMILAR_LABELS: return std::make_shared<ERC_ITEM>( similarLabels );
334 case ERCE_SIMILAR_POWER: return std::make_shared<ERC_ITEM>( similarPower );
335 case ERCE_SIMILAR_LABEL_AND_POWER: return std::make_shared<ERC_ITEM>( similarLabelAndPower );
336 case ERCE_SINGLE_GLOBAL_LABEL: return std::make_shared<ERC_ITEM>( singleGlobalLabel );
337 case ERCE_SAME_LOCAL_GLOBAL_LABEL: return std::make_shared<ERC_ITEM>( sameLocalGlobalLabel );
338 case ERCE_SAME_LOCAL_GLOBAL_POWER: return std::make_shared<ERC_ITEM>( sameLocalGlobalPower );
339 case ERCE_DIFFERENT_UNIT_FP: return std::make_shared<ERC_ITEM>( differentUnitFootprint );
340 case ERCE_DIFFERENT_UNIT_NET: return std::make_shared<ERC_ITEM>( differentUnitNet );
341 case ERCE_BUS_ALIAS_CONFLICT: return std::make_shared<ERC_ITEM>( busDefinitionConflict );
342 case ERCE_DRIVER_CONFLICT: return std::make_shared<ERC_ITEM>( multipleNetNames );
343 case ERCE_BUS_ENTRY_CONFLICT: return std::make_shared<ERC_ITEM>( netNotBusMember );
344 case ERCE_BUS_TO_BUS_CONFLICT: return std::make_shared<ERC_ITEM>( busToBusConflict );
345 case ERCE_BUS_TO_NET_CONFLICT: return std::make_shared<ERC_ITEM>( busToNetConflict );
346 case ERCE_GROUND_PIN_NOT_GROUND: return std::make_shared<ERC_ITEM>( groundPinNotGround );
347 case ERCE_LABEL_SINGLE_PIN: return std::make_shared<ERC_ITEM>( isolatedPinLabel );
348 case ERCE_UNRESOLVED_VARIABLE: return std::make_shared<ERC_ITEM>( unresolvedVariable );
349 case ERCE_UNDEFINED_NETCLASS: return std::make_shared<ERC_ITEM>( undefinedNetclass );
350 case ERCE_SIMULATION_MODEL: return std::make_shared<ERC_ITEM>( simulationModelIssues );
351 case ERCE_WIRE_DANGLING: return std::make_shared<ERC_ITEM>( wireDangling );
352 case ERCE_LIB_SYMBOL_ISSUES: return std::make_shared<ERC_ITEM>( libSymbolIssues );
353 case ERCE_LIB_SYMBOL_MISMATCH: return std::make_shared<ERC_ITEM>( libSymbolMismatch );
354 case ERCE_FOOTPRINT_LINK_ISSUES: return std::make_shared<ERC_ITEM>( footprintLinkIssues );
355 case ERCE_FOOTPRINT_FILTERS: return std::make_shared<ERC_ITEM>( footprintFilters );
356 case ERCE_UNANNOTATED: return std::make_shared<ERC_ITEM>( unannotated );
357 case ERCE_EXTRA_UNITS: return std::make_shared<ERC_ITEM>( extraUnits );
358 case ERCE_DIFFERENT_UNIT_VALUE: return std::make_shared<ERC_ITEM>( differentUnitValue );
359 case ERCE_DUPLICATE_REFERENCE: return std::make_shared<ERC_ITEM>( duplicateReference );
360 case ERCE_BUS_ENTRY_NEEDED: return std::make_shared<ERC_ITEM>( busEntryNeeded );
361 case ERCE_MISSING_UNIT: return std::make_shared<ERC_ITEM>( missingUnits );
362 case ERCE_MISSING_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingInputPin );
363 case ERCE_MISSING_POWER_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingPowerInputPin );
364 case ERCE_MISSING_BIDI_PIN: return std::make_shared<ERC_ITEM>( missingBidiPin );
365 case ERCE_UNCONNECTED_WIRE_ENDPOINT: return std::make_shared<ERC_ITEM>( unconnectedWireEndpoint );
366 case ERCE_STACKED_PIN_SYNTAX: return std::make_shared<ERC_ITEM>( stackedPinName );
367 case ERCE_FIELD_NAME_WHITESPACE: return std::make_shared<ERC_ITEM>( fieldNameWhitespace );
368 case ERCE_EMPTY_LABEL_NAME: return std::make_shared<ERC_ITEM>( emptyLabelName );
369 case ERCE_EMPTY_POWER_VALUE: return std::make_shared<ERC_ITEM>( emptyPowerValue );
370 case ERCE_PIN_MAP_BAD_PAD: return std::make_shared<ERC_ITEM>( pinMapBadPad );
371 case ERCE_PIN_MAP_UNMAPPED_PIN: return std::make_shared<ERC_ITEM>( pinMapUnmappedPin );
372 case ERCE_PIN_MAP_DUPLICATE_PAD: return std::make_shared<ERC_ITEM>( pinMapDuplicatePad );
373 case ERCE_PIN_MAP_STALE_PIN: return std::make_shared<ERC_ITEM>( pinMapStalePin );
374 case ERCE_VARIANT_SYMBOL_INVALID: return std::make_shared<ERC_ITEM>( variantSymbolInvalid );
375 case ERCE_VARIANT_SYMBOL_INCOMPATIBLE: return std::make_shared<ERC_ITEM>( variantSymbolIncompatible );
376 case ERCE_UNSPECIFIED:
377 default:
378 wxFAIL_MSG( wxS( "Unknown ERC error code" ) );
379 break;
380 }
381
382 return nullptr;
383}
384
390void ERC_TREE_MODEL::GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
391 unsigned int aCol ) const
392{
393 SCH_EDIT_FRAME* schEditFrame = static_cast<SCH_EDIT_FRAME*>( m_editFrame );
394 const RC_TREE_NODE* node = ToNode( aItem );
395
396 if( !node || !node->m_RcItem )
397 {
398 aVariant = wxEmptyString;
399 return;
400 }
401
402 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>( node->m_RcItem );
403 MARKER_BASE* marker = ercItem->GetParent();
404 wxString msg;
405 const SCH_SHEET_PATH& fallbackSheet = ercItem->IsSheetSpecific() ? ercItem->GetSpecificSheetPath()
406 : schEditFrame->GetCurrentSheet();
407
408 auto getItemDesc =
409 [&]( EDA_ITEM* aCurrItem, const SCH_SHEET_PATH& aSheet )
410 {
411 const auto currentPath = schEditFrame->Schematic().Hierarchy().GetSheetPathByKIIDPath(
412 aSheet.PathRef() );
413
414 if( !currentPath )
415 return _( "(Deleted Item)" );
416
417 SCH_SHEET_PATH curSheet = schEditFrame->GetCurrentSheet();
418 wxString desc;
419
420 if( *currentPath != curSheet )
421 {
422 // Use the schematic-level setter to avoid the view side effects of
423 // SCH_EDIT_FRAME::SetCurrentSheet, which recreates the drawing sheet
424 // proxy with potentially stale page number state.
425 schEditFrame->Schematic().SetCurrentSheet( *currentPath );
426 currentPath->UpdateAllScreenReferences();
427 {
428 desc = aCurrItem->GetItemDescription( m_editFrame, true );
429 }
430 schEditFrame->Schematic().SetCurrentSheet( curSheet );
431 curSheet.UpdateAllScreenReferences();
432 }
433 else
434 {
435 desc = aCurrItem->GetItemDescription( m_editFrame, true );
436 }
437
438 return desc;
439 };
440
441 switch( node->m_Type )
442 {
444 if( marker )
445 {
446 SEVERITY severity = ercItem->GetParent()->GetSeverity();
447
448 if( severity == RPT_SEVERITY_EXCLUSION )
449 {
450 if( schEditFrame->GetSeverity( ercItem->GetErrorCode() ) == RPT_SEVERITY_WARNING )
451 msg = _( "Excluded warning: " );
452 else
453 msg = _( "Excluded error: " );
454 }
455 else if( severity == RPT_SEVERITY_WARNING )
456 {
457 msg = _( "Warning: " );
458 }
459 else
460 {
461 msg = _( "Error: " );
462 }
463 }
464
465 msg += ercItem->GetErrorMessage( true );
466 break;
467
469 if( marker && marker->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
470 {
471 msg = _( "Drawing Sheet" );
472 }
473 else
474 {
475 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetMainItemID() ),
476 ercItem->MainItemHasSheetPath() ? ercItem->GetMainItemSheetPath()
477 : fallbackSheet );
478 }
479
480 break;
481
483 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetAuxItemID() ),
484 ercItem->AuxItemHasSheetPath() ? ercItem->GetAuxItemSheetPath()
485 : fallbackSheet );
486 break;
487
489 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetAuxItem2ID() ),
490 fallbackSheet );
491 break;
492
494 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetAuxItem3ID() ),
495 fallbackSheet );
496 break;
497
499 if( marker )
500 msg = marker->GetComment();
501
502 break;
503 }
504
505 msg.Replace( wxS( "\n" ), wxS( " " ) );
506 aVariant = msg;
507}
508
509
510wxString ERC_ITEM::getItemDescription( EDA_ITEM* aItem, int aIndex, UNITS_PROVIDER* aUnitsProvider ) const
511{
512 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( aItem );
513 SCHEMATIC* sch = schItem ? schItem->Schematic() : nullptr;
514
515 const std::optional<SCH_SHEET_PATH>& explicitSheet = aIndex == 0 ? m_mainItemSheet : m_auxItemSheet;
516 const std::optional<SCH_SHEET_PATH>& itemSheet = explicitSheet ? explicitSheet : m_sheetSpecificPath;
517
518 if( !sch || !itemSheet.has_value() )
519 return RC_ITEM::getItemDescription( aItem, aIndex, aUnitsProvider );
520
521 const auto currentPath = sch->Hierarchy().GetSheetPathByKIIDPath( itemSheet->PathRef() );
522
523 if( !currentPath )
524 return _( "(Deleted Item)" );
525
526 if( sch->CurrentSheet() == *currentPath )
527 return RC_ITEM::getItemDescription( aItem, aIndex, aUnitsProvider );
528
529 // Temporarily point the schematic at the affected item's sheet so per-instance
530 // fields (notably the symbol reference) resolve to the same text the GUI ERC
531 // dialog shows. Mirrors the lambda in ERC_TREE_MODEL::GetValue.
532 SCH_SHEET_PATH savedSheet = sch->CurrentSheet();
533 SCH_SHEET_PATH targetSheet = *currentPath;
534
535 sch->SetCurrentSheet( targetSheet );
536 targetSheet.UpdateAllScreenReferences();
537
538 wxString desc = RC_ITEM::getItemDescription( aItem, aIndex, aUnitsProvider );
539
540 sch->SetCurrentSheet( savedSheet );
541 savedSheet.UpdateAllScreenReferences();
542
543 return desc;
544}
545
546
548{
549 if( !m_itemsBuilt )
550 {
551 m_sheetList.FillItemMap( m_items );
552 m_itemsBuilt = true;
553 }
554
555 auto it = m_items.find( aKiid );
556 if( it != m_items.end() )
557 return it->second;
558
559 return nullptr;
560}
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
Definition eda_item.cpp:304
static ERC_ITEM differentUnitValue
Definition erc_item.h:260
std::optional< SCH_SHEET_PATH > m_mainItemSheet
Definition erc_item.h:195
static ERC_ITEM busToBusConflict
Definition erc_item.h:235
static ERC_ITEM labelMultipleWires
Definition erc_item.h:220
static ERC_ITEM pinTableWarning
Definition erc_item.h:213
static ERC_ITEM footprintLinkIssues
Definition erc_item.h:252
static ERC_ITEM emptyLabelName
Definition erc_item.h:240
static ERC_ITEM unresolvedVariable
Definition erc_item.h:246
static ERC_ITEM duplicateSheetName
Definition erc_item.h:206
static ERC_ITEM noConnectDangling
Definition erc_item.h:221
static ERC_ITEM busDefinitionConflict
Definition erc_item.h:232
static ERC_ITEM fourWayJunction
Definition erc_item.h:219
static ERC_ITEM genericError
Definition erc_item.h:216
static ERC_ITEM libSymbolIssues
Definition erc_item.h:250
static ERC_ITEM emptyPowerValue
Definition erc_item.h:241
static ERC_ITEM variantSymbolIncompatible
Definition erc_item.h:265
static ERC_ITEM pinNotDriven
Definition erc_item.h:209
wxString getItemDescription(EDA_ITEM *aItem, int aIndex, UNITS_PROVIDER *aUnitsProvider) const override
Resolve the affected-item description in the per-instance SCH_SHEET_PATH context stored on this marke...
Definition erc_item.cpp:510
static ERC_ITEM undefinedNetclass
Definition erc_item.h:247
static ERC_ITEM extraUnits
Definition erc_item.h:255
static ERC_ITEM pinMapUnmappedPin
Definition erc_item.h:243
static ERC_ITEM variantSymbolInvalid
Definition erc_item.h:264
static ERC_ITEM heading_conflicts
Definition erc_item.h:202
static std::shared_ptr< ERC_ITEM > Create(int aErrorCode)
Constructs an ERC_ITEM for the given error code.
Definition erc_item.cpp:312
static ERC_ITEM noConnectConnected
Definition erc_item.h:218
static ERC_ITEM heading_misc
Definition erc_item.h:203
static ERC_ITEM endpointOffGrid
Definition erc_item.h:207
static ERC_ITEM isolatedPinLabel
Definition erc_item.h:223
static ERC_ITEM busToNetConflict
Definition erc_item.h:236
static ERC_ITEM differentUnitFootprint
Definition erc_item.h:230
static ERC_ITEM sameLocalGlobalLabel
Definition erc_item.h:225
static ERC_ITEM hierLabelMismatch
Definition erc_item.h:217
static ERC_ITEM heading_connections
Definition erc_item.h:201
static ERC_ITEM missingUnits
Definition erc_item.h:256
static ERC_ITEM similarLabels
Definition erc_item.h:227
static ERC_ITEM unconnectedWireEndpoint
Definition erc_item.h:263
static ERC_ITEM heading_internal
Definition erc_item.h:204
static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
A list of all ERC_ITEM types which are valid error codes.
Definition erc_item.h:199
static ERC_ITEM labelDangling
Definition erc_item.h:222
static ERC_ITEM pinMapStalePin
Definition erc_item.h:245
static ERC_ITEM differentUnitNet
Definition erc_item.h:231
static ERC_ITEM pinMapDuplicatePad
Definition erc_item.h:244
static ERC_ITEM pinTableError
Definition erc_item.h:214
static ERC_ITEM similarLabelAndPower
Definition erc_item.h:229
static ERC_ITEM groundPinNotGround
Definition erc_item.h:237
static ERC_ITEM genericWarning
Definition erc_item.h:215
static ERC_ITEM footprintFilters
Definition erc_item.h:253
static ERC_ITEM fieldNameWhitespace
Definition erc_item.h:239
static ERC_ITEM netNotBusMember
Definition erc_item.h:234
static ERC_ITEM wireDangling
Definition erc_item.h:249
static ERC_ITEM powerpinNotDriven
Definition erc_item.h:210
static ERC_ITEM missingPowerInputPin
Definition erc_item.h:259
std::optional< SCH_SHEET_PATH > m_sheetSpecificPath
True if this item is specific to a sheet instance (as opposed to applying to all instances)
Definition erc_item.h:268
static ERC_ITEM missingBidiPin
Definition erc_item.h:258
static ERC_ITEM unannotated
Definition erc_item.h:254
static ERC_ITEM missingInputPin
Definition erc_item.h:257
static ERC_ITEM wiredImplicitPower
Definition erc_item.h:211
static ERC_ITEM singleGlobalLabel
Definition erc_item.h:224
static ERC_ITEM sameLocalGlobalPower
Definition erc_item.h:226
static ERC_ITEM busEntryNeeded
Definition erc_item.h:262
static ERC_ITEM simulationModelIssues
Definition erc_item.h:248
std::optional< SCH_SHEET_PATH > m_auxItemSheet
Definition erc_item.h:196
static ERC_ITEM pinMapBadPad
Definition erc_item.h:242
static ERC_ITEM multipleNetNames
Definition erc_item.h:233
static ERC_ITEM similarPower
Definition erc_item.h:228
static ERC_ITEM pinNotConnected
Definition erc_item.h:208
static ERC_ITEM stackedPinName
Definition erc_item.h:238
static ERC_ITEM libSymbolMismatch
Definition erc_item.h:251
static ERC_ITEM duplicateReference
Definition erc_item.h:261
static ERC_ITEM duplicatePinError
Definition erc_item.h:212
void GetValue(wxVariant &aVariant, wxDataViewItem const &aItem, unsigned int aCol) const override
Override of RC_TREE_MODEL::GetValue which returns item descriptions in a specific SCH_SHEET_PATH cont...
Definition erc_item.cpp:390
Definition kiid.h:46
Marker are mainly used to show a DRC or ERC error or warning.
Definition marker_base.h:45
@ MARKER_DRAWING_SHEET
Definition marker_base.h:52
enum MARKER_T GetMarkerType() const
Definition marker_base.h:88
wxString GetComment() const
Definition marker_base.h:97
virtual wxString getItemDescription(EDA_ITEM *aItem, int aIndex, UNITS_PROVIDER *aUnitsProvider) const
Resolve the description string used for an affected item in ShowReport and GetJsonViolation.
Definition rc_item.cpp:79
EDA_DRAW_FRAME * m_editFrame
Definition rc_item.h:425
static RC_TREE_NODE * ToNode(wxDataViewItem aItem)
Definition rc_item.h:323
std::shared_ptr< RC_ITEM > m_RcItem
Definition rc_item.h:307
NODE_TYPE m_Type
Definition rc_item.h:306
Holds all the data relating to one schematic.
Definition schematic.h:149
void SetCurrentSheet(const SCH_SHEET_PATH &aPath)
Definition schematic.h:317
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
SCH_SHEET_PATH & CurrentSheet() const
Definition schematic.h:312
Schematic editor (Eeschema) main window.
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
EDA_ITEM * ResolveItem(const KIID &aId, bool aAllowNullptrReturn=false) const override
Fetch an item by KIID.
SEVERITY GetSeverity(int aErrorCode) const override
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:170
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:302
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...
Definition erc_item.cpp:547
std::unordered_map< KIID, EDA_ITEM * > m_items
Definition erc_item.h:290
const SCH_SHEET_LIST & m_sheetList
Definition erc_item.h:286
std::optional< SCH_SHEET_PATH > GetSheetPathByKIIDPath(const KIID_PATH &aPath, bool aIncludeLastSheet=true) const
Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
#define _(s)
@ ERCE_UNSPECIFIED
@ ERCE_UNANNOTATED
Symbol has not been annotated.
@ ERCE_POWERPIN_NOT_DRIVEN
Power input pin connected to some others pins but no power out pin to drive it.
@ ERCE_DRIVER_CONFLICT
Conflicting drivers (labels, etc) on a subgraph.
@ ERCE_SIMILAR_POWER
2 power pins are equal for case insensitive comparisons.
@ ERCE_MISSING_POWER_INPUT_PIN
Symbol has power input pins that are not placed on the schematic.
@ ERCE_EMPTY_POWER_VALUE
Power symbol has no value, so it names no net.
@ ERCE_UNCONNECTED_WIRE_ENDPOINT
A label is connected to more than one wire.
@ ERCE_GROUND_PIN_NOT_GROUND
A ground-labeled pin is not on a ground net while another pin is.
@ ERCE_SIMILAR_LABELS
2 labels are equal for case insensitive comparisons.
@ ERCE_VARIANT_SYMBOL_INCOMPATIBLE
Variant symbol override fails pin compatibility.
@ ERCE_STACKED_PIN_SYNTAX
Pin name resembles stacked pin notation.
@ ERCE_LABEL_NOT_CONNECTED
Label not connected to any pins.
@ ERCE_ENDPOINT_OFF_GRID
Pin or wire-end off grid.
@ ERCE_DUPLICATE_REFERENCE
More than one symbol with the same reference.
@ ERCE_EMPTY_LABEL_NAME
Label has an empty or whitespace-only name.
@ ERCE_EXTRA_UNITS
Symbol has more units than are defined.
@ ERCE_SAME_LOCAL_GLOBAL_LABEL
2 labels are equal for case insensitive comparisons.
@ ERCE_BUS_TO_BUS_CONFLICT
A connection between bus objects doesn't share at least one net.
@ ERCE_SIMILAR_LABEL_AND_POWER
label and pin are equal for case insensitive comparisons.
@ ERCE_SAME_LOCAL_GLOBAL_POWER
Local power port and global power port have the same name.
@ ERCE_PIN_MAP_BAD_PAD
Pin map references a pad absent from the footprint.
@ ERCE_LABEL_SINGLE_PIN
A label is connected only to a single pin.
@ ERCE_BUS_ENTRY_CONFLICT
A wire connected to a bus doesn't match the bus.
@ ERCE_FOOTPRINT_LINK_ISSUES
The footprint link is invalid, or points to a missing (or inactive) footprint or library.
@ ERCE_PIN_MAP_DUPLICATE_PAD
Two symbol pins map to one pad (not stacked/jumper).
@ ERCE_BUS_TO_NET_CONFLICT
A bus wire is graphically connected to a net port/pin (or vice versa).
@ ERCE_DUPLICATE_PIN_ERROR
@ ERCE_NOCONNECT_NOT_CONNECTED
A no connect symbol is not connected to anything.
@ ERCE_DIFFERENT_UNIT_NET
Shared pin in a multi-unit symbol is connected to more than one net.
@ ERCE_FOUR_WAY_JUNCTION
A four-way junction was found.
@ ERCE_PIN_NOT_CONNECTED
Pin not connected and not no connect symbol.
@ ERCE_UNDEFINED_NETCLASS
A netclass was referenced but not defined.
@ ERCE_BUS_ENTRY_NEEDED
Importer failed to auto-place a bus entry.
@ ERCE_UNRESOLVED_VARIABLE
A text variable could not be resolved.
@ ERCE_SIMULATION_MODEL
An error was found in the simulation model.
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
@ ERCE_GENERIC_ERROR
@ ERCE_DIFFERENT_UNIT_FP
Different units of the same symbol have different footprints assigned.
@ ERCE_NOCONNECT_CONNECTED
A no connect symbol is connected to more than 1 pin.
@ ERCE_PIN_TO_PIN_WARNING
@ ERCE_PIN_NOT_DRIVEN
Pin connected to some others pins but no pin to drive it.
@ ERCE_MISSING_INPUT_PIN
Symbol has input pins that are not placed.
@ ERCE_MISSING_UNIT
Symbol has units that are not placed on the schematic.
@ ERCE_FIELD_NAME_WHITESPACE
Field name has leading or trailing whitespace.
@ ERCE_DUPLICATE_SHEET_NAME
Duplicate sheet names within a given sheet.
@ ERCE_PIN_MAP_STALE_PIN
Pin map references a pin number not on the symbol.
@ ERCE_MISSING_BIDI_PIN
Symbol has bi-directional pins that are not placed.
@ ERCE_LIB_SYMBOL_ISSUES
Symbol not found in active libraries.
@ ERCE_FOOTPRINT_FILTERS
The assigned footprint doesn't match the footprint filters.
@ ERCE_HIERACHICAL_LABEL
Mismatch between hierarchical labels and pins sheets.
@ ERCE_WIRE_DANGLING
Some wires are not connected to anything else.
@ ERCE_BUS_ALIAS_CONFLICT
Conflicting bus alias definitions across sheets.
@ ERCE_GENERIC_WARNING
@ ERCE_VARIANT_SYMBOL_INVALID
Variant symbol override LIB_ID cannot be resolved.
@ ERCE_SINGLE_GLOBAL_LABEL
A label only exists once in the schematic.
@ ERCE_PIN_MAP_UNMAPPED_PIN
A connected pin resolves to no footprint pad.
@ ERCE_LABEL_MULTIPLE_WIRES
A label is connected to more than one wire.
@ ERCE_DIFFERENT_UNIT_VALUE
Units of same symbol have different values.
@ ERCE_WIRED_IMPLICIT_POWER
Wired hidden power input also joins its global net by name.
@ ERCE_PIN_TO_PIN_ERROR
Some functions to handle hotkeys in KiCad.
#define _HKI(x)
Definition page_info.cpp:40
SEVERITY
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_EXCLUSION