KiCad PCB EDA Suite
DRC_ITEM Class Reference

#include <drc_item.h>

Inheritance diagram for DRC_ITEM:
RC_ITEM

Public Types

typedef std::vector< KIIDKIIDS
 

Public Member Functions

void SetViolatingRule (DRC_RULE *aRule)
 
DRC_RULEGetViolatingRule () const
 
wxString GetViolatingRuleDesc () const override
 
void SetViolatingTest (DRC_TEST_PROVIDER *aProvider)
 
DRC_TEST_PROVIDERGetViolatingTest () const
 
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< DRC_ITEMCreate (int aErrorCode)
 Constructs a DRC_ITEM for the given error code. More...
 
static std::shared_ptr< DRC_ITEMCreate (const wxString &aErrorKey)
 Constructs a DRC item from a given error settings key. More...
 
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

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

Private Attributes

DRC_RULEm_violatingRule = nullptr
 
DRC_TEST_PROVIDERm_violatingTest = nullptr
 

Static Private Attributes

static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
 A list of all DRC_ITEM types which are valid error codes. More...
 
static DRC_ITEM heading_electrical
 
static DRC_ITEM heading_DFM
 
static DRC_ITEM heading_schematic_parity
 
static DRC_ITEM heading_signal_integrity
 
static DRC_ITEM heading_misc
 
static DRC_ITEM unconnectedItems
 
static DRC_ITEM shortingItems
 
static DRC_ITEM itemsNotAllowed
 
static DRC_ITEM textOnEdgeCuts
 
static DRC_ITEM clearance
 
static DRC_ITEM tracksCrossing
 
static DRC_ITEM edgeClearance
 
static DRC_ITEM zonesIntersect
 
static DRC_ITEM zoneHasEmptyNet
 
static DRC_ITEM viaDangling
 
static DRC_ITEM trackDangling
 
static DRC_ITEM holeNearHole
 
static DRC_ITEM holesCoLocated
 
static DRC_ITEM holeClearance
 
static DRC_ITEM trackWidth
 
static DRC_ITEM annularWidth
 
static DRC_ITEM drillTooSmall
 
static DRC_ITEM viaDiameter
 
static DRC_ITEM padstack
 
static DRC_ITEM microviaDrillTooSmall
 
static DRC_ITEM courtyardsOverlap
 
static DRC_ITEM missingCourtyard
 
static DRC_ITEM malformedCourtyard
 
static DRC_ITEM pthInsideCourtyard
 
static DRC_ITEM npthInsideCourtyard
 
static DRC_ITEM itemOnDisabledLayer
 
static DRC_ITEM invalidOutline
 
static DRC_ITEM duplicateFootprints
 
static DRC_ITEM missingFootprint
 
static DRC_ITEM extraFootprint
 
static DRC_ITEM netConflict
 
static DRC_ITEM unresolvedVariable
 
static DRC_ITEM silkMaskClearance
 
static DRC_ITEM silkOverlaps
 
static DRC_ITEM lengthOutOfRange
 
static DRC_ITEM skewOutOfRange
 
static DRC_ITEM tooManyVias
 
static DRC_ITEM diffPairGapOutOfRange
 
static DRC_ITEM diffPairUncoupledLengthTooLong
 
static DRC_ITEM footprintTypeMismatch
 
static DRC_ITEM footprintTHPadhasNoHole
 

Detailed Description

Definition at line 88 of file drc_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

◆ DRC_ITEM()

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

Definition at line 119 of file drc_item.h.

120  {
121  m_errorCode = aErrorCode;
122  m_errorTitle = aTitle;
123  m_settingsKey = aSettingsKey;
124  m_parent = nullptr;
125  }
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:169
int m_errorCode
The error code's numeric value.
Definition: rc_item.h:166
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: rc_item.h:170
wxString m_errorTitle
The string describing the type of error.
Definition: rc_item.h:168

References RC_ITEM::m_errorCode, RC_ITEM::m_errorTitle, RC_ITEM::m_parent, 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 }
KIIDS m_ids
Definition: rc_item.h:172
const KIID m_Uuid
Definition: eda_item.h:475

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

◆ Create() [1/2]

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

Constructs a DRC_ITEM for the given error code.

See also
DRCE_T

Definition at line 266 of file drc_item.cpp.

