KiCad PCB EDA Suite
DRC_ITEM Class Reference

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 (EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxiliaryItem, const wxPoint &bAuxiliaryPos)
 
 DRC_ITEM (EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos)
 
 DRC_ITEM (int aErrorCode, const wxString &aMainText)
 
void SetData (EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxiliaryItem=nullptr, const wxPoint &bAuxiliaryPos=wxPoint())
 Function SetData initialize all data in item. More...
 
void SetData (int aErrorCode, const wxString &aMainText, const wxPoint &aMainPos, const wxString &bAuxiliaryText=wxEmptyString, const wxPoint &bAuxiliaryPos=wxPoint())
 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
 Access to A and B texts. More...
 
wxString GetAuxiliaryText () const
 
BOARD_ITEMGetMainItem (BOARD *aBoard) const
 Access to A and B items for BOARDs. More...
 
BOARD_ITEMGetAuxiliaryItem (BOARD *aBoard) const
 
wxString ShowHtml (EDA_UNITS aUnits) const
 Function ShowHtml translates this object into a fragment of HTML suitable for the wxWidget's wxHtmlListBox class. More...
 
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
 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 (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_AuxiliaryText
 
wxPoint m_MainPosition
 
wxPoint m_AuxiliaryPosition
 
bool m_hasSecondItem
 
bool m_noCoordinate
 
MARKER_BASEm_parent
 
void * m_mainItemWeakRef
 
void * m_auxItemWeakRef
 

Detailed Description

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

Constructor & Destructor Documentation

◆ DRC_ITEM() [1/4]

DRC_ITEM::DRC_ITEM ( )
inline

Definition at line 65 of file drc_item.h.

66  {
67  m_ErrorCode = 0;
68  m_hasSecondItem = false;
69  m_noCoordinate = false;
70  m_parent = nullptr;
71  m_mainItemWeakRef = nullptr;
72  m_auxItemWeakRef = nullptr;
73  }
bool m_hasSecondItem
Definition: drc_item.h:56
void * m_auxItemWeakRef
Definition: drc_item.h:61
void * m_mainItemWeakRef
Definition: drc_item.h:60
MARKER_BASE * m_parent
Definition: drc_item.h:59
bool m_noCoordinate
Definition: drc_item.h:57
int m_ErrorCode
Definition: drc_item.h:51

References m_auxItemWeakRef, m_ErrorCode, m_hasSecondItem, m_mainItemWeakRef, m_noCoordinate, and m_parent.

◆ DRC_ITEM() [2/4]

DRC_ITEM::DRC_ITEM ( EDA_UNITS  aUnits,
int  aErrorCode,
EDA_ITEM aMainItem,
const wxPoint aMainPos,
EDA_ITEM bAuxiliaryItem,
const wxPoint bAuxiliaryPos 
)
inline

Definition at line 75 of file drc_item.h.

77  {
78  SetData( aUnits, aErrorCode, aMainItem, aMainPos, bAuxiliaryItem, bAuxiliaryPos );
79  }
void SetData(EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxiliaryItem=nullptr, const wxPoint &bAuxiliaryPos=wxPoint())
Function SetData initialize all data in item.
Definition: drc_item.h:103

References SetData().

◆ DRC_ITEM() [3/4]

DRC_ITEM::DRC_ITEM ( EDA_UNITS  aUnits,
int  aErrorCode,
EDA_ITEM aMainItem,
const wxPoint aMainPos 
)
inline

Definition at line 81 of file drc_item.h.

82  {
83  SetData( aUnits, aErrorCode, aMainItem, aMainPos );
84  }
void SetData(EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxiliaryItem=nullptr, const wxPoint &bAuxiliaryPos=wxPoint())
Function SetData initialize all data in item.
Definition: drc_item.h:103

References SetData().

◆ DRC_ITEM() [4/4]

DRC_ITEM::DRC_ITEM ( int  aErrorCode,
const wxString &  aMainText 
)
inline

Definition at line 87 of file drc_item.h.

88  {
89  SetData( aErrorCode, aMainText, wxPoint() );
91  }
void SetData(EDA_UNITS aUnits, int aErrorCode, EDA_ITEM *aMainItem, const wxPoint &aMainPos, EDA_ITEM *bAuxiliaryItem=nullptr, const wxPoint &bAuxiliaryPos=wxPoint())
Function SetData initialize all data in item.
Definition: drc_item.h:103
void SetShowNoCoordinate()
Definition: drc_item.h:169

References SetData(), and SetShowNoCoordinate().

Member Function Documentation

◆ GetAuxiliaryItem()

BOARD_ITEM * DRC_ITEM::GetAuxiliaryItem ( BOARD aBoard) const

Definition at line 258 of file drc_item.cpp.

259 {
260  return aBoard->GetItem( m_auxItemWeakRef );
261 }
void * m_auxItemWeakRef
Definition: drc_item.h:61
BOARD_ITEM * GetItem(void *aWeakReference)

References BOARD::GetItem(), and m_auxItemWeakRef.

Referenced by CollisionMatchesExpected(), DIALOG_DRC_CONTROL::doSelectionMenu(), and DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem().

◆ GetAuxiliaryText()

wxString DRC_ITEM::GetAuxiliaryText ( ) const
inline

Definition at line 175 of file drc_item.h.

175 { return m_AuxiliaryText; }
wxString m_AuxiliaryText
Definition: drc_item.h:53

References m_AuxiliaryText.

Referenced by SCH_MARKER::Matches().

◆ GetErrorCode()

int DRC_ITEM::GetErrorCode ( ) const
inline

Function GetErrorCode returns the error code.

Definition at line 203 of file drc_item.h.

204  {
205  return m_ErrorCode;
206  }
int m_ErrorCode
Definition: drc_item.h:51

References m_ErrorCode.

Referenced by MARKER_PCB::GetMsgPanelInfo(), InvalidMatchesExpected(), KI_TEST::IsDrcMarkerOfType(), and operator<<().

◆ GetErrorText()

wxString DRC_ITEM::GetErrorText ( ) const

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

Definition at line 35 of file drc_erc_item.cpp.

36 {
37  switch( m_ErrorCode )
38  {
39  case ERCE_UNSPECIFIED:
40  return wxString( _("ERC err unspecified") );
42  return wxString( _("Duplicate sheet names within a given sheet") );
44  return wxString( _("Pin not connected (use a \"no connection\" flag to suppress this error)") );
46  return wxString( _( "Pin connected to other pins, but not driven by any pin" ) );
48  return wxString( _("Conflict problem between pins. Severity: warning") );
50  return wxString( _("Conflict problem between pins. Severity: error") );
52  return wxString( _("Mismatch between hierarchical labels and pins sheets") );
54  return wxString( _("A pin with a \"no connection\" flag is connected") );
56  return wxString( _("A \"no connection\" flag is not connected to anything") );
58  return wxString( _("Label not connected anywhere else in the schematic") );
60  return wxString( _("Labels are similar (lower/upper case difference only)" ) );
62  return wxString( _("Global labels are similar (lower/upper case difference only)" ) );
64  return wxString( _("Different footprint assigned in another unit of the same component" ) );
66  return wxString( _("Different net assigned to a shared pin in another unit of the same component" ) );
68  return wxString( _("Conflict between bus alias definitions across schematic sheets") );
70  return wxString( _( "More than one name given to this bus or net" ) );
72  return wxString( _( "Net is graphically connected to a bus but not a bus member" ) );
74  return wxString( _( "Label attached to bus item does not describe a bus" ) );
76  return wxString( _( "No nets are shared between two bus items" ) );
78  return wxString( _( "Invalid connection between bus and net items" ) );
79  case ERCE_GLOBLABEL:
80  return wxString( _( "Global label not connected anywhere else in the schematic" ) );
81  default:
82  wxFAIL_MSG( "Missing ERC error description" );
83  return wxString( wxT("Unknown.") );
84  }
85 }
#define _(s)
Definition: 3d_actions.cpp:31
int m_ErrorCode
Definition: drc_item.h:51

References _, ERCE_BUS_ALIAS_CONFLICT, ERCE_BUS_ENTRY_CONFLICT, ERCE_BUS_LABEL_ERROR, ERCE_BUS_TO_BUS_CONFLICT, ERCE_BUS_TO_NET_CONFLICT, ERCE_DIFFERENT_UNIT_FP, ERCE_DIFFERENT_UNIT_NET, ERCE_DRIVER_CONFLICT, ERCE_DUPLICATE_SHEET_NAME, ERCE_GLOBLABEL, ERCE_HIERACHICAL_LABEL, ERCE_LABEL_NOT_CONNECTED, ERCE_NOCONNECT_CONNECTED, ERCE_NOCONNECT_NOT_CONNECTED, ERCE_PIN_NOT_CONNECTED, ERCE_PIN_NOT_DRIVEN, ERCE_PIN_TO_PIN_ERROR, ERCE_PIN_TO_PIN_WARNING, ERCE_SIMILAR_GLBL_LABELS, ERCE_SIMILAR_LABELS, ERCE_UNSPECIFIED, and m_ErrorCode.

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

◆ GetMainItem()

BOARD_ITEM * DRC_ITEM::GetMainItem ( BOARD aBoard) const

Access to A and B items for BOARDs.

Definition at line 252 of file drc_item.cpp.

253 {
254  return aBoard->GetItem( m_mainItemWeakRef );
255 }
void * m_mainItemWeakRef
Definition: drc_item.h:60
BOARD_ITEM * GetItem(void *aWeakReference)

References BOARD::GetItem(), and m_mainItemWeakRef.

Referenced by CollisionMatchesExpected(), DIALOG_DRC_CONTROL::doSelectionMenu(), InvalidMatchesExpected(), and DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem().

◆ GetMainText()

wxString DRC_ITEM::GetMainText ( ) const
inline

Access to A and B texts.

Definition at line 174 of file drc_item.h.

174 { return m_MainText; }
wxString m_MainText
Definition: drc_item.h:52

References m_MainText.

Referenced by SCH_MARKER::Matches().

◆ GetParent()

MARKER_BASE* DRC_ITEM::GetParent ( void  ) const
inline

Definition at line 165 of file drc_item.h.

165 { return m_parent; }
MARKER_BASE * m_parent
Definition: drc_item.h:59

References m_parent.

Referenced by DIALOG_DRC_CONTROL::focusOnItem().

◆ GetPointA()

const wxPoint& DRC_ITEM::GetPointA ( ) const
inline

◆ GetPointB()

const wxPoint& DRC_ITEM::GetPointB ( ) const
inline

Definition at line 232 of file drc_item.h.

233  {
234  return m_AuxiliaryPosition;
235  }
wxPoint m_AuxiliaryPosition
Definition: drc_item.h:55

References m_AuxiliaryPosition.

Referenced by MARKER_PCB::GetMsgPanelInfo().

◆ GetTextA()

const wxString& DRC_ITEM::GetTextA ( ) const
inline

Definition at line 214 of file drc_item.h.

215  {
216  return m_MainText;
217  }
wxString m_MainText
Definition: drc_item.h:52

References m_MainText.

Referenced by MARKER_PCB::GetMsgPanelInfo().

◆ GetTextB()

const wxString& DRC_ITEM::GetTextB ( ) const
inline

Definition at line 220 of file drc_item.h.

221  {
222  return m_AuxiliaryText;
223  }
wxString m_AuxiliaryText
Definition: drc_item.h:53

References m_AuxiliaryText.

Referenced by MARKER_PCB::GetMsgPanelInfo().

◆ HasSecondItem()

bool DRC_ITEM::HasSecondItem ( ) const
inline

◆ SetAuxiliaryData()

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

155  {
156  m_AuxiliaryText = aAuxiliaryText;
157  m_AuxiliaryPosition = aAuxiliaryPos;
158  m_hasSecondItem = true;
159 
160  m_auxItemWeakRef = nullptr;
161  }
bool m_hasSecondItem
Definition: drc_item.h:56
void * m_auxItemWeakRef
Definition: drc_item.h:61
wxPoint m_AuxiliaryPosition
Definition: drc_item.h:55
wxString m_AuxiliaryText
Definition: drc_item.h:53

References m_AuxiliaryPosition, m_AuxiliaryText, m_auxItemWeakRef, and m_hasSecondItem.

Referenced by MARKER_BASE::SetAuxiliaryData().

◆ SetData() [1/2]

void DRC_ITEM::SetData ( EDA_UNITS  aUnits,
int  aErrorCode,
EDA_ITEM aMainItem,
const wxPoint aMainPos,
EDA_ITEM bAuxiliaryItem = nullptr,
const wxPoint bAuxiliaryPos = wxPoint() 
)
inline

Function SetData initialize all data in item.

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

Definition at line 103 of file drc_item.h.

105  {
106  m_ErrorCode = aErrorCode;
107  m_MainText = aMainItem->GetSelectMenuText( aUnits );
108  m_AuxiliaryText = wxEmptyString;
109  m_MainPosition = aMainPos;
110  m_AuxiliaryPosition = bAuxiliaryPos;
111  m_hasSecondItem = bAuxiliaryItem != nullptr;
112  m_noCoordinate = false;
113  m_parent = nullptr;
114 
115  if( m_hasSecondItem )
116  m_AuxiliaryText = bAuxiliaryItem->GetSelectMenuText( aUnits );
117 
118  // Weak references (void*). One must search the BOARD_ITEMS or SCH_ITEMS for a match.
119  m_mainItemWeakRef = aMainItem;
120  m_auxItemWeakRef = bAuxiliaryItem;
121  }
bool m_hasSecondItem
Definition: drc_item.h:56
void * m_auxItemWeakRef
Definition: drc_item.h:61
wxPoint m_MainPosition
Definition: drc_item.h:54
wxPoint m_AuxiliaryPosition
Definition: drc_item.h:55
void * m_mainItemWeakRef
Definition: drc_item.h:60
wxString m_MainText
Definition: drc_item.h:52
MARKER_BASE * m_parent
Definition: drc_item.h:59
bool m_noCoordinate
Definition: drc_item.h:57
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
wxString m_AuxiliaryText
Definition: drc_item.h:53
int m_ErrorCode
Definition: drc_item.h:51

References EDA_ITEM::GetSelectMenuText(), m_AuxiliaryPosition, m_AuxiliaryText, m_auxItemWeakRef, m_ErrorCode, m_hasSecondItem, m_mainItemWeakRef, m_MainPosition, m_MainText, m_noCoordinate, and m_parent.

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

◆ SetData() [2/2]

void DRC_ITEM::SetData ( int  aErrorCode,
const wxString &  aMainText,
const wxPoint aMainPos,
const wxString &  bAuxiliaryText = wxEmptyString,
const wxPoint bAuxiliaryPos = wxPoint() 
)
inline

Function SetData initialize all data in item.

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

Definition at line 132 of file drc_item.h.

134  {
135  m_ErrorCode = aErrorCode;
136  m_MainText = aMainText;
137  m_AuxiliaryText = bAuxiliaryText;
138  m_MainPosition = aMainPos;
139  m_AuxiliaryPosition = bAuxiliaryPos;
140  m_hasSecondItem = bAuxiliaryText.Length();
141  m_noCoordinate = false;
142  m_parent = nullptr;
143 
144  m_mainItemWeakRef = nullptr;
145  m_auxItemWeakRef = nullptr;
146  }
bool m_hasSecondItem
Definition: drc_item.h:56
void * m_auxItemWeakRef
Definition: drc_item.h:61
wxPoint m_MainPosition
Definition: drc_item.h:54
wxPoint m_AuxiliaryPosition
Definition: drc_item.h:55
void * m_mainItemWeakRef
Definition: drc_item.h:60
wxString m_MainText
Definition: drc_item.h:52
MARKER_BASE * m_parent
Definition: drc_item.h:59
bool m_noCoordinate
Definition: drc_item.h:57
wxString m_AuxiliaryText
Definition: drc_item.h:53
int m_ErrorCode
Definition: drc_item.h:51

References m_AuxiliaryPosition, m_AuxiliaryText, m_auxItemWeakRef, m_ErrorCode, m_hasSecondItem, m_mainItemWeakRef, m_MainPosition, m_MainText, m_noCoordinate, and m_parent.

◆ SetParent()

void DRC_ITEM::SetParent ( MARKER_BASE aMarker)
inline

Definition at line 163 of file drc_item.h.

163 { m_parent = aMarker; }
MARKER_BASE * m_parent
Definition: drc_item.h:59

References m_parent.

Referenced by MARKER_BASE::SetData().

◆ SetShowNoCoordinate()

void DRC_ITEM::SetShowNoCoordinate ( )
inline

Definition at line 169 of file drc_item.h.

169 { m_noCoordinate = true; }
bool m_noCoordinate
Definition: drc_item.h:57

References m_noCoordinate.

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

◆ ShowCoord()

wxString DRC_ITEM::ShowCoord ( EDA_UNITS  aUnits,
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 87 of file drc_erc_item.cpp.

88 {
89  return wxString::Format( "@(%s, %s)",
90  MessageTextFromValue( aUnits, aPos.x ),
91  MessageTextFromValue( aUnits, aPos.y ) );
92 }
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils)
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 MARKER_PCB::GetMsgPanelInfo(), ShowHtml(), and ShowReport().

◆ ShowHtml()

wxString DRC_ITEM::ShowHtml ( EDA_UNITS  aUnits) const

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 95 of file drc_erc_item.cpp.

96 {
97  wxString mainText = m_MainText;
98  // a wxHtmlWindows does not like < and > in the text to display
99  // because these chars have a special meaning in html
100  mainText.Replace( wxT("<"), wxT("&lt;") );
101  mainText.Replace( wxT(">"), wxT("&gt;") );
102 
103  wxString errText = GetErrorText();
104  errText.Replace( wxT("<"), wxT("&lt;") );
105  errText.Replace( wxT(">"), wxT("&gt;") );
106 
107  wxColour hrefColour = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT );
108 
109  if( m_noCoordinate )
110  {
111  // omit the coordinate, a NETCLASS has no location
112  return wxString::Format( "<p><b>%s</b><br>&nbsp;&nbsp; %s", errText, mainText );
113  }
114  else if( m_hasSecondItem )
115  {
116  wxString auxText = m_AuxiliaryText;
117  auxText.Replace( wxT("<"), wxT("&lt;") );
118  auxText.Replace( wxT(">"), wxT("&gt;") );
119 
120  // an html fragment for the entire message in the listbox. feel free
121  // to add color if you want:
122  return wxString::Format( "<p><b>%s</b><br>&nbsp;&nbsp; <font color='%s'><a href=''>%s</a></font>: %s<br>&nbsp;&nbsp; %s: %s",
123  errText,
124  hrefColour.GetAsString( wxC2S_HTML_SYNTAX ),
125  ShowCoord( aUnits, m_MainPosition ),
126  mainText,
127  ShowCoord( aUnits, m_AuxiliaryPosition ),
128  auxText );
129  }
130  else
131  {
132  return wxString::Format( "<p><b>%s</b><br>&nbsp;&nbsp; <font color='%s'><a href=''>%s</a></font>: %s",
133  errText,
134  hrefColour.GetAsString( wxC2S_HTML_SYNTAX ),
135  ShowCoord( aUnits, m_MainPosition ),
136  mainText );
137  }
138 }
wxString GetErrorText() const
Function GetErrorText returns the string form of a drc error code.
bool m_hasSecondItem
Definition: drc_item.h:56
static wxString ShowCoord(EDA_UNITS aUnits, const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
wxPoint m_MainPosition
Definition: drc_item.h:54
wxPoint m_AuxiliaryPosition
Definition: drc_item.h:55
wxString m_MainText
Definition: drc_item.h:52
bool m_noCoordinate
Definition: drc_item.h:57
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
wxString m_AuxiliaryText
Definition: drc_item.h:53

References Format(), GetErrorText(), m_AuxiliaryPosition, m_AuxiliaryText, m_hasSecondItem, m_MainPosition, m_MainText, m_noCoordinate, and ShowCoord().

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

◆ ShowReport()

wxString DRC_ITEM::ShowReport ( EDA_UNITS  aUnits) const

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 141 of file drc_erc_item.cpp.

142 {
143  if( m_hasSecondItem )
144  {
145  return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n %s: %s\n" ),
146  m_ErrorCode,
147  GetErrorText(),
148  ShowCoord( aUnits, m_MainPosition ),
149  m_MainText,
150  ShowCoord( aUnits, m_AuxiliaryPosition ),
151  m_AuxiliaryText );
152  }
153  else
154  {
155  return wxString::Format( wxT( "ErrType(%d): %s\n %s: %s\n" ),
156  m_ErrorCode,
157  GetErrorText(),
158  ShowCoord( aUnits, m_MainPosition ),
159  m_MainText );
160  }
161 }
wxString GetErrorText() const
Function GetErrorText returns the string form of a drc error code.
bool m_hasSecondItem
Definition: drc_item.h:56
static wxString ShowCoord(EDA_UNITS aUnits, const wxPoint &aPos)
Function ShowCoord formats a coordinate or position to text.
wxPoint m_MainPosition
Definition: drc_item.h:54
wxPoint m_AuxiliaryPosition
Definition: drc_item.h:55
wxString m_MainText
Definition: drc_item.h:52
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
wxString m_AuxiliaryText
Definition: drc_item.h:53
int m_ErrorCode
Definition: drc_item.h:51

