KiCad PCB EDA Suite
DRC_ITEM Class Reference

#include <drc_item.h>

Inheritance diagram for DRC_ITEM:
RC_ITEM

Public Member Functions

wxString GetErrorText () const override
 Function GetErrorText returns the string form of a drc error code. More...
 
wxString ShowHtml (EDA_UNITS aUnits) const
 Function ShowHtml translates this object into a fragment of HTML suitable for the wxHtmlListBox class. More...
 
void SetData (EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, EDA_ITEM *bAuxItem=nullptr)
 Function SetData initialize all data in item. More...
 
void SetData (EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxItem=nullptr, const wxPoint &bAuxPos=wxPoint())
 Function SetData initialize all data in item. More...
 
void SetData (int aErrorCode, const wxString &aMainText, const wxString &bAuxText=wxEmptyString)
 Function SetData initialize all data in item. More...
 
void SetData (int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos, const wxString &bAuxText=wxEmptyString, const wxPoint &bAuxPos=wxPoint())
 Function SetData initialize all data in item. More...
 
void SetData (int aErrorCode, const wxString &aMainText, const KIID &aMainID, const wxString &bAuxText, const KIID &bAuxID)
 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
 
wxString GetMainText () const
 
wxString GetAuxText () const
 
KIID GetMainItemID () const
 
KIID GetAuxItemID () const
 
virtual wxString ShowReport (EDA_UNITS aUnits) const
 Function ShowReport translates this object into a text string suitable for saving to disk in a report. More...
 
int GetErrorCode () const
 

Static Public Member Functions

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_MainText
 
wxString m_AuxText
 
wxPoint m_MainPosition
 
wxPoint m_AuxPosition
 
bool m_hasSecondItem
 
MARKER_BASEm_parent
 
KIID m_mainItemUuid
 
KIID m_auxItemUuid
 

Detailed Description

Definition at line 37 of file drc_item.h.

Member Function Documentation

◆ GetAuxItemID()

KIID RC_ITEM::GetAuxItemID ( ) const
inlineinherited

◆ GetAuxText()

wxString RC_ITEM::GetAuxText ( ) const
inlineinherited

Definition at line 261 of file rc_item.h.

261 { return m_AuxText; }
wxString m_AuxText
Definition: rc_item.h:87

References RC_ITEM::m_AuxText.

Referenced by MARKER_PCB::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), SCH_MARKER::Matches(), and MARKER_PCB::Serialize().

◆ GetErrorCode()

◆ GetErrorText()

wxString DRC_ITEM::GetErrorText ( ) const
overridevirtual

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

Implements RC_ITEM.

Definition at line 35 of file drc_item.cpp.