267 {
268  switch( aErrorCode )
269  {
270  case DRCE_UNCONNECTED_ITEMS: return std::make_shared<DRC_ITEM>( unconnectedItems );
271  case DRCE_SHORTING_ITEMS: return std::make_shared<DRC_ITEM>( shortingItems );
272  case DRCE_ALLOWED_ITEMS: return std::make_shared<DRC_ITEM>( itemsNotAllowed );
273  case DRCE_TEXT_ON_EDGECUTS: return std::make_shared<DRC_ITEM>( textOnEdgeCuts );
274  case DRCE_CLEARANCE: return std::make_shared<DRC_ITEM>( clearance );
275  case DRCE_TRACKS_CROSSING: return std::make_shared<DRC_ITEM>( tracksCrossing );
276  case DRCE_EDGE_CLEARANCE: return std::make_shared<DRC_ITEM>( edgeClearance );
277  case DRCE_ZONES_INTERSECT: return std::make_shared<DRC_ITEM>( zonesIntersect );
278  case DRCE_ZONE_HAS_EMPTY_NET: return std::make_shared<DRC_ITEM>( zoneHasEmptyNet );
279  case DRCE_DANGLING_VIA: return std::make_shared<DRC_ITEM>( viaDangling );
280  case DRCE_DANGLING_TRACK: return std::make_shared<DRC_ITEM>( trackDangling );
281  case DRCE_DRILLED_HOLES_TOO_CLOSE: return std::make_shared<DRC_ITEM>( holeNearHole );
282  case DRCE_DRILLED_HOLES_COLOCATED: return std::make_shared<DRC_ITEM>( holesCoLocated );
283  case DRCE_HOLE_CLEARANCE: return std::make_shared<DRC_ITEM>( holeClearance );
284  case DRCE_TRACK_WIDTH: return std::make_shared<DRC_ITEM>( trackWidth );
285  case DRCE_ANNULAR_WIDTH: return std::make_shared<DRC_ITEM>( annularWidth );
286  case DRCE_DRILL_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( drillTooSmall );
287  case DRCE_VIA_DIAMETER: return std::make_shared<DRC_ITEM>( viaDiameter );
288  case DRCE_PADSTACK: return std::make_shared<DRC_ITEM>( padstack );
289  case DRCE_MICROVIA_DRILL_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( microviaDrillTooSmall );
290  case DRCE_OVERLAPPING_FOOTPRINTS: return std::make_shared<DRC_ITEM>( courtyardsOverlap );
291  case DRCE_MISSING_COURTYARD: return std::make_shared<DRC_ITEM>( missingCourtyard );
292  case DRCE_MALFORMED_COURTYARD: return std::make_shared<DRC_ITEM>( malformedCourtyard );
293  case DRCE_PTH_IN_COURTYARD: return std::make_shared<DRC_ITEM>( pthInsideCourtyard );
294  case DRCE_NPTH_IN_COURTYARD: return std::make_shared<DRC_ITEM>( npthInsideCourtyard );
295  case DRCE_DISABLED_LAYER_ITEM: return std::make_shared<DRC_ITEM>( itemOnDisabledLayer );
296  case DRCE_INVALID_OUTLINE: return std::make_shared<DRC_ITEM>( invalidOutline );
297  case DRCE_MISSING_FOOTPRINT: return std::make_shared<DRC_ITEM>( missingFootprint );
298  case DRCE_DUPLICATE_FOOTPRINT: return std::make_shared<DRC_ITEM>( duplicateFootprints );
299  case DRCE_NET_CONFLICT: return std::make_shared<DRC_ITEM>( netConflict );
300  case DRCE_EXTRA_FOOTPRINT: return std::make_shared<DRC_ITEM>( extraFootprint );
301  case DRCE_UNRESOLVED_VARIABLE: return std::make_shared<DRC_ITEM>( unresolvedVariable );
302  case DRCE_OVERLAPPING_SILK: return std::make_shared<DRC_ITEM>( silkOverlaps );
303  case DRCE_SILK_MASK_CLEARANCE: return std::make_shared<DRC_ITEM>( silkMaskClearance );
304  case DRCE_LENGTH_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( lengthOutOfRange );
305  case DRCE_SKEW_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( skewOutOfRange );
306  case DRCE_TOO_MANY_VIAS: return std::make_shared<DRC_ITEM>( tooManyVias );
307  case DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( diffPairGapOutOfRange );
308  case DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG: return std::make_shared<DRC_ITEM>( diffPairUncoupledLengthTooLong );
309  case DRCE_FOOTPRINT_TYPE_MISMATCH: return std::make_shared<DRC_ITEM>( footprintTypeMismatch );
310  case DRCE_PAD_TH_WITH_NO_HOLE: return std::make_shared<DRC_ITEM>( footprintTHPadhasNoHole );
311  default:
312  wxFAIL_MSG( "Unknown DRC error code" );
313  return nullptr;
314  }
315 }
static DRC_ITEM extraFootprint
Definition: drc_item.h:165
static DRC_ITEM itemOnDisabledLayer
Definition: drc_item.h:161
static DRC_ITEM missingCourtyard
Definition: drc_item.h:157
static DRC_ITEM holesCoLocated
Definition: drc_item.h:148
static DRC_ITEM invalidOutline
Definition: drc_item.h:162
static DRC_ITEM holeNearHole
Definition: drc_item.h:147
static DRC_ITEM silkMaskClearance
Definition: drc_item.h:168
static DRC_ITEM clearance
Definition: drc_item.h:140
static DRC_ITEM unconnectedItems
Definition: drc_item.h:136
static DRC_ITEM missingFootprint
Definition: drc_item.h:164
static DRC_ITEM footprintTHPadhasNoHole
Definition: drc_item.h:176
static DRC_ITEM itemsNotAllowed
Definition: drc_item.h:138
static DRC_ITEM microviaDrillTooSmall
Definition: drc_item.h:155
static DRC_ITEM diffPairUncoupledLengthTooLong
Definition: drc_item.h:174
static DRC_ITEM tracksCrossing
Definition: drc_item.h:141
static DRC_ITEM npthInsideCourtyard
Definition: drc_item.h:160
static DRC_ITEM malformedCourtyard
Definition: drc_item.h:158
static DRC_ITEM footprintTypeMismatch
Definition: drc_item.h:175
static DRC_ITEM edgeClearance
Definition: drc_item.h:142
static DRC_ITEM courtyardsOverlap
Definition: drc_item.h:156
static DRC_ITEM shortingItems
Definition: drc_item.h:137
static DRC_ITEM diffPairGapOutOfRange
Definition: drc_item.h:173
static DRC_ITEM drillTooSmall
Definition: drc_item.h:152
static DRC_ITEM duplicateFootprints
Definition: drc_item.h:163
static DRC_ITEM textOnEdgeCuts
Definition: drc_item.h:139
static DRC_ITEM zoneHasEmptyNet
Definition: drc_item.h:144
static DRC_ITEM zonesIntersect
Definition: drc_item.h:143
static DRC_ITEM viaDangling
Definition: drc_item.h:145
static DRC_ITEM trackWidth
Definition: drc_item.h:150
static DRC_ITEM annularWidth
Definition: drc_item.h:151
static DRC_ITEM silkOverlaps
Definition: drc_item.h:169
static DRC_ITEM holeClearance
Definition: drc_item.h:149
static DRC_ITEM trackDangling
Definition: drc_item.h:146
static DRC_ITEM lengthOutOfRange
Definition: drc_item.h:170
static DRC_ITEM tooManyVias
Definition: drc_item.h:172
static DRC_ITEM unresolvedVariable
Definition: drc_item.h:167
static DRC_ITEM viaDiameter
Definition: drc_item.h:153
static DRC_ITEM skewOutOfRange
Definition: drc_item.h:171
static DRC_ITEM netConflict
Definition: drc_item.h:166
static DRC_ITEM pthInsideCourtyard
Definition: drc_item.h:159
static DRC_ITEM padstack
Definition: drc_item.h:154

