KiCad PCB EDA Suite
DRC_ITEM Class Reference

Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. More...

#include <drc_item.h>

Public Member Functions

 DRC_ITEM ()
 
 DRC_ITEM (int aErrorCode, const wxString &aMainText, const wxString &bAuxiliaryText, const wxPoint &aMainPos, const wxPoint &bAuxiliaryPos)
 
 DRC_ITEM (int aErrorCode, const wxString &aText, const wxPoint &aPos)
 
void SetData (int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos)
 Function SetData initialize all data in item. More...
 
void SetData (int aErrorCode, const wxString &aMainText, const wxString &bAuxiliaryText, const wxPoint &aMainPos, const wxPoint &bAuxiliaryPos)
 Function SetData initialize all data in item. More...
 
void SetAuxiliaryData (const wxString &aAuxiliaryText, const wxPoint &aAuxiliaryPos)
 Function SetAuxiliaryData initialize data for the second (auxiliary) item. More...
 
void SetParent (MARKER_BASE *aMarker)
 
MARKER_BASEGetParent () const
 
bool HasSecondItem () const
 
void SetShowNoCoordinate ()
 
wxString GetMainText () const
 acces to A and B texts More...
 
wxString GetAuxiliaryText () const
 
wxString ShowHtml () const
 Function ShowHtml translates this object into a fragment of HTML suitable for the wxWidget's wxHtmlListBox class. More...
 
wxString ShowReport () const
 Function ShowReport translates this object into a text string suitable for saving to disk in a report. More...
 
int GetErrorCode () const
 Function GetErrorCode returns the error code. More...
 
wxString GetErrorText () const
 Function GetErrorText returns the string form of a drc error code. More...
 
const wxString & GetTextA () const
 
const wxString & GetTextB () const
 
const wxPointGetPointA () const
 
const wxPointGetPointB () const
 

Static Public Member Functions

static wxString ShowCoord (const wxPoint &aPos)
 Function ShowCoord formats a coordinate or position to text. More...
 

Protected Attributes

int m_ErrorCode
 the error code's numeric value More...
 
wxString m_MainText
 text for the first BOARD_ITEM or SCH_ITEM More...
 
wxString m_AuxiliaryText
 text for the second BOARD_ITEM or SCH_ITEM More...
 
wxPoint m_MainPosition
 the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker More...
 
wxPoint m_AuxiliaryPosition
 the location of the second BOARD_ITEM or SCH_ITEM More...
 
bool m_hasSecondItem
 true when 2 items create a DRC/ERC error, false if only one item More...
 
bool m_noCoordinate
 
MARKER_BASEm_parent
 The marker this item belongs to, if any. More...
 

Detailed Description

Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.

It is generated when two objects are too close (DRC) or two connected objects (pins) have incompatible electrical types (ERC). There are holders for information on two items. The information held is the board coordinate and the MenuText for each item. Also held is the type of error by number and the location of the MARKER. A function is provided to translate that number into text. Some errors involve only one item (item with an incorrect param) so m_hasSecondItem is set to false in this case.

Definition at line 45 of file drc_item.h.

Constructor & Destructor Documentation

DRC_ITEM::DRC_ITEM ( )
inline

Definition at line 61 of file drc_item.h.

62  {
63  m_ErrorCode = 0;
64  m_hasSecondItem = false;
65  m_noCoordinate = false;
66  m_parent = nullptr;
67  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
Definition: drc_item.h:53
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: drc_item.h:57
bool m_noCoordinate
Definition: drc_item.h:54
int m_ErrorCode
the error code&#39;s numeric value
Definition: drc_item.h:48
DRC_ITEM::DRC_ITEM ( int  aErrorCode,
const wxString &  aMainText,
const wxString &  bAuxiliaryText,
const wxPoint aMainPos,
const wxPoint bAuxiliaryPos 
)
inline

Definition at line 69 of file drc_item.h.

References SetData().

72  {
73  SetData( aErrorCode,
74  aMainText, bAuxiliaryText,
75  aMainPos, bAuxiliaryPos );
76  }
void SetData(int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos)
Function SetData initialize all data in item.
Definition: drc_item.h:92
DRC_ITEM::DRC_ITEM ( int  aErrorCode,
const wxString &  aText,
const wxPoint aPos 
)
inline

Definition at line 78 of file drc_item.h.

References SetData().

80  {
81  SetData( aErrorCode, aText, aPos );
82  }
void SetData(int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos)
Function SetData initialize all data in item.
Definition: drc_item.h:92

Member Function Documentation

wxString DRC_ITEM::GetAuxiliaryText ( ) const
inline

Definition at line 147 of file drc_item.h.

References m_AuxiliaryText.

Referenced by SCH_MARKER::Matches().

147 { return m_AuxiliaryText; }
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:50
int DRC_ITEM::GetErrorCode ( ) const
inline

Function GetErrorCode returns the error code.

Definition at line 238 of file drc_item.h.

References GetErrorText(), and m_ErrorCode.

Referenced by MARKER_PCB::GetMsgPanelInfo().

239  {
240  return m_ErrorCode;
241  }
int m_ErrorCode
the error code&#39;s numeric value
Definition: drc_item.h:48
wxString DRC_ITEM::GetErrorText ( ) const

Function GetErrorText returns the string form of a drc error code.

Definition at line 38 of file drc_item.cpp.

References COPPERAREA_CLOSE_TO_COPPERAREA, COPPERAREA_INSIDE_COPPERAREA, DRCE_BURIED_VIA_NOT_ALLOWED, DRCE_ENDS_PROBLEM1, DRCE_ENDS_PROBLEM2, DRCE_ENDS_PROBLEM3, DRCE_ENDS_PROBLEM4, DRCE_ENDS_PROBLEM5, DRCE_HOLE_NEAR_PAD, DRCE_HOLE_NEAR_TRACK, DRCE_MALFORMED_COURTYARD_IN_FOOTPRINT, DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR, DRCE_MICRO_VIA_NOT_ALLOWED, DRCE_MISSING_COURTYARD_IN_FOOTPRINT, DRCE_NETCLASS_CLEARANCE, DRCE_NETCLASS_TRACKWIDTH, DRCE_NETCLASS_uVIADRILLSIZE, DRCE_NETCLASS_uVIASIZE, DRCE_NETCLASS_VIADRILLSIZE, DRCE_NETCLASS_VIASIZE, DRCE_OVERLAPPING_FOOTPRINTS, DRCE_PAD_INSIDE_KEEPOUT, DRCE_PAD_INSIDE_TEXT, DRCE_PAD_NEAR_PAD1, DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE, DRCE_TOO_SMALL_MICROVIA, DRCE_TOO_SMALL_MICROVIA_DRILL, DRCE_TOO_SMALL_TRACK_WIDTH, DRCE_TOO_SMALL_VIA, DRCE_TOO_SMALL_VIA_DRILL, DRCE_TRACK_ENDS1, DRCE_TRACK_ENDS2, DRCE_TRACK_ENDS3, DRCE_TRACK_ENDS4, DRCE_TRACK_INSIDE_KEEPOUT, DRCE_TRACK_INSIDE_TEXT, DRCE_TRACK_NEAR_PAD, DRCE_TRACK_NEAR_THROUGH_HOLE, DRCE_TRACK_NEAR_VIA, DRCE_TRACK_SEGMENTS_TOO_CLOSE, DRCE_TRACKS_CROSSING, DRCE_UNCONNECTED_ITEMS, DRCE_VIA_HOLE_BIGGER, DRCE_VIA_INSIDE_KEEPOUT, DRCE_VIA_INSIDE_TEXT, DRCE_VIA_NEAR_TRACK, DRCE_VIA_NEAR_VIA, Format(), and m_ErrorCode.

Referenced by GetErrorCode(), MARKER_PCB::GetMsgPanelInfo(), SCH_MARKER::Matches(), ShowHtml(), and ShowReport().

39 {
40  switch( m_ErrorCode )
41  {
43  return wxString( _( "Unconnected items" ) );
45  return wxString( _( "Track near thru-hole" ) );
47  return wxString( _( "Track near pad" ) );
49  return wxString( _( "Track near via" ) );
50  case DRCE_VIA_NEAR_VIA:
51  return wxString( _( "Via near via" ) );
53  return wxString( _( "Via near track" ) );
54  case DRCE_TRACK_ENDS1:
55  case DRCE_TRACK_ENDS2:
56  case DRCE_TRACK_ENDS3:
57  case DRCE_TRACK_ENDS4:
58  case DRCE_ENDS_PROBLEM1:
59  case DRCE_ENDS_PROBLEM2:
60  case DRCE_ENDS_PROBLEM3:
61  case DRCE_ENDS_PROBLEM4:
62  case DRCE_ENDS_PROBLEM5:
63  return wxString( _( "Two track ends too close" ) );
65  return wxString( _( "Two parallel track segments too close" ) );
67  return wxString( _( "Tracks crossing" ) );
68  case DRCE_PAD_NEAR_PAD1:
69  return wxString( _( "Pad near pad" ) );
71  return wxString( _( "Via hole > diameter" ) );
73  return wxString( _( "Micro Via: incorrect layer pairs (not adjacent)" ) );
75  return wxString( _( "Micro Via: not allowed" ) );
77  return wxString( _( "Buried Via: not allowed" ) );
79  return wxString( _( "Copper area inside copper area" ) );
81  return wxString( _( "Copper areas intersect or are too close" ) );
82 
84  return wxString( _( "Copper area belongs a net which has no pads. This is strange" ) );
85 
86  case DRCE_HOLE_NEAR_PAD:
87  return wxString( _( "Hole near pad" ) );
89  return wxString( _( "Hole near track" ) );
91  return wxString( _( "Too small track width" ) );
92  case DRCE_TOO_SMALL_VIA:
93  return wxString( _( "Too small via size" ) );
95  return wxString( _( "Too small micro via size" ) );
97  return wxString( _( "Too small via drill" ) );
99  return wxString( _( "Too small micro via drill" ) );
100 
101  // use &lt; since this is text ultimately embedded in HTML
103  return wxString( _( "NetClass Track Width &lt; global limit" ) );
105  return wxString( _( "NetClass Clearance &lt; global limit" ) );
107  return wxString( _( "NetClass Via Dia &lt; global limit" ) );
109  return wxString( _( "NetClass Via Drill &lt; global limit" ) );
111  return wxString( _( "NetClass uVia Dia &lt; global limit" ) );
113  return wxString( _( "NetClass uVia Drill &lt; global limit" ) );
114 
116  return wxString( _( "Via inside a keepout area" ) );
117 
119  return wxString( _( "Track inside a keepout area" ) );
120 
122  return wxString( _( "Pad inside a keepout area" ) );
123 
125  return wxString( _( "Via inside a text" ) );
126 
128  return wxString( _( "Track inside a text" ) );
129 
131  return wxString( _( "Pad inside a text" ) );
132 
134  return wxString( _( "Courtyards overlap" ) );
135 
137  return wxString( _( "Footprint has no courtyard defined" ) );
138 
140  return wxString( _( "Footprint has incorrect courtyard (not a closed shape)" ) );
141 
142  default:
143  return wxString::Format( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
144  }
145 }
#define DRCE_TOO_SMALL_MICROVIA_DRILL
Too small micro via drill.
Definition: drc.h:74
#define DRCE_TRACK_INSIDE_TEXT
Track in inside a text area.
Definition: drc.h:85
#define DRCE_TOO_SMALL_VIA
Too small via size.
Definition: drc.h:71
#define DRCE_PAD_NEAR_PAD1
pad too close to pad
Definition: drc.h:62
#define DRCE_NETCLASS_TRACKWIDTH
netclass has TrackWidth < board.m_designSettings->m_TrackMinWidth
Definition: drc.h:75
#define DRCE_HOLE_NEAR_PAD
hole too close to pad
Definition: drc.h:68
#define DRCE_TRACK_ENDS4
2 parallel track segments too close: fine end point test
Definition: drc.h:54
#define DRCE_VIA_INSIDE_KEEPOUT
Via in inside a keepout area.
Definition: drc.h:81
#define DRCE_TRACK_NEAR_PAD
pad too close to track
Definition: drc.h:47
#define COPPERAREA_INSIDE_COPPERAREA
copper area outlines intersect
Definition: drc.h:65
#define DRCE_NETCLASS_CLEARANCE
netclass has Clearance < board.m_designSettings->m_TrackClearance
Definition: drc.h:76
#define DRCE_UNCONNECTED_ITEMS
items are unconnected
Definition: drc.h:45
#define DRCE_TRACK_ENDS2
2 parallel track segments too close: fine start point test
Definition: drc.h:52
#define DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE
copper area has a net but no pads in nets, which is suspicious
Definition: drc.h:67
#define DRCE_MALFORMED_COURTYARD_IN_FOOTPRINT
footprint has a courtyard but malformed
Definition: drc.h:89
#define DRCE_TRACK_SEGMENTS_TOO_CLOSE
2 parallel track segments too close: segm ends between segref ends
Definition: drc.h:55
#define DRCE_MISSING_COURTYARD_IN_FOOTPRINT
footprint has no courtyard defined
Definition: drc.h:88
#define DRCE_BURIED_VIA_NOT_ALLOWED
buried vias are not allowed
Definition: drc.h:92
#define DRCE_TRACK_NEAR_VIA
track too close to via
Definition: drc.h:48
#define DRCE_TOO_SMALL_MICROVIA
Too small micro via size.
Definition: drc.h:72
#define DRCE_PAD_INSIDE_KEEPOUT
Pad in inside a keepout area.
Definition: drc.h:83
#define DRCE_VIA_HOLE_BIGGER
via&#39;s hole is bigger than its diameter
Definition: drc.h:63
#define COPPERAREA_CLOSE_TO_COPPERAREA
copper area outlines are too close
Definition: drc.h:66
#define DRCE_NETCLASS_uVIADRILLSIZE
netclass has ViaSize < board.m_designSettings->m_MicroViasMinDrill
Definition: drc.h:80
#define DRCE_NETCLASS_VIASIZE
netclass has ViaSize < board.m_designSettings->m_ViasMinSize
Definition: drc.h:77
#define DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR
micro via&#39;s layer pair incorrect (layers must be adjacent)
Definition: drc.h:64
#define DRCE_TRACK_ENDS1
2 parallel track segments too close: fine start point test
Definition: drc.h:51
#define DRCE_TRACK_ENDS3
2 parallel track segments too close: fine end point test
Definition: drc.h:53
#define DRCE_ENDS_PROBLEM2
track ends are too close
Definition: drc.h:58
#define DRCE_ENDS_PROBLEM3
track ends are too close
Definition: drc.h:59
#define DRCE_OVERLAPPING_FOOTPRINTS
footprint courtyards overlap
Definition: drc.h:87
#define DRCE_NETCLASS_VIADRILLSIZE
netclass has ViaDrillSize < board.m_designSettings->m_ViasMinDrill
Definition: drc.h:78
#define DRCE_VIA_INSIDE_TEXT
Via in inside a text area.
Definition: drc.h:84
#define DRCE_HOLE_NEAR_TRACK
hole too close to track
Definition: drc.h:69
#define DRCE_PAD_INSIDE_TEXT
Pad in inside a text area.
Definition: drc.h:86
#define DRCE_ENDS_PROBLEM4
track ends are too close
Definition: drc.h:60
#define DRCE_VIA_NEAR_VIA
via too close to via
Definition: drc.h:49
#define DRCE_TRACKS_CROSSING
tracks are crossing
Definition: drc.h:56
#define DRCE_ENDS_PROBLEM5
track ends are too close
Definition: drc.h:61
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
#define DRCE_TRACK_INSIDE_KEEPOUT
Track in inside a keepout area.
Definition: drc.h:82
#define DRCE_VIA_NEAR_TRACK
via too close to track
Definition: drc.h:50
#define DRCE_MICRO_VIA_NOT_ALLOWED
micro vias are not allowed
Definition: drc.h:91
#define DRCE_ENDS_PROBLEM1
track ends are too close
Definition: drc.h:57
#define DRCE_NETCLASS_uVIASIZE
netclass has ViaSize < board.m_designSettings->m_MicroViasMinSize
Definition: drc.h:79
#define DRCE_TOO_SMALL_VIA_DRILL
Too small via drill.
Definition: drc.h:73
int m_ErrorCode
the error code&#39;s numeric value
Definition: drc_item.h:48
#define DRCE_TRACK_NEAR_THROUGH_HOLE
thru hole is too close to track
Definition: drc.h:46
#define DRCE_TOO_SMALL_TRACK_WIDTH
Too small track width.
Definition: drc.h:70
wxString DRC_ITEM::GetMainText ( ) const
inline

acces to A and B texts

Definition at line 146 of file drc_item.h.

References m_MainText.

Referenced by SCH_MARKER::Matches().

146 { return m_MainText; }
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:49
MARKER_BASE* DRC_ITEM::GetParent ( void  ) const
inline

Definition at line 138 of file drc_item.h.

References m_parent.

Referenced by DIALOG_DRC_CONTROL::OnLeftDClickClearance(), and DIALOG_DRC_CONTROL::OnMarkerSelectionEvent().

138 { return m_parent; }
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: drc_item.h:57
const wxPoint& DRC_ITEM::GetPointA ( ) const
inline

Definition at line 261 of file drc_item.h.

References m_MainPosition.

Referenced by MARKER_PCB::GetMsgPanelInfo(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), DIALOG_DRC_CONTROL::OnMarkerSelectionEvent(), DIALOG_DRC_CONTROL::OnPopupMenu(), and DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent().

262  {
263  return m_MainPosition;
264  }
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
Definition: drc_item.h:51
const wxPoint& DRC_ITEM::GetPointB ( ) const
inline

Definition at line 267 of file drc_item.h.

References m_AuxiliaryPosition, and ShowCoord().

Referenced by MARKER_PCB::GetMsgPanelInfo(), and DIALOG_DRC_CONTROL::OnPopupMenu().

268  {
269  return m_AuxiliaryPosition;
270  }
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:52
const wxString& DRC_ITEM::GetTextA ( ) const
inline

Definition at line 249 of file drc_item.h.

References m_MainText.

Referenced by MARKER_PCB::GetMsgPanelInfo(), DIALOG_DRC_CONTROL::OnRightUpClearance(), and DIALOG_DRC_CONTROL::OnRightUpUnconnected().

250  {
251  return m_MainText;
252  }
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:49
const wxString& DRC_ITEM::GetTextB ( ) const
inline

Definition at line 255 of file drc_item.h.

References m_AuxiliaryText.

Referenced by MARKER_PCB::GetMsgPanelInfo(), DIALOG_DRC_CONTROL::OnRightUpClearance(), and DIALOG_DRC_CONTROL::OnRightUpUnconnected().

256  {
257  return m_AuxiliaryText;
258  }
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:50
bool DRC_ITEM::HasSecondItem ( ) const
inline

Definition at line 140 of file drc_item.h.

References m_hasSecondItem.

Referenced by MARKER_PCB::GetMsgPanelInfo(), DIALOG_DRC_CONTROL::OnRightUpClearance(), and DIALOG_DRC_CONTROL::OnRightUpUnconnected().

140 { return m_hasSecondItem; }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
Definition: drc_item.h:53
void DRC_ITEM::SetAuxiliaryData ( const wxString &  aAuxiliaryText,
const wxPoint aAuxiliaryPos 
)
inline

Function SetAuxiliaryData initialize data for the second (auxiliary) item.

Parameters
aAuxiliaryText= the second text (main text) concerning the second schematic or board item
aAuxiliaryPos= position the second item

Definition at line 129 of file drc_item.h.

Referenced by MARKER_BASE::SetAuxiliaryData().

130  {
131  m_AuxiliaryText = aAuxiliaryText;
132  m_AuxiliaryPosition = aAuxiliaryPos;
133  m_hasSecondItem = true;
134  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
Definition: drc_item.h:53
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:52
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:50
void DRC_ITEM::SetData ( int  aErrorCode,
const wxString &  aMainText,
const wxPoint aMainPos 
)
inline

Function SetData initialize all data in item.

Parameters
aErrorCode= error code
aMainText= the text concerning the schematic or board item
aMainPos= position the item and therefore of this issue

Definition at line 92 of file drc_item.h.

Referenced by DRC_ITEM(), and MARKER_BASE::SetData().

94  {
95  SetData( aErrorCode,
96  aMainText, aMainText,
97  aMainPos, aMainPos );
98  m_hasSecondItem = false;
99  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
Definition: drc_item.h:53
void SetData(int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos)
Function SetData initialize all data in item.
Definition: drc_item.h:92
void DRC_ITEM::SetData ( int  aErrorCode,
const wxString &  aMainText,
const wxString &  bAuxiliaryText,
const wxPoint aMainPos,
const wxPoint bAuxiliaryPos 
)
inline

Function SetData initialize all data in item.

Parameters
aErrorCode= error code
aMainText= the first text (main text) concerning the main schematic or board item
bAuxiliaryText= the second text (main text) concerning the second schematic or board item
aMainPos= position the first item and therefore of this issue
bAuxiliaryPos= position the second item

Definition at line 110 of file drc_item.h.

113  {
114  m_ErrorCode = aErrorCode;
115  m_MainText = aMainText;
116  m_AuxiliaryText = bAuxiliaryText;
117  m_MainPosition = aMainPos;
118  m_AuxiliaryPosition = bAuxiliaryPos;
119  m_hasSecondItem = true;
120  m_noCoordinate = false;
121  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
Definition: drc_item.h:53
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
Definition: drc_item.h:51
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:52
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:49
bool m_noCoordinate
Definition: drc_item.h:54
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:50
int m_ErrorCode
the error code&#39;s numeric value
Definition: drc_item.h:48
void DRC_ITEM::SetParent ( MARKER_BASE aMarker)
inline

Definition at line 136 of file drc_item.h.

Referenced by MARKER_BASE::SetData().

136 { m_parent = aMarker; }
MARKER_BASE * m_parent
The marker this item belongs to, if any.
Definition: drc_item.h:57
void DRC_ITEM::SetShowNoCoordinate ( )
inline

Definition at line 142 of file drc_item.h.

Referenced by MARKER_BASE::SetShowNoCoordinate().

142 { m_noCoordinate = true; }
bool m_noCoordinate
Definition: drc_item.h:54
wxString DRC_ITEM::ShowCoord ( const wxPoint aPos)
static

Function ShowCoord formats a coordinate or position to text.

Parameters
aPosThe position to format
Returns
wxString - The formated string

Definition at line 148 of file drc_item.cpp.

Referenced by MARKER_PCB::GetMsgPanelInfo(), GetPointB(), ShowHtml(), and ShowReport().

149 {
150  wxString ret;
151 
152  ret << aPos;
153  return ret;
154 }
wxString DRC_ITEM::ShowHtml ( ) const
inline

Function ShowHtml translates this object into a fragment of HTML suitable for the wxWidget's wxHtmlListBox class.

Returns
wxString - the html text.

Definition at line 156 of file drc_item.h.

References GetChars(), GetErrorText(), m_AuxiliaryText, m_MainText, and ShowCoord().

Referenced by MARKER_BASE::DisplayMarkerInfo(), and DRCLISTBOX::OnGetItem().

157  {
158  wxString ret;
159  wxString mainText = m_MainText;
160  // a wxHtmlWindows does not like < and > in the text to display
161  // because these chars have a special meaning in html
162  mainText.Replace( wxT("<"), wxT("&lt;") );
163  mainText.Replace( wxT(">"), wxT("&gt;") );
164 
165  wxString errText = GetErrorText();
166  errText.Replace( wxT("<"), wxT("&lt;") );
167  errText.Replace( wxT(">"), wxT("&gt;") );
168 
169 
170  if( m_noCoordinate )
171  {
172  // omit the coordinate, a NETCLASS has no location
173  ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s </li></ul>" ),
174  m_ErrorCode,
175  GetChars( errText ),
176  GetChars( mainText ) );
177  }
178  else if( m_hasSecondItem )
179  {
180  wxString auxText = m_AuxiliaryText;
181  auxText.Replace( wxT("<"), wxT("&lt;") );
182  auxText.Replace( wxT(">"), wxT("&gt;") );
183 
184  // an html fragment for the entire message in the listbox. feel free
185  // to add color if you want:
186  ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>" ),
187  m_ErrorCode,
188  GetChars( errText ),
189  GetChars( ShowCoord( m_MainPosition )), GetChars( mainText ),
190  GetChars( ShowCoord( m_AuxiliaryPosition )), GetChars( auxText ) );
191  }
192  else
193  {
194  ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>" ),
195  m_ErrorCode,
196  GetChars( errText ),
197  GetChars( ShowCoord( m_MainPosition ) ), GetChars( mainText ) );
198  }
199 
200  return ret;
201  }
wxString GetErrorText() const
Function GetErrorText returns the string form of a drc error code.
Definition: drc_item.cpp:38
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
Definition: drc_item.h:53
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
Definition: drc_item.h:51
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:52
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:49
bool m_noCoordinate
Definition: drc_item.h:54
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:50
static wxString ShowCoord(const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
Definition: drc_item.cpp:148
int m_ErrorCode
the error code&#39;s numeric value
Definition: drc_item.h:48
wxString DRC_ITEM::ShowReport ( ) const
inline

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 210 of file drc_item.h.

References GetChars(), GetErrorText(), and ShowCoord().

Referenced by WriteDiagnosticERC(), and DIALOG_DRC_CONTROL::writeReport().

211  {
212  wxString ret;
213 
214  if( m_hasSecondItem )
215  {
216  ret.Printf( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ),
217  m_ErrorCode,
218  GetChars( GetErrorText() ),
221  }
222  else
223  {
224  ret.Printf( wxT( "ErrType(%d): %s\n %s: %s\n" ),
225  m_ErrorCode,
226  GetChars( GetErrorText() ),
228  }
229 
230  return ret;
231  }
wxString GetErrorText() const
Function GetErrorText returns the string form of a drc error code.
Definition: drc_item.cpp:38
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
Definition: drc_item.h:53
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
Definition: drc_item.h:51
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:52
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:49
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
Definition: drc_item.h:50
static wxString ShowCoord(const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
Definition: drc_item.cpp:148
int m_ErrorCode
the error code&#39;s numeric value
Definition: drc_item.h:48

Member Data Documentation

wxPoint DRC_ITEM::m_AuxiliaryPosition
protected

the location of the second BOARD_ITEM or SCH_ITEM

Definition at line 52 of file drc_item.h.

Referenced by GetPointB().

wxString DRC_ITEM::m_AuxiliaryText
protected

text for the second BOARD_ITEM or SCH_ITEM

Definition at line 50 of file drc_item.h.

Referenced by GetAuxiliaryText(), GetTextB(), and ShowHtml().

int DRC_ITEM::m_ErrorCode
protected

the error code's numeric value

Definition at line 48 of file drc_item.h.

Referenced by GetErrorCode(), and GetErrorText().

bool DRC_ITEM::m_hasSecondItem
protected

true when 2 items create a DRC/ERC error, false if only one item

Definition at line 53 of file drc_item.h.

Referenced by HasSecondItem().

wxPoint DRC_ITEM::m_MainPosition
protected

the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker

Definition at line 51 of file drc_item.h.

Referenced by GetPointA().

wxString DRC_ITEM::m_MainText
protected

text for the first BOARD_ITEM or SCH_ITEM

Definition at line 49 of file drc_item.h.

Referenced by GetMainText(), GetTextA(), and ShowHtml().

bool DRC_ITEM::m_noCoordinate
protected

Definition at line 54 of file drc_item.h.

MARKER_BASE* DRC_ITEM::m_parent
protected

The marker this item belongs to, if any.

Definition at line 57 of file drc_item.h.

Referenced by GetParent().


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