KiCad PCB EDA Suite
DRC_ITEM Class Reference

#include <drc_item.h>

Inheritance diagram for DRC_ITEM:
RC_ITEM

Public Member Functions

wxString ShowHtml (PCB_BASE_FRAME *aFrame) const
 Translates this object into a fragment of HTML suitable for the wxHtmlListBox class. More...
 
void SetErrorMessage (const wxString &aMessage)
 
void SetItems (EDA_ITEM *aItem, EDA_ITEM *bItem=nullptr, EDA_ITEM *cItem=nullptr, EDA_ITEM *dItem=nullptr)
 
void SetItems (const KIID &aItem, const KIID &bItem=niluuid, const KIID &cItem=niluuid, const KIID &dItem=niluuid)
 
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, const std::map< KIID, EDA_ITEM * > &aItemMap) const
 Function ShowReport translates 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
 Function GetErrorMessage returns the error message of a RC_ITEM. More...
 
wxString GetErrorText () const
 
wxString GetSettingsKey () const
 

Static Public Member Functions

static DRC_ITEMCreate (int aErrorCode)
 Constructs a DRC_ITEM for the given error code. More...
 
static 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)
 Function ShowCoord formats a coordinate or position to text. More...
 

Protected Attributes

int m_errorCode
 
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
 
KIID m_mainItemUuid
 
KIID m_auxItemUuid
 
KIID m_auxItem2Uuid
 
KIID m_auxItem3Uuid
 

Private Member Functions

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

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 unconnectedItems
 
static DRC_ITEM shortingItems
 
static DRC_ITEM itemsNotAllowed
 
static DRC_ITEM clearance
 
static DRC_ITEM tracksCrossing
 
static DRC_ITEM copperEdgeClearance
 
static DRC_ITEM zonesIntersect
 
static DRC_ITEM zoneHasEmptyNet
 
static DRC_ITEM viaDangling
 
static DRC_ITEM trackDangling
 
static DRC_ITEM holeNearHole
 
static DRC_ITEM trackWidth
 
static DRC_ITEM viaTooSmall
 
static DRC_ITEM viaAnnulus
 
static DRC_ITEM drillTooSmall
 
static DRC_ITEM viaHoleLargerThanPad
 
static DRC_ITEM padstack
 
static DRC_ITEM microviaTooSmall
 
static DRC_ITEM microviaDrillTooSmall
 
static DRC_ITEM keepout
 
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 unresolvedVariable
 

Detailed Description

Definition at line 32 of file pcbnew/drc/drc_item.h.

Constructor & Destructor Documentation

◆ DRC_ITEM()

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

Definition at line 61 of file pcbnew/drc/drc_item.h.

62  {
63  m_errorCode = aErrorCode;
64  m_errorTitle = aTitle;
65  m_settingsKey = aSettingsKey;
66  }
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:79
int m_errorCode
Definition: rc_item.h:76
wxString m_errorTitle
The string describing the type of error.
Definition: rc_item.h:78

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

Referenced by Create().

Member Function Documentation

◆ Create() [1/2]

DRC_ITEM * DRC_ITEM::Create ( int  aErrorCode)
static

Constructs a DRC_ITEM for the given error code.

See also
DRCE_T

Definition at line 202 of file pcbnew/drc/drc_item.cpp.