References annularWidth, clearance, courtyardsOverlap, diffPairGapOutOfRange, diffPairUncoupledLengthTooLong, DRCE_ALLOWED_ITEMS, DRCE_ANNULAR_WIDTH, DRCE_CLEARANCE, DRCE_DANGLING_TRACK, DRCE_DANGLING_VIA, DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE, DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG, DRCE_DISABLED_LAYER_ITEM, DRCE_DRILL_OUT_OF_RANGE, DRCE_DRILLED_HOLES_COLOCATED, DRCE_DRILLED_HOLES_TOO_CLOSE, DRCE_DUPLICATE_FOOTPRINT, DRCE_EDGE_CLEARANCE, DRCE_EXTRA_FOOTPRINT, DRCE_FOOTPRINT_TYPE_MISMATCH, DRCE_HOLE_CLEARANCE, DRCE_INVALID_OUTLINE, DRCE_LENGTH_OUT_OF_RANGE, DRCE_MALFORMED_COURTYARD, DRCE_MICROVIA_DRILL_OUT_OF_RANGE, DRCE_MISSING_COURTYARD, DRCE_MISSING_FOOTPRINT, DRCE_NET_CONFLICT, DRCE_NPTH_IN_COURTYARD, DRCE_OVERLAPPING_FOOTPRINTS, DRCE_OVERLAPPING_SILK, DRCE_PAD_TH_WITH_NO_HOLE, DRCE_PADSTACK, DRCE_PTH_IN_COURTYARD, DRCE_SHORTING_ITEMS, DRCE_SILK_MASK_CLEARANCE, DRCE_SKEW_OUT_OF_RANGE, DRCE_TEXT_ON_EDGECUTS, DRCE_TOO_MANY_VIAS, DRCE_TRACK_WIDTH, DRCE_TRACKS_CROSSING, DRCE_UNCONNECTED_ITEMS, DRCE_UNRESOLVED_VARIABLE, DRCE_VIA_DIAMETER, DRCE_ZONE_HAS_EMPTY_NET, DRCE_ZONES_INTERSECT, drillTooSmall, duplicateFootprints, edgeClearance, extraFootprint, footprintTHPadhasNoHole, footprintTypeMismatch, holeClearance, holeNearHole, holesCoLocated, invalidOutline, itemOnDisabledLayer, itemsNotAllowed, lengthOutOfRange, malformedCourtyard, microviaDrillTooSmall, missingCourtyard, missingFootprint, netConflict, npthInsideCourtyard, padstack, pthInsideCourtyard, shortingItems, silkMaskClearance, silkOverlaps, skewOutOfRange, textOnEdgeCuts, tooManyVias, trackDangling, tracksCrossing, trackWidth, unconnectedItems, unresolvedVariable, viaDangling, viaDiameter, zoneHasEmptyNet, and zonesIntersect.

