KiCad PCB EDA Suite
Loading...
Searching...
No Matches
RC_ITEM Class Reference

A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema. More...

#include <rc_item.h>

Inheritance diagram for RC_ITEM:
CLEANUP_ITEM DRC_ITEM ERC_ITEM

Public Types

typedef std::vector< KIIDKIIDS
 

Public Member Functions

 RC_ITEM ()
 
 RC_ITEM (std::shared_ptr< RC_ITEM > aItem)
 
virtual ~RC_ITEM ()
 
void SetErrorMessage (const wxString &aMessage)
 
void SetItems (const KIIDS &aIds)
 
void AddItem (EDA_ITEM *aItem)
 
void SetItems (const EDA_ITEM *aItem, const EDA_ITEM *bItem=nullptr, const EDA_ITEM *cItem=nullptr, const EDA_ITEM *dItem=nullptr)
 
void SetItems (const KIID &aItem, const KIID &bItem=niluuid, const KIID &cItem=niluuid, const KIID &dItem=niluuid)
 
virtual KIID GetMainItemID () const
 
virtual KIID GetAuxItemID () const
 
virtual KIID GetAuxItem2ID () const
 
virtual KIID GetAuxItem3ID () const
 
std::vector< KIIDGetIDs () const
 
void SetParent (MARKER_BASE *aMarker)
 
MARKER_BASEGetParent () const
 
virtual wxString ShowReport (UNITS_PROVIDER *aUnitsProvider, SEVERITY aSeverity, const std::map< KIID, EDA_ITEM * > &aItemMap) const
 Translate this object into a text string suitable for saving to disk in a report. More...
 
int GetErrorCode () const
 
void SetErrorCode (int aCode)
 
virtual wxString GetErrorMessage () const
 
wxString GetErrorText () const
 
wxString GetSettingsKey () const
 
virtual wxString GetViolatingRuleDesc () const
 

Protected Attributes

int m_errorCode
 The error code's numeric value. More...
 
wxString m_errorMessage
 A message describing the details of this specific error. More...
 
wxString m_errorTitle
 The string describing the type of error. More...
 
wxString m_settingsKey
 The key used to describe this type of error in settings. More...
 
MARKER_BASEm_parent
 The marker this item belongs to, if any. More...
 
KIIDS m_ids
 

Detailed Description

A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.

RC_ITEMs can have zero, one, or two related EDA_ITEMs.

Definition at line 74 of file rc_item.h.

Member Typedef Documentation

◆ KIIDS

typedef std::vector<KIID> RC_ITEM::KIIDS

Definition at line 77 of file rc_item.h.

Constructor & Destructor Documentation

◆ RC_ITEM() [1/2]

RC_ITEM::RC_ITEM ( )
inline

Definition at line 79 of file rc_item.h.

◆ RC_ITEM() [2/2]

RC_ITEM::RC_ITEM ( std::shared_ptr< RC_ITEM aItem)
inline

Definition at line 85 of file rc_item.h.

References m_errorCode, m_errorMessage, m_errorTitle, m_ids, m_parent, and m_settingsKey.

◆ ~RC_ITEM()

virtual RC_ITEM::~RC_ITEM ( )
inlinevirtual

Definition at line 95 of file rc_item.h.

Member Function Documentation

◆ AddItem()

void RC_ITEM::AddItem ( EDA_ITEM aItem)

Definition at line 55 of file rc_item.cpp.

References m_ids, and EDA_ITEM::m_Uuid.

◆ GetAuxItem2ID()

virtual KIID RC_ITEM::GetAuxItem2ID ( ) const
inlinevirtual

Reimplemented in DRC_ITEM.

Definition at line 119 of file rc_item.h.

References m_ids, and niluuid.

◆ GetAuxItem3ID()

virtual KIID RC_ITEM::GetAuxItem3ID ( ) const
inlinevirtual

Reimplemented in DRC_ITEM.

Definition at line 120 of file rc_item.h.

References m_ids, and niluuid.

◆ GetAuxItemID()

virtual KIID RC_ITEM::GetAuxItemID ( ) const
inlinevirtual

Definition at line 118 of file rc_item.h.

References m_ids, and niluuid.

Referenced by ShowReport().

