KiCad PCB EDA Suite
erc.h File Reference

Go to the source code of this file.

Macros

#define NPI   4
 
#define DRV   3
 
#define NET_NC   2
 
#define NOD   1
 
#define NOC   0
 

Enumerations

enum  errortype { OK = 0, WAR, ERR, UNC }
 
enum  ERCE_T {
  ERCE_UNSPECIFIED = 0, ERCE_FIRST, ERCE_DUPLICATE_SHEET_NAME = ERCE_FIRST, ERCE_PIN_NOT_CONNECTED,
  ERCE_PIN_NOT_DRIVEN, ERCE_PIN_TO_PIN_WARNING, ERCE_PIN_TO_PIN_ERROR, ERCE_HIERACHICAL_LABEL,
  ERCE_NOCONNECT_CONNECTED, ERCE_NOCONNECT_NOT_CONNECTED, ERCE_LABEL_NOT_CONNECTED, ERCE_SIMILAR_LABELS,
  ERCE_DIFFERENT_UNIT_FP, ERCE_DIFFERENT_UNIT_NET, ERCE_BUS_ALIAS_CONFLICT, ERCE_DRIVER_CONFLICT,
  ERCE_BUS_ENTRY_CONFLICT, ERCE_BUS_LABEL_ERROR, ERCE_BUS_TO_BUS_CONFLICT, ERCE_BUS_TO_NET_CONFLICT,
  ERCE_GLOBLABEL, ERCE_LAST = ERCE_GLOBLABEL
}
 DRC error codes: More...
 

Functions

void Diagnose (NETLIST_OBJECT *NetItemRef, NETLIST_OBJECT *NetItemTst, int MinConnexion, int Diag)
 Performs ERC testing and creates an ERC marker to show the ERC problem for aNetItemRef or between aNetItemRef and aNetItemTst. More...
 
void TestOthersItems (NETLIST_OBJECT_LIST *aList, unsigned aNetItemRef, unsigned aNetStart, int *aMinConnexion)
 Perform ERC testing for electrical conflicts between NetItemRef and other items (mainly pin) on the same net. More...
 
int TestDuplicateSheetNames (bool aCreateMarker)
 Function TestDuplicateSheetNames( ) inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated). More...
 
int TestConflictingBusAliases ()
 Checks that there are not conflicting bus alias definitions in the schematic. More...
 
int TestMultiunitFootprints (SCH_SHEET_LIST &aSheetList)
 Test if all units of each multiunit component have the same footprint assigned. More...
 

Variables

const wxString CommentERC_H []
 
const wxString CommentERC_V []
 

Macro Definition Documentation

◆ DRV

#define DRV   3

Definition at line 80 of file erc.h.

◆ NET_NC

#define NET_NC   2

Definition at line 81 of file erc.h.

◆ NOC

#define NOC   0

Definition at line 83 of file erc.h.

◆ NOD

#define NOD   1

Definition at line 82 of file erc.h.

◆ NPI

#define NPI   4

Definition at line 79 of file erc.h.

Enumeration Type Documentation

◆ ERCE_T

enum ERCE_T

DRC error codes:

Enumerator
ERCE_UNSPECIFIED 
ERCE_FIRST 
ERCE_DUPLICATE_SHEET_NAME 
ERCE_PIN_NOT_CONNECTED 
ERCE_PIN_NOT_DRIVEN 
ERCE_PIN_TO_PIN_WARNING 
ERCE_PIN_TO_PIN_ERROR 
ERCE_HIERACHICAL_LABEL 
ERCE_NOCONNECT_CONNECTED 
ERCE_NOCONNECT_NOT_CONNECTED 
ERCE_LABEL_NOT_CONNECTED 
ERCE_SIMILAR_LABELS 
ERCE_DIFFERENT_UNIT_FP 
ERCE_DIFFERENT_UNIT_NET 
ERCE_BUS_ALIAS_CONFLICT 
ERCE_DRIVER_CONFLICT 
ERCE_BUS_ENTRY_CONFLICT 
ERCE_BUS_LABEL_ERROR 
ERCE_BUS_TO_BUS_CONFLICT 
ERCE_BUS_TO_NET_CONFLICT 
ERCE_GLOBLABEL 
ERCE_LAST 

Definition at line 52 of file erc.h.