203 {
204  switch( aErrorCode )
205  {
207  case DRCE_SHORTING_ITEMS: return new DRC_ITEM( shortingItems );
208  case DRCE_ALLOWED_ITEMS: return new DRC_ITEM( itemsNotAllowed );
209  case DRCE_CLEARANCE: return new DRC_ITEM( clearance );
210  case DRCE_TRACKS_CROSSING: return new DRC_ITEM( tracksCrossing );
212  case DRCE_ZONES_INTERSECT: return new DRC_ITEM( zonesIntersect );
214  case DRCE_DANGLING_VIA: return new DRC_ITEM( viaDangling );
215  case DRCE_DANGLING_TRACK: return new DRC_ITEM( trackDangling );
217  case DRCE_TRACK_WIDTH: return new DRC_ITEM( trackWidth );
218  case DRCE_TOO_SMALL_VIA: return new DRC_ITEM( viaTooSmall );
219  case DRCE_VIA_ANNULUS: return new DRC_ITEM( viaAnnulus );
220  case DRCE_TOO_SMALL_DRILL: return new DRC_ITEM( drillTooSmall );
222  case DRCE_PADSTACK: return new DRC_ITEM( padstack );
225  case DRCE_KEEPOUT: return new DRC_ITEM( keepout );
232  case DRCE_INVALID_OUTLINE: return new DRC_ITEM( invalidOutline );
235  case DRCE_EXTRA_FOOTPRINT: return new DRC_ITEM( extraFootprint );
237 
238  default:
239  wxFAIL_MSG( "Unknown DRC error code" );
240  return nullptr;
241  }
242 }
static DRC_ITEM keepout
static DRC_ITEM viaAnnulus
via's hole is bigger than its diameter
Too small micro via size.
static DRC_ITEM extraFootprint
Via size and drill leave annulus too small or too large.
a disallowed item has been used
static DRC_ITEM copperEdgeClearance
static DRC_ITEM itemOnDisabledLayer
invalid board outline
more than one footprints found for netlist item
tracks are crossing
footprint not found for netlist item
static DRC_ITEM microviaTooSmall
Too small via size.
static DRC_ITEM missingCourtyard
Too small micro via drill.
items short two nets but are not a net tie
static DRC_ITEM invalidOutline
static DRC_ITEM holeNearHole
static DRC_ITEM clearance
something is wrong with a pad or via stackup
static DRC_ITEM unconnectedItems
overlapping drilled holes break drill bits
static DRC_ITEM missingFootprint
a copper item is too close to the board edge
static DRC_ITEM itemsNotAllowed
footprint has a courtyard but malformed (not convertible to a closed polygon with holes)
static DRC_ITEM microviaDrillTooSmall
Too small via or pad drill.
static DRC_ITEM viaTooSmall
footprint courtyards overlap
copper area outlines intersect
static DRC_ITEM tracksCrossing
netlist item not found for footprint
footprint has no courtyard defined
static DRC_ITEM npthInsideCourtyard
static DRC_ITEM malformedCourtyard
track with at least one end not connected to anything
static DRC_ITEM courtyardsOverlap
static DRC_ITEM shortingItems
items are unconnected
copper area has a net but no pads in nets, which is suspicious
static DRC_ITEM drillTooSmall
static DRC_ITEM duplicateFootprints
via which isn't connected to anything
static DRC_ITEM zoneHasEmptyNet
static DRC_ITEM zonesIntersect
DRC_ITEM(int aErrorCode=0, const wxString &aTitle="", const wxString &aSettingsKey="")
static DRC_ITEM viaDangling
static DRC_ITEM trackWidth
item on a disabled layer
static DRC_ITEM viaHoleLargerThanPad
A disallowed object is inside a keepout.
Track width is too small or too large.
static DRC_ITEM trackDangling
static DRC_ITEM unresolvedVariable
static DRC_ITEM pthInsideCourtyard
items are too close together
static DRC_ITEM padstack

References clearance, copperEdgeClearance, courtyardsOverlap, DRC_ITEM(), DRCE_ALLOWED_ITEMS, DRCE_CLEARANCE, DRCE_COPPER_EDGE_CLEARANCE, DRCE_DANGLING_TRACK, DRCE_DANGLING_VIA, DRCE_DISABLED_LAYER_ITEM, DRCE_DRILLED_HOLES_TOO_CLOSE, DRCE_DUPLICATE_FOOTPRINT, DRCE_EXTRA_FOOTPRINT, DRCE_INVALID_OUTLINE, DRCE_KEEPOUT, DRCE_MALFORMED_COURTYARD, DRCE_MISSING_COURTYARD, DRCE_MISSING_FOOTPRINT, DRCE_NPTH_IN_COURTYARD, DRCE_OVERLAPPING_FOOTPRINTS, DRCE_PADSTACK, DRCE_PTH_IN_COURTYARD, DRCE_SHORTING_ITEMS, DRCE_TOO_SMALL_DRILL, DRCE_TOO_SMALL_MICROVIA, DRCE_TOO_SMALL_MICROVIA_DRILL, DRCE_TOO_SMALL_VIA, DRCE_TRACK_WIDTH, DRCE_TRACKS_CROSSING, DRCE_UNCONNECTED_ITEMS, DRCE_UNRESOLVED_VARIABLE, DRCE_VIA_ANNULUS, DRCE_VIA_HOLE_BIGGER, DRCE_ZONE_HAS_EMPTY_NET, DRCE_ZONES_INTERSECT, drillTooSmall, duplicateFootprints, extraFootprint, holeNearHole, invalidOutline, itemOnDisabledLayer, itemsNotAllowed, keepout, malformedCourtyard, microviaDrillTooSmall, microviaTooSmall, missingCourtyard, missingFootprint, npthInsideCourtyard, padstack, pthInsideCourtyard, shortingItems, trackDangling, tracksCrossing, trackWidth, unconnectedItems, unresolvedVariable, viaAnnulus, viaDangling, viaHoleLargerThanPad, viaTooSmall, zoneHasEmptyNet, and zonesIntersect.