36 {
37  switch( m_ErrorCode )
38  {
40  return wxString( _( "Unconnected items" ) );
42  return wxString( _( "Track too close to thru-hole" ) );
44  return wxString( _( "Track too close to pad" ) );
46  return wxString( _( "Track too close to via" ) );
47  case DRCE_VIA_NEAR_VIA:
48  return wxString( _( "Via too close to via" ) );
50  return wxString( _( "Via too close to track" ) );
51  case DRCE_TRACK_ENDS:
52  return wxString( _( "Two track ends too close" ) );
54  return wxString( _( "Two parallel track segments too close" ) );
56  return wxString( _( "Tracks crossing" ) );
58  return wxString( _( "Track too close to copper area" ) );
59  case DRCE_PAD_NEAR_PAD1:
60  return wxString( _( "Pad too close to pad" ) );
62  return wxString( _( "Via hole > diameter" ) );
64  return wxString( _( "Micro Via: incorrect layer pairs (not adjacent)" ) );
66  return wxString( _( "Micro Via: not allowed" ) );
68  return wxString( _( "Buried Via: not allowed" ) );
70  return wxString( _( "Item on a disabled layer" ) );
72  return wxString( _( "Copper area inside copper area" ) );
74  return wxString( _( "Copper areas intersect or are too close" ) );
75 
77  return wxString( _( "Copper area belongs to a net which has no pads" ) );
78 
79  case DRCE_HOLE_NEAR_PAD:
80  return wxString( _( "Hole too close to pad" ) );
82  return wxString( _( "Hole too close to track" ) );
84  return wxString( _( "Track width too small" ) );
85  case DRCE_TOO_SMALL_VIA:
86  return wxString( _( "Via size too small" ) );
88  return wxString( _( "Micro via size too small" ) );
90  return wxString( _( "Via drill too small" ) );
92  return wxString( _( "Micro via drill too small" ) );
94  return wxString( _( "Drilled holes too close together" ) );
96  return wxString( _( "Track too close to board edge" ) );
98  return wxString( _( "Board outline does not form a closed polygon" ) );
99 
100  // use &lt; since this is text ultimately embedded in HTML
102  return wxString( _( "NetClass Track Width < global limit" ) );
104  return wxString( _( "NetClass Clearance < global limit" ) );
106  return wxString( _( "NetClass Via Dia < global limit" ) );
108  return wxString( _( "NetClass Via Drill < global limit" ) );
110  return wxString( _( "NetClass uVia Dia < global limit" ) );
112  return wxString( _( "NetClass uVia Drill < global limit" ) );
113 
115  return wxString( _( "Via inside keepout area" ) );
117  return wxString( _( "Track inside keepout area" ) );
119  return wxString( _( "Pad inside keepout area" ) );
120 
122  return wxString( _( "Via too close to copper item" ) );
124  return wxString( _( "Track too close to copper item" ) );
126  return wxString( _( "Pad too close to copper item" ) );
127 
129  return wxString( _( "Courtyards overlap" ) );
130 
132  return wxString( _( "Footprint has no courtyard defined" ) );
133 
135  return wxString( _( "Footprint has incorrect courtyard (not a closed shape)" ) );
136 
138  return wxString( _( "Duplicate footprints" ) );
140  return wxString( _( "Missing footprint" ) );
142  return wxString( _( "Extra footprint" ) );
143 
144  case DRCE_SHORT:
145  return wxString( _( "Remove track shorting two nets" ) );
146  case DRCE_REDUNDANT_VIA:
147  return wxString( _( "Remove redundant via" ) );
149  return wxString( _( "Remove duplicate track" ) );
150  case DRCE_MERGE_TRACKS:
151  return wxString( _( "Merge co-linear tracks" ) );
152  case DRCE_DANGLING_TRACK:
153  return wxString( _( "Remove dangling track" ) );
154  case DRCE_DANGLING_VIA:
155  return wxString( _( "Remove dangling via" ) );
157  return wxString( _( "Remove zero-length track" ) );
158  case DRCE_TRACK_IN_PAD:
159  return wxString( _( "Remove track inside pad" ) );
160 
161  default:
162  return wxEmptyString;
163  }
164 }
Definition: drc.h:94
hole too close to track
Definition: drc.h:61
copper area outlines intersect
Definition: drc.h:57
Too small via size.
Definition: drc.h:63
micro vias are not allowed
Definition: drc.h:84
overlapping drilled holes break drill bits
Definition: drc.h:87
track too close to via
Definition: drc.h:48
Via in inside a keepout area.
Definition: drc.h:73
footprint not found for netlist item
Definition: drc.h:90
more than one footprints found for netlist item
Definition: drc.h:91
copper area has a net but no pads in nets, which is suspicious
Definition: drc.h:59
Too small micro via size.
Definition: drc.h:64
via and copper graphic collide or are too close
Definition: drc.h:77
track ends are too close
Definition: drc.h:51
tracks are crossing
Definition: drc.h:53
netclass has Clearance < board.m_designSettings->m_TrackClearance
Definition: drc.h:68
via too close to via
Definition: drc.h:49
2 parallel track segments too close: segm ends between segref ends
Definition: drc.h:52
footprint has no courtyard defined
Definition: drc.h:81
netlist item not found for footprint
Definition: drc.h:92
track too close to board edge
Definition: drc.h:88
Too small track width.
Definition: drc.h:62
Pad in inside a keepout area.
Definition: drc.h:75
item on a disabled layer
Definition: drc.h:86
pad too close to track
Definition: drc.h:47
invalid board outline
Definition: drc.h:89
netclass has TrackWidth < board.m_designSettings->m_TrackMinWidth
Definition: drc.h:67
thru hole is too close to track
Definition: drc.h:46
Too small micro via drill.
Definition: drc.h:66
via's hole is bigger than its diameter
Definition: drc.h:55
micro via's layer pair incorrect (layers must be adjacent)
Definition: drc.h:56
Too small via drill.
Definition: drc.h:65
pad and copper graphic collide or are too close
Definition: drc.h:78
netclass has ViaDrillSize < board.m_designSettings->m_ViasMinDrill
Definition: drc.h:70
track & copper graphic collide or are too close
Definition: drc.h:76
#define _(s)
Definition: 3d_actions.cpp:33
Track in inside a keepout area.
Definition: drc.h:74
track & zone collide or are too close together
Definition: drc.h:79
via too close to track
Definition: drc.h:50
items are unconnected
Definition: drc.h:45
hole too close to pad
Definition: drc.h:60
footprint courtyards overlap
Definition: drc.h:80
netclass has ViaSize < board.m_designSettings->m_MicroViasMinDrill
Definition: drc.h:72
int m_ErrorCode
Definition: rc_item.h:85
copper area outlines are too close
Definition: drc.h:58
footprint has a courtyard but malformed
Definition: drc.h:82
buried vias are not allowed
Definition: drc.h:85
pad too close to pad
Definition: drc.h:54
netclass has ViaSize < board.m_designSettings->m_ViasMinSize
Definition: drc.h:69
netclass has ViaSize < board.m_designSettings->m_MicroViasMinSize
Definition: drc.h:71

