ERC: flag unconnected sheet pins

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1780
This commit is contained in:
Jon Evans 2021-01-13 19:47:28 -05:00
parent 693e40b5b0
commit 24ff66f5a2
1 changed files with 15 additions and 0 deletions

View File

@ -2754,6 +2754,8 @@ int CONNECTION_GRAPH::ercCheckHierSheets()
{
int errors = 0;
ERC_SETTINGS& settings = m_schematic->ErcSettings();
for( const SCH_SHEET_PATH& sheet : m_sheetList )
{
for( SCH_ITEM* item : sheet.LastScreen()->Items() )
@ -2766,8 +2768,21 @@ int CONNECTION_GRAPH::ercCheckHierSheets()
std::map<wxString, SCH_SHEET_PIN*> pins;
for( SCH_SHEET_PIN* pin : parentSheet->GetPins() )
{
pins[pin->GetText()] = pin;
if( pin->IsDangling() && settings.IsTestEnabled( ERCE_PIN_NOT_CONNECTED ) )
{
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_PIN_NOT_CONNECTED );
ercItem->SetItems( pin );
SCH_MARKER* marker = new SCH_MARKER( ercItem, pin->GetPosition() );
sheet.LastScreen()->Append( marker );
errors++;
}
}
for( SCH_ITEM* subItem : parentSheet->GetScreen()->Items() )
{
if( subItem->Type() == SCH_HIER_LABEL_T )