KiCad PCB EDA Suite
eeschema/erc.cpp File Reference
#include <fctsys.h>
#include <kicad_string.h>
#include <sch_edit_frame.h>
#include <netlist_object.h>
#include <lib_pin.h>
#include <erc.h>
#include <sch_marker.h>
#include <sch_sheet.h>
#include <sch_reference_list.h>
#include <schematic.h>
#include <wx/ffile.h>
#include <ws_draw_item.h>
#include <ws_proxy_view_item.h>

Go to the source code of this file.

Classes

struct  compare_labels
 
struct  compare_label_names
 
struct  compare_paths
 

Functions

static int countIndenticalLabels (std::vector< NETLIST_OBJECT * > &aList, NETLIST_OBJECT *aRef)
 
static void SimilarLabelsDiagnose (NETLIST_OBJECT *aItemA, NETLIST_OBJECT *aItemB)
 

Variables

const wxString CommentERC_H []
 
const wxString CommentERC_V []
 

Function Documentation

◆ countIndenticalLabels()

static int countIndenticalLabels ( std::vector< NETLIST_OBJECT * > &  aList,
NETLIST_OBJECT aRef 
)
static

Definition at line 732 of file eeschema/erc.cpp.

733 {
734  int count = 0;
735 
736  if( aRef->IsLabelGlobal() )
737  {
738  for( NETLIST_OBJECT* i : aList )
739  {
740  if( i->IsLabelGlobal() && i->m_Label == aRef->m_Label )
741  count++;
742  }
743  }
744  else
745  {
746  for( NETLIST_OBJECT* i : aList )
747  {
748  if( i->m_Label == aRef->m_Label && i->m_SheetPath.Path() == aRef->m_SheetPath.Path() )
749  count++;
750  }
751  }
752 
753  return count;
754 }
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
SCH_SHEET_PATH m_SheetPath
bool IsLabelGlobal() const
Function IsLabelGlobal.

References NETLIST_OBJECT::IsLabelGlobal(), NETLIST_OBJECT::m_Label, NETLIST_OBJECT::m_SheetPath, and SCH_SHEET_PATH::Path().

Referenced by NETLIST_OBJECT_LIST::TestforSimilarLabels().

◆ SimilarLabelsDiagnose()

static void SimilarLabelsDiagnose ( NETLIST_OBJECT aItemA,
NETLIST_OBJECT aItemB 
)
static

Definition at line 758 of file eeschema/erc.cpp.

759 {
761  ercItem->SetItems( aItemA->m_Comp, aItemB->m_Comp );
762 
763  SCH_MARKER* marker = new SCH_MARKER( ercItem, aItemA->m_Start );
764  aItemA->m_SheetPath.LastScreen()->Append( marker );
765 }
void SetItems(EDA_ITEM *aItem, EDA_ITEM *bItem=nullptr, EDA_ITEM *cItem=nullptr, EDA_ITEM *dItem=nullptr)
Definition: rc_item.h:119
SCH_SHEET_PATH m_SheetPath
EDA_ITEM * m_Comp
static ERC_ITEM * Create(int aErrorCode)
Constructs an ERC_ITEM for the given error code.
Definition: erc_item.cpp:144
SCH_SCREEN * LastScreen()
Function LastScreen.
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:133

References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_SIMILAR_LABELS, SCH_SHEET_PATH::LastScreen(), NETLIST_OBJECT::m_Comp, NETLIST_OBJECT::m_SheetPath, NETLIST_OBJECT::m_Start, and RC_ITEM::SetItems().

Referenced by NETLIST_OBJECT_LIST::TestforSimilarLabels().

Variable Documentation

◆ CommentERC_H

const wxString CommentERC_H[]
Initial value:
=
{
_( "Input Pin" ),
_( "Output Pin" ),
_( "Bidirectional Pin" ),
_( "Tri-State Pin" ),
_( "Passive Pin" ),
_( "Unspecified Pin" ),
_( "Power Input Pin" ),
_( "Power Output Pin" ),
_( "Open Collector" ),
_( "Open Emitter" ),
_( "No Connection" )
}
#define _(s)
Definition: 3d_actions.cpp:33

Definition at line 69 of file eeschema/erc.cpp.

Referenced by PANEL_SETUP_PINMAP::reBuildMatrixPanel().

◆ CommentERC_V

const wxString CommentERC_V[]
Initial value:
=
{
_( "Input Pin" ),
_( "Output Pin" ),
_( "Bidirectional Pin" ),
_( "Tri-State Pin" ),
_( "Passive Pin" ),
_( "Unspecified Pin" ),
_( "Power Input Pin" ),
_( "Power Output Pin" ),
_( "Open Collector" ),
_( "Open Emitter" ),
_( "No Connection" )
}
#define _(s)
Definition: 3d_actions.cpp:33

Definition at line 85 of file eeschema/erc.cpp.

Referenced by PANEL_SETUP_PINMAP::reBuildMatrixPanel().