References _, DRCE_BURIED_VIA_NOT_ALLOWED, DRCE_DANGLING_TRACK, DRCE_DANGLING_VIA, DRCE_DISABLED_LAYER_ITEM, DRCE_DRILLED_HOLES_TOO_CLOSE, DRCE_DUPLICATE_FOOTPRINT, DRCE_DUPLICATE_TRACK, DRCE_EXTRA_FOOTPRINT, DRCE_HOLE_NEAR_PAD, DRCE_HOLE_NEAR_TRACK, DRCE_INVALID_OUTLINE, DRCE_MALFORMED_COURTYARD_IN_FOOTPRINT, DRCE_MERGE_TRACKS, DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR, DRCE_MICRO_VIA_NOT_ALLOWED, DRCE_MISSING_COURTYARD_IN_FOOTPRINT, DRCE_MISSING_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_NEAR_COPPER, DRCE_PAD_NEAR_PAD1, DRCE_REDUNDANT_VIA, DRCE_SHORT, 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_ENDS, DRCE_TRACK_IN_PAD, DRCE_TRACK_INSIDE_KEEPOUT, DRCE_TRACK_NEAR_COPPER, DRCE_TRACK_NEAR_EDGE, DRCE_TRACK_NEAR_PAD, DRCE_TRACK_NEAR_THROUGH_HOLE, DRCE_TRACK_NEAR_VIA, DRCE_TRACK_NEAR_ZONE, DRCE_TRACK_SEGMENTS_TOO_CLOSE, DRCE_TRACKS_CROSSING, DRCE_UNCONNECTED_ITEMS, DRCE_VIA_HOLE_BIGGER, DRCE_VIA_INSIDE_KEEPOUT, DRCE_VIA_NEAR_COPPER, DRCE_VIA_NEAR_TRACK, DRCE_VIA_NEAR_VIA, DRCE_ZERO_LENGTH_TRACK, DRCE_ZONES_INTERSECT, DRCE_ZONES_TOO_CLOSE, and RC_ITEM::m_ErrorCode.