53 {
54  ERCE_UNSPECIFIED = 0,
55  ERCE_FIRST,
56  ERCE_DUPLICATE_SHEET_NAME = ERCE_FIRST, // duplicate sheet names within a given sheet
57  ERCE_PIN_NOT_CONNECTED, // pin not connected and not no connect symbol
58  ERCE_PIN_NOT_DRIVEN, // pin connected to some others pins but no pin to drive it
59  ERCE_PIN_TO_PIN_WARNING, // pin connected to an other pin: warning level
60  ERCE_PIN_TO_PIN_ERROR, // pin connected to an other pin: error level
61  ERCE_HIERACHICAL_LABEL, // mismatch between hierarchical labels and pins sheets
62  ERCE_NOCONNECT_CONNECTED, // a no connect symbol is connected to more than 1 pin
63  ERCE_NOCONNECT_NOT_CONNECTED, // a no connect symbol is not connected to anything
64  ERCE_LABEL_NOT_CONNECTED, // label not connected to anything
65  ERCE_SIMILAR_LABELS, // 2 labels are equal fir case insensitive comparisons
66  ERCE_DIFFERENT_UNIT_FP, // different units of the same component have different footprints assigned
67  ERCE_DIFFERENT_UNIT_NET, // a shared pin in a multi-unit component is connected to more than one net
68  ERCE_BUS_ALIAS_CONFLICT, // conflicting bus alias definitions across sheets
69  ERCE_DRIVER_CONFLICT, // conflicting drivers (labels, etc) on a subgraph
70  ERCE_BUS_ENTRY_CONFLICT, // a wire connected to a bus doesn't match the bus
71  ERCE_BUS_LABEL_ERROR, // a label attached to a bus isn't in bus format
72  ERCE_BUS_TO_BUS_CONFLICT, // a connection between bus objects doesn't share at least one net
73  ERCE_BUS_TO_NET_CONFLICT, // a bus wire is graphically connected to a net port/pin (or vice versa)
74  ERCE_GLOBLABEL, // a global label is unique
76 };
Definition: erc.h:55
Definition: erc.h:75

◆ errortype

enum errortype
Enumerator
OK 
WAR 
ERR 
UNC 

Definition at line 40 of file erc.h.

41 {
42  OK = 0,
43  WAR, // Error: severity = warning
44  ERR, // Error: severity = error
45  UNC // Error: unconnected pin
46 };
Definition: erc.h:43
Definition: erc.h:42
Definition: erc.h:44
Definition: erc.h:45

Function Documentation

◆ Diagnose()

void Diagnose ( NETLIST_OBJECT NetItemRef,
NETLIST_OBJECT NetItemTst,
int  MinConnexion,
int  Diag 
)

Performs ERC testing and creates an ERC marker to show the ERC problem for aNetItemRef or between aNetItemRef and aNetItemTst.

if MinConn < 0: this is an error on labels

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

