![]() |
KiCad PCB EDA Suite
|
#include <erc.h>
Public Member Functions | |
ERC_TESTER (SCHEMATIC *aSchematic) | |
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) |
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated). More... | |
void | TestTextVars (DS_PROXY_VIEW_ITEM *aDrawingSheet) |
Check for any unresolved text variable references. More... | |
int | TestConflictingBusAliases () |
Check that there are no conflicting bus alias definitions in the schematic. More... | |
int | TestMultiunitFootprints () |
Test if all units of each multiunit symbol have the same footprint assigned. More... | |
int | TestNoConnectPins () |
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type. More... | |
int | TestPinToPin () |
Checks the full netlist against the pin-to-pin connectivity requirements. More... | |
int | TestMultUnitPinConflicts () |
Checks if shared pins on multi-unit symbols have been connected to different nets. More... | |
int | TestSimilarLabels () |
Checks for labels that differ only in capitalization. More... | |
int | TestLibSymbolIssues () |
Test symbols for changed library symbols and broken symbol library links. More... | |
Private Attributes | |
SCHEMATIC * | m_schematic |
int ERC_TESTER::TestConflictingBusAliases | ( | ) |
Check that there are no conflicting bus alias definitions in the schematic.
(for example, two hierarchical sub-sheets contain different definitions for the same bus alias)
Definition at line 282 of file erc.cpp.
References _, ERC_ITEM::Create(), ERCE_BUS_ALIAS_CONFLICT, m_schematic, and SCHEMATIC::Root().
Referenced by DIALOG_ERC::testErc().
int ERC_TESTER::TestDuplicateSheetNames | ( | bool | aCreateMarker | ) |
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).
aCreateMarker | true = create error markers in schematic, false = calculate error count only |
Definition at line 118 of file erc.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_DUPLICATE_SHEET_NAME, SCH_SHEET::GetName(), SCH_SHEET::GetPosition(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), SCHEMATIC::Root(), and SCH_SHEET_T.
Referenced by DIALOG_ERC::testErc().
int ERC_TESTER::TestLibSymbolIssues | ( | ) |
Test symbols for changed library symbols and broken symbol library links.
Definition at line 680 of file erc.cpp.
References _, ERC_ITEM::Create(), ERCE_LIB_SYMBOL_ISSUES, SYMBOL_LIB_TABLE::FindRow(), LIB_SYMBOL::Flatten(), SCH_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPosition(), LIB_TABLE::HasLibrary(), m_schematic, SCHEMATIC::Prj(), SCHEMATIC::Root(), SCH_SYMBOL_T, SchGetLibSymbol(), and UnescapeString().
Referenced by DIALOG_ERC::testErc().
int ERC_TESTER::TestMultiunitFootprints | ( | ) |
Test if all units of each multiunit symbol have the same footprint assigned.
Definition at line 323 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_DIFFERENT_UNIT_FP, SCH_REFERENCE_LIST::GetCount(), SCH_REFERENCE::GetFootprint(), SCH_REFERENCE_LIST::GetItem(), SCH_SHEET_LIST::GetMultiUnitSymbols(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetRef(), SCH_REFERENCE::GetSheetPath(), SCHEMATIC::GetSheets(), SCH_REFERENCE::GetSymbol(), SCH_SHEET_PATH::LastScreen(), and m_schematic.
Referenced by DIALOG_ERC::testErc().
int ERC_TESTER::TestMultUnitPinConflicts | ( | ) |
Checks if shared pins on multi-unit symbols have been connected to different nets.
Definition at line 567 of file erc.cpp.
References _, SCH_SCREEN::Append(), SCHEMATIC::ConnectionGraph(), ERC_ITEM::Create(), ERCE_DIFFERENT_UNIT_NET, Format(), CONNECTION_GRAPH::GetNetMap(), SCH_SHEET_PATH::LastScreen(), CONNECTION_SUBGRAPH::m_items, m_schematic, CONNECTION_SUBGRAPH::m_sheet, name, pin, SCH_PIN_T, and EDA_ITEM::Type().
Referenced by DIALOG_ERC::testErc().
int ERC_TESTER::TestNoConnectPins | ( | ) |
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
In KiCad 6, this no longer results in those pins joining the net, so we need to warn about it
Definition at line 389 of file erc.cpp.
References _, ERC_ITEM::Create(), ERCE_NOCONNECT_CONNECTED, SCH_SYMBOL::GetPins(), SCHEMATIC::GetSheets(), m_schematic, pin, PT_NC, and SCH_SYMBOL_T.
Referenced by DIALOG_ERC::testErc().
void ERC_TESTER::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.
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) |
int ERC_TESTER::TestPinToPin | ( | ) |
Checks the full netlist against the pin-to-pin connectivity requirements.
Definition at line 431 of file erc.cpp.
References _, SCHEMATIC::ConnectionGraph(), ERC_ITEM::Create(), DrivenPinTypes, DrivingPinTypes, DrivingPowerPinTypes, ElectricalPinTypeGetText(), erc, ERCE_PIN_NOT_DRIVEN, ERCE_PIN_TO_PIN_ERROR, ERCE_PIN_TO_PIN_WARNING, ERCE_POWERPIN_NOT_DRIVEN, SCHEMATIC::ErcSettings(), Format(), CONNECTION_GRAPH::GetNetMap(), ERC_SETTINGS::GetPinMapValue(), SCH_PIN::GetTransformedPosition(), SCH_PIN::GetType(), ERC_SETTINGS::IsTestEnabled(), SCH_PIN::IsVisible(), SCH_SHEET_PATH::LastScreen(), CONNECTION_SUBGRAPH::m_items, CONNECTION_SUBGRAPH::m_no_connect, m_schematic, CONNECTION_SUBGRAPH::m_sheet, OK, PT_POWER_IN, SCH_PIN_T, EDA_ITEM::Type(), and WARNING.
Referenced by DIALOG_ERC::testErc().
int ERC_TESTER::TestSimilarLabels | ( | ) |
Checks for labels that differ only in capitalization.
Definition at line 626 of file erc.cpp.
References SCH_SCREEN::Append(), SCHEMATIC::ConnectionGraph(), ERC_ITEM::Create(), ERCE_SIMILAR_LABELS, CONNECTION_GRAPH::GetNetMap(), SCH_SHEET_PATH::LastScreen(), CONNECTION_SUBGRAPH::m_items, m_schematic, CONNECTION_SUBGRAPH::m_sheet, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, text, and EDA_ITEM::Type().
Referenced by DIALOG_ERC::testErc().
void ERC_TESTER::TestTextVars | ( | DS_PROXY_VIEW_ITEM * | aDrawingSheet | ) |
Check for any unresolved text variable references.
Definition at line 164 of file erc.cpp.
References _, SCH_SCREEN::Append(), DS_DRAW_ITEM_LIST::BuildDrawItemsList(), ERC_ITEM::Create(), SCHEMATIC::CurrentSheet(), ERCE_UNRESOLVED_VARIABLE, ExpandEnvVarSubstitutions(), SCH_SHEET::GetFields(), SCH_SYMBOL::GetFields(), DS_DRAW_ITEM_LIST::GetFirst(), DS_DRAW_ITEM_LIST::GetNext(), DS_PROXY_VIEW_ITEM::GetPageInfo(), SCH_SYMBOL::GetPosition(), SCHEMATIC::GetSheets(), DS_PROXY_VIEW_ITEM::GetTitleBlock(), SCH_SYMBOL::GetTransform(), SCH_SCREEN::Items(), IU_PER_MILS, m_schematic, EE_RTREE::OfType(), pin, SCHEMATIC::Prj(), SCH_LOCATE_ANY_T, SCH_SHEET_T, SCH_SYMBOL_T, SCHEMATIC::SetCurrentSheet(), DS_DRAW_ITEM_LIST::SetFileName(), DS_DRAW_ITEM_LIST::SetMilsToIUfactor(), DS_DRAW_ITEM_LIST::SetPageNumber(), DS_DRAW_ITEM_LIST::SetProject(), DS_DRAW_ITEM_LIST::SetSheetCount(), DS_DRAW_ITEM_LIST::SetSheetLayer(), DS_DRAW_ITEM_LIST::SetSheetName(), text, and TRANSFORM::TransformCoordinate().
Referenced by DIALOG_ERC::testErc().
|
private |
Definition at line 133 of file erc.h.
Referenced by TestConflictingBusAliases(), TestDuplicateSheetNames(), TestLibSymbolIssues(), TestMultiunitFootprints(), TestMultUnitPinConflicts(), TestNoConnectPins(), TestPinToPin(), TestSimilarLabels(), and TestTextVars().