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( "Reused sheets have the same reference suffix" ),
186 wxT( "duplicate_sheet_suffix" ) );
187
189 _HKI( "Reference does not match its reused sheet" ),
190 wxT( "ref_suffix_mismatch" ) );
191
193 _HKI( "Pin map references a pad that does not exist on the footprint" ),
194 wxT( "pin_map_bad_pad" ) );
195
197 _HKI( "Connected pin is not mapped to any footprint pad" ),
198 wxT( "pin_map_unmapped_pin" ) );
199
201 _HKI( "Two symbol pins are mapped to the same footprint pad" ),
202 wxT( "pin_map_duplicate_pad" ) );
203
205 _HKI( "Pin map references a pin number that no longer exists on the symbol" ),
206 wxT( "pin_map_stale_pin" ) );
207
209 _HKI( "Unresolved text variable" ),
210 wxT( "unresolved_variable" ) );
211
213 _HKI( "Undefined netclass" ),
214 wxT( "undefined_netclass" ) );
215
217 _HKI( "SPICE model issue" ),
218 wxT( "simulation_model_issue" ) );
219
221 _HKI( "Wires not connected to anything" ),
222 wxT( "wire_dangling" ) );
223
225 _HKI( "Library symbol issue" ),
226 wxT( "lib_symbol_issues" ) );
227
229 _HKI( "Symbol doesn't match copy in library" ),
230 wxT( "lib_symbol_mismatch" ) );
231
233 _HKI( "Footprint link issue" ),
234 wxT( "footprint_link_issues" ) );
235
237 _HKI( "Assigned footprint doesn't match footprint filters" ),
238 wxT( "footprint_filter" ) );
239
241 _HKI( "Symbol is not annotated" ),
242 wxT( "unannotated" ) );
243
245 _HKI( "Symbol has more units than are defined" ),
246 wxT( "extra_units" ) );
247
249 _HKI( "Symbol has units that are not placed" ),
250 wxT( "missing_unit" ) );
251
253 _HKI( "Symbol has input pins that are not placed" ),
254 wxT( "missing_input_pin" ) );
255
257 _HKI( "Symbol has bidirectional pins that are not placed" ),
258 wxT( "missing_bidi_pin" ) );
259
261 _HKI( "Symbol has power input pins that are not placed" ),
262 wxT( "missing_power_pin" ) );
263
265 _HKI( "Units of same symbol have different values" ),
266 wxT( "unit_value_mismatch" ) );
267
269 _HKI( "Duplicate reference designators" ),
270 wxT( "duplicate_reference" ) );
271
273 _HKI( "Bus Entry needed" ),
274 wxT( "bus_entry_needed" ) );
275
277 _HKI( "Unconnected wire endpoint" ),
278 wxT( "unconnected_wire_endpoint" ) );
279
281 _HKI( "Variant symbol not found in libraries" ),
282 wxT( "variant_symbol_invalid" ) );
283
285 _HKI( "Variant symbol is not pin-compatible" ),
286 wxT( "variant_symbol_incompatible" ) );
287
288std::vector<std::reference_wrapper<RC_ITEM>> ERC_ITEM::allItemTypes(
295
301
307 // Commented out until the logic for this element is coded
308 // TODO: Add bus label syntax checking
309 // ERC_ITEM::busLabelSyntax,
314
315 // ERC_ITEM types with no user-editable severities
316 // NOTE: this MUST be the last grouping in the list!
319
320
321std::shared_ptr<ERC_ITEM> ERC_ITEM::Create( int aErrorCode )
322{
323 switch( aErrorCode )
324 {
325 case ERCE_DUPLICATE_SHEET_NAME: return std::make_shared<ERC_ITEM>( duplicateSheetName );
326 case ERCE_ENDPOINT_OFF_GRID: return std::make_shared<ERC_ITEM>( endpointOffGrid );
327 case ERCE_PIN_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( pinNotConnected );
328 case ERCE_PIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( pinNotDriven );
329 case ERCE_POWERPIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( powerpinNotDriven );
330 case ERCE_WIRED_IMPLICIT_POWER: return std::make_shared<ERC_ITEM>( wiredImplicitPower );
331 case ERCE_DUPLICATE_PIN_ERROR: return std::make_shared<ERC_ITEM>( duplicatePinError );
332 case ERCE_PIN_TO_PIN_WARNING: return std::make_shared<ERC_ITEM>( pinTableWarning );
333 case ERCE_PIN_TO_PIN_ERROR: return std::make_shared<ERC_ITEM>( pinTableError );
334 case ERCE_GENERIC_WARNING: return std::make_shared<ERC_ITEM>( genericWarning );
335 case ERCE_GENERIC_ERROR: return std::make_shared<ERC_ITEM>( genericError );
336 case ERCE_HIERACHICAL_LABEL: return std::make_shared<ERC_ITEM>( hierLabelMismatch );
337 case ERCE_NOCONNECT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectConnected );
338 case ERCE_NOCONNECT_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectDangling );
339 case ERCE_FOUR_WAY_JUNCTION: return std::make_shared<ERC_ITEM>( fourWayJunction );
340 case ERCE_LABEL_MULTIPLE_WIRES: return std::make_shared<ERC_ITEM>( labelMultipleWires );
341 case ERCE_LABEL_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( labelDangling );
342 case ERCE_SIMILAR_LABELS: return std::make_shared<ERC_ITEM>( similarLabels );
343 case ERCE_SIMILAR_POWER: return std::make_shared<ERC_ITEM>( similarPower );
344 case ERCE_SIMILAR_LABEL_AND_POWER: return std::make_shared<ERC_ITEM>( similarLabelAndPower );
345 case ERCE_SINGLE_GLOBAL_LABEL: return std::make_shared<ERC_ITEM>( singleGlobalLabel );
346 case ERCE_SAME_LOCAL_GLOBAL_LABEL: return std::make_shared<ERC_ITEM>( sameLocalGlobalLabel );
347 case ERCE_SAME_LOCAL_GLOBAL_POWER: return std::make_shared<ERC_ITEM>( sameLocalGlobalPower );
348 case ERCE_DIFFERENT_UNIT_FP: return std::make_shared<ERC_ITEM>( differentUnitFootprint );
349 case ERCE_DIFFERENT_UNIT_NET: return std::make_shared<ERC_ITEM>( differentUnitNet );
350 case ERCE_BUS_ALIAS_CONFLICT: return std::make_shared<ERC_ITEM>( busDefinitionConflict );
351 case ERCE_DRIVER_CONFLICT: return std::make_shared<ERC_ITEM>( multipleNetNames );
352 case ERCE_BUS_ENTRY_CONFLICT: return std::make_shared<ERC_ITEM>( netNotBusMember );
353 case ERCE_BUS_TO_BUS_CONFLICT: return std::make_shared<ERC_ITEM>( busToBusConflict );
354 case ERCE_BUS_TO_NET_CONFLICT: return std::make_shared<ERC_ITEM>( busToNetConflict );
355 case ERCE_GROUND_PIN_NOT_GROUND: return std::make_shared<ERC_ITEM>( groundPinNotGround );
356 case ERCE_LABEL_SINGLE_PIN: return std::make_shared<ERC_ITEM>( isolatedPinLabel );
357 case ERCE_UNRESOLVED_VARIABLE: return std::make_shared<ERC_ITEM>( unresolvedVariable );
358 case ERCE_UNDEFINED_NETCLASS: return std::make_shared<ERC_ITEM>( undefinedNetclass );
359 case ERCE_SIMULATION_MODEL: return std::make_shared<ERC_ITEM>( simulationModelIssues );
360 case ERCE_WIRE_DANGLING: return std::make_shared<ERC_ITEM>( wireDangling );
361 case ERCE_LIB_SYMBOL_ISSUES: return std::make_shared<ERC_ITEM>( libSymbolIssues );
362 case ERCE_LIB_SYMBOL_MISMATCH: return std::make_shared<ERC_ITEM>( libSymbolMismatch );
363 case ERCE_FOOTPRINT_LINK_ISSUES: return std::make_shared<ERC_ITEM>( footprintLinkIssues );
364 case ERCE_FOOTPRINT_FILTERS: return std::make_shared<ERC_ITEM>( footprintFilters );
365 case ERCE_UNANNOTATED: return std::make_shared<ERC_ITEM>( unannotated );
366 case ERCE_EXTRA_UNITS: return std::make_shared<ERC_ITEM>( extraUnits );
367 case ERCE_DIFFERENT_UNIT_VALUE: return std::make_shared<ERC_ITEM>( differentUnitValue );
368 case ERCE_DUPLICATE_REFERENCE: return std::make_shared<ERC_ITEM>( duplicateReference );
369 case ERCE_BUS_ENTRY_NEEDED: return std::make_shared<ERC_ITEM>( busEntryNeeded );
370 case ERCE_MISSING_UNIT: return std::make_shared<ERC_ITEM>( missingUnits );
371 case ERCE_MISSING_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingInputPin );
372 case ERCE_MISSING_POWER_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingPowerInputPin );
373 case ERCE_MISSING_BIDI_PIN: return std::make_shared<ERC_ITEM>( missingBidiPin );
374 case ERCE_UNCONNECTED_WIRE_ENDPOINT: return std::make_shared<ERC_ITEM>( unconnectedWireEndpoint );
375 case ERCE_STACKED_PIN_SYNTAX: return std::make_shared<ERC_ITEM>( stackedPinName );
376 case ERCE_FIELD_NAME_WHITESPACE: return std::make_shared<ERC_ITEM>( fieldNameWhitespace );
377 case ERCE_EMPTY_LABEL_NAME: return std::make_shared<ERC_ITEM>( emptyLabelName );
378 case ERCE_EMPTY_POWER_VALUE: return std::make_shared<ERC_ITEM>( emptyPowerValue );
379 case ERCE_DUPLICATE_SHEET_SUFFIX: return std::make_shared<ERC_ITEM>( duplicateSheetSuffix );
380 case ERCE_REF_SUFFIX_MISMATCH: return std::make_shared<ERC_ITEM>( refSuffixMismatch );
381 case ERCE_PIN_MAP_BAD_PAD: return std::make_shared<ERC_ITEM>( pinMapBadPad );
382 case ERCE_PIN_MAP_UNMAPPED_PIN: return std::make_shared<ERC_ITEM>( pinMapUnmappedPin );
383 case ERCE_PIN_MAP_DUPLICATE_PAD: return std::make_shared<ERC_ITEM>( pinMapDuplicatePad );
384 case ERCE_PIN_MAP_STALE_PIN: return std::make_shared<ERC_ITEM>( pinMapStalePin );
385 case ERCE_VARIANT_SYMBOL_INVALID: return std::make_shared<ERC_ITEM>( variantSymbolInvalid );
386 case ERCE_VARIANT_SYMBOL_INCOMPATIBLE: return std::make_shared<ERC_ITEM>( variantSymbolIncompatible );
387 case ERCE_UNSPECIFIED:
388 default:
389 wxFAIL_MSG( wxS( "Unknown ERC error code" ) );
390 break;
391 }
392
393 return nullptr;
394}
395
401void ERC_TREE_MODEL::GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
402 unsigned int aCol ) const
403{
404 SCH_EDIT_FRAME* schEditFrame = static_cast<SCH_EDIT_FRAME*>( m_editFrame );
405 const RC_TREE_NODE* node = ToNode( aItem );
406
407 if( !node || !node->m_RcItem )
408 {
409 aVariant = wxEmptyString;
410 return;
411 }
412
413 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>( node->m_RcItem );
414 MARKER_BASE* marker = ercItem->GetParent();
415 wxString msg;
416 const SCH_SHEET_PATH& fallbackSheet = ercItem->IsSheetSpecific() ? ercItem->GetSpecificSheetPath()
417 : schEditFrame->GetCurrentSheet();
418
419 auto getItemDesc =
420 [&]( EDA_ITEM* aCurrItem, const SCH_SHEET_PATH& aSheet )
421 {
422 const auto currentPath = schEditFrame->Schematic().Hierarchy().GetSheetPathByKIIDPath(
423 aSheet.PathRef() );
424
425 if( !currentPath )
426 return _( "(Deleted Item)" );
427
428 SCH_SHEET_PATH curSheet = schEditFrame->GetCurrentSheet();
429 wxString desc;
430
431 if( *currentPath != curSheet )
432 {
433 // Use the schematic-level setter to avoid the view side effects of
434 // SCH_EDIT_FRAME::SetCurrentSheet, which recreates the drawing sheet
435 // proxy with potentially stale page number state.
436 schEditFrame->Schematic().SetCurrentSheet( *currentPath );
437 currentPath->UpdateAllScreenReferences();
438 {
439 desc = aCurrItem->GetItemDescription( m_editFrame, true );
440 }
441 schEditFrame->Schematic().SetCurrentSheet( curSheet );
442 curSheet.UpdateAllScreenReferences();
443 }
444 else
445 {
446 desc = aCurrItem->GetItemDescription( m_editFrame, true );
447 }
448
449 return desc;
450 };
451
452 switch( node->m_Type )
453 {
455 if( marker )
456 {
457 SEVERITY severity = ercItem->GetParent()->GetSeverity();
458
459 if( severity == RPT_SEVERITY_EXCLUSION )
460 {
461 if( schEditFrame->GetSeverity( ercItem->GetErrorCode() ) == RPT_SEVERITY_WARNING )
462 msg = _( "Excluded warning: " );
463 else
464 msg = _( "Excluded error: " );
465 }
466 else if( severity == RPT_SEVERITY_WARNING )
467 {
468 msg = _( "Warning: " );
469 }
470 else
471 {
472 msg = _( "Error: " );
473 }
474 }
475
476 msg += ercItem->GetErrorMessage( true );
477 break;
478
480 if( marker && marker->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
481 {
482 msg = _( "Drawing Sheet" );
483 }
484 else
485 {
486 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetMainItemID() ),
487 ercItem->MainItemHasSheetPath() ? ercItem->GetMainItemSheetPath()
488 : fallbackSheet );
489 }
490
491 break;
492
494 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetAuxItemID() ),
495 ercItem->AuxItemHasSheetPath() ? ercItem->GetAuxItemSheetPath()
496 : fallbackSheet );
497 break;
498
500 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetAuxItem2ID() ),
501 fallbackSheet );
502 break;
503
505 msg = getItemDesc( schEditFrame->ResolveItem( ercItem->GetAuxItem3ID() ),
506 fallbackSheet );
507 break;
508
510 if( marker )
511 msg = marker->GetComment();
512
513 break;
514 }
515
516 msg.Replace( wxS( "\n" ), wxS( " " ) );
517 aVariant = msg;
518}
519
520
521wxString ERC_ITEM::getItemDescription( EDA_ITEM* aItem, int aIndex, UNITS_PROVIDER* aUnitsProvider ) const
522{
523 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( aItem );
524 SCHEMATIC* sch = schItem ? schItem->Schematic() : nullptr;
525
526 const std::optional<SCH_SHEET_PATH>& explicitSheet = aIndex == 0 ? m_mainItemSheet : m_auxItemSheet;
527 const std::optional<SCH_SHEET_PATH>& itemSheet = explicitSheet ? explicitSheet : m_sheetSpecificPath;
528
529 if( !sch || !itemSheet.has_value() )
530 return RC_ITEM::getItemDescription( aItem, aIndex, aUnitsProvider );
531
532 const auto currentPath = sch->Hierarchy().GetSheetPathByKIIDPath( itemSheet->PathRef() );
533
534 if( !currentPath )
535 return _( "(Deleted Item)" );
536
537 if( sch->CurrentSheet() == *currentPath )
538 return RC_ITEM::getItemDescription( aItem, aIndex, aUnitsProvider );
539
540 // Temporarily point the schematic at the affected item's sheet so per-instance
541 // fields (notably the symbol reference) resolve to the same text the GUI ERC
542 // dialog shows. Mirrors the lambda in ERC_TREE_MODEL::GetValue.
543 SCH_SHEET_PATH savedSheet = sch->CurrentSheet();
544 SCH_SHEET_PATH targetSheet = *currentPath;
545
546 sch->SetCurrentSheet( targetSheet );
547 targetSheet.UpdateAllScreenReferences();
548
549 wxString desc = RC_ITEM::getItemDescription( aItem, aIndex, aUnitsProvider );
550
551 sch->SetCurrentSheet( savedSheet );
552 savedSheet.UpdateAllScreenReferences();
553
554 return desc;
555}
556
557
559{
560 if( !m_itemsBuilt )
561 {
562 m_sheetList.FillItemMap( m_items );
563 m_itemsBuilt = true;
564 }
565
566 auto it = m_items.find( aKiid );
567 if( it != m_items.end() )
568 return it->second;
569
570 return nullptr;
571}
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:314
static ERC_ITEM differentUnitValue
Definition erc_item.h:262
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:254
static ERC_ITEM emptyLabelName
Definition erc_item.h:240
static ERC_ITEM unresolvedVariable
Definition erc_item.h:248
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:252
static ERC_ITEM emptyPowerValue
Definition erc_item.h:241
static ERC_ITEM variantSymbolIncompatible
Definition erc_item.h:267
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:521
static ERC_ITEM undefinedNetclass
Definition erc_item.h:249
static ERC_ITEM extraUnits
Definition erc_item.h:257
static ERC_ITEM duplicateSheetSuffix
Definition erc_item.h:242
static ERC_ITEM pinMapUnmappedPin
Definition erc_item.h:245
static ERC_ITEM variantSymbolInvalid
Definition erc_item.h:266
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:321
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 refSuffixMismatch
Definition erc_item.h:243
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:258
static ERC_ITEM similarLabels
Definition erc_item.h:227
static ERC_ITEM unconnectedWireEndpoint
Definition erc_item.h:265
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:247
static ERC_ITEM differentUnitNet
Definition erc_item.h:231
static ERC_ITEM pinMapDuplicatePad
Definition erc_item.h:246
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:255
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:251
static ERC_ITEM powerpinNotDriven
Definition erc_item.h:210
static ERC_ITEM missingPowerInputPin
Definition erc_item.h:261
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:270
static ERC_ITEM missingBidiPin
Definition erc_item.h:260
static ERC_ITEM unannotated
Definition erc_item.h:256
static ERC_ITEM missingInputPin
Definition erc_item.h:259
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:264
static ERC_ITEM simulationModelIssues
Definition erc_item.h:250
std::optional< SCH_SHEET_PATH > m_auxItemSheet
Definition erc_item.h:196
static ERC_ITEM pinMapBadPad
Definition erc_item.h:244
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:253
static ERC_ITEM duplicateReference
Definition erc_item.h:263
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:401
Definition kiid.h:46
Marker are mainly used to show a DRC or ERC error or warning.
Definition marker_base.h:44
@ MARKER_DRAWING_SHEET
Definition marker_base.h:51
enum MARKER_T GetMarkerType() const
Definition marker_base.h:86
wxString GetComment() const
Definition marker_base.h:95
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:155
void SetCurrentSheet(const SCH_SHEET_PATH &aPath)
Definition schematic.h:404
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
SCH_SHEET_PATH & CurrentSheet() const
Definition schematic.h:399
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:558
std::unordered_map< KIID, EDA_ITEM * > m_items
Definition erc_item.h:292
const SCH_SHEET_LIST & m_sheetList
Definition erc_item.h:288
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_REF_SUFFIX_MISMATCH
Saved reference lacks the suffix of its reused sheet.
@ 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_DUPLICATE_SHEET_SUFFIX
Two uses of one sheet file share a reference suffix.
@ 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