References Format(), GetErrorText(), m_AuxiliaryPosition, m_AuxiliaryText, m_ErrorCode, m_hasSecondItem, m_MainPosition, m_MainText, and ShowCoord().

Referenced by DIALOG_DRC_CONTROL::writeReport().

Member Data Documentation

◆ m_AuxiliaryPosition

wxPoint DRC_ITEM::m_AuxiliaryPosition
protected

Definition at line 55 of file drc_item.h.

Referenced by GetPointB(), SetAuxiliaryData(), SetData(), ShowHtml(), and ShowReport().

◆ m_AuxiliaryText

wxString DRC_ITEM::m_AuxiliaryText
protected

Definition at line 53 of file drc_item.h.

Referenced by GetAuxiliaryText(), GetTextB(), SetAuxiliaryData(), SetData(), ShowHtml(), and ShowReport().

◆ m_auxItemWeakRef

void* DRC_ITEM::m_auxItemWeakRef
protected

Definition at line 61 of file drc_item.h.

Referenced by DRC_ITEM(), GetAuxiliaryItem(), SetAuxiliaryData(), and SetData().

◆ m_ErrorCode

int DRC_ITEM::m_ErrorCode
protected

Definition at line 51 of file drc_item.h.

Referenced by DRC_ITEM(), GetErrorCode(), GetErrorText(), SetData(), and ShowReport().