◆ GetErrorCode()

◆ GetErrorMessage()

wxString RC_ITEM::GetErrorMessage ( ) const
virtual
Returns
the error message describing the specific details of a RC_ITEM. For instance, "Clearance violation (netclass '100ohm' clearance 0.4000mm; actual 0.3200mm)"

Definition at line 38 of file rc_item.cpp.

References GetErrorText(), and m_errorMessage.

Referenced by ShowReport().

◆ GetErrorText()

wxString RC_ITEM::GetErrorText ( ) const
inline
Returns
the error text for the class of error of this RC_ITEM represents. For instance, "Clearance violation".

Definition at line 149 of file rc_item.h.

References m_errorTitle.

Referenced by CLEANUP_ITEM::CLEANUP_ITEM(), GetErrorMessage(), and PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES().

◆ GetIDs()

std::vector< KIID > RC_ITEM::GetIDs ( ) const
inline

Definition at line 122 of file rc_item.h.

References m_ids.

◆ GetMainItemID()

virtual KIID RC_ITEM::GetMainItemID ( ) const
inlinevirtual

Definition at line 117 of file rc_item.h.

References m_ids, and niluuid.

Referenced by ShowReport().

◆ GetParent()

MARKER_BASE * RC_ITEM::GetParent ( ) const
inline

Definition at line 125 of file rc_item.h.

References m_parent.

◆ GetSettingsKey()

wxString RC_ITEM::GetSettingsKey ( ) const
inline

Definition at line 154 of file rc_item.h.

References m_settingsKey.

Referenced by ShowReport().

◆ GetViolatingRuleDesc()

virtual wxString RC_ITEM::GetViolatingRuleDesc ( ) const
inlinevirtual

Reimplemented in DRC_ITEM.

Definition at line 159 of file rc_item.h.

Referenced by ShowReport().

◆ SetErrorCode()

void RC_ITEM::SetErrorCode ( int  aCode)
inline

Definition at line 137 of file rc_item.h.

References m_errorCode.

◆ SetErrorMessage()

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

Definition at line 97 of file rc_item.h.

References m_errorMessage.

◆ SetItems() [1/3]

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

Definition at line 61 of file rc_item.cpp.

References m_ids, and EDA_ITEM::m_Uuid.

◆ SetItems() [2/3]

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

Definition at line 106 of file rc_item.h.

References m_ids.

◆ SetItems() [3/3]

void RC_ITEM::SetItems ( const KIIDS aIds)
inline

Definition at line 99 of file rc_item.h.

References m_ids.

◆ SetParent()

void RC_ITEM::SetParent ( MARKER_BASE aMarker)
inline

Definition at line 124 of file rc_item.h.

References m_parent.

◆ ShowReport()

wxString RC_ITEM::ShowReport ( UNITS_PROVIDER aUnitsProvider,
SEVERITY  aSeverity,
const std::map< KIID, EDA_ITEM * > &  aItemMap 
) const
virtual

Translate 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 79 of file rc_item.cpp.

References GetAuxItemID(), GetErrorMessage(), EDA_ITEM::GetItemDescription(), GetMainItemID(), EDA_ITEM::GetPosition(), GetSettingsKey(), GetViolatingRuleDesc(), MARKER_BASE::IsExcluded(), m_parent, RPT_SEVERITY_ACTION, RPT_SEVERITY_DEBUG, RPT_SEVERITY_ERROR, RPT_SEVERITY_EXCLUSION, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, and showCoord().

Member Data Documentation

◆ m_errorCode

int RC_ITEM::m_errorCode
protected

◆ m_errorMessage

wxString RC_ITEM::m_errorMessage
protected

A message describing the details of this specific error.

Definition at line 166 of file rc_item.h.

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

◆ m_errorTitle

wxString RC_ITEM::m_errorTitle
protected

The string describing the type of error.

Definition at line 167 of file rc_item.h.

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

◆ m_ids

◆ m_parent

MARKER_BASE* RC_ITEM::m_parent
protected

The marker this item belongs to, if any.

Definition at line 169 of file rc_item.h.

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

◆ m_settingsKey

wxString RC_ITEM::m_settingsKey
protected

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

Definition at line 168 of file rc_item.h.

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


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