Referenced by DRC_KEEPOUT_TESTER::checkDrawings(), DRC_KEEPOUT_TESTER::checkFootprints(), DRC_DRILLED_HOLE_TESTER::checkHoles(), DRC_DRILLED_HOLE_TESTER::checkMicroVia(), DRC_DRILLED_HOLE_TESTER::checkPad(), DRC_KEEPOUT_TESTER::checkPads(), DRC_KEEPOUT_TESTER::checkTracksAndVias(), DRC_DRILLED_HOLE_TESTER::checkVia(), MARKER_PCB::Deserialize(), DRC::doPadToPadsDrc(), DRC::doTrackDrc(), BOARD_DESIGN_SETTINGS::LoadFromFile(), DRC_COURTYARD_TESTER::RunDRC(), DRC_TEXTVAR_TESTER::RunDRC(), DRC::testCopperDrawItem(), DRC::testDisabledLayers(), TestFootprints(), DRC::testOutline(), DRC::testPadClearances(), DRC::testTracks(), DRC::testUnconnected(), and DRC::testZones().

◆ Create() [2/2]

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 245 of file pcbnew/drc/drc_item.cpp.

246 {
247  for( const RC_ITEM& item : allItemTypes )
248  {
249  if( aErrorKey == item.GetSettingsKey() )
250  return new DRC_ITEM( static_cast<const DRC_ITEM&>( item ) );
251  }
252 
253  // This can happen if a project has old-format exclusions. Just drop these items.
254  return nullptr;
255 }
RC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
Definition: rc_item.h:73
DRC_ITEM(int aErrorCode=0, const wxString &aTitle="", const wxString &aSettingsKey="")
static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
A list of all DRC_ITEM types which are valid error codes.

References allItemTypes, and DRC_ITEM().

◆ GetAuxItem2ID()

KIID RC_ITEM::GetAuxItem2ID ( ) const
inlineinherited

Definition at line 141 of file rc_item.h.

141 { return m_auxItem2Uuid; }
KIID m_auxItem2Uuid
Definition: rc_item.h:83

References RC_ITEM::m_auxItem2Uuid.

Referenced by RC_TREE_MODEL::GetValue(), RC_TREE_MODEL::rebuildModel(), and RC_TREE_MODEL::ToUUID().

◆ GetAuxItem3ID()

KIID RC_ITEM::GetAuxItem3ID ( ) const
inlineinherited

Definition at line 142 of file rc_item.h.

142 { return m_auxItem3Uuid; }
KIID m_auxItem3Uuid
Definition: rc_item.h:84

References RC_ITEM::m_auxItem3Uuid.

Referenced by RC_TREE_MODEL::GetValue(), RC_TREE_MODEL::rebuildModel(), and RC_TREE_MODEL::ToUUID().

◆ GetAuxItemID()

◆ GetErrorCode()

◆ GetErrorMessage()

wxString RC_ITEM::GetErrorMessage ( ) const
virtualinherited

Function GetErrorMessage returns the error message of a RC_ITEM.

Definition at line 36 of file rc_item.cpp.

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

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

Referenced by MARKER_PCB::GetMsgPanelInfo(), SCH_MARKER::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), MARKER_PCB::Matches(), SCH_MARKER::Matches(), test::DRC_ENGINE::Report(), and RC_ITEM::ShowReport().

◆ GetErrorText()

wxString RC_ITEM::GetErrorText ( ) const
inlineinherited

◆ GetItemsWithSeverities()

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

