KiCad PCB EDA Suite
ERC_ITEM Class Reference

#include <erc_item.h>

Inheritance diagram for ERC_ITEM:
RC_ITEM

Public Types

typedef std::vector< KIIDKIIDS
 

Public Member Functions

bool IsSheetSpecific () const
 Determines whether the ERC item is bound to a specific sheet, or is common across multiple sheets (e.g. More...
 
void SetSheetSpecificPath (const SCH_SHEET_PATH &aSpecificSheet)
 Sets the SCH_SHEET_PATH this ERC item is bound to. More...
 
const SCH_SHEET_PATHGetSpecificSheetPath () const
 Gets the SCH_SHEET_PATH this ERC item is bound to. More...
 
void SetItemsSheetPaths (const SCH_SHEET_PATH &mainItemSheet)
 Sets the SCH_SHEET_PATH of the main item causing this ERC violation to (e.g. More...
 
void SetItemsSheetPaths (const SCH_SHEET_PATH &mainItemSheet, const SCH_SHEET_PATH &auxItemSheet)
 Set the SCH_SHEET PATHs of the main and auxiliary items causing this ERC violation to (e.g. More...
 
SCH_SHEET_PATHGetMainItemSheetPath ()
 Gets the SCH_SHEET_PATH of the main item causing this ERC violation. More...
 
SCH_SHEET_PATHGetAuxItemSheetPath ()
 Gets the SCH_SHEET_PATH of the auxillary item causing this ERC violation. More...
 
bool MainItemHasSheetPath ()
 Determines whether the main item causing this ERC violation has a specific SCH_SHEET_PATH binding. More...
 
bool AuxItemHasSheetPath ()
 Determines whether the auxiliary item causing this ERC violation has a specific SCH_SHEET_PATH binding. More...
 
void SetErrorMessage (const wxString &aMessage)
 
void SetItems (const KIIDS &aIds)
 
void SetItems (const EDA_ITEM *aItem, const EDA_ITEM *bItem=nullptr, const EDA_ITEM *cItem=nullptr, const EDA_ITEM *dItem=nullptr)
 
void SetItems (const KIID &aItem, const KIID &bItem=niluuid, const KIID &cItem=niluuid, const KIID &dItem=niluuid)
 
void AddItem (EDA_ITEM *aItem)
 
virtual KIID GetMainItemID () const
 
virtual KIID GetAuxItemID () const
 
virtual KIID GetAuxItem2ID () const
 
virtual KIID GetAuxItem3ID () const
 
std::vector< KIIDGetIDs () const
 
void SetParent (MARKER_BASE *aMarker)
 
MARKER_BASEGetParent () const
 
virtual wxString ShowReport (UNITS_PROVIDER *aUnitsProvider, SEVERITY aSeverity, const std::map< KIID, EDA_ITEM * > &aItemMap) const
 Translate this object into a text string suitable for saving to disk in a report. More...
 
int GetErrorCode () const
 
void SetErrorCode (int aCode)
 
virtual wxString GetErrorMessage () const
 
wxString GetErrorText () const
 
wxString GetSettingsKey () const
 
virtual wxString GetViolatingRuleDesc () const
 

Static Public Member Functions

static std::shared_ptr< ERC_ITEMCreate (int aErrorCode)
 Constructs an ERC_ITEM for the given error code. More...
 
static std::shared_ptr< ERC_ITEMCreate (const wxString &aErrorKey)
 
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities ()
 

Protected Attributes

int m_errorCode
 The error code's numeric value. More...
 
wxString m_errorMessage
 A message describing the details of this specific error. More...
 
wxString m_errorTitle
 The string describing the type of error. More...
 
wxString m_settingsKey
 The key used to describe this type of error in settings. More...
 
MARKER_BASEm_parent
 The marker this item belongs to, if any. More...
 
KIIDS m_ids
 

Private Member Functions

 ERC_ITEM (int aErrorCode=0, const wxString &aTitle="", const wxString &aSettingsKey="")
 

Private Attributes

std::optional< SCH_SHEET_PATHm_mainItemSheet
 
std::optional< SCH_SHEET_PATHm_auxItemSheet
 
std::optional< SCH_SHEET_PATHm_sheetSpecificPath
 True if this item is specific to a sheet instance (as opposed to applying to all instances) More...
 

Static Private Attributes

static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
 A list of all ERC_ITEM types which are valid error codes. More...
 
static ERC_ITEM heading_connections
 
static ERC_ITEM heading_conflicts
 
static ERC_ITEM heading_misc
 
static ERC_ITEM duplicateSheetName
 
static ERC_ITEM endpointOffGrid
 
static ERC_ITEM pinNotConnected
 
static ERC_ITEM pinNotDriven
 
static ERC_ITEM powerpinNotDriven
 
static ERC_ITEM pinTableWarning
 
static ERC_ITEM pinTableError
 
static ERC_ITEM hierLabelMismatch
 
static ERC_ITEM noConnectConnected
 
static ERC_ITEM noConnectDangling
 
static ERC_ITEM labelDangling
 
static ERC_ITEM globalLabelDangling
 
static ERC_ITEM similarLabels
 
static ERC_ITEM differentUnitFootprint
 
static ERC_ITEM differentUnitNet
 
static ERC_ITEM busDefinitionConflict
 
static ERC_ITEM multipleNetNames
 
static ERC_ITEM netclassConflict
 
static ERC_ITEM netNotBusMember
 
static ERC_ITEM busLabelSyntax
 
static ERC_ITEM busToBusConflict
 
static ERC_ITEM busToNetConflict
 
static ERC_ITEM unresolvedVariable
 
static ERC_ITEM simulationModelIssues
 
static ERC_ITEM wireDangling
 
static ERC_ITEM libSymbolIssues
 
static ERC_ITEM unannotated
 
static ERC_ITEM extraUnits
 
static ERC_ITEM missingUnits
 
static ERC_ITEM missingInputPin
 
static ERC_ITEM missingBidiPin
 
static ERC_ITEM missingPowerInputPin
 
static ERC_ITEM differentUnitValue
 
static ERC_ITEM duplicateReference
 
static ERC_ITEM busEntryNeeded
 

Detailed Description

Definition at line 56 of file erc_item.h.

Member Typedef Documentation

◆ KIIDS

typedef std::vector<KIID> RC_ITEM::KIIDS
inherited

Definition at line 77 of file rc_item.h.

Constructor & Destructor Documentation

◆ ERC_ITEM()

ERC_ITEM::ERC_ITEM ( int  aErrorCode = 0,
const wxString &  aTitle = "",
const wxString &  aSettingsKey = "" 
)
inlineprivate

Definition at line 169 of file erc_item.h.

170 {
171 m_errorCode = aErrorCode;
172 m_errorTitle = aTitle;
173 m_settingsKey = aSettingsKey;
174 }
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:168
int m_errorCode
The error code's numeric value.
Definition: rc_item.h:165
wxString m_errorTitle
The string describing the type of error.
Definition: rc_item.h:167

References RC_ITEM::m_errorCode, RC_ITEM::m_errorTitle, and RC_ITEM::m_settingsKey.

Member Function Documentation

◆ AddItem()

void RC_ITEM::AddItem ( EDA_ITEM aItem)
inherited

Definition at line 55 of file rc_item.cpp.

56{
57 m_ids.push_back( aItem->m_Uuid );
58}
const KIID m_Uuid
Definition: eda_item.h:492
KIIDS m_ids
Definition: rc_item.h:171

References RC_ITEM::m_ids, and EDA_ITEM::m_Uuid.

◆ AuxItemHasSheetPath()

bool ERC_ITEM::AuxItemHasSheetPath ( )
inline

Determines whether the auxiliary item causing this ERC violation has a specific SCH_SHEET_PATH binding.

Returns
true if the item ERC violation is specific to a sheet, false otherwise

Definition at line 166 of file erc_item.h.

166{ return m_auxItemSheet.has_value(); }
std::optional< SCH_SHEET_PATH > m_auxItemSheet
Definition: erc_item.h:177

References m_auxItemSheet.

Referenced by GetAuxItemSheetPath().

◆ Create() [1/2]

static std::shared_ptr< ERC_ITEM > ERC_ITEM::Create ( const wxString &  aErrorKey)
inlinestatic

Definition at line 65 of file erc_item.h.

66 {
67 for( const RC_ITEM& item : allItemTypes )
68 {
69 if( aErrorKey == item.GetSettingsKey() )
70 return std::make_shared<ERC_ITEM>( static_cast<const ERC_ITEM&>( item ) );
71 }
72
73 return nullptr;
74 }
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:180
A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
Definition: rc_item.h:75

References allItemTypes.

◆ Create() [2/2]

std::shared_ptr< ERC_ITEM > ERC_ITEM::Create ( int  aErrorCode)
static

Constructs an ERC_ITEM for the given error code.

See also
ERCE_T

Definition at line 232 of file erc_item.cpp.

233{
234 switch( aErrorCode )
235 {
236 case ERCE_DUPLICATE_SHEET_NAME: return std::make_shared<ERC_ITEM>( duplicateSheetName );
237 case ERCE_ENDPOINT_OFF_GRID: return std::make_shared<ERC_ITEM>( endpointOffGrid );
238 case ERCE_PIN_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( pinNotConnected );
239 case ERCE_PIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( pinNotDriven );
240 case ERCE_POWERPIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( powerpinNotDriven );
241 case ERCE_PIN_TO_PIN_WARNING: return std::make_shared<ERC_ITEM>( pinTableWarning );
242 case ERCE_PIN_TO_PIN_ERROR: return std::make_shared<ERC_ITEM>( pinTableError );
243 case ERCE_HIERACHICAL_LABEL: return std::make_shared<ERC_ITEM>( hierLabelMismatch );
244 case ERCE_NOCONNECT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectConnected );
245 case ERCE_NOCONNECT_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectDangling );
246 case ERCE_LABEL_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( labelDangling );
247 case ERCE_SIMILAR_LABELS: return std::make_shared<ERC_ITEM>( similarLabels );
248 case ERCE_DIFFERENT_UNIT_FP: return std::make_shared<ERC_ITEM>( differentUnitFootprint );
249 case ERCE_DIFFERENT_UNIT_NET: return std::make_shared<ERC_ITEM>( differentUnitNet );
250 case ERCE_BUS_ALIAS_CONFLICT: return std::make_shared<ERC_ITEM>( busDefinitionConflict );
251 case ERCE_DRIVER_CONFLICT: return std::make_shared<ERC_ITEM>( multipleNetNames );
252 case ERCE_BUS_ENTRY_CONFLICT: return std::make_shared<ERC_ITEM>( netNotBusMember );
253 case ERCE_BUS_LABEL_ERROR: return std::make_shared<ERC_ITEM>( busLabelSyntax );
254 case ERCE_BUS_TO_BUS_CONFLICT: return std::make_shared<ERC_ITEM>( busToBusConflict );
255 case ERCE_BUS_TO_NET_CONFLICT: return std::make_shared<ERC_ITEM>( busToNetConflict );
256 case ERCE_NETCLASS_CONFLICT: return std::make_shared<ERC_ITEM>( netclassConflict );
257 case ERCE_GLOBLABEL: return std::make_shared<ERC_ITEM>( globalLabelDangling );
258 case ERCE_UNRESOLVED_VARIABLE: return std::make_shared<ERC_ITEM>( unresolvedVariable );
259 case ERCE_SIMULATION_MODEL: return std::make_shared<ERC_ITEM>( simulationModelIssues );
260 case ERCE_WIRE_DANGLING: return std::make_shared<ERC_ITEM>( wireDangling );
261 case ERCE_LIB_SYMBOL_ISSUES: return std::make_shared<ERC_ITEM>( libSymbolIssues );
262 case ERCE_UNANNOTATED: return std::make_shared<ERC_ITEM>( unannotated );
263 case ERCE_EXTRA_UNITS: return std::make_shared<ERC_ITEM>( extraUnits );
264 case ERCE_DIFFERENT_UNIT_VALUE: return std::make_shared<ERC_ITEM>( differentUnitValue );
265 case ERCE_DUPLICATE_REFERENCE: return std::make_shared<ERC_ITEM>( duplicateReference );
266 case ERCE_BUS_ENTRY_NEEDED: return std::make_shared<ERC_ITEM>( busEntryNeeded );
267 case ERCE_MISSING_UNIT: return std::make_shared<ERC_ITEM>( missingUnits );
268 case ERCE_MISSING_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingInputPin );
269 case ERCE_MISSING_POWER_INPUT_PIN: return std::make_shared<ERC_ITEM>( missingPowerInputPin );
270 case ERCE_MISSING_BIDI_PIN: return std::make_shared<ERC_ITEM>( missingBidiPin );
271 case ERCE_UNSPECIFIED:
272 default:
273 wxFAIL_MSG( wxS( "Unknown ERC error code" ) );
274 return nullptr;
275 }
276
277 return nullptr;
278}
static ERC_ITEM differentUnitValue
Definition: erc_item.h:218
static ERC_ITEM busToBusConflict
Definition: erc_item.h:206
static ERC_ITEM pinTableWarning
Definition: erc_item.h:191
static ERC_ITEM unresolvedVariable
Definition: erc_item.h:208
static ERC_ITEM duplicateSheetName
Definition: erc_item.h:186
static ERC_ITEM noConnectDangling
Definition: erc_item.h:195
static ERC_ITEM busDefinitionConflict
Definition: erc_item.h:201
static ERC_ITEM libSymbolIssues
Definition: erc_item.h:211
static ERC_ITEM pinNotDriven
Definition: erc_item.h:189
static ERC_ITEM extraUnits
Definition: erc_item.h:213
static ERC_ITEM noConnectConnected
Definition: erc_item.h:194
static ERC_ITEM endpointOffGrid
Definition: erc_item.h:187
static ERC_ITEM busToNetConflict
Definition: erc_item.h:207
static ERC_ITEM differentUnitFootprint
Definition: erc_item.h:199
static ERC_ITEM hierLabelMismatch
Definition: erc_item.h:193
static ERC_ITEM missingUnits
Definition: erc_item.h:214
static ERC_ITEM similarLabels
Definition: erc_item.h:198
static ERC_ITEM globalLabelDangling
Definition: erc_item.h:197
static ERC_ITEM labelDangling
Definition: erc_item.h:196
static ERC_ITEM differentUnitNet
Definition: erc_item.h:200
static ERC_ITEM pinTableError
Definition: erc_item.h:192
static ERC_ITEM netNotBusMember
Definition: erc_item.h:204
static ERC_ITEM wireDangling
Definition: erc_item.h:210
static ERC_ITEM busLabelSyntax
Definition: erc_item.h:205
static ERC_ITEM powerpinNotDriven
Definition: erc_item.h:190
static ERC_ITEM missingPowerInputPin
Definition: erc_item.h:217
static ERC_ITEM missingBidiPin
Definition: erc_item.h:216
static ERC_ITEM unannotated
Definition: erc_item.h:212
static ERC_ITEM missingInputPin
Definition: erc_item.h:215
static ERC_ITEM netclassConflict
Definition: erc_item.h:203
static ERC_ITEM busEntryNeeded
Definition: erc_item.h:220
static ERC_ITEM simulationModelIssues
Definition: erc_item.h:209
static ERC_ITEM multipleNetNames
Definition: erc_item.h:202
static ERC_ITEM pinNotConnected
Definition: erc_item.h:188
static ERC_ITEM duplicateReference
Definition: erc_item.h:219
@ ERCE_UNSPECIFIED
Definition: erc_settings.h:38
@ ERCE_UNANNOTATED
Symbol has not been annotated.
Definition: erc_settings.h:75
@ ERCE_POWERPIN_NOT_DRIVEN
Power input pin connected to some others pins but no power out pin to drive it.
Definition: erc_settings.h:45
@ ERCE_DRIVER_CONFLICT
Conflicting drivers (labels, etc) on a subgraph.
Definition: erc_settings.h:61
@ ERCE_MISSING_POWER_INPUT_PIN
Symbol has power input pins that are not placed on the schematic.
Definition: erc_settings.h:54
@ ERCE_SIMILAR_LABELS
2 labels are equal for case insensitive comparisons.
Definition: erc_settings.h:51
@ ERCE_LABEL_NOT_CONNECTED
Label not connected to anything.
Definition: erc_settings.h:50
@ ERCE_ENDPOINT_OFF_GRID
Pin or wire-end off grid.
Definition: erc_settings.h:41
@ ERCE_DUPLICATE_REFERENCE
More than one symbol with the same reference.
Definition: erc_settings.h:78
@ ERCE_EXTRA_UNITS
Symbol has more units than are defined.
Definition: erc_settings.h:76
@ ERCE_BUS_TO_BUS_CONFLICT
A connection between bus objects doesn't share at least one net.
Definition: erc_settings.h:64
@ ERCE_BUS_LABEL_ERROR
A label attached to a bus isn't in bus format.
Definition: erc_settings.h:63
@ ERCE_BUS_ENTRY_CONFLICT
A wire connected to a bus doesn't match the bus.
Definition: erc_settings.h:62
@ ERCE_NETCLASS_CONFLICT
Multiple labels assign different netclasses to same net.
Definition: erc_settings.h:68
@ ERCE_GLOBLABEL
A global label is unique.
Definition: erc_settings.h:69
@ ERCE_BUS_TO_NET_CONFLICT
A bus wire is graphically connected to a net port/pin (or vice versa).
Definition: erc_settings.h:66
@ ERCE_NOCONNECT_NOT_CONNECTED
A no connect symbol is not connected to anything.
Definition: erc_settings.h:49
@ ERCE_DIFFERENT_UNIT_NET
Shared pin in a multi-unit symbol is connected to more than one net.
Definition: erc_settings.h:58
@ ERCE_PIN_NOT_CONNECTED
Pin not connected and not no connect symbol.
Definition: erc_settings.h:42
@ ERCE_BUS_ENTRY_NEEDED
Importer failed to auto-place a bus entry.
Definition: erc_settings.h:79
@ ERCE_UNRESOLVED_VARIABLE
A text variable could not be resolved.
Definition: erc_settings.h:70
@ ERCE_SIMULATION_MODEL
An error was found in the simulation model.
Definition: erc_settings.h:71
@ ERCE_DIFFERENT_UNIT_FP
Different units of the same symbol have different footprints assigned.
Definition: erc_settings.h:52
@ ERCE_NOCONNECT_CONNECTED
A no connect symbol is connected to more than 1 pin.
Definition: erc_settings.h:48
@ ERCE_PIN_TO_PIN_WARNING
Definition: erc_settings.h:85
@ ERCE_PIN_NOT_DRIVEN
Pin connected to some others pins but no pin to drive it.
Definition: erc_settings.h:43
@ ERCE_MISSING_INPUT_PIN
Symbol has input pins that are not placed.
Definition: erc_settings.h:55
@ ERCE_MISSING_UNIT
Symbol has units that are not placed on the schematic.
Definition: erc_settings.h:57
@ ERCE_DUPLICATE_SHEET_NAME
Duplicate sheet names within a given sheet.
Definition: erc_settings.h:40
@ ERCE_MISSING_BIDI_PIN
Symbol has bi-directional pins that are not placed.
Definition: erc_settings.h:56
@ ERCE_LIB_SYMBOL_ISSUES
Library symbol changed from current symbol in schematic or the library symbol link no longer valid.
Definition: erc_settings.h:73
@ ERCE_HIERACHICAL_LABEL
Mismatch between hierarchical labels and pins sheets.
Definition: erc_settings.h:47
@ ERCE_WIRE_DANGLING
Some wires are not connected to anything else.
Definition: erc_settings.h:72
@ ERCE_BUS_ALIAS_CONFLICT
Conflicting bus alias definitions across sheets.
Definition: erc_settings.h:60
@ ERCE_DIFFERENT_UNIT_VALUE
Units of same symbol have different values.
Definition: erc_settings.h:77
@ ERCE_PIN_TO_PIN_ERROR
Definition: erc_settings.h:86