Referenced by ShowHtml().

◆ GetMainItemID()

KIID RC_ITEM::GetMainItemID ( ) const
inlineinherited

◆ GetMainText()

wxString RC_ITEM::GetMainText ( ) const
inlineinherited

Definition at line 260 of file rc_item.h.

260 { return m_MainText; }
wxString m_MainText
Definition: rc_item.h:86

References RC_ITEM::m_MainText.

Referenced by MARKER_PCB::GetMsgPanelInfo(), RC_TREE_MODEL::GetValue(), SCH_MARKER::Matches(), and MARKER_PCB::Serialize().

◆ GetParent()

MARKER_BASE* RC_ITEM::GetParent ( void  ) const
inlineinherited

◆ HasSecondItem()

bool RC_ITEM::HasSecondItem ( ) const
inlineinherited

Definition at line 258 of file rc_item.h.

258 { return m_hasSecondItem; }
bool m_hasSecondItem
Definition: rc_item.h:90

References RC_ITEM::m_hasSecondItem.

Referenced by InvalidMatchesExpected().

◆ SetAuxiliaryData()

void RC_ITEM::SetAuxiliaryData ( const wxString &  aAuxiliaryText,
const wxPoint aAuxiliaryPos 
)
inlineinherited

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

248  {
249  m_AuxText = aAuxiliaryText;
250  m_AuxPosition = aAuxiliaryPos;
251  m_hasSecondItem = true;
253  }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
KIID m_auxItemUuid
Definition: rc_item.h:93
KIID niluuid(0)
wxPoint m_AuxPosition
Definition: rc_item.h:89

References RC_ITEM::m_auxItemUuid, RC_ITEM::m_AuxPosition, RC_ITEM::m_AuxText, RC_ITEM::m_hasSecondItem, and niluuid.

Referenced by MARKER_BASE::SetAuxiliaryData().

◆ SetData() [1/5]

void RC_ITEM::SetData ( EDA_UNITS  aUnits,
int  aErrorCode,
EDA_ITEM aMainItem,
EDA_ITEM bAuxItem = nullptr 
)
inlineinherited

Function SetData initialize all data in item.

Parameters
aErrorCode= error code
aMainItem= the first (main) schematic or board item
bAuxItem= the second schematic or board item

Definition at line 128 of file rc_item.h.

131  {
132  m_ErrorCode = aErrorCode;
133  m_MainText = aMainItem->GetSelectMenuText( aUnits );
134  m_AuxText = wxEmptyString;
135  m_hasSecondItem = bAuxItem != nullptr;
136  m_parent = nullptr;
137  m_mainItemUuid = aMainItem->m_Uuid;
138 
139  if( m_hasSecondItem )
140  {
141  m_AuxText = bAuxItem->GetSelectMenuText( aUnits );
142  m_auxItemUuid = bAuxItem->m_Uuid;
143  }
144  }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
KIID m_auxItemUuid
Definition: rc_item.h:93
wxString m_MainText
Definition: rc_item.h:86
const KIID m_Uuid
Definition: base_struct.h:169
MARKER_BASE * m_parent
Definition: rc_item.h:91
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
KIID m_mainItemUuid
Definition: rc_item.h:92
int m_ErrorCode
Definition: rc_item.h:85

References EDA_ITEM::GetSelectMenuText(), RC_ITEM::m_auxItemUuid, RC_ITEM::m_AuxText, RC_ITEM::m_ErrorCode, RC_ITEM::m_hasSecondItem, RC_ITEM::m_mainItemUuid, RC_ITEM::m_MainText, RC_ITEM::m_parent, and EDA_ITEM::m_Uuid.