Definition at line 49 of file pcbnew/drc/drc_item.h.

50  {
51  return allItemTypes;
52  }
static std::vector< std::reference_wrapper< RC_ITEM > > allItemTypes
A list of all DRC_ITEM types which are valid error codes.

References allItemTypes.

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

◆ GetMainItemID()

◆ GetParent()

MARKER_BASE* RC_ITEM::GetParent ( void  ) const
inlineinherited

◆ GetSettingsKey()

wxString RC_ITEM::GetSettingsKey ( ) const
inlineinherited

Definition at line 170 of file rc_item.h.

171  {
172  return m_settingsKey;
173  }
wxString m_settingsKey
The key used to describe this type of error in settings.
Definition: rc_item.h:79

References RC_ITEM::m_settingsKey.

Referenced by BOARD_DESIGN_SETTINGS::LoadFromFile(), and MARKER_PCB::Serialize().

◆ SetErrorCode()

void RC_ITEM::SetErrorCode ( int  aCode)
inlineinherited

Definition at line 157 of file rc_item.h.

157 { m_errorCode = aCode; }
int m_errorCode
Definition: rc_item.h:76

References RC_ITEM::m_errorCode.

◆ SetErrorMessage()

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

◆ SetItems() [1/2]

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

Definition at line 115 of file rc_item.h.

117  {
118  m_mainItemUuid = aItem->m_Uuid;
119 
120  if( bItem )
121  m_auxItemUuid = bItem->m_Uuid;
122 
123  if( cItem )
124  m_auxItem2Uuid = cItem->m_Uuid;
125 
126  if( dItem )
127  m_auxItem3Uuid = dItem->m_Uuid;
128  }
KIID m_auxItemUuid
Definition: rc_item.h:82
const KIID m_Uuid
Definition: base_struct.h:162
KIID m_auxItem3Uuid
Definition: rc_item.h:84
KIID m_mainItemUuid
Definition: rc_item.h:81
KIID m_auxItem2Uuid
Definition: rc_item.h:83

References RC_ITEM::m_auxItem2Uuid, RC_ITEM::m_auxItem3Uuid, RC_ITEM::m_auxItemUuid, RC_ITEM::m_mainItemUuid, and EDA_ITEM::m_Uuid.