Referenced by DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths(), DRC_TEST_PROVIDER_HOLE_SIZE::checkPad(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), DRC_TEST_PROVIDER_HOLE_SIZE::checkVia(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkViaCounts(), PCB_MARKER::Deserialize(), BOARD_DESIGN_SETTINGS::LoadFromFile(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), DRC_TEST_PROVIDER_TRACK_WIDTH::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTIVITY::Run(), DRC_TEST_PROVIDER_SILK_TO_MASK::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DIALOG_FOOTPRINT_CHECKER::runChecks(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions(), DRC_TEST_PROVIDER_LVS::testFootprints(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_MISC::testOutline(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_MISC::testTextVars(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().

◆ Create() [2/2]

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

Constructs a DRC item from a given error settings key.

Parameters
aErrorKeyis a settings key for an error code (the untranslated string that is used to represent a given error code in settings files and for storing ignored DRC items)
Returns
the created item

Definition at line 318 of file drc_item.cpp.

319 {
320  for( const RC_ITEM& item : allItemTypes )
321  {
322  if( aErrorKey == item.GetSettingsKey() )
323  return std::make_shared<DRC_ITEM>( static_cast<const DRC_ITEM&>( item ) );
324  }
325 
326  // This can happen if a project has old-format exclusions. Just drop these items.
327  return nullptr;
328 }
A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
Definition: rc_item.h:74
static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
A list of all DRC_ITEM types which are valid error codes.
Definition: drc_item.h:128

References allItemTypes.

◆ GetAuxItem2ID()

KIID RC_ITEM::GetAuxItem2ID ( ) const
inlineinherited

Definition at line 122 of file rc_item.h.

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

References RC_ITEM::m_ids, and niluuid.

◆ GetAuxItem3ID()

KIID RC_ITEM::GetAuxItem3ID ( ) const
inlineinherited

Definition at line 123 of file rc_item.h.

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

References RC_ITEM::m_ids, and niluuid.

◆ GetAuxItemID()

KIID RC_ITEM::GetAuxItemID ( ) const
inlineinherited

Definition at line 121 of file rc_item.h.

121 { return m_ids.size() > 1 ? m_ids[1] : niluuid;; }
KIIDS m_ids
Definition: rc_item.h:172
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 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:145
wxString m_errorMessage
A message describing the details of this specific error.
Definition: rc_item.h:167

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

Referenced by RC_ITEM::ShowReport().

◆ GetErrorText()

wxString RC_ITEM::GetErrorText ( ) const
inlineinherited

Definition at line 145 of file rc_item.h.

146  {
147  return wxGetTranslation( m_errorTitle );
148  }
wxString m_errorTitle
The string describing the type of error.
Definition: rc_item.h:168

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> > DRC_ITEM::GetItemsWithSeverities ( )
inlinestatic

Definition at line 105 of file drc_item.h.

106  {
107  return allItemTypes;
108  }
static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
A list of all DRC_ITEM types which are valid error codes.
Definition: drc_item.h:128

References allItemTypes.

Referenced by BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), and DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP().

◆ GetMainItemID()

KIID RC_ITEM::GetMainItemID ( ) const
inlineinherited

Definition at line 120 of file rc_item.h.

120 { return m_ids.size() > 0 ? m_ids[0] : niluuid; }
KIIDS m_ids
Definition: rc_item.h:172
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 126 of file rc_item.h.

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

References RC_ITEM::m_parent.

◆ GetSettingsKey()

wxString RC_ITEM::GetSettingsKey ( ) const
inlineinherited

Definition at line 150 of file rc_item.h.

151  {
152  return m_settingsKey;
153  }
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:169

References RC_ITEM::m_settingsKey.

Referenced by RC_ITEM::ShowReport().

◆ GetViolatingRule()

DRC_RULE* DRC_ITEM::GetViolatingRule ( ) const
inline

Definition at line 111 of file drc_item.h.

111 { return m_violatingRule; }
DRC_RULE * m_violatingRule
Definition: drc_item.h:179

References m_violatingRule.

◆ GetViolatingRuleDesc()

wxString DRC_ITEM::GetViolatingRuleDesc ( ) const
overridevirtual

Reimplemented from RC_ITEM.

Definition at line 331 of file drc_item.cpp.

332 {
333  if( m_violatingRule )
334  return wxString::Format( _( "Rule: %s" ), m_violatingRule->m_Name );
335  else
336  return _("Local override" );
337 }
wxString m_Name
Definition: drc_rule.h:96
#define _(s)
Definition: drc_item.cpp:38
DRC_RULE * m_violatingRule
Definition: drc_item.h:179
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(), DRC_RULE::m_Name, and m_violatingRule.

◆ GetViolatingTest()

DRC_TEST_PROVIDER* DRC_ITEM::GetViolatingTest ( ) const
inline

Definition at line 116 of file drc_item.h.

116 { return m_violatingTest; }
DRC_TEST_PROVIDER * m_violatingTest
Definition: drc_item.h:180

References m_violatingTest.

◆ SetErrorCode()

void RC_ITEM::SetErrorCode ( int  aCode)
inlineinherited

Definition at line 138 of file rc_item.h.

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

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; }
wxString m_errorMessage
A message describing the details of this specific error.
Definition: rc_item.h:167

References RC_ITEM::m_errorMessage.

◆ SetItems() [1/3]

void RC_ITEM::SetItems ( const KIIDS aIds)
inlineinherited

Definition at line 99 of file rc_item.h.

100  {
101  m_ids = aIds;
102  }
KIIDS m_ids
Definition: rc_item.h:172

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 
)
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 }
KIIDS m_ids
Definition: rc_item.h:172
const KIID m_Uuid
Definition: eda_item.h:475

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 109 of file rc_item.h.

111  {
112  m_ids.clear();
113 
114  m_ids.push_back( aItem );
115  m_ids.push_back( bItem );
116  m_ids.push_back( cItem );
117  m_ids.push_back( dItem );
118  }
KIIDS m_ids
Definition: rc_item.h:172

References RC_ITEM::m_ids.

◆ SetParent()

void RC_ITEM::SetParent ( MARKER_BASE aMarker)
inlineinherited

Definition at line 125 of file rc_item.h.

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

References RC_ITEM::m_parent.

◆ SetViolatingRule()

void DRC_ITEM::SetViolatingRule ( DRC_RULE aRule)
inline

Definition at line 110 of file drc_item.h.

110 { m_violatingRule = aRule; }
DRC_RULE * m_violatingRule
Definition: drc_item.h:179

References m_violatingRule.

◆ SetViolatingTest()

void DRC_ITEM::SetViolatingTest ( DRC_TEST_PROVIDER aProvider)
inline

Definition at line 115 of file drc_item.h.

115 { m_violatingTest = aProvider; }
DRC_TEST_PROVIDER * m_violatingTest
Definition: drc_item.h:180

References m_violatingTest.

◆ ShowCoord()

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

Format a coordinate or position to text.

Definition at line 47 of file rc_item.cpp.

48 {
49  return wxString::Format( "@(%s, %s)",
50  MessageTextFromValue( aUnits, aPos.x ),
51  MessageTextFromValue( aUnits, aPos.y ) );
52 }
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:104
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 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  default: ;
91  };
92 
93  if( m_parent && m_parent->IsExcluded() )
94  severity += wxT( " (excluded)" );
95 
96  EDA_ITEM* mainItem = nullptr;
97  EDA_ITEM* auxItem = nullptr;
98 
99  auto ii = aItemMap.find( GetMainItemID() );
100 
101  if( ii != aItemMap.end() )
102  mainItem = ii->second;
103 
104  ii = aItemMap.find( GetAuxItemID() );
105 
106  if( ii != aItemMap.end() )
107  auxItem = ii->second;
108 
109  // Note: some customers machine-process these. So:
110  // 1) don't translate
111  // 2) try not to re-order or change syntax
112  // 3) report settings key (which should be more stable) in addition to message
113 
114  if( mainItem && auxItem )
115  {
116  return wxString::Format( wxT( "[%s]: %s\n %s; %s\n %s: %s\n %s: %s\n" ),
117  GetSettingsKey(),
118  GetErrorMessage(),
120  severity,
121  ShowCoord( aUnits, mainItem->GetPosition() ),
122  mainItem->GetSelectMenuText( aUnits ),
123  ShowCoord( aUnits, auxItem->GetPosition() ),
124  auxItem->GetSelectMenuText( aUnits ) );
125  }
126  else if( mainItem )
127  {
128  return wxString::Format( wxT( "[%s]: %s\n %s; %s\n %s: %s\n" ),
129  GetSettingsKey(),
130  GetErrorMessage(),
132  severity,
133  ShowCoord( aUnits, mainItem->GetPosition() ),
134  mainItem->GetSelectMenuText( aUnits ) );
135  }
136  else
137  {
138  return wxString::Format( wxT( "[%s]: %s\n %s; %s\n" ),
139  GetSettingsKey(),
140  GetErrorMessage(),
142  severity );
143  }
144 }
virtual wxPoint GetPosition() const
Definition: eda_item.h:252
virtual wxString GetViolatingRuleDesc() const
Definition: rc_item.h:155
static wxString ShowCoord(EDA_UNITS aUnits, const wxPoint &aPos)
Format a coordinate or position to text.
Definition: rc_item.cpp:47
KIID GetAuxItemID() const
Definition: rc_item.h:121
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:170
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:109
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
wxString GetSettingsKey() const
Definition: rc_item.h:150
KIID GetMainItemID() const
Definition: rc_item.h:120
virtual wxString GetErrorMessage() const
Return the error message of a RC_ITEM.
Definition: rc_item.cpp:38