Referenced by TRACKS_CLEANER::cleanupSegments(), TRACKS_CLEANER::cleanupVias(), TRACKS_CLEANER::deleteDanglingTracks(), TRACKS_CLEANER::deleteNullSegments(), TRACKS_CLEANER::deleteTracksInPads(), MARKER_PCB::Deserialize(), TRACKS_CLEANER::mergeCollinearSegments(), PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES(), TRACKS_CLEANER::removeBadTrackSegments(), MARKER_BASE::SetData(), DRC::TestFootprints(), and DRC::testUnconnected().

◆ SetData() [2/5]

void RC_ITEM::SetData ( EDA_UNITS  aUnits,
int  aErrorCode,
EDA_ITEM aMainItem,
const wxPoint aMainPos,
EDA_ITEM bAuxItem = nullptr,
const wxPoint bAuxPos = wxPoint() 
)
inlineinherited

Function SetData initialize all data in item.

Parameters
aErrorCode= error code
aMainItem= the first (main) schematic or board item
bAuxItem= the second schematic or board item
aMainPos= position the first item and therefore of this issue
bAuxPos= position the second item

Definition at line 155 of file rc_item.h.

158  {
159  m_ErrorCode = aErrorCode;
160  m_MainText = aMainItem->GetSelectMenuText( aUnits );
161  m_AuxText = wxEmptyString;
162  m_MainPosition = aMainPos;
163  m_AuxPosition = bAuxPos;
164  m_hasSecondItem = bAuxItem != nullptr;
165  m_parent = nullptr;
166  m_mainItemUuid = aMainItem->m_Uuid;
167 
168  if( m_hasSecondItem )
169  {
170  m_AuxText = bAuxItem->GetSelectMenuText( aUnits );
171  m_auxItemUuid = bAuxItem->m_Uuid;
172  }
173  }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
KIID m_auxItemUuid
Definition: rc_item.h:93
wxPoint m_MainPosition
Definition: rc_item.h:88
wxString m_MainText
Definition: rc_item.h:86
const KIID m_Uuid
Definition: base_struct.h:169
wxPoint m_AuxPosition
Definition: rc_item.h:89
MARKER_BASE * m_parent
Definition: rc_item.h:91
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
KIID m_mainItemUuid
Definition: rc_item.h:92
int m_ErrorCode
Definition: rc_item.h:85

References EDA_ITEM::GetSelectMenuText(), RC_ITEM::m_auxItemUuid, RC_ITEM::m_AuxPosition, RC_ITEM::m_AuxText, RC_ITEM::m_ErrorCode, RC_ITEM::m_hasSecondItem, RC_ITEM::m_mainItemUuid, RC_ITEM::m_MainPosition, RC_ITEM::m_MainText, RC_ITEM::m_parent, and EDA_ITEM::m_Uuid.

◆ SetData() [3/5]

void RC_ITEM::SetData ( int  aErrorCode,
const wxString &  aMainText,
const wxString &  bAuxText = wxEmptyString 
)
inlineinherited

Function SetData initialize all data in item.

Parameters
aErrorCode= error code
aMainText= a description of the first (main) item
bAuxText= a description of the second item

Definition at line 182 of file rc_item.h.

185  {
186  m_ErrorCode = aErrorCode;
187  m_MainText = aMainText;
188  m_AuxText = bAuxText;
189  m_hasSecondItem = !bAuxText.IsEmpty();
190  m_parent = nullptr;
193  }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
KIID m_auxItemUuid
Definition: rc_item.h:93
KIID niluuid(0)
wxString m_MainText
Definition: rc_item.h:86
MARKER_BASE * m_parent
Definition: rc_item.h:91
KIID m_mainItemUuid
Definition: rc_item.h:92
int m_ErrorCode
Definition: rc_item.h:85

References RC_ITEM::m_auxItemUuid, RC_ITEM::m_AuxText, RC_ITEM::m_ErrorCode, RC_ITEM::m_hasSecondItem, RC_ITEM::m_mainItemUuid, RC_ITEM::m_MainText, RC_ITEM::m_parent, and niluuid.

◆ SetData() [4/5]

void RC_ITEM::SetData ( int  aErrorCode,
const wxString &  aMainText,
const wxPoint aMainPos,
const wxString &  bAuxText = wxEmptyString,
const wxPoint bAuxPos = wxPoint() 
)
inlineinherited

Function SetData initialize all data in item.

Parameters
aErrorCode= error code
aMainText= a description of the first (main) item
aMainPos= position the first item and therefore of this issue
bAuxText= a description of the second item
bAuxPos= position the second item

Definition at line 204 of file rc_item.h.

207  {
208  m_ErrorCode = aErrorCode;
209  m_MainText = aMainText;
210  m_AuxText = bAuxText;
211  m_MainPosition = aMainPos;
212  m_AuxPosition = bAuxPos;
213  m_hasSecondItem = !bAuxText.IsEmpty();
214  m_parent = nullptr;
217  }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
KIID m_auxItemUuid
Definition: rc_item.h:93
wxPoint m_MainPosition
Definition: rc_item.h:88
KIID niluuid(0)
wxString m_MainText
Definition: rc_item.h:86
wxPoint m_AuxPosition
Definition: rc_item.h:89
MARKER_BASE * m_parent
Definition: rc_item.h:91
KIID m_mainItemUuid
Definition: rc_item.h:92
int m_ErrorCode
Definition: rc_item.h:85

References RC_ITEM::m_auxItemUuid, RC_ITEM::m_AuxPosition, RC_ITEM::m_AuxText, RC_ITEM::m_ErrorCode, RC_ITEM::m_hasSecondItem, RC_ITEM::m_mainItemUuid, RC_ITEM::m_MainPosition, RC_ITEM::m_MainText, RC_ITEM::m_parent, and niluuid.

◆ SetData() [5/5]

void RC_ITEM::SetData ( int  aErrorCode,
const wxString &  aMainText,
const KIID aMainID,
const wxString &  bAuxText,
const KIID bAuxID 
)
inlineinherited

Function SetData initialize all data in item.

Parameters
aErrorCode= error code
aMainText= a description of the first (main) item
aMainID= UUID of the main item
bAuxText= a description of the second item
bAuxID= UUID of the second item

Definition at line 228 of file rc_item.h.

231  {
232  m_ErrorCode = aErrorCode;
233  m_MainText = aMainText;
234  m_AuxText = bAuxText;
235  m_hasSecondItem = !bAuxText.IsEmpty() || bAuxID != niluuid;
236  m_parent = nullptr;
237  m_mainItemUuid = aMainID;
238  m_auxItemUuid = bAuxID;
239  }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
KIID m_auxItemUuid
Definition: rc_item.h:93
KIID niluuid(0)
wxString m_MainText
Definition: rc_item.h:86
MARKER_BASE * m_parent
Definition: rc_item.h:91
KIID m_mainItemUuid
Definition: rc_item.h:92
int m_ErrorCode
Definition: rc_item.h:85

References RC_ITEM::m_auxItemUuid, RC_ITEM::m_AuxText, RC_ITEM::m_ErrorCode, RC_ITEM::m_hasSecondItem, RC_ITEM::m_mainItemUuid, RC_ITEM::m_MainText, RC_ITEM::m_parent, and niluuid.

◆ SetParent()

void RC_ITEM::SetParent ( MARKER_BASE aMarker)
inlineinherited

Definition at line 255 of file rc_item.h.

255 { m_parent = aMarker; }
MARKER_BASE * m_parent
Definition: rc_item.h:91

References RC_ITEM::m_parent.

Referenced by MARKER_PCB::Deserialize(), and MARKER_BASE::SetData().

◆ ShowCoord()

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

Function ShowCoord formats a coordinate or position to text.

Definition at line 36 of file rc_item.cpp.