Referenced by DRC_KEEPOUT_TESTER::checkDrawings(), DRC_KEEPOUT_TESTER::checkFootprints(), DRC_DRILLED_HOLE_TESTER::checkHoles(), DRC_DRILLED_HOLE_TESTER::checkMicroVia(), DRC_DRILLED_HOLE_TESTER::checkPad(), test::DRC_TEST_PROVIDER_HOLE_SIZE::checkPad(), DRC_KEEPOUT_TESTER::checkPads(), DRC_KEEPOUT_TESTER::checkTracksAndVias(), DRC_DRILLED_HOLE_TESTER::checkVia(), test::DRC_TEST_PROVIDER_HOLE_SIZE::checkVia(), GRAPHICS_CLEANER::cleanupSegments(), TRACKS_CLEANER::cleanupSegments(), TRACKS_CLEANER::cleanupVias(), TRACKS_CLEANER::deleteDanglingTracks(), TRACKS_CLEANER::deleteNullSegments(), TRACKS_CLEANER::deleteTracksInPads(), MARKER_PCB::Deserialize(), ERC_TESTER::diagnose(), test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::doPadToPadHoleDrc(), test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::doPadToPadsDrc(), DRC::doPadToPadsDrc(), test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::doTrackDrc(), DRC::doTrackDrc(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckLabels(), CONNECTION_GRAPH::ercCheckNoConnects(), TRACKS_CLEANER::mergeCollinearSegments(), GRAPHICS_CLEANER::mergeRects(), TRACKS_CLEANER::removeBadTrackSegments(), CONNECTION_SUBGRAPH::ResolveDrivers(), DRC_COURTYARD_TESTER::RunDRC(), DRC_TEXTVAR_TESTER::RunDRC(), SimilarLabelsDiagnose(), test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperDrawItem(), DRC::testCopperDrawItem(), DRC::testDisabledLayers(), ERC_TESTER::TestDuplicateSheetNames(), DIALOG_ERC::TestErc(), TestFootprints(), test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::testHoles2Holes(), ERC_TESTER::TestMultiunitFootprints(), ERC_TESTER::TestNoConnectPins(), DRC::testOutline(), DRC::testPadClearances(), ERC_TESTER::TestTextVars(), DRC::testTracks(), DRC::testUnconnected(), test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZones(), and DRC::testZones().

◆ SetItems() [2/2]

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

Definition at line 130 of file rc_item.h.

132  {
133  m_mainItemUuid = aItem;
134  m_auxItemUuid = bItem;
135  m_auxItem2Uuid = cItem;
136  m_auxItem3Uuid = dItem;
137  }
KIID m_auxItemUuid
Definition: rc_item.h:82
KIID m_auxItem3Uuid
Definition: rc_item.h:84
KIID m_mainItemUuid
Definition: rc_item.h:81
KIID m_auxItem2Uuid
Definition: rc_item.h:83

References RC_ITEM::m_auxItem2Uuid, RC_ITEM::m_auxItem3Uuid, RC_ITEM::m_auxItemUuid, and RC_ITEM::m_mainItemUuid.

◆ SetParent()

void RC_ITEM::SetParent ( MARKER_BASE aMarker)
inlineinherited

Definition at line 144 of file rc_item.h.

144 { m_parent = aMarker; }
MARKER_BASE * m_parent
Definition: rc_item.h:80

References RC_ITEM::m_parent.

Referenced by MARKER_PCB::MARKER_PCB(), and SCH_MARKER::SCH_MARKER().

◆ ShowCoord()

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

Function ShowCoord formats a coordinate or position to text.

Definition at line 45 of file rc_item.cpp.

46 {
47  return wxString::Format( "@(%s, %s)",
48  MessageTextFromValue( aUnits, aPos.x ),
49  MessageTextFromValue( aUnits, aPos.y ) );
50 }
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References Format(), MessageTextFromValue(), wxPoint::x, and wxPoint::y.

Referenced by RC_ITEM::ShowReport().

◆ ShowHtml()

wxString DRC_ITEM::ShowHtml ( PCB_BASE_FRAME aFrame) const

Translates this object into a fragment of HTML suitable for the wxHtmlListBox class.

Returns
wxString - the html text.

Definition at line 266 of file pcbnew/drc/drc_item.cpp.

267 {
268  BOARD_ITEM* mainItem = nullptr;
269  BOARD_ITEM* auxItem = nullptr;
270  wxString msg = m_errorMessage.IsEmpty() ? GetErrorText() : m_errorMessage;
271  wxString mainText;
272  wxString auxText;
273 
274  if( m_mainItemUuid != niluuid )
275  mainItem = aFrame->GetBoard()->GetItem( m_mainItemUuid );
276 
277  if( m_auxItemUuid != niluuid )
278  auxItem = aFrame->GetBoard()->GetItem( m_auxItemUuid );
279 
280  if( mainItem )
281  mainText = mainItem->GetSelectMenuText( aFrame->GetUserUnits() );
282 
283  if( auxItem )
284  auxText = auxItem->GetSelectMenuText( aFrame->GetUserUnits() );
285 
286  if( mainItem && auxItem )
287  {
288  // an html fragment for the entire message in the listbox. feel free
289  // to add color if you want:
290  return wxString::Format( wxT( "<b>%s</b><br>&nbsp;&nbsp; %s<br>&nbsp;&nbsp; %s" ),
291  escapeHtml( msg ),
292  escapeHtml( mainText ),
293  escapeHtml( auxText ) );
294  }
295  else if( mainItem )
296  {
297  return wxString::Format( wxT( "<b>%s</b><br>&nbsp;&nbsp; %s" ),
298  escapeHtml( msg ),
299  escapeHtml( mainText ) );
300  }
301  else
302  {
303  return wxString::Format( wxT( "<b>%s</b>" ),
304  escapeHtml( msg ) );
305  }
306 }
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
KIID m_auxItemUuid
Definition: rc_item.h:82
BOARD_ITEM * GetItem(const KIID &aID)
wxString GetErrorText() const
Definition: rc_item.h:165
KIID niluuid(0)
wxString m_errorMessage
A message describing the details of this specific error.
Definition: rc_item.h:77
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
wxString escapeHtml(wxString aString)
KIID m_mainItemUuid
Definition: rc_item.h:81
BOARD * GetBoard() const
EDA_UNITS GetUserUnits() const
Return the user units currently in use.

References escapeHtml(), Format(), PCB_BASE_FRAME::GetBoard(), RC_ITEM::GetErrorText(), BOARD::GetItem(), EDA_ITEM::GetSelectMenuText(), EDA_BASE_FRAME::GetUserUnits(), RC_ITEM::m_auxItemUuid, RC_ITEM::m_errorMessage, RC_ITEM::m_mainItemUuid, and niluuid.

◆ ShowReport()

wxString RC_ITEM::ShowReport ( EDA_UNITS  aUnits,
const std::map< KIID, EDA_ITEM * > &  aItemMap 
) const
virtualinherited

Function ShowReport translates 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 53 of file rc_item.cpp.

54 {
55  EDA_ITEM* mainItem = nullptr;
56  EDA_ITEM* auxItem = nullptr;
57 
58  if( m_mainItemUuid != niluuid )
59  mainItem = aItemMap.at( m_mainItemUuid );
60 
61  if( m_auxItemUuid != niluuid )
62  auxItem = aItemMap.at( m_auxItemUuid );
63 
64  if( mainItem && auxItem )
65  {
66  return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ),
67  GetErrorCode(),
69  ShowCoord( aUnits, mainItem->GetPosition() ),
70  mainItem->GetSelectMenuText( aUnits ),
71  ShowCoord( aUnits, auxItem->GetPosition() ),
72  auxItem->GetSelectMenuText( aUnits ) );
73  }
74  else if( mainItem )
75  {
76  return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n" ),
77  GetErrorCode(),
79  ShowCoord( aUnits, mainItem->GetPosition() ),
80  mainItem->GetSelectMenuText( aUnits ) );
81  }
82  else
83  {
84  return wxString::Format( wxT( "ErrType(%d): %s\n" ),
85  GetErrorCode(),
86  GetErrorMessage() );
87  }
88 }
KIID m_auxItemUuid
Definition: rc_item.h:82
virtual wxPoint GetPosition() const
Definition: base_struct.h:337
static wxString ShowCoord(EDA_UNITS aUnits, const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
Definition: rc_item.cpp:45
KIID niluuid(0)
int GetErrorCode() const
Definition: rc_item.h:156
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
KIID m_mainItemUuid
Definition: rc_item.h:81
virtual wxString GetErrorMessage() const
Function GetErrorMessage returns the error message of a RC_ITEM.
Definition: rc_item.cpp:36

References Format(), RC_ITEM::GetErrorCode(), RC_ITEM::GetErrorMessage(), EDA_ITEM::GetPosition(), EDA_ITEM::GetSelectMenuText(), RC_ITEM::m_auxItemUuid, RC_ITEM::m_mainItemUuid, niluuid, and RC_ITEM::ShowCoord().

Referenced by DIALOG_DRC::writeReport(), and DIALOG_ERC::writeReport().

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 69 of file pcbnew/drc/drc_item.h.

Referenced by Create(), and GetItemsWithSeverities().

◆ clearance

DRC_ITEM DRC_ITEM::clearance
staticprivate

Definition at line 74 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ copperEdgeClearance

DRC_ITEM DRC_ITEM::copperEdgeClearance
staticprivate

Definition at line 76 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ courtyardsOverlap

DRC_ITEM DRC_ITEM::courtyardsOverlap
staticprivate

Definition at line 91 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ drillTooSmall

DRC_ITEM DRC_ITEM::drillTooSmall
staticprivate

Definition at line 85 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ duplicateFootprints

DRC_ITEM DRC_ITEM::duplicateFootprints
staticprivate

Definition at line 98 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ extraFootprint

DRC_ITEM DRC_ITEM::extraFootprint
staticprivate

Definition at line 100 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ holeNearHole

DRC_ITEM DRC_ITEM::holeNearHole
staticprivate

Definition at line 81 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ invalidOutline

DRC_ITEM DRC_ITEM::invalidOutline
staticprivate

Definition at line 97 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ itemOnDisabledLayer

DRC_ITEM DRC_ITEM::itemOnDisabledLayer
staticprivate

Definition at line 96 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ itemsNotAllowed

DRC_ITEM DRC_ITEM::itemsNotAllowed
staticprivate

Definition at line 73 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ keepout

DRC_ITEM DRC_ITEM::keepout
staticprivate

Definition at line 90 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ m_auxItem2Uuid

KIID RC_ITEM::m_auxItem2Uuid
protectedinherited

Definition at line 83 of file rc_item.h.

Referenced by RC_ITEM::GetAuxItem2ID(), RC_ITEM::RC_ITEM(), and RC_ITEM::SetItems().

◆ m_auxItem3Uuid

KIID RC_ITEM::m_auxItem3Uuid
protectedinherited

Definition at line 84 of file rc_item.h.

Referenced by RC_ITEM::GetAuxItem3ID(), RC_ITEM::RC_ITEM(), and RC_ITEM::SetItems().

◆ m_auxItemUuid

KIID RC_ITEM::m_auxItemUuid
protectedinherited

◆ m_errorCode

◆ m_errorMessage

wxString RC_ITEM::m_errorMessage
protectedinherited

A message describing the details of this specific error.

Definition at line 77 of file rc_item.h.

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

◆ m_errorTitle

wxString RC_ITEM::m_errorTitle
protectedinherited

The string describing the type of error.

Definition at line 78 of file rc_item.h.

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

◆ m_mainItemUuid

KIID RC_ITEM::m_mainItemUuid
protectedinherited

◆ m_parent

MARKER_BASE* RC_ITEM::m_parent
protectedinherited

Definition at line 80 of file rc_item.h.

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

◆ m_settingsKey

wxString RC_ITEM::m_settingsKey
protectedinherited

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

Definition at line 79 of file rc_item.h.

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

◆ malformedCourtyard

DRC_ITEM DRC_ITEM::malformedCourtyard
staticprivate

Definition at line 93 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ microviaDrillTooSmall

DRC_ITEM DRC_ITEM::microviaDrillTooSmall
staticprivate

Definition at line 89 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ microviaTooSmall

DRC_ITEM DRC_ITEM::microviaTooSmall
staticprivate

Definition at line 88 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ missingCourtyard

DRC_ITEM DRC_ITEM::missingCourtyard
staticprivate

Definition at line 92 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ missingFootprint

DRC_ITEM DRC_ITEM::missingFootprint
staticprivate

Definition at line 99 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ npthInsideCourtyard

DRC_ITEM DRC_ITEM::npthInsideCourtyard
staticprivate

Definition at line 95 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ padstack

DRC_ITEM DRC_ITEM::padstack
staticprivate

Definition at line 87 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ pthInsideCourtyard

DRC_ITEM DRC_ITEM::pthInsideCourtyard
staticprivate

Definition at line 94 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ shortingItems

DRC_ITEM DRC_ITEM::shortingItems
staticprivate

Definition at line 72 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ trackDangling

DRC_ITEM DRC_ITEM::trackDangling
staticprivate

Definition at line 80 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ tracksCrossing

DRC_ITEM DRC_ITEM::tracksCrossing
staticprivate

Definition at line 75 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ trackWidth

DRC_ITEM DRC_ITEM::trackWidth
staticprivate

Definition at line 82 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ unconnectedItems

DRC_ITEM DRC_ITEM::unconnectedItems
staticprivate

Definition at line 71 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ unresolvedVariable

DRC_ITEM DRC_ITEM::unresolvedVariable
staticprivate

Definition at line 101 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ viaAnnulus

DRC_ITEM DRC_ITEM::viaAnnulus
staticprivate

Definition at line 84 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ viaDangling

DRC_ITEM DRC_ITEM::viaDangling
staticprivate

Definition at line 79 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ viaHoleLargerThanPad

DRC_ITEM DRC_ITEM::viaHoleLargerThanPad
staticprivate

Definition at line 86 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ viaTooSmall

DRC_ITEM DRC_ITEM::viaTooSmall
staticprivate

Definition at line 83 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ zoneHasEmptyNet

DRC_ITEM DRC_ITEM::zoneHasEmptyNet
staticprivate

Definition at line 78 of file pcbnew/drc/drc_item.h.

Referenced by Create().

◆ zonesIntersect

DRC_ITEM DRC_ITEM::zonesIntersect
staticprivate

Definition at line 77 of file pcbnew/drc/drc_item.h.

Referenced by Create().


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