References Format(), RC_ITEM::GetAuxItemID(), RC_ITEM::GetErrorMessage(), RC_ITEM::GetMainItemID(), EDA_ITEM::GetPosition(), EDA_ITEM::GetSelectMenuText(), RC_ITEM::GetSettingsKey(), RC_ITEM::GetViolatingRuleDesc(), 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 > > DRC_ITEM::allItemTypes
staticprivate

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

Definition at line 128 of file drc_item.h.

Referenced by Create(), and GetItemsWithSeverities().

◆ annularWidth

DRC_ITEM DRC_ITEM::annularWidth
staticprivate

Definition at line 151 of file drc_item.h.

Referenced by Create().

◆ clearance

DRC_ITEM DRC_ITEM::clearance
staticprivate

Definition at line 140 of file drc_item.h.

Referenced by Create().

◆ courtyardsOverlap

DRC_ITEM DRC_ITEM::courtyardsOverlap
staticprivate

Definition at line 156 of file drc_item.h.

Referenced by Create().

◆ diffPairGapOutOfRange

DRC_ITEM DRC_ITEM::diffPairGapOutOfRange
staticprivate

Definition at line 173 of file drc_item.h.

Referenced by Create().

◆ diffPairUncoupledLengthTooLong

DRC_ITEM DRC_ITEM::diffPairUncoupledLengthTooLong
staticprivate

