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... | |
int | TestOffGridEndpoints (int aGridSize) |
Test pins and wire ends for being off grid. More... | |
int | TestSimModelIssues () |
Test SPICE models for various issues. More... | |
int | TestMissingUnits () |
Test for uninstantiated units of multi unit symbols. More... | |
Private Attributes | |
SCHEMATIC * | m_schematic |
|
inline |
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 300 of file erc.cpp.
References _, ERC_ITEM::Create(), ERCE_BUS_ALIAS_CONFLICT, SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), m_schematic, and SCHEMATIC::Root().
Referenced by BOOST_FIXTURE_TEST_CASE(), and 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 125 of file erc.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_DUPLICATE_SHEET_NAME, SCH_SCREENS::GetFirst(), SCH_SHEET::GetName(), SCH_SCREENS::GetNext(), 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 857 of file erc.cpp.
References _, ERC_ITEM::Create(), ERCE_LIB_SYMBOL_ISSUES, SYMBOL_LIB_TABLE::FindRow(), LIB_SYMBOL::Flatten(), SCH_SCREENS::GetFirst(), SCH_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SCREENS::GetNext(), 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::TestMissingUnits | ( | ) |
Test for uninstantiated units of multi unit symbols.
Definition at line 412 of file erc.cpp.
References _, SCH_SCREEN::Append(), convert, ERC_ITEM::Create(), ERCE_MISSING_BIDI_PIN, ERCE_MISSING_INPUT_PIN, ERCE_MISSING_POWER_INPUT_PIN, ERCE_MISSING_UNIT, SCHEMATIC::ErcSettings(), SCH_SYMBOL::GetConvert(), SCH_REFERENCE_LIST::GetCount(), SCH_REFERENCE_LIST::GetItem(), SCH_REFERENCE::GetLibPart(), SCH_SHEET_LIST::GetMultiUnitSymbols(), LIB_SYMBOL::GetPins(), SCH_SYMBOL::GetPosition(), SCH_REFERENCE::GetSheetPath(), SCHEMATIC::GetSheets(), SCH_REFERENCE::GetSymbol(), SCH_REFERENCE::GetUnit(), LIB_SYMBOL::GetUnitCount(), LIB_SYMBOL::GetUnitDisplayName(), ERC_SETTINGS::IsTestEnabled(), SCH_SHEET_PATH::LastScreen(), m_schematic, pin, PT_BIDI, PT_INPUT, and PT_POWER_IN.
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 347 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 BOOST_FIXTURE_TEST_CASE(), and DIALOG_ERC::testErc().
int ERC_TESTER::TestMultUnitPinConflicts | ( | ) |
Checks if shared pins on multi-unit symbols have been connected to different nets.
Definition at line 746 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 BOOST_FIXTURE_TEST_CASE(), and 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 552 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 BOOST_FIXTURE_TEST_CASE(), and DIALOG_ERC::testErc().
int ERC_TESTER::TestOffGridEndpoints | ( | int | aGridSize | ) |
Test pins and wire ends for being off grid.
Definition at line 947 of file erc.cpp.
References ERC_ITEM::Create(), ERCE_ENDPOINT_OFF_GRID, SCH_LINE::GetEndPoint(), SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), SCH_SYMBOL::GetPins(), SCH_LINE::GetStartPoint(), m_schematic, EDA_IU_SCALE::MilsToIU(), pin, SCHEMATIC::Root(), SCH_LINE_T, SCH_SYMBOL_T, schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
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 594 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, ERC_SCH_PIN_CONTEXT::Pin(), PT_POWER_IN, SCH_PIN_T, EDA_ITEM::Type(), and WARNING.
Referenced by BOOST_FIXTURE_TEST_CASE(), and DIALOG_ERC::testErc().
int ERC_TESTER::TestSimilarLabels | ( | ) |
Checks for labels that differ only in capitalization.
Definition at line 805 of file erc.cpp.
References SCH_SCREEN::Append(), SCHEMATIC::ConnectionGraph(), ERC_ITEM::Create(), ERCE_SIMILAR_LABELS, CONNECTION_GRAPH::GetNetMap(), SCH_TEXT::GetPosition(), SCH_LABEL_BASE::GetShownText(), 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, and EDA_ITEM::Type().
Referenced by BOOST_FIXTURE_TEST_CASE(), and DIALOG_ERC::testErc().
int ERC_TESTER::TestSimModelIssues | ( | ) |
Test SPICE models for various issues.
Definition at line 1019 of file erc.cpp.
References ERC_ITEM::Create(), SIM_LIB_MGR::CreateModel(), ERCE_SIMULATION_MODEL, SCH_SYMBOL::GetPosition(), SCHEMATIC::GetSheets(), m_schematic, SCHEMATIC::Prj(), and SCH_SYMBOL_T.
Referenced by DIALOG_ERC::testErc().
void ERC_TESTER::TestTextVars | ( | DS_PROXY_VIEW_ITEM * | aDrawingSheet | ) |
Check for any unresolved text variable references.
Definition at line 171 of file erc.cpp.
References _, SCH_SCREEN::Append(), DS_DRAW_ITEM_LIST::BuildDrawItemsList(), ERC_ITEM::Create(), SCHEMATIC::CurrentSheet(), erc, 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(), EDA_IU_SCALE::IU_PER_MILS, m_schematic, EE_RTREE::OfType(), pin, SCHEMATIC::Prj(), SCH_LOCATE_ANY_T, SCH_SHEET_T, SCH_SYMBOL_T, schIUScale, 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 148 of file erc.h.
Referenced by TestConflictingBusAliases(), TestDuplicateSheetNames(), TestLibSymbolIssues(), TestMissingUnits(), TestMultiunitFootprints(), TestMultUnitPinConflicts(), TestNoConnectPins(), TestOffGridEndpoints(), TestPinToPin(), TestSimilarLabels(), TestSimModelIssues(), and TestTextVars().