◆ m_hasSecondItem

bool DRC_ITEM::m_hasSecondItem
protected

Definition at line 56 of file drc_item.h.

Referenced by DRC_ITEM(), HasSecondItem(), SetAuxiliaryData(), SetData(), ShowHtml(), and ShowReport().

◆ m_mainItemWeakRef

void* DRC_ITEM::m_mainItemWeakRef
protected

Definition at line 60 of file drc_item.h.

Referenced by DRC_ITEM(), GetMainItem(), and SetData().

◆ m_MainPosition

wxPoint DRC_ITEM::m_MainPosition
protected

Definition at line 54 of file drc_item.h.

Referenced by GetPointA(), SetData(), ShowHtml(), and ShowReport().

◆ m_MainText

wxString DRC_ITEM::m_MainText
protected

Definition at line 52 of file drc_item.h.

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

◆ m_noCoordinate

bool DRC_ITEM::m_noCoordinate
protected

Definition at line 57 of file drc_item.h.

Referenced by DRC_ITEM(), SetData(), SetShowNoCoordinate(), and ShowHtml().

◆ m_parent

MARKER_BASE* DRC_ITEM::m_parent
protected

Definition at line 59 of file drc_item.h.

Referenced by DRC_ITEM(), GetParent(), SetData(), and SetParent().


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