Definition at line 174 of file drc_item.h.

Referenced by Create().

◆ drillTooSmall

DRC_ITEM DRC_ITEM::drillTooSmall
staticprivate

Definition at line 152 of file drc_item.h.

Referenced by Create().

◆ duplicateFootprints

DRC_ITEM DRC_ITEM::duplicateFootprints
staticprivate

Definition at line 163 of file drc_item.h.

Referenced by Create().

◆ edgeClearance

DRC_ITEM DRC_ITEM::edgeClearance
staticprivate

Definition at line 142 of file drc_item.h.

Referenced by Create().

◆ extraFootprint

DRC_ITEM DRC_ITEM::extraFootprint
staticprivate

Definition at line 165 of file drc_item.h.

Referenced by Create().

◆ footprintTHPadhasNoHole

DRC_ITEM DRC_ITEM::footprintTHPadhasNoHole
staticprivate

Definition at line 176 of file drc_item.h.

Referenced by Create().

◆ footprintTypeMismatch

DRC_ITEM DRC_ITEM::footprintTypeMismatch
staticprivate

Definition at line 175 of file drc_item.h.

Referenced by Create().

◆ heading_DFM

DRC_ITEM DRC_ITEM::heading_DFM
staticprivate

Definition at line 131 of file drc_item.h.

