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
 
void SetIsSheetSpecific (bool aSpecific=true)
 
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)
 
KIID GetMainItemID () const
 
KIID GetAuxItemID () const
 
KIID GetAuxItem2ID () const
 
KIID GetAuxItem3ID () const
 
void SetParent (MARKER_BASE *aMarker)
 
MARKER_BASEGetParent () const
 
virtual wxString ShowReport (EDA_UNITS aUnits, 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
 Return the error message of a RC_ITEM. More...
 
wxString GetErrorText () const
 
wxString GetSettingsKey () 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 ()
 
static wxString ShowCoord (EDA_UNITS aUnits, const wxPoint &aPos)
 Format a coordinate or position to text. More...
 

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

bool m_sheetSpecific
 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 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 netNotBusMember
 
static ERC_ITEM busLabelSyntax
 
static ERC_ITEM busToBusConflict
 
static ERC_ITEM busToNetConflict
 
static ERC_ITEM unresolvedVariable
 
static ERC_ITEM wireDangling
 
static ERC_ITEM libSymbolIssues
 
static ERC_ITEM unannotated
 
static ERC_ITEM extraUnits
 
static ERC_ITEM differentUnitValue
 
static ERC_ITEM duplicateReference
 

Detailed Description

Definition at line 30 of file erc_item.h.

Member Typedef Documentation

◆ KIIDS

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

Definition at line 75 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 59 of file erc_item.h.

60  {
61  m_errorCode = aErrorCode;
62  m_errorTitle = aTitle;
63  m_settingsKey = aSettingsKey;
64  m_sheetSpecific = false;
65  }
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:179
bool m_sheetSpecific
True if this item is specific to a sheet instance (as opposed to applying to all instances)
Definition: erc_item.h:103
int m_errorCode
The error code's numeric value.
Definition: rc_item.h:176
wxString m_errorTitle
The string describing the type of error.
Definition: rc_item.h:178

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

Member Function Documentation

◆ AddItem()

void RC_ITEM::AddItem ( EDA_ITEM aItem)
inlineinherited

Definition at line 102 of file rc_item.h.

103  {
104  m_ids.push_back( aItem->m_Uuid );
105  }
KIIDS m_ids
Definition: rc_item.h:182
const KIID m_Uuid
Definition: eda_item.h:524

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

◆ Create() [1/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 189 of file erc_item.cpp.

190 {
191  switch( aErrorCode )
192  {
193  case ERCE_DUPLICATE_SHEET_NAME: return std::make_shared<ERC_ITEM>( duplicateSheetName );
194  case ERCE_PIN_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( pinNotConnected );
195  case ERCE_PIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( pinNotDriven );
196  case ERCE_POWERPIN_NOT_DRIVEN: return std::make_shared<ERC_ITEM>( powerpinNotDriven );
197  case ERCE_PIN_TO_PIN_WARNING: return std::make_shared<ERC_ITEM>( pinTableWarning );
198  case ERCE_PIN_TO_PIN_ERROR: return std::make_shared<ERC_ITEM>( pinTableError );
199  case ERCE_HIERACHICAL_LABEL: return std::make_shared<ERC_ITEM>( hierLabelMismatch );
200  case ERCE_NOCONNECT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectConnected );
201  case ERCE_NOCONNECT_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( noConnectDangling );
202  case ERCE_LABEL_NOT_CONNECTED: return std::make_shared<ERC_ITEM>( labelDangling );
203  case ERCE_SIMILAR_LABELS: return std::make_shared<ERC_ITEM>( similarLabels );
204  case ERCE_DIFFERENT_UNIT_FP: return std::make_shared<ERC_ITEM>( differentUnitFootprint );
205  case ERCE_DIFFERENT_UNIT_NET: return std::make_shared<ERC_ITEM>( differentUnitNet );
206  case ERCE_BUS_ALIAS_CONFLICT: return std::make_shared<ERC_ITEM>( busDefinitionConflict );
207  case ERCE_DRIVER_CONFLICT: return std::make_shared<ERC_ITEM>( multipleNetNames );
208  case ERCE_BUS_ENTRY_CONFLICT: return std::make_shared<ERC_ITEM>( netNotBusMember );
209  case ERCE_BUS_LABEL_ERROR: return std::make_shared<ERC_ITEM>( busLabelSyntax );
210  case ERCE_BUS_TO_BUS_CONFLICT: return std::make_shared<ERC_ITEM>( busToBusConflict );
211  case ERCE_BUS_TO_NET_CONFLICT: return std::make_shared<ERC_ITEM>( busToNetConflict );
212  case ERCE_GLOBLABEL: return std::make_shared<ERC_ITEM>( globalLabelDangling );
213  case ERCE_UNRESOLVED_VARIABLE: return std::make_shared<ERC_ITEM>( unresolvedVariable );
214  case ERCE_WIRE_DANGLING: return std::make_shared<ERC_ITEM>( wireDangling );
215  case ERCE_LIB_SYMBOL_ISSUES: return std::make_shared<ERC_ITEM>( libSymbolIssues );
216  case ERCE_UNANNOTATED: return std::make_shared<ERC_ITEM>( unannotated );
217  case ERCE_EXTRA_UNITS: return std::make_shared<ERC_ITEM>( extraUnits );
218  case ERCE_DIFFERENT_UNIT_VALUE: return std::make_shared<ERC_ITEM>( differentUnitValue );
219  case ERCE_DUPLICATE_REFERENCE: return std::make_shared<ERC_ITEM>( duplicateReference );
220  case ERCE_UNSPECIFIED:
221  default:
222  wxFAIL_MSG( "Unknown ERC error code" );
223  return nullptr;
224  }
225 
226  return nullptr;
227 }
static ERC_ITEM unannotated
Definition: erc_item.h:97
Pin not connected and not no connect symbol.
Definition: erc_settings.h:41
Units of same symbol have different values.
Definition: erc_settings.h:70
A connection between bus objects doesn't share at least one net.
Definition: erc_settings.h:59
static ERC_ITEM busToNetConflict
Definition: erc_item.h:93
static ERC_ITEM pinTableError
Definition: erc_item.h:79
Different units of the same component have different footprints assigned.
Definition: erc_settings.h:51
static ERC_ITEM noConnectConnected
Definition: erc_item.h:81
Power input pin connected to some others pins but no power out pin to drive it.
Definition: erc_settings.h:44
static ERC_ITEM differentUnitNet
Definition: erc_item.h:87
A bus wire is graphically connected to a net port/pin (or vice versa).
Definition: erc_settings.h:61
static ERC_ITEM busLabelSyntax
Definition: erc_item.h:91
A label attached to a bus isn't in bus format.
Definition: erc_settings.h:58
Some wires are not connected to anything else.
Definition: erc_settings.h:65
Label not connected to anything.
Definition: erc_settings.h:49
Library symbol changed from current symbol in schematic or the library symbol link no longer valid.
Definition: erc_settings.h:66
static ERC_ITEM similarLabels
Definition: erc_item.h:85
static ERC_ITEM duplicateReference
Definition: erc_item.h:100
Pin connected to some others pins but no pin to drive it.
Definition: erc_settings.h:42
Shared pin in a multi-unit component is connected to more than one net.
Definition: erc_settings.h:53
2 labels are equal for case insensitive comparisons.
Definition: erc_settings.h:50
static ERC_ITEM multipleNetNames
Definition: erc_item.h:89
static ERC_ITEM labelDangling
Definition: erc_item.h:83
static ERC_ITEM noConnectDangling
Definition: erc_item.h:82
static ERC_ITEM pinTableWarning
Definition: erc_item.h:78
static ERC_ITEM unresolvedVariable
Definition: erc_item.h:94
Symbol has not been annotated.
Definition: erc_settings.h:68
A wire connected to a bus doesn't match the bus.
Definition: erc_settings.h:57
static ERC_ITEM extraUnits
Definition: erc_item.h:98
A no connect symbol is not connected to anything.
Definition: erc_settings.h:48
static ERC_ITEM pinNotDriven
Definition: erc_item.h:76
static ERC_ITEM duplicateSheetName
Definition: erc_item.h:74
A global label is unique.
Definition: erc_settings.h:63
A text variable could not be resolved.
Definition: erc_settings.h:64
A no connect symbol is connected to more than 1 pin.
Definition: erc_settings.h:47
static ERC_ITEM busDefinitionConflict
Definition: erc_item.h:88
static ERC_ITEM netNotBusMember
Definition: erc_item.h:90
More than one symbol with the same reference.
Definition: erc_settings.h:71
Mismatch between hierarchical labels and pins sheets.
Definition: erc_settings.h:46
static ERC_ITEM libSymbolIssues
Definition: erc_item.h:96
Conflicting bus alias definitions across sheets.
Definition: erc_settings.h:55
static ERC_ITEM powerpinNotDriven
Definition: erc_item.h:77
static ERC_ITEM pinNotConnected
Definition: erc_item.h:75
static ERC_ITEM differentUnitFootprint
Definition: erc_item.h:86
Symbol has more units than are defined.
Definition: erc_settings.h:69
Duplicate sheet names within a given sheet.
Definition: erc_settings.h:40
static ERC_ITEM busToBusConflict
Definition: erc_item.h:92
static ERC_ITEM hierLabelMismatch
Definition: erc_item.h:80
Conflicting drivers (labels, etc) on a subgraph.
Definition: erc_settings.h:56
static ERC_ITEM globalLabelDangling
Definition: erc_item.h:84
static ERC_ITEM wireDangling
Definition: erc_item.h:95
static ERC_ITEM differentUnitValue
Definition: erc_item.h:99

References busDefinitionConflict, busLabelSyntax, busToBusConflict, busToNetConflict, differentUnitFootprint, differentUnitNet, differentUnitValue, duplicateReference, duplicateSheetName, ERCE_BUS_ALIAS_CONFLICT, ERCE_BUS_ENTRY_CONFLICT, 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_EXTRA_UNITS, ERCE_GLOBLABEL, ERCE_HIERACHICAL_LABEL, ERCE_LABEL_NOT_CONNECTED, ERCE_LIB_SYMBOL_ISSUES, 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_UNANNOTATED, ERCE_UNRESOLVED_VARIABLE, ERCE_UNSPECIFIED, ERCE_WIRE_DANGLING, extraUnits, globalLabelDangling, hierLabelMismatch, labelDangling, libSymbolIssues, multipleNetNames, netNotBusMember, noConnectConnected, noConnectDangling, pinNotConnected, pinNotDriven, pinTableError, pinTableWarning, powerpinNotDriven, similarLabels, 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::ercCheckNoConnects(), DIALOG_ERC::OnRunERCClick(), ERC_TESTER::TestConflictingBusAliases(), ERC_TESTER::TestDuplicateSheetNames(), ERC_TESTER::TestLibSymbolIssues(), ERC_TESTER::TestMultiunitFootprints(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestNoConnectPins(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), and ERC_TESTER::TestTextVars().

◆ Create() [2/2]

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

Definition at line 39 of file erc_item.h.

40  {
41  for( const RC_ITEM& item : allItemTypes )
42  {
43  if( aErrorKey == item.GetSettingsKey() )
44  return std::make_shared<ERC_ITEM>( static_cast<const ERC_ITEM&>( item ) );
45  }
46 
47  return nullptr;
48  }
A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
Definition: rc_item.h:72
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:68

References allItemTypes.

◆ GetAuxItem2ID()

KIID RC_ITEM::GetAuxItem2ID ( ) const
inlineinherited

Definition at line 137 of file rc_item.h.

137 { return m_ids.size() > 2 ? m_ids[2] : niluuid;; }
KIIDS m_ids
Definition: rc_item.h:182
KIID niluuid(0)

References RC_ITEM::m_ids, and niluuid.

◆ GetAuxItem3ID()

KIID RC_ITEM::GetAuxItem3ID ( ) const
inlineinherited

Definition at line 138 of file rc_item.h.

138 { return m_ids.size() > 3 ? m_ids[3] : niluuid;; }
KIIDS m_ids
Definition: rc_item.h:182
KIID niluuid(0)

References RC_ITEM::m_ids, and niluuid.

◆ GetAuxItemID()

KIID RC_ITEM::GetAuxItemID ( ) const
inlineinherited

Definition at line 136 of file rc_item.h.

136 { return m_ids.size() > 1 ? m_ids[1] : niluuid;; }
KIIDS m_ids
Definition: rc_item.h:182
KIID niluuid(0)

References RC_ITEM::m_ids, and niluuid.

Referenced by RC_ITEM::ShowReport().

◆ GetErrorCode()

int RC_ITEM::GetErrorCode ( ) const
inlineinherited

◆ GetErrorMessage()

wxString RC_ITEM::GetErrorMessage ( ) const
virtualinherited

Return the error message of a RC_ITEM.

Definition at line 37 of file rc_item.cpp.

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

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

Referenced by RC_ITEM::ShowReport().

◆ GetErrorText()

wxString RC_ITEM::GetErrorText ( ) const
inlineinherited

Definition at line 160 of file rc_item.h.

161  {
162  return wxGetTranslation( m_errorTitle );
163  }
wxString m_errorTitle
The string describing the type of error.
Definition: rc_item.h:178

References RC_ITEM::m_errorTitle.

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

◆ GetItemsWithSeverities()

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

Definition at line 50 of file erc_item.h.

51  {
52  return allItemTypes;
53  }
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:68

References allItemTypes.

Referenced by DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), and ERC_SETTINGS::ERC_SETTINGS().

◆ GetMainItemID()

KIID RC_ITEM::GetMainItemID ( ) const
inlineinherited

Definition at line 135 of file rc_item.h.

135 { return m_ids.size() > 0 ? m_ids[0] : niluuid; }
KIIDS m_ids
Definition: rc_item.h:182
KIID niluuid(0)

References RC_ITEM::m_ids, and niluuid.

Referenced by RC_ITEM::ShowReport().

◆ GetParent()

MARKER_BASE* RC_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 141 of file rc_item.h.

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

References RC_ITEM::m_parent.

◆ GetSettingsKey()

wxString RC_ITEM::GetSettingsKey ( ) const
inlineinherited

Definition at line 165 of file rc_item.h.

166  {
167  return m_settingsKey;
168  }
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:179

References RC_ITEM::m_settingsKey.

Referenced by RC_ITEM::ShowReport().

◆ IsSheetSpecific()

bool ERC_ITEM::IsSheetSpecific ( ) const
inline

Definition at line 55 of file erc_item.h.

55 { return m_sheetSpecific; }
bool m_sheetSpecific
True if this item is specific to a sheet instance (as opposed to applying to all instances)
Definition: erc_item.h:103

References m_sheetSpecific.

◆ SetErrorCode()

void RC_ITEM::SetErrorCode ( int  aCode)
inlineinherited

Definition at line 153 of file rc_item.h.

153 { m_errorCode = aCode; }
int m_errorCode
The error code's numeric value.
Definition: rc_item.h:176

References RC_ITEM::m_errorCode.

◆ SetErrorMessage()

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

Definition at line 95 of file rc_item.h.

95 { m_errorMessage = aMessage; }
wxString m_errorMessage
A message describing the details of this specific error.
Definition: rc_item.h:177

References RC_ITEM::m_errorMessage.

◆ SetIsSheetSpecific()

void ERC_ITEM::SetIsSheetSpecific ( bool  aSpecific = true)
inline

Definition at line 56 of file erc_item.h.

56 { m_sheetSpecific = aSpecific; }
bool m_sheetSpecific
True if this item is specific to a sheet instance (as opposed to applying to all instances)
Definition: erc_item.h:103

References m_sheetSpecific.

◆ SetItems() [1/3]

void RC_ITEM::SetItems ( const KIIDS aIds)
inlineinherited

Definition at line 97 of file rc_item.h.

98  {
99  m_ids = aIds;
100  }
KIIDS m_ids
Definition: rc_item.h:182

References RC_ITEM::m_ids.

◆ SetItems() [2/3]

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

Definition at line 107 of file rc_item.h.

109  {
110  m_ids.clear();
111 
112  m_ids.push_back( aItem->m_Uuid );
113 
114  if( bItem )
115  m_ids.push_back( bItem->m_Uuid );
116 
117  if( cItem )
118  m_ids.push_back( cItem->m_Uuid );
119 
120  if( dItem )
121  m_ids.push_back( dItem->m_Uuid );
122  }
KIIDS m_ids
Definition: rc_item.h:182
const KIID m_Uuid
Definition: eda_item.h:524

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

◆ SetItems() [3/3]

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

Definition at line 124 of file rc_item.h.

126  {
127  m_ids.clear();
128 
129  m_ids.push_back( aItem );
130  m_ids.push_back( bItem );
131  m_ids.push_back( cItem );
132  m_ids.push_back( dItem );
133  }
KIIDS m_ids
Definition: rc_item.h:182

References RC_ITEM::m_ids.

◆ SetParent()

void RC_ITEM::SetParent ( MARKER_BASE aMarker)
inlineinherited

Definition at line 140 of file rc_item.h.

140 { m_parent = aMarker; }
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: rc_item.h:180

References RC_ITEM::m_parent.

◆ ShowCoord()

wxString RC_ITEM::ShowCoord ( EDA_UNITS  aUnits,
const wxPoint &  aPos 
)
staticinherited

Format a coordinate or position to text.

Definition at line 46 of file rc_item.cpp.

47 {
48  return wxString::Format( "@(%s, %s)",
49  MessageTextFromValue( aUnits, aPos.x ),
50  MessageTextFromValue( aUnits, aPos.y ) );
51 }
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:125
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

References Format(), and MessageTextFromValue().

Referenced by RC_ITEM::ShowReport().

◆ ShowReport()

wxString RC_ITEM::ShowReport ( EDA_UNITS  aUnits,
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 54 of file rc_item.cpp.

56 {
57  wxString severity;
58 
59  switch( aSeverity )
60  {
61  case RPT_SEVERITY_ERROR: severity = wxT( "Severity: error" ); break;
62  case RPT_SEVERITY_WARNING: severity = wxT( "Severity: warning" ); break;
63  case RPT_SEVERITY_ACTION: severity = wxT( "Severity: action" ); break;
64  case RPT_SEVERITY_INFO: severity = wxT( "Severity: info" ); break;
65  default: ;
66  };
67 
68  if( m_parent && m_parent->IsExcluded() )
69  severity += wxT( " (excluded)" );
70 
71  EDA_ITEM* mainItem = nullptr;
72  EDA_ITEM* auxItem = nullptr;
73 
74  auto ii = aItemMap.find( GetMainItemID() );
75 
76  if( ii != aItemMap.end() )
77  mainItem = ii->second;
78 
79  ii = aItemMap.find( GetAuxItemID() );
80 
81  if( ii != aItemMap.end() )
82  auxItem = ii->second;
83 
84  // Note: some customers machine-process these. So:
85  // 1) don't translate
86  // 2) try not to re-order or change syntax
87  // 3) report numeric error code (which should be more stable) in addition to message
88 
89  if( mainItem && auxItem )
90  {
91  return wxString::Format( wxT( "[%s]: %s %s\n %s: %s\n %s: %s\n" ),
94  severity,
95  ShowCoord( aUnits, mainItem->GetPosition() ),
96  mainItem->GetSelectMenuText( aUnits ),
97  ShowCoord( aUnits, auxItem->GetPosition() ),
98  auxItem->GetSelectMenuText( aUnits ) );
99  }
100  else if( mainItem )
101  {
102  return wxString::Format( wxT( "[%s]: %s %s\n %s: %s\n" ),
103  GetSettingsKey(),
104  GetErrorMessage(),
105  severity,
106  ShowCoord( aUnits, mainItem->GetPosition() ),
107  mainItem->GetSelectMenuText( aUnits ) );
108  }
109  else
110  {
111  return wxString::Format( wxT( "[%s]: %s %s\n" ),
112  GetSettingsKey(),
113  GetErrorMessage(),
114  severity );
115  }
116 }
virtual wxPoint GetPosition() const
Definition: eda_item.h:301
static wxString ShowCoord(EDA_UNITS aUnits, const wxPoint &aPos)
Format a coordinate or position to text.
Definition: rc_item.cpp:46
KIID GetAuxItemID() const
Definition: rc_item.h:136
bool IsExcluded() const
Definition: marker_base.h:94
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
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: rc_item.h:180
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: eda_item.cpp:123
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
wxString GetSettingsKey() const
Definition: rc_item.h:165
KIID GetMainItemID() const
Definition: rc_item.h:135
virtual wxString GetErrorMessage() const
Return the error message of a RC_ITEM.
Definition: rc_item.cpp:37

References Format(), RC_ITEM::GetAuxItemID(), RC_ITEM::GetErrorMessage(), RC_ITEM::GetMainItemID(), EDA_ITEM::GetPosition(), EDA_ITEM::GetSelectMenuText(), RC_ITEM::GetSettingsKey(), MARKER_BASE::IsExcluded(), RC_ITEM::m_parent, RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, and RC_ITEM::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 68 of file erc_item.h.

Referenced by Create(), and GetItemsWithSeverities().

◆ busDefinitionConflict

ERC_ITEM ERC_ITEM::busDefinitionConflict
staticprivate

Definition at line 88 of file erc_item.h.

Referenced by Create().

◆ busLabelSyntax

ERC_ITEM ERC_ITEM::busLabelSyntax
staticprivate

Definition at line 91 of file erc_item.h.

Referenced by Create().

◆ busToBusConflict

ERC_ITEM ERC_ITEM::busToBusConflict
staticprivate

Definition at line 92 of file erc_item.h.

Referenced by Create().

◆ busToNetConflict

ERC_ITEM ERC_ITEM::busToNetConflict
staticprivate

Definition at line 93 of file erc_item.h.

Referenced by Create().

◆ differentUnitFootprint

ERC_ITEM ERC_ITEM::differentUnitFootprint
staticprivate

Definition at line 86 of file erc_item.h.

Referenced by Create().

◆ differentUnitNet

ERC_ITEM ERC_ITEM::differentUnitNet
staticprivate

Definition at line 87 of file erc_item.h.

Referenced by Create().

◆ differentUnitValue

ERC_ITEM ERC_ITEM::differentUnitValue
staticprivate

Definition at line 99 of file erc_item.h.

Referenced by Create().

◆ duplicateReference

ERC_ITEM ERC_ITEM::duplicateReference
staticprivate

Definition at line 100 of file erc_item.h.

Referenced by Create().

◆ duplicateSheetName

ERC_ITEM ERC_ITEM::duplicateSheetName
staticprivate

Definition at line 74 of file erc_item.h.

Referenced by Create().

◆ extraUnits

ERC_ITEM ERC_ITEM::extraUnits
staticprivate

Definition at line 98 of file erc_item.h.

Referenced by Create().

◆ globalLabelDangling

ERC_ITEM ERC_ITEM::globalLabelDangling
staticprivate

Definition at line 84 of file erc_item.h.

Referenced by Create().

◆ heading_conflicts

ERC_ITEM ERC_ITEM::heading_conflicts
staticprivate

Definition at line 71 of file erc_item.h.

◆ heading_connections

ERC_ITEM ERC_ITEM::heading_connections
staticprivate

Definition at line 70 of file erc_item.h.

◆ heading_misc

ERC_ITEM ERC_ITEM::heading_misc
staticprivate

Definition at line 72 of file erc_item.h.

◆ hierLabelMismatch

ERC_ITEM ERC_ITEM::hierLabelMismatch
staticprivate

Definition at line 80 of file erc_item.h.

Referenced by Create().

◆ labelDangling

ERC_ITEM ERC_ITEM::labelDangling
staticprivate

Definition at line 83 of file erc_item.h.

Referenced by Create().

◆ libSymbolIssues

ERC_ITEM ERC_ITEM::libSymbolIssues
staticprivate

Definition at line 96 of file erc_item.h.

Referenced by Create().

◆ 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 177 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 178 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_parent

MARKER_BASE* RC_ITEM::m_parent
protectedinherited

The marker this item belongs to, if any.

Definition at line 180 of file rc_item.h.

Referenced by 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 179 of file rc_item.h.

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

◆ m_sheetSpecific

bool ERC_ITEM::m_sheetSpecific
private

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

Definition at line 103 of file erc_item.h.

Referenced by ERC_ITEM(), IsSheetSpecific(), and SetIsSheetSpecific().

◆ multipleNetNames

ERC_ITEM ERC_ITEM::multipleNetNames
staticprivate

Definition at line 89 of file erc_item.h.

Referenced by Create().

◆ netNotBusMember

ERC_ITEM ERC_ITEM::netNotBusMember
staticprivate

Definition at line 90 of file erc_item.h.

Referenced by Create().

◆ noConnectConnected

ERC_ITEM ERC_ITEM::noConnectConnected
staticprivate

Definition at line 81 of file erc_item.h.

Referenced by Create().

◆ noConnectDangling

ERC_ITEM ERC_ITEM::noConnectDangling
staticprivate

Definition at line 82 of file erc_item.h.

Referenced by Create().

◆ pinNotConnected

ERC_ITEM ERC_ITEM::pinNotConnected
staticprivate

Definition at line 75 of file erc_item.h.

Referenced by Create().

◆ pinNotDriven

ERC_ITEM ERC_ITEM::pinNotDriven
staticprivate

Definition at line 76 of file erc_item.h.

Referenced by Create().

◆ pinTableError

ERC_ITEM ERC_ITEM::pinTableError
staticprivate

Definition at line 79 of file erc_item.h.

Referenced by Create().

◆ pinTableWarning

ERC_ITEM ERC_ITEM::pinTableWarning
staticprivate

Definition at line 78 of file erc_item.h.

Referenced by Create().

◆ powerpinNotDriven

ERC_ITEM ERC_ITEM::powerpinNotDriven
staticprivate

Definition at line 77 of file erc_item.h.

Referenced by Create().

◆ similarLabels

ERC_ITEM ERC_ITEM::similarLabels
staticprivate

Definition at line 85 of file erc_item.h.

Referenced by Create().

◆ unannotated

ERC_ITEM ERC_ITEM::unannotated
staticprivate

Definition at line 97 of file erc_item.h.

Referenced by Create().

◆ unresolvedVariable

ERC_ITEM ERC_ITEM::unresolvedVariable
staticprivate

Definition at line 94 of file erc_item.h.

Referenced by Create().

◆ wireDangling

ERC_ITEM ERC_ITEM::wireDangling
staticprivate

Definition at line 95 of file erc_item.h.

Referenced by Create().


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