References busDefinitionConflict, busEntryNeeded, busLabelSyntax, busToBusConflict, busToNetConflict, differentUnitFootprint, differentUnitNet, differentUnitValue, duplicateReference, duplicateSheetName, endpointOffGrid, ERCE_BUS_ALIAS_CONFLICT, ERCE_BUS_ENTRY_CONFLICT, ERCE_BUS_ENTRY_NEEDED, ERCE_BUS_LABEL_ERROR, ERCE_BUS_TO_BUS_CONFLICT, ERCE_BUS_TO_NET_CONFLICT, ERCE_DIFFERENT_UNIT_FP, ERCE_DIFFERENT_UNIT_NET, ERCE_DIFFERENT_UNIT_VALUE, ERCE_DRIVER_CONFLICT, ERCE_DUPLICATE_REFERENCE, ERCE_DUPLICATE_SHEET_NAME, ERCE_ENDPOINT_OFF_GRID, ERCE_EXTRA_UNITS, ERCE_GLOBLABEL, ERCE_HIERACHICAL_LABEL, ERCE_LABEL_NOT_CONNECTED, ERCE_LIB_SYMBOL_ISSUES, ERCE_MISSING_BIDI_PIN, ERCE_MISSING_INPUT_PIN, ERCE_MISSING_POWER_INPUT_PIN, ERCE_MISSING_UNIT, ERCE_NETCLASS_CONFLICT, ERCE_NOCONNECT_CONNECTED, ERCE_NOCONNECT_NOT_CONNECTED, ERCE_PIN_NOT_CONNECTED, ERCE_PIN_NOT_DRIVEN, ERCE_PIN_TO_PIN_ERROR, ERCE_PIN_TO_PIN_WARNING, ERCE_POWERPIN_NOT_DRIVEN, ERCE_SIMILAR_LABELS, ERCE_SIMULATION_MODEL, ERCE_UNANNOTATED, ERCE_UNRESOLVED_VARIABLE, ERCE_UNSPECIFIED, ERCE_WIRE_DANGLING, extraUnits, globalLabelDangling, hierLabelMismatch, labelDangling, libSymbolIssues, missingBidiPin, missingInputPin, missingPowerInputPin, missingUnits, multipleNetNames, netclassConflict, netNotBusMember, noConnectConnected, noConnectDangling, pinNotConnected, pinNotDriven, pinTableError, pinTableWarning, powerpinNotDriven, similarLabels, simulationModelIssues, unannotated, unresolvedVariable, and wireDangling.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_MARKER::Deserialize(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckHierSheets(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNetclassConflicts(), CONNECTION_GRAPH::ercCheckNoConnects(), DIALOG_ERC::OnRunERCClick(), ERC_TESTER::TestConflictingBusAliases(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestLibSymbolIssues(), ERC_TESTER::TestMissingUnits(), ERC_TESTER::TestMultiunitFootprints(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestNoConnectPins(), ERC_TESTER::TestOffGridEndpoints(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), ERC_TESTER::TestSimModelIssues(), and ERC_TESTER::TestTextVars().

◆ GetAuxItem2ID()

virtual KIID RC_ITEM::GetAuxItem2ID ( ) const
inlinevirtualinherited

Reimplemented in DRC_ITEM.

Definition at line 119 of file rc_item.h.

119{ return m_ids.size() > 2 ? m_ids[2] : niluuid; }
KIID niluuid(0)

References RC_ITEM::m_ids, and niluuid.

◆ GetAuxItem3ID()

virtual KIID RC_ITEM::GetAuxItem3ID ( ) const
inlinevirtualinherited

Reimplemented in DRC_ITEM.

Definition at line 120 of file rc_item.h.

120{ return m_ids.size() > 3 ? m_ids[3] : niluuid; }

References RC_ITEM::m_ids, and niluuid.

◆ GetAuxItemID()

virtual KIID RC_ITEM::GetAuxItemID ( ) const
inlinevirtualinherited

Definition at line 118 of file rc_item.h.

118{ return m_ids.size() > 1 ? m_ids[1] : niluuid; }

References RC_ITEM::m_ids, and niluuid.

Referenced by RC_ITEM::ShowReport().

◆ GetAuxItemSheetPath()

SCH_SHEET_PATH & ERC_ITEM::GetAuxItemSheetPath ( )
inline

Gets the SCH_SHEET_PATH of the auxillary item causing this ERC violation.

Returns
SCH_SHEET_PATH containing the auxillary item

Definition at line 148 of file erc_item.h.

149 {
150 wxASSERT( AuxItemHasSheetPath() );
151 return m_auxItemSheet.value();
152 }
bool AuxItemHasSheetPath()
Determines whether the auxiliary item causing this ERC violation has a specific SCH_SHEET_PATH bindin...
Definition: erc_item.h:166

References AuxItemHasSheetPath(), and m_auxItemSheet.

◆ GetErrorCode()

◆ GetErrorMessage()

wxString RC_ITEM::GetErrorMessage ( ) const
virtualinherited
Returns
the error message describing the specific details of a RC_ITEM. For instance, "Clearance violation (netclass '100ohm' clearance 0.4000mm; actual 0.3200mm)"

Definition at line 38 of file rc_item.cpp.

39{
40 if( m_errorMessage.IsEmpty() )
41 return GetErrorText();
42 else
43 return m_errorMessage;
44}
wxString GetErrorText() const
Definition: rc_item.h:149
wxString m_errorMessage
A message describing the details of this specific error.
Definition: rc_item.h:166

References RC_ITEM::GetErrorText(), and RC_ITEM::m_errorMessage.

Referenced by RC_ITEM::ShowReport().

◆ GetErrorText()

wxString RC_ITEM::GetErrorText ( ) const
inlineinherited
Returns
the error text for the class of error of this RC_ITEM represents. For instance, "Clearance violation".

Definition at line 149 of file rc_item.h.

150 {
151 return wxGetTranslation( m_errorTitle );
152 }

References RC_ITEM::m_errorTitle.

Referenced by CLEANUP_ITEM::CLEANUP_ITEM(), RC_ITEM::GetErrorMessage(), and PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES().

◆ GetIDs()

std::vector< KIID > RC_ITEM::GetIDs ( ) const
inlineinherited

Definition at line 122 of file rc_item.h.

122{ return m_ids; }

References RC_ITEM::m_ids.

◆ GetItemsWithSeverities()

static std::vector< std::reference_wrapper< RC_ITEM > > ERC_ITEM::GetItemsWithSeverities ( )
inlinestatic

◆ GetMainItemID()

virtual KIID RC_ITEM::GetMainItemID ( ) const
inlinevirtualinherited

Definition at line 117 of file rc_item.h.

117{ return m_ids.size() > 0 ? m_ids[0] : niluuid; }

References RC_ITEM::m_ids, and niluuid.

Referenced by RC_ITEM::ShowReport().

◆ GetMainItemSheetPath()

SCH_SHEET_PATH & ERC_ITEM::GetMainItemSheetPath ( )
inline

Gets the SCH_SHEET_PATH of the main item causing this ERC violation.

Returns
SCH_SHEET_PATH containing the main item

Definition at line 138 of file erc_item.h.

139 {
140 wxASSERT( MainItemHasSheetPath() );
141 return m_mainItemSheet.value();
142 }
std::optional< SCH_SHEET_PATH > m_mainItemSheet
Definition: erc_item.h:176
bool MainItemHasSheetPath()
Determines whether the main item causing this ERC violation has a specific SCH_SHEET_PATH binding.
Definition: erc_item.h:159

References m_mainItemSheet, and MainItemHasSheetPath().

◆ GetParent()

MARKER_BASE * RC_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 125 of file rc_item.h.

125{ return m_parent; }
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: rc_item.h:169

References RC_ITEM::m_parent.

◆ GetSettingsKey()

wxString RC_ITEM::GetSettingsKey ( ) const
inlineinherited

Definition at line 154 of file rc_item.h.

155 {
156 return m_settingsKey;
157 }

References RC_ITEM::m_settingsKey.

Referenced by RC_ITEM::ShowReport().

◆ GetSpecificSheetPath()

const SCH_SHEET_PATH & ERC_ITEM::GetSpecificSheetPath ( ) const
inline

Gets the SCH_SHEET_PATH this ERC item is bound to.

Throws std::bad_optional_access if there is no specific sheet path binding

Returns
the SCH_SHEET_PATH containing the ERC violation

Definition at line 103 of file erc_item.h.

104 {
105 wxASSERT( m_sheetSpecificPath.has_value() );
106 return m_sheetSpecificPath.value();
107 }
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:223

References m_sheetSpecificPath.

◆ GetViolatingRuleDesc()

virtual wxString RC_ITEM::GetViolatingRuleDesc ( ) const
inlinevirtualinherited

Reimplemented in DRC_ITEM.

Definition at line 159 of file rc_item.h.

160 {
161 return wxEmptyString;
162 }

Referenced by RC_ITEM::ShowReport().

◆ IsSheetSpecific()

bool ERC_ITEM::IsSheetSpecific ( ) const
inline

Determines whether the ERC item is bound to a specific sheet, or is common across multiple sheets (e.g.

whether the error is internal to a hierarchical sheet, or is due to an enclosing context interacting with the hierarchical sheet)

Returns
true if ERC applies to a specific sheet, otherwise false

Definition at line 87 of file erc_item.h.

87{ return m_sheetSpecificPath.has_value(); }

References m_sheetSpecificPath.

◆ MainItemHasSheetPath()

bool ERC_ITEM::MainItemHasSheetPath ( )
inline

Determines whether the main item causing this ERC violation has a specific SCH_SHEET_PATH binding.

Returns
true if the item ERC violation is specific to a sheet, false otherwise

Definition at line 159 of file erc_item.h.

159{ return m_mainItemSheet.has_value(); }

References m_mainItemSheet.

Referenced by GetMainItemSheetPath().

◆ SetErrorCode()

void RC_ITEM::SetErrorCode ( int  aCode)
inlineinherited

Definition at line 137 of file rc_item.h.

137{ m_errorCode = aCode; }

References RC_ITEM::m_errorCode.

◆ SetErrorMessage()

void RC_ITEM::SetErrorMessage ( const wxString &  aMessage)
inlineinherited

Definition at line 97 of file rc_item.h.

97{ m_errorMessage = aMessage; }

References RC_ITEM::m_errorMessage.

◆ SetItems() [1/3]

void RC_ITEM::SetItems ( const EDA_ITEM aItem,
const EDA_ITEM bItem = nullptr,
const EDA_ITEM cItem = nullptr,
const EDA_ITEM dItem = nullptr 
)
inherited

Definition at line 61 of file rc_item.cpp.

63{
64 m_ids.clear();
65
66 m_ids.push_back( aItem->m_Uuid );
67
68 if( bItem )
69 m_ids.push_back( bItem->m_Uuid );
70
71 if( cItem )
72 m_ids.push_back( cItem->m_Uuid );
73
74 if( dItem )
75 m_ids.push_back( dItem->m_Uuid );
76}

References RC_ITEM::m_ids, and EDA_ITEM::m_Uuid.

◆ SetItems() [2/3]

void RC_ITEM::SetItems ( const KIID aItem,
const KIID bItem = niluuid,
const KIID cItem = niluuid,
const KIID dItem = niluuid 
)
inlineinherited

Definition at line 106 of file rc_item.h.

108 {
109 m_ids.clear();
110
111 m_ids.push_back( aItem );
112 m_ids.push_back( bItem );
113 m_ids.push_back( cItem );
114 m_ids.push_back( dItem );
115 }

References RC_ITEM::m_ids.

◆ SetItems() [3/3]

void RC_ITEM::SetItems ( const KIIDS aIds)
inlineinherited

Definition at line 99 of file rc_item.h.

99{ m_ids = aIds; }

References RC_ITEM::m_ids.

◆ SetItemsSheetPaths() [1/2]

void ERC_ITEM::SetItemsSheetPaths ( const SCH_SHEET_PATH mainItemSheet)
inline

Sets the SCH_SHEET_PATH of the main item causing this ERC violation to (e.g.

a schematic pin). This allows violations to be specific to particular uses of shared hierarchical schematics.

Parameters
mainItemSheetthe SCH_SHEET_PATH of the item causing the ERC violation

Definition at line 115 of file erc_item.h.

116 {
117 m_mainItemSheet = mainItemSheet;
118 }

References m_mainItemSheet.

◆ SetItemsSheetPaths() [2/2]

void ERC_ITEM::SetItemsSheetPaths ( const SCH_SHEET_PATH mainItemSheet,
const SCH_SHEET_PATH auxItemSheet 
)
inline

Set the SCH_SHEET PATHs of the main and auxiliary items causing this ERC violation to (e.g.

two schematic pins which have a mutual connection violation). This allows violations to be specific to particular uses of shared hierarchical schematics.

Parameters
mainItemSheetthe SCH_SHEET_PATH of the first item causing the ERC violation
auxItemSheetthe SCH_SHEET_PATH of the second item causing the ERC violation

Definition at line 127 of file erc_item.h.

129 {
130 m_mainItemSheet = mainItemSheet;
131 m_auxItemSheet = auxItemSheet;
132 }

References m_auxItemSheet, and m_mainItemSheet.

◆ SetParent()

void RC_ITEM::SetParent ( MARKER_BASE aMarker)
inlineinherited

Definition at line 124 of file rc_item.h.

124{ m_parent = aMarker; }

References RC_ITEM::m_parent.

◆ SetSheetSpecificPath()

void ERC_ITEM::SetSheetSpecificPath ( const SCH_SHEET_PATH aSpecificSheet)
inline

Sets the SCH_SHEET_PATH this ERC item is bound to.

Parameters
aSpecificSheetThe SCH_SHEET_PATH containing the ERC violation

Definition at line 93 of file erc_item.h.

94 {
95 m_sheetSpecificPath = aSpecificSheet;
96 }

References m_sheetSpecificPath.

◆ ShowReport()

wxString RC_ITEM::ShowReport ( UNITS_PROVIDER aUnitsProvider,
SEVERITY  aSeverity,
const std::map< KIID, EDA_ITEM * > &  aItemMap 
) const
virtualinherited

Translate this object into a text string suitable for saving to disk in a report.

Returns
wxString - the simple multi-line report text.

Definition at line 79 of file rc_item.cpp.

81{
82 wxString severity;
83
84 switch( aSeverity )
85 {
86 case RPT_SEVERITY_ERROR: severity = wxT( "Severity: error" ); break;
87 case RPT_SEVERITY_WARNING: severity = wxT( "Severity: warning" ); break;
88 case RPT_SEVERITY_ACTION: severity = wxT( "Severity: action" ); break;
89 case RPT_SEVERITY_INFO: severity = wxT( "Severity: info" ); break;
90 case RPT_SEVERITY_EXCLUSION: severity = wxT( "Severity: exclusion" ); break;
91 case RPT_SEVERITY_DEBUG: severity = wxT( "Severity: debug" ); break;
92 default: ;
93 };
94
95 if( m_parent && m_parent->IsExcluded() )
96 severity += wxT( " (excluded)" );
97
98 EDA_ITEM* mainItem = nullptr;
99 EDA_ITEM* auxItem = nullptr;
100
101 auto ii = aItemMap.find( GetMainItemID() );
102
103 if( ii != aItemMap.end() )
104 mainItem = ii->second;
105
106 ii = aItemMap.find( GetAuxItemID() );
107
108 if( ii != aItemMap.end() )
109 auxItem = ii->second;
110
111 // Note: some customers machine-process these. So:
112 // 1) don't translate
113 // 2) try not to re-order or change syntax
114 // 3) report settings key (which should be more stable) in addition to message
115
116 if( mainItem && auxItem )
117 {
118 return wxString::Format( wxT( "[%s]: %s\n %s; %s\n %s: %s\n %s: %s\n" ),
122 severity,
123 showCoord( aUnitsProvider, mainItem->GetPosition()),
124 mainItem->GetItemDescription( aUnitsProvider ),
125 showCoord( aUnitsProvider, auxItem->GetPosition()),
126 auxItem->GetItemDescription( aUnitsProvider ) );
127 }
128 else if( mainItem )
129 {
130 return wxString::Format( wxT( "[%s]: %s\n %s; %s\n %s: %s\n" ),
134 severity,
135 showCoord( aUnitsProvider, mainItem->GetPosition()),
136 mainItem->GetItemDescription( aUnitsProvider ) );
137 }
138 else
139 {
140 return wxString::Format( wxT( "[%s]: %s\n %s; %s\n" ),
144 severity );
145 }
146}
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:249
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const
Return a user-visible description string of this item.
Definition: eda_item.cpp:108
bool IsExcluded() const
Definition: marker_base.h:97
virtual KIID GetMainItemID() const
Definition: rc_item.h:117
virtual KIID GetAuxItemID() const
Definition: rc_item.h:118
virtual wxString GetErrorMessage() const
Definition: rc_item.cpp:38
wxString GetSettingsKey() const
Definition: rc_item.h:154
virtual wxString GetViolatingRuleDesc() const
Definition: rc_item.h:159
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
static wxString showCoord(UNITS_PROVIDER *aUnitsProvider, const VECTOR2I &aPos)
Definition: rc_item.cpp:47
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_EXCLUSION
@ RPT_SEVERITY_DEBUG
@ RPT_SEVERITY_INFO
@ RPT_SEVERITY_ACTION

References Format(), RC_ITEM::GetAuxItemID(), RC_ITEM::GetErrorMessage(), EDA_ITEM::GetItemDescription(), RC_ITEM::GetMainItemID(), EDA_ITEM::GetPosition(), RC_ITEM::GetSettingsKey(), RC_ITEM::GetViolatingRuleDesc(), MARKER_BASE::IsExcluded(), RC_ITEM::m_parent, RPT_SEVERITY_ACTION, RPT_SEVERITY_DEBUG, RPT_SEVERITY_ERROR, RPT_SEVERITY_EXCLUSION, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, and showCoord().

Member Data Documentation

◆ allItemTypes

std::vector< std::reference_wrapper< RC_ITEM > > ERC_ITEM::allItemTypes
staticprivate

A list of all ERC_ITEM types which are valid error codes.

Definition at line 180 of file erc_item.h.

Referenced by Create(), and GetItemsWithSeverities().

◆ busDefinitionConflict

ERC_ITEM ERC_ITEM::busDefinitionConflict
staticprivate

Definition at line 201 of file erc_item.h.

Referenced by Create().

◆ busEntryNeeded

ERC_ITEM ERC_ITEM::busEntryNeeded
staticprivate

Definition at line 220 of file erc_item.h.

Referenced by Create().

◆ busLabelSyntax

ERC_ITEM ERC_ITEM::busLabelSyntax
staticprivate

Definition at line 205 of file erc_item.h.

Referenced by Create().

◆ busToBusConflict

ERC_ITEM ERC_ITEM::busToBusConflict
staticprivate

Definition at line 206 of file erc_item.h.

Referenced by Create().

◆ busToNetConflict

ERC_ITEM ERC_ITEM::busToNetConflict
staticprivate

Definition at line 207 of file erc_item.h.

Referenced by Create().

◆ differentUnitFootprint

ERC_ITEM ERC_ITEM::differentUnitFootprint
staticprivate

Definition at line 199 of file erc_item.h.

Referenced by Create().

◆ differentUnitNet

ERC_ITEM ERC_ITEM::differentUnitNet
staticprivate

Definition at line 200 of file erc_item.h.

Referenced by Create().

◆ differentUnitValue

ERC_ITEM ERC_ITEM::differentUnitValue
staticprivate

Definition at line 218 of file erc_item.h.

Referenced by Create().

◆ duplicateReference

ERC_ITEM ERC_ITEM::duplicateReference
staticprivate

Definition at line 219 of file erc_item.h.

Referenced by Create().

◆ duplicateSheetName

ERC_ITEM ERC_ITEM::duplicateSheetName
staticprivate

Definition at line 186 of file erc_item.h.

Referenced by Create().

◆ endpointOffGrid

ERC_ITEM ERC_ITEM::endpointOffGrid
staticprivate

Definition at line 187 of file erc_item.h.

Referenced by Create().

◆ extraUnits

ERC_ITEM ERC_ITEM::extraUnits
staticprivate

Definition at line 213 of file erc_item.h.

Referenced by Create().

◆ globalLabelDangling

ERC_ITEM ERC_ITEM::globalLabelDangling
staticprivate

Definition at line 197 of file erc_item.h.

Referenced by Create().

◆ heading_conflicts

ERC_ITEM ERC_ITEM::heading_conflicts
staticprivate

Definition at line 183 of file erc_item.h.

◆ heading_connections

ERC_ITEM ERC_ITEM::heading_connections
staticprivate

Definition at line 182 of file erc_item.h.

◆ heading_misc

ERC_ITEM ERC_ITEM::heading_misc
staticprivate

Definition at line 184 of file erc_item.h.

◆ hierLabelMismatch

ERC_ITEM ERC_ITEM::hierLabelMismatch
staticprivate

Definition at line 193 of file erc_item.h.

Referenced by Create().

◆ labelDangling

ERC_ITEM ERC_ITEM::labelDangling
staticprivate

Definition at line 196 of file erc_item.h.

Referenced by Create().

◆ libSymbolIssues

ERC_ITEM ERC_ITEM::libSymbolIssues
staticprivate

Definition at line 211 of file erc_item.h.

Referenced by Create().

◆ m_auxItemSheet

std::optional<SCH_SHEET_PATH> ERC_ITEM::m_auxItemSheet
private

Definition at line 177 of file erc_item.h.

Referenced by AuxItemHasSheetPath(), GetAuxItemSheetPath(), and SetItemsSheetPaths().

◆ m_errorCode

int RC_ITEM::m_errorCode
protectedinherited

◆ m_errorMessage

wxString RC_ITEM::m_errorMessage
protectedinherited

A message describing the details of this specific error.

Definition at line 166 of file rc_item.h.

Referenced by RC_ITEM::GetErrorMessage(), RC_ITEM::RC_ITEM(), and RC_ITEM::SetErrorMessage().

◆ m_errorTitle

wxString RC_ITEM::m_errorTitle
protectedinherited

The string describing the type of error.

Definition at line 167 of file rc_item.h.

Referenced by CLEANUP_ITEM::CLEANUP_ITEM(), DRC_ITEM::DRC_ITEM(), ERC_ITEM(), RC_ITEM::GetErrorText(), and RC_ITEM::RC_ITEM().

◆ m_ids

◆ m_mainItemSheet

std::optional<SCH_SHEET_PATH> ERC_ITEM::m_mainItemSheet
private

Definition at line 176 of file erc_item.h.

Referenced by GetMainItemSheetPath(), MainItemHasSheetPath(), and SetItemsSheetPaths().

◆ m_parent

MARKER_BASE* RC_ITEM::m_parent
protectedinherited

The marker this item belongs to, if any.

Definition at line 169 of file rc_item.h.

Referenced by DRC_ITEM::DRC_ITEM(), RC_ITEM::GetParent(), RC_ITEM::RC_ITEM(), RC_ITEM::SetParent(), and RC_ITEM::ShowReport().

◆ m_settingsKey

wxString RC_ITEM::m_settingsKey
protectedinherited

The key used to describe this type of error in settings.

Definition at line 168 of file rc_item.h.

Referenced by DRC_ITEM::DRC_ITEM(), ERC_ITEM(), RC_ITEM::GetSettingsKey(), and RC_ITEM::RC_ITEM().

◆ m_sheetSpecificPath

std::optional<SCH_SHEET_PATH> ERC_ITEM::m_sheetSpecificPath
private

True if this item is specific to a sheet instance (as opposed to applying to all instances)

Definition at line 223 of file erc_item.h.

Referenced by GetSpecificSheetPath(), IsSheetSpecific(), and SetSheetSpecificPath().

◆ missingBidiPin

ERC_ITEM ERC_ITEM::missingBidiPin
staticprivate

Definition at line 216 of file erc_item.h.

Referenced by Create().

◆ missingInputPin

ERC_ITEM ERC_ITEM::missingInputPin
staticprivate

Definition at line 215 of file erc_item.h.

Referenced by Create().

◆ missingPowerInputPin

ERC_ITEM ERC_ITEM::missingPowerInputPin
staticprivate

Definition at line 217 of file erc_item.h.

Referenced by Create().

◆ missingUnits

ERC_ITEM ERC_ITEM::missingUnits
staticprivate

Definition at line 214 of file erc_item.h.

Referenced by Create().

◆ multipleNetNames

ERC_ITEM ERC_ITEM::multipleNetNames
staticprivate

Definition at line 202 of file erc_item.h.

Referenced by Create().

◆ netclassConflict

ERC_ITEM ERC_ITEM::netclassConflict
staticprivate

Definition at line 203 of file erc_item.h.

Referenced by Create().

◆ netNotBusMember

ERC_ITEM ERC_ITEM::netNotBusMember
staticprivate

Definition at line 204 of file erc_item.h.

Referenced by Create().

◆ noConnectConnected

ERC_ITEM ERC_ITEM::noConnectConnected
staticprivate

Definition at line 194 of file erc_item.h.

Referenced by Create().

◆ noConnectDangling

ERC_ITEM ERC_ITEM::noConnectDangling
staticprivate

Definition at line 195 of file erc_item.h.

Referenced by Create().

◆ pinNotConnected

ERC_ITEM ERC_ITEM::pinNotConnected
staticprivate

Definition at line 188 of file erc_item.h.

Referenced by Create().

◆ pinNotDriven

ERC_ITEM ERC_ITEM::pinNotDriven
staticprivate

Definition at line 189 of file erc_item.h.

Referenced by Create().

◆ pinTableError

ERC_ITEM ERC_ITEM::pinTableError
staticprivate

Definition at line 192 of file erc_item.h.

Referenced by Create().

◆ pinTableWarning

ERC_ITEM ERC_ITEM::pinTableWarning
staticprivate

Definition at line 191 of file erc_item.h.

Referenced by Create().

◆ powerpinNotDriven

ERC_ITEM ERC_ITEM::powerpinNotDriven
staticprivate

Definition at line 190 of file erc_item.h.

Referenced by Create().

◆ similarLabels

ERC_ITEM ERC_ITEM::similarLabels
staticprivate

Definition at line 198 of file erc_item.h.

Referenced by Create().

◆ simulationModelIssues

ERC_ITEM ERC_ITEM::simulationModelIssues
staticprivate

Definition at line 209 of file erc_item.h.

Referenced by Create().

◆ unannotated

ERC_ITEM ERC_ITEM::unannotated
staticprivate

Definition at line 212 of file erc_item.h.

Referenced by Create().

◆ unresolvedVariable

ERC_ITEM ERC_ITEM::unresolvedVariable
staticprivate

Definition at line 208 of file erc_item.h.

Referenced by Create().

◆ wireDangling

ERC_ITEM ERC_ITEM::wireDangling
staticprivate

Definition at line 210 of file erc_item.h.

Referenced by Create().


The documentation for this class was generated from the following files: