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 <class_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...
 
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
 

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 43 of file class_drc_item.h.

Constructor & Destructor Documentation

DRC_ITEM::DRC_ITEM ( )
inline

Definition at line 56 of file class_drc_item.h.

57  {
58  m_ErrorCode = 0;
59  m_hasSecondItem = false;
60  m_noCoordinate = false;
61  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
bool m_noCoordinate
int m_ErrorCode
the error code's numeric value
DRC_ITEM::DRC_ITEM ( int  aErrorCode,
const wxString &  aMainText,
const wxString &  bAuxiliaryText,
const wxPoint aMainPos,
const wxPoint bAuxiliaryPos 
)
inline

Definition at line 63 of file class_drc_item.h.

References SetData().

66  {
67  SetData( aErrorCode,
68  aMainText, bAuxiliaryText,
69  aMainPos, bAuxiliaryPos );
70  }
void SetData(int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos)
Function SetData initialize all data in item.
DRC_ITEM::DRC_ITEM ( int  aErrorCode,
const wxString &  aText,
const wxPoint aPos 
)
inline

Definition at line 72 of file class_drc_item.h.

References SetData().

74  {
75  SetData( aErrorCode, aText, aPos );
76  }
void SetData(int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos)
Function SetData initialize all data in item.

Member Function Documentation

wxString DRC_ITEM::GetAuxiliaryText ( ) const
inline

Definition at line 138 of file class_drc_item.h.

References m_AuxiliaryText.

Referenced by SCH_MARKER::Matches().

138 { return m_AuxiliaryText; }
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
int DRC_ITEM::GetErrorCode ( ) const
inline

Function GetErrorCode returns the error code.

Definition at line 229 of file class_drc_item.h.

References m_ErrorCode.

Referenced by MARKER_PCB::GetMsgPanelInfo().

230  {
231  return m_ErrorCode;
232  }
int m_ErrorCode
the error code's numeric value
wxString DRC_ITEM::GetErrorText ( ) const

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

Definition at line 38 of file class_drc_item.cpp.

References COPPERAREA_CLOSE_TO_COPPERAREA, COPPERAREA_INSIDE_COPPERAREA, 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_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_PADS, 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 MARKER_PCB::GetMsgPanelInfo(), SCH_MARKER::Matches(), ShowHtml(), and ShowReport().

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

acces to A and B texts

Definition at line 137 of file class_drc_item.h.

References m_MainText.

Referenced by SCH_MARKER::Matches().

137 { return m_MainText; }
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
const wxPoint& DRC_ITEM::GetPointA ( ) const
inline

Definition at line 252 of file class_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().

253  {
254  return m_MainPosition;
255  }
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
const wxPoint& DRC_ITEM::GetPointB ( ) const
inline

Definition at line 258 of file class_drc_item.h.

References m_AuxiliaryPosition.

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

259  {
260  return m_AuxiliaryPosition;
261  }
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
const wxString& DRC_ITEM::GetTextA ( ) const
inline

Definition at line 240 of file class_drc_item.h.

References m_MainText.

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

241  {
242  return m_MainText;
243  }
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
const wxString& DRC_ITEM::GetTextB ( ) const
inline

Definition at line 246 of file class_drc_item.h.

References m_AuxiliaryText.

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

247  {
248  return m_AuxiliaryText;
249  }
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
bool DRC_ITEM::HasSecondItem ( ) const
inline

Definition at line 131 of file class_drc_item.h.

References m_hasSecondItem.

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

131 { return m_hasSecondItem; }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
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 123 of file class_drc_item.h.

Referenced by MARKER_BASE::SetAuxiliaryData().

124  {
125  m_AuxiliaryText = aAuxiliaryText;
126  m_AuxiliaryPosition = aAuxiliaryPos;
127  m_hasSecondItem = true;
128  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
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 86 of file class_drc_item.h.

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

88  {
89  SetData( aErrorCode,
90  aMainText, aMainText,
91  aMainPos, aMainPos );
92  m_hasSecondItem = false;
93  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
void SetData(int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos)
Function SetData initialize all data in item.
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 104 of file class_drc_item.h.

107  {
108  m_ErrorCode = aErrorCode;
109  m_MainText = aMainText;
110  m_AuxiliaryText = bAuxiliaryText;
111  m_MainPosition = aMainPos;
112  m_AuxiliaryPosition = bAuxiliaryPos;
113  m_hasSecondItem = true;
114  m_noCoordinate = false;
115  }
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
bool m_noCoordinate
wxString m_AuxiliaryText
text for the second BOARD_ITEM or SCH_ITEM
int m_ErrorCode
the error code's numeric value
void DRC_ITEM::SetShowNoCoordinate ( )
inline

Definition at line 133 of file class_drc_item.h.

Referenced by MARKER_BASE::SetShowNoCoordinate().

133 { m_noCoordinate = true; }
bool m_noCoordinate
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 144 of file class_drc_item.cpp.

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

145 {
146  wxString ret;
147 
148  ret << aPos;
149  return ret;
150 }
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 147 of file class_drc_item.h.

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

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

148  {
149  wxString ret;
150  wxString mainText = m_MainText;
151  // a wxHtmlWindows does not like < and > in the text to display
152  // because these chars have a special meaning in html
153  mainText.Replace( wxT("<"), wxT("&lt;") );
154  mainText.Replace( wxT(">"), wxT("&gt;") );
155 
156  wxString errText = GetErrorText();
157  errText.Replace( wxT("<"), wxT("&lt;") );
158  errText.Replace( wxT(">"), wxT("&gt;") );
159 
160 
161  if( m_noCoordinate )
162  {
163  // omit the coordinate, a NETCLASS has no location
164  ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s </li></ul>" ),
165  m_ErrorCode,
166  GetChars( errText ),
167  GetChars( mainText ) );
168  }
169  else if( m_hasSecondItem )
170  {
171  wxString auxText = m_AuxiliaryText;
172  auxText.Replace( wxT("<"), wxT("&lt;") );
173  auxText.Replace( wxT(">"), wxT("&gt;") );
174 
175  // an html fragment for the entire message in the listbox. feel free
176  // to add color if you want:
177  ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>" ),
178  m_ErrorCode,
179  GetChars( errText ),
180  GetChars( ShowCoord( m_MainPosition )), GetChars( mainText ),
181  GetChars( ShowCoord( m_AuxiliaryPosition )), GetChars( auxText ) );
182  }
183  else
184  {
185  ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>" ),
186  m_ErrorCode,
187  GetChars( errText ),
188  GetChars( ShowCoord( m_MainPosition ) ), GetChars( mainText ) );
189  }
190 
191  return ret;
192  }
wxString GetErrorText() const
Function GetErrorText returns the string form of a drc error code.
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
bool m_noCoordinate
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
static wxString ShowCoord(const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
int m_ErrorCode
the error code's numeric value
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 201 of file class_drc_item.h.

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

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

202  {
203  wxString ret;
204 
205  if( m_hasSecondItem )
206  {
207  ret.Printf( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ),
208  m_ErrorCode,
209  GetChars( GetErrorText() ),
212  }
213  else
214  {
215  ret.Printf( wxT( "ErrType(%d): %s\n %s: %s\n" ),
216  m_ErrorCode,
217  GetChars( GetErrorText() ),
219  }
220 
221  return ret;
222  }
wxString GetErrorText() const
Function GetErrorText returns the string form of a drc error code.
bool m_hasSecondItem
true when 2 items create a DRC/ERC error, false if only one item
wxPoint m_MainPosition
the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker ...
wxPoint m_AuxiliaryPosition
the location of the second BOARD_ITEM or SCH_ITEM
wxString m_MainText
text for the first BOARD_ITEM or SCH_ITEM
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
static wxString ShowCoord(const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
int m_ErrorCode
the error code's numeric value

Member Data Documentation

wxPoint DRC_ITEM::m_AuxiliaryPosition
protected

the location of the second BOARD_ITEM or SCH_ITEM

Definition at line 50 of file class_drc_item.h.

Referenced by GetPointB().

wxString DRC_ITEM::m_AuxiliaryText
protected

text for the second BOARD_ITEM or SCH_ITEM

Definition at line 48 of file class_drc_item.h.

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

int DRC_ITEM::m_ErrorCode
protected

the error code's numeric value

Definition at line 46 of file class_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 51 of file class_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 49 of file class_drc_item.h.

Referenced by GetPointA().

wxString DRC_ITEM::m_MainText
protected

text for the first BOARD_ITEM or SCH_ITEM

Definition at line 47 of file class_drc_item.h.

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

bool DRC_ITEM::m_noCoordinate
protected

Definition at line 52 of file class_drc_item.h.


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