37 {
38  return wxString::Format( "@(%s, %s)",
39  MessageTextFromValue( aUnits, aPos.x ),
40  MessageTextFromValue( aUnits, aPos.y ) );
41 }
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:127
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 ( EDA_UNITS  aUnits) const

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

Returns
wxString - the html text.

Definition at line 175 of file drc_item.cpp.

176 {
177  if( m_hasSecondItem )
178  {
179  // an html fragment for the entire message in the listbox. feel free
180  // to add color if you want:
181  return wxString::Format( wxT( "<b>%s</b><br>&nbsp;&nbsp; %s<br>&nbsp;&nbsp; %s" ),
184  escapeHtml( m_AuxText ) );
185  }
186  else
187  {
188  return wxString::Format( wxT( "<b>%s</b><br>&nbsp;&nbsp; %s" ),
190  escapeHtml( m_MainText ) );
191  }
192 }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
wxString escapeHtml(wxString aString)
Definition: drc_item.cpp:167
wxString GetErrorText() const override
Function GetErrorText returns the string form of a drc error code.
Definition: drc_item.cpp:35
wxString m_MainText
Definition: rc_item.h:86
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 escapeHtml(), Format(), GetErrorText(), RC_ITEM::m_AuxText, RC_ITEM::m_hasSecondItem, and RC_ITEM::m_MainText.

◆ ShowReport()

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

45 {
46  if( m_hasSecondItem )
47  {
48  return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ),
50  GetErrorText(),
51  ShowCoord( aUnits, m_MainPosition ),
52  m_MainText,
53  ShowCoord( aUnits, m_AuxPosition ),
54  m_AuxText );
55  }
56  else
57  {
58  return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n" ),
60  GetErrorText(),
61  ShowCoord( aUnits, m_MainPosition ),
62  m_MainText );
63  }
64 }
wxString m_AuxText
Definition: rc_item.h:87
bool m_hasSecondItem
Definition: rc_item.h:90
wxPoint m_MainPosition
Definition: rc_item.h:88
static wxString ShowCoord(EDA_UNITS aUnits, const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
Definition: rc_item.cpp:36
virtual wxString GetErrorText() const =0
Function GetErrorText returns the string form of a drc error code.
wxString m_MainText
Definition: rc_item.h:86
wxPoint m_AuxPosition
Definition: rc_item.h:89
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
int m_ErrorCode
Definition: rc_item.h:85

References Format(), RC_ITEM::GetErrorText(), RC_ITEM::m_AuxPosition, RC_ITEM::m_AuxText, RC_ITEM::m_ErrorCode, RC_ITEM::m_hasSecondItem, RC_ITEM::m_MainPosition, RC_ITEM::m_MainText, and RC_ITEM::ShowCoord().

Referenced by DIALOG_DRC::writeReport().

Member Data Documentation

◆ m_auxItemUuid

KIID RC_ITEM::m_auxItemUuid
protectedinherited

◆ m_AuxPosition

wxPoint RC_ITEM::m_AuxPosition
protectedinherited

◆ m_AuxText

wxString RC_ITEM::m_AuxText
protectedinherited

◆ m_ErrorCode

int RC_ITEM::m_ErrorCode
protectedinherited

◆ m_hasSecondItem

bool RC_ITEM::m_hasSecondItem
protectedinherited

◆ m_mainItemUuid

KIID RC_ITEM::m_mainItemUuid
protectedinherited

Definition at line 92 of file rc_item.h.

Referenced by RC_ITEM::GetMainItemID(), RC_ITEM::RC_ITEM(), and RC_ITEM::SetData().

◆ m_MainPosition

wxPoint RC_ITEM::m_MainPosition
protectedinherited

Definition at line 88 of file rc_item.h.

Referenced by RC_ITEM::RC_ITEM(), RC_ITEM::SetData(), and RC_ITEM::ShowReport().

◆ m_MainText

wxString RC_ITEM::m_MainText
protectedinherited

◆ m_parent

MARKER_BASE* RC_ITEM::m_parent
protectedinherited

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