◆ heading_electrical

DRC_ITEM DRC_ITEM::heading_electrical
staticprivate

Definition at line 130 of file drc_item.h.

◆ heading_misc

DRC_ITEM DRC_ITEM::heading_misc
staticprivate

Definition at line 134 of file drc_item.h.

◆ heading_schematic_parity

DRC_ITEM DRC_ITEM::heading_schematic_parity
staticprivate

Definition at line 132 of file drc_item.h.

◆ heading_signal_integrity

DRC_ITEM DRC_ITEM::heading_signal_integrity
staticprivate

Definition at line 133 of file drc_item.h.

◆ holeClearance

DRC_ITEM DRC_ITEM::holeClearance
staticprivate

Definition at line 149 of file drc_item.h.

Referenced by Create().

◆ holeNearHole

DRC_ITEM DRC_ITEM::holeNearHole
staticprivate

Definition at line 147 of file drc_item.h.

Referenced by Create().

◆ holesCoLocated

DRC_ITEM DRC_ITEM::holesCoLocated
staticprivate

Definition at line 148 of file drc_item.h.

Referenced by Create().

◆ invalidOutline

DRC_ITEM DRC_ITEM::invalidOutline
staticprivate

Definition at line 162 of file drc_item.h.

Referenced by Create().

◆ itemOnDisabledLayer

DRC_ITEM DRC_ITEM::itemOnDisabledLayer
staticprivate

Definition at line 161 of file drc_item.h.

Referenced by Create().

◆ itemsNotAllowed

DRC_ITEM DRC_ITEM::itemsNotAllowed
staticprivate

Definition at line 138 of file drc_item.h.

Referenced by Create().

◆ lengthOutOfRange

DRC_ITEM DRC_ITEM::lengthOutOfRange
staticprivate

Definition at line 170 of file drc_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 167 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 168 of file rc_item.h.

Referenced by CLEANUP_ITEM::CLEANUP_ITEM(), DRC_ITEM(), ERC_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 170 of file rc_item.h.

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

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

◆ m_violatingRule

DRC_RULE* DRC_ITEM::m_violatingRule = nullptr
private

Definition at line 179 of file drc_item.h.

Referenced by GetViolatingRule(), GetViolatingRuleDesc(), and SetViolatingRule().

◆ m_violatingTest

DRC_TEST_PROVIDER* DRC_ITEM::m_violatingTest = nullptr
private

Definition at line 180 of file drc_item.h.

Referenced by GetViolatingTest(), and SetViolatingTest().

◆ malformedCourtyard

DRC_ITEM DRC_ITEM::malformedCourtyard
staticprivate

Definition at line 158 of file drc_item.h.

Referenced by Create().

◆ microviaDrillTooSmall

DRC_ITEM DRC_ITEM::microviaDrillTooSmall
staticprivate

Definition at line 155 of file drc_item.h.

Referenced by Create().

◆ missingCourtyard

DRC_ITEM DRC_ITEM::missingCourtyard
staticprivate

Definition at line 157 of file drc_item.h.

Referenced by Create().

◆ missingFootprint

DRC_ITEM DRC_ITEM::missingFootprint
staticprivate

Definition at line 164 of file drc_item.h.

Referenced by Create().

◆ netConflict

DRC_ITEM DRC_ITEM::netConflict
staticprivate

Definition at line 166 of file drc_item.h.

Referenced by Create().

◆ npthInsideCourtyard

DRC_ITEM DRC_ITEM::npthInsideCourtyard
staticprivate

Definition at line 160 of file drc_item.h.

Referenced by Create().

◆ padstack

DRC_ITEM DRC_ITEM::padstack
staticprivate

Definition at line 154 of file drc_item.h.

Referenced by Create().

◆ pthInsideCourtyard

DRC_ITEM DRC_ITEM::pthInsideCourtyard
staticprivate

Definition at line 159 of file drc_item.h.

Referenced by Create().

◆ shortingItems

DRC_ITEM DRC_ITEM::shortingItems
staticprivate

Definition at line 137 of file drc_item.h.

Referenced by Create().

◆ silkMaskClearance

DRC_ITEM DRC_ITEM::silkMaskClearance
staticprivate

Definition at line 168 of file drc_item.h.

Referenced by Create().

◆ silkOverlaps

DRC_ITEM DRC_ITEM::silkOverlaps
staticprivate

Definition at line 169 of file drc_item.h.

Referenced by Create().

◆ skewOutOfRange

DRC_ITEM DRC_ITEM::skewOutOfRange
staticprivate

Definition at line 171 of file drc_item.h.

Referenced by Create().

◆ textOnEdgeCuts

DRC_ITEM DRC_ITEM::textOnEdgeCuts
staticprivate

Definition at line 139 of file drc_item.h.

Referenced by Create().

◆ tooManyVias

DRC_ITEM DRC_ITEM::tooManyVias
staticprivate

Definition at line 172 of file drc_item.h.

Referenced by Create().

◆ trackDangling

DRC_ITEM DRC_ITEM::trackDangling
staticprivate

Definition at line 146 of file drc_item.h.

Referenced by Create().

◆ tracksCrossing

DRC_ITEM DRC_ITEM::tracksCrossing
staticprivate

Definition at line 141 of file drc_item.h.

Referenced by Create().

◆ trackWidth

DRC_ITEM DRC_ITEM::trackWidth
staticprivate

Definition at line 150 of file drc_item.h.

Referenced by Create().

◆ unconnectedItems

DRC_ITEM DRC_ITEM::unconnectedItems
staticprivate

Definition at line 136 of file drc_item.h.

Referenced by Create().

◆ unresolvedVariable

DRC_ITEM DRC_ITEM::unresolvedVariable
staticprivate

Definition at line 167 of file drc_item.h.

Referenced by Create().

◆ viaDangling

DRC_ITEM DRC_ITEM::viaDangling
staticprivate

Definition at line 145 of file drc_item.h.

Referenced by Create().

◆ viaDiameter

DRC_ITEM DRC_ITEM::viaDiameter
staticprivate

Definition at line 153 of file drc_item.h.

Referenced by Create().

◆ zoneHasEmptyNet

DRC_ITEM DRC_ITEM::zoneHasEmptyNet
staticprivate

Definition at line 144 of file drc_item.h.

Referenced by Create().

◆ zonesIntersect

DRC_ITEM DRC_ITEM::zonesIntersect
staticprivate

Definition at line 143 of file drc_item.h.

Referenced by Create().


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