305 {
306  if( aDiag == OK || aMinConn < 1 || aNetItemRef->m_Type != NETLIST_ITEM::PIN )
307  return;
308 
309  SCH_PIN* pin = static_cast<SCH_PIN*>( aNetItemRef->m_Comp );
310 
311  /* Create new marker for ERC error. */
313  aNetItemRef->m_SheetPath.LastScreen()->Append( marker );
314 
315  if( aNetItemTst == NULL)
316  {
317  if( aMinConn == NOD ) /* Nothing driving the net. */
318  {
319  marker->SetData( ERCE_PIN_NOT_DRIVEN, aNetItemRef->m_Start,
320  pin->GetDescription( &aNetItemRef->m_SheetPath ), pin->m_Uuid );
321  return;
322  }
323  }
324 
325  if( aNetItemTst && aNetItemTst->m_Type == NETLIST_ITEM::PIN ) /* Error between 2 pins */
326  {
327  SCH_PIN* pinB = static_cast<SCH_PIN*>( aNetItemTst->m_Comp );
328 
330  aNetItemRef->m_Start,
331  pin->GetDescription( &aNetItemRef->m_SheetPath ), pin->m_Uuid,
332  pinB->GetDescription( &aNetItemTst->m_SheetPath ), pinB->m_Uuid );
333  }
334 }
wxString GetDescription(const SCH_SHEET_PATH *aSheet)
Definition: sch_pin.cpp:84
Definition: erc.h:42
Definition: erc.h:44
#define NULL
const KIID m_Uuid
Definition: base_struct.h:169
void SetData(EDA_UNITS aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
Definition: marker_base.cpp:91
#define NOD
Definition: erc.h:82

References SCH_SCREEN::Append(), ERCE_PIN_NOT_DRIVEN, ERCE_PIN_TO_PIN_ERROR, ERCE_PIN_TO_PIN_WARNING, ERR, SCH_PIN::GetDescription(), SCH_SHEET_PATH::LastScreen(), NETLIST_OBJECT::m_Comp, NETLIST_OBJECT::m_SheetPath, NETLIST_OBJECT::m_Start, NETLIST_OBJECT::m_Type, EDA_ITEM::m_Uuid, MARKER_BASE::MARKER_ERC, NOD, NULL, OK, PIN, and MARKER_BASE::SetData().

Referenced by TestOthersItems().

◆ TestConflictingBusAliases()

int TestConflictingBusAliases ( )

Checks that there are not conflicting bus alias definitions in the schematic.

(for example, two hierarchical sub-sheets contain different definitions for the same bus alias)

Returns
the error count

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

202 {
203  wxString msg;
204  int err_count = 0;
205  SCH_SCREENS screens;
206  std::vector< std::shared_ptr<BUS_ALIAS> > aliases;
207 
208  for( auto screen = screens.GetFirst(); screen != NULL; screen = screens.GetNext() )
209  {
210  std::unordered_set< std::shared_ptr<BUS_ALIAS> > screen_aliases = screen->GetBusAliases();
211 
212  for( const std::shared_ptr<BUS_ALIAS>& alias : screen_aliases )
213  {
214  for( const std::shared_ptr<BUS_ALIAS>& test : aliases )
215  {
216  if( alias->GetName() == test->GetName() && alias->Members() != test->Members() )
217  {
218  msg.Printf( _( "Bus alias %s has conflicting definitions on %s and %s" ),
219  alias->GetName(),
220  alias->GetParent()->GetFileName(),
221  test->GetParent()->GetFileName() );
222 
224  marker->SetData( ERCE_BUS_ALIAS_CONFLICT, wxPoint(), msg );
225  test->GetParent()->Append( marker );
226 
227  ++err_count;
228  }
229  }
230  }
231 
232  aliases.insert( aliases.end(), screen_aliases.begin(), screen_aliases.end() );
233  }
234 
235  return err_count;
236 }
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:970
#define NULL
#define _(s)
Definition: 3d_actions.cpp:33
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:959
void SetData(EDA_UNITS aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
Definition: marker_base.cpp:91
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491

References _, ERCE_BUS_ALIAS_CONFLICT, SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), MARKER_BASE::MARKER_ERC, NULL, and MARKER_BASE::SetData().

Referenced by DIALOG_ERC::TestErc().

◆ TestDuplicateSheetNames()

int TestDuplicateSheetNames ( bool  aCreateMarker)

Function TestDuplicateSheetNames( ) inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).

Returns
the error count
Parameters
aCreateMarkertrue = create error markers in schematic, false = calculate error count only

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

158 {
159  SCH_SCREEN* screen;
160  int err_count = 0;
161  SCH_SCREENS screenList; // Created the list of screen
162 
163  for( screen = screenList.GetFirst(); screen != NULL; screen = screenList.GetNext() )
164  {
165  std::vector<SCH_SHEET*> list;
166 
167  for( SCH_ITEM* item : screen->Items().OfType( SCH_SHEET_T ) )
168  list.push_back( static_cast<SCH_SHEET*>( item ) );
169 
170  for( size_t i = 0; i < list.size(); i++ )
171  {
172  SCH_SHEET* item = list[i];
173 
174  for( size_t j = i + 1; j < list.size(); j++ )
175  {
176  SCH_SHEET* test_item = list[j];
177 
178  // We have found a second sheet: compare names
179  // we are using case insensitive comparison to avoid mistakes between
180  // similar names like Mysheet and mysheet
181  if( item->GetName().CmpNoCase( test_item->GetName() ) == 0 )
182  {
183  if( aCreateMarker )
184  {
187  item->GetPosition(), item, test_item );
188  screen->Append( marker );
189  }
190 
191  err_count++;
192  }
193  }
194  }
195  }
196 
197  return err_count;
198 }
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:970
EE_TYPE OfType(KICAD_T aType)
Definition: sch_rtree.h:219
wxString GetName() const
Definition: sch_sheet.h:280
#define NULL
wxPoint GetPosition() const override
Function GetPosition.
Definition: sch_sheet.h:565
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:215
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:175
EE_RTREE & Items()
Definition: sch_screen.h:127
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:959
void SetData(EDA_UNITS aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
Definition: marker_base.cpp:91
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491

◆ TestMultiunitFootprints()

int TestMultiunitFootprints ( SCH_SHEET_LIST aSheetList)

Test if all units of each multiunit component have the same footprint assigned.

Parameters
aSheetListcontains components to be validated.
Returns
The error count.

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

240 {
241  int errors = 0;
242  std::map<wxString, LIB_ID> footprints;
244  aSheetList.GetMultiUnitComponents( refMap, true );
245 
246  for( auto& component : refMap )
247  {
248  auto& refList = component.second;
249 
250  if( refList.GetCount() == 0 )
251  {
252  wxFAIL; // it should not happen
253  continue;
254  }
255 
256  // Reference footprint
257  wxString fp;
258  wxString unitName;
259  KIID unitID;
260 
261  for( unsigned i = 0; i < component.second.GetCount(); ++i )
262  {
263  SCH_COMPONENT* unit = refList.GetItem( i ).GetComp();
264  SCH_SHEET_PATH sheetPath = refList.GetItem( i ).GetSheetPath();
265  fp = unit->GetField( FOOTPRINT )->GetText();
266 
267  if( !fp.IsEmpty() )
268  {
269  unitName = unit->GetRef( &sheetPath, true );
270  unitID = unit->m_Uuid;
271  break;
272  }
273  }
274 
275  for( unsigned i = 0; i < component.second.GetCount(); ++i )
276  {
277  SCH_REFERENCE& secondRef = refList.GetItem( i );
278  SCH_COMPONENT* secondUnit = secondRef.GetComp();
279  SCH_SHEET_PATH sheetPath = secondRef.GetSheetPath();
280 
281  const wxString secondFp = secondUnit->GetField( FOOTPRINT )->GetText();
282  wxString secondName = secondUnit->GetRef( &sheetPath, true );
283  KIID secondID = secondUnit->m_Uuid;
284 
285  if( !secondFp.IsEmpty() && fp != secondFp )
286  {
287  wxString description = _( "%s has '%s' assigned" );
288 
290  marker->SetData( ERCE_DIFFERENT_UNIT_FP, secondUnit->GetPosition(),
291  wxString::Format( description, unitName, fp ), unitID,
292  wxString::Format( description, secondName, secondFp ), secondID );
293  secondRef.GetSheetPath().LastScreen()->Append( marker );
294 
295  ++errors;
296  }
297  }
298  }
299 
300  return errors;
301 }
const SCH_SHEET_PATH & GetSheetPath() const
SCH_COMPONENT * GetComp() const
Field Name Module PCB, i.e. "16DIP300".
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
Definition: common.h:65
SCH_SHEET_PATH.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false)
Return the reference for the given sheet path.
std::map< wxString, SCH_REFERENCE_LIST > SCH_MULTI_UNIT_REFERENCE_MAP
Type SCH_MULTI_UNIT_REFERENCE_MAP is used to create a map of reference designators for multi-unit par...
void GetMultiUnitComponents(SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols=true)
Function GetMultiUnitComponents adds a SCH_REFERENCE_LIST object to aRefList for each same-reference ...
const KIID m_Uuid
Definition: base_struct.h:169
SCH_SCREEN * LastScreen()
Function LastScreen.
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
void Append(SCH_ITEM *aItem)
Definition: sch_screen.cpp:175
#define _(s)
Definition: 3d_actions.cpp:33
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
wxPoint GetPosition() const override
Function GetPosition.
void SetData(EDA_UNITS aUnits, int aErrorCode, const wxPoint &aMarkerPos, EDA_ITEM *aItem, const wxPoint &aPos, EDA_ITEM *bItem=nullptr, const wxPoint &bPos=wxPoint())
Function SetData fills in all the reportable data associated with a MARKER.
Definition: marker_base.cpp:91
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
SCH_REFERENCE is used as a helper to define a component's reference designator in a schematic.

References _, SCH_SCREEN::Append(), ERCE_DIFFERENT_UNIT_FP, FOOTPRINT, Format(), SCH_REFERENCE::GetComp(), SCH_COMPONENT::GetField(), SCH_SHEET_LIST::GetMultiUnitComponents(), SCH_COMPONENT::GetPosition(), SCH_COMPONENT::GetRef(), SCH_REFERENCE::GetSheetPath(), EDA_TEXT::GetText(), SCH_SHEET_PATH::LastScreen(), EDA_ITEM::m_Uuid, MARKER_BASE::MARKER_ERC, and MARKER_BASE::SetData().

Referenced by DIALOG_ERC::TestErc().

◆ TestOthersItems()

void TestOthersItems ( NETLIST_OBJECT_LIST aList,
unsigned  aNetItemRef,
unsigned  aNetStart,
int *  aMinConnexion 
)

Perform ERC testing for electrical conflicts between NetItemRef and other items (mainly pin) on the same net.

Parameters
aList= a reference to the list of connected objects
aNetItemRef= index in list of the current object
aNetStart= index in list of net objects of the first item
aMinConnexion= a pointer to a variable to store the minimal connection found( NOD, DRV, NPI, NET_NC)

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

339 {
340  unsigned netItemTst = aNetStart;
342  int erc = OK;
343 
344  /* Analysis of the table of connections. */
345  ELECTRICAL_PINTYPE ref_elect_type = aList->GetItem( aNetItemRef )->m_ElectricalPinType;
346  int local_minconn = NOC;
347 
348  if( ref_elect_type == ELECTRICAL_PINTYPE::PT_NC )
349  local_minconn = NPI;
350 
351  /* Test pins connected to NetItemRef */
352  for( ; ; netItemTst++ )
353  {
354  if( aNetItemRef == netItemTst )
355  continue;
356 
357  // We examine only a given net. We stop the search if the net changes
358  if( ( netItemTst >= aList->size() ) // End of list
359  || ( aList->GetItemNet( aNetItemRef ) !=
360  aList->GetItemNet( netItemTst ) ) ) // End of net
361  {
362  /* End net code found: minimum connection test. */
363  if( ( *aMinConnexion < NET_NC ) && ( local_minconn < NET_NC ) )
364  {
365  /* Not connected or not driven pin. */
366  bool seterr = true;
367 
368  if( local_minconn == NOC && aList->GetItemType( aNetItemRef ) == NETLIST_ITEM::PIN )
369  {
370  /* This pin is not connected: for multiple part per
371  * package, and duplicated pin,
372  * search for another instance of this pin
373  * this will be flagged only if all instances of this pin
374  * are not connected
375  * TODO test also if instances connected are connected to
376  * the same net
377  */
378  for( unsigned duplicate = 0; duplicate < aList->size(); duplicate++ )
379  {
380  if( aList->GetItemType( duplicate ) != NETLIST_ITEM::PIN )
381  continue;
382 
383  if( duplicate == aNetItemRef )
384  continue;
385 
386  if( aList->GetItem( aNetItemRef )->m_PinNum !=
387  aList->GetItem( duplicate )->m_PinNum )
388  continue;
389 
390  if( ( (SCH_COMPONENT*) aList->GetItem( aNetItemRef )->
391  m_Link )->GetRef( &aList->GetItem( aNetItemRef )-> m_SheetPath ) !=
392  ( (SCH_COMPONENT*) aList->GetItem( duplicate )->m_Link )
393  ->GetRef( &aList->GetItem( duplicate )->m_SheetPath ) )
394  continue;
395 
396  // Same component and same pin. Do dot create error for this pin
397  // if the other pin is connected (i.e. if duplicate net has another
398  // item)
399  if( (duplicate > 0)
400  && ( aList->GetItemNet( duplicate ) ==
401  aList->GetItemNet( duplicate - 1 ) ) )
402  seterr = false;
403 
404  if( (duplicate < aList->size() - 1)
405  && ( aList->GetItemNet( duplicate ) ==
406  aList->GetItemNet( duplicate + 1 ) ) )
407  seterr = false;
408  }
409  }
410 
411  if( seterr )
412  Diagnose( aList->GetItem( aNetItemRef ), NULL, local_minconn, WAR );
413 
414  *aMinConnexion = DRV; // inhibiting other messages of this
415  // type for the net.
416  }
417  return;
418  }
419 
420  switch( aList->GetItemType( netItemTst ) )
421  {
424  case NETLIST_ITEM::BUS:
426  case NETLIST_ITEM::LABEL:
435  break;
436 
438  local_minconn = std::max( NET_NC, local_minconn );
439  break;
440 
441  case NETLIST_ITEM::PIN:
442  jj = aList->GetItem( netItemTst )->m_ElectricalPinType;
443  local_minconn = std::max(
444  MinimalReq[static_cast<int>( ref_elect_type )][static_cast<int>( jj )],
445  local_minconn );
446 
447  if( netItemTst <= aNetItemRef )
448  break;
449 
450  if( erc == OK )
451  {
452  erc = PinMap[static_cast<int>( ref_elect_type )][static_cast<int>( jj )];
453 
454  if( erc != OK )
455  {
456  if( aList->GetConnectionType( netItemTst ) == NET_CONNECTION::UNCONNECTED )
457  {
458  Diagnose( aList->GetItem( aNetItemRef ), aList->GetItem( netItemTst ),
459  0, erc );
460  aList->SetConnectionType( netItemTst,
462  }
463  }
464  }
465 
466  break;
467  }
468  }
469 }
Definition: erc.h:43
void Diagnose(NETLIST_OBJECT *aNetItemRef, NETLIST_OBJECT *aNetItemTst, int aMinConn, int aDiag)
Performs ERC testing and creates an ERC marker to show the ERC problem for aNetItemRef or between aNe...
SCH_SHEET_PATH m_SheetPath
ELECTRICAL_PINTYPE m_ElectricalPinType
int GetItemNet(unsigned aIdx) const
Acces to an item net code.
#define DRV
Definition: erc.h:80
Definition: erc.h:42
#define NULL
NETLIST_ITEM GetItemType(unsigned aIdx) const
Acces to an item type.
NETLIST_OBJECT * GetItem(unsigned aIdx) const
Acces to an item in list.
#define NOC
Definition: erc.h:83
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
Definition: pin_type.h:37
#define NPI
Definition: erc.h:79
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
void SetConnectionType(unsigned aIdx, NET_CONNECTION aFlg=NET_CONNECTION::UNCONNECTED)
Set the item connection type: UNCONNECTED Pin or Label not connected (error) NOCONNECT_SYMBOL_PRESENT...
NET_CONNECTION GetConnectionType(unsigned aIdx)
#define NET_NC
Definition: erc.h:81
not connected (must be left open)
SCH_ITEM * m_Link
int PinMap[ELECTRICAL_PINTYPES_TOTAL][ELECTRICAL_PINTYPES_TOTAL]
static int MinimalReq[ELECTRICAL_PINTYPES_TOTAL][ELECTRICAL_PINTYPES_TOTAL]
Look up table which gives the minimal drive for a pair of connected pins on a net.

References BUS, BUSLABELMEMBER, Diagnose(), DRV, NETLIST_OBJECT_LIST::GetConnectionType(), NETLIST_OBJECT_LIST::GetItem(), NETLIST_OBJECT_LIST::GetItemNet(), NETLIST_OBJECT_LIST::GetItemType(), GLOBBUSLABELMEMBER, GLOBLABEL, HIERBUSLABELMEMBER, HIERLABEL, ITEM_UNSPECIFIED, JUNCTION, LABEL, NETLIST_OBJECT::m_ElectricalPinType, NETLIST_OBJECT::m_Link, NETLIST_OBJECT::m_PinNum, NETLIST_OBJECT::m_SheetPath, MinimalReq, NET_NC, NOC, NOCONNECT, NOCONNECT_SYMBOL_PRESENT, NPI, NULL, OK, PIN, PINLABEL, PinMap, PT_NC, SEGMENT, NETLIST_OBJECT_LIST::SetConnectionType(), SHEETBUSLABELMEMBER, SHEETLABEL, UNCONNECTED, and WAR.

Referenced by DIALOG_ERC::TestErc().

Variable Documentation

◆ CommentERC_H

const wxString CommentERC_H[]

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

Referenced by PANEL_SETUP_PINMAP::ReBuildMatrixPanel().

◆ CommentERC_V

const wxString CommentERC_V[]

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

Referenced by PANEL_SETUP_PINMAP::ReBuildMatrixPanel().