diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index 7344561e4f..e136448bb8 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -208,11 +208,15 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet ) { if( unresolved( field.GetShownText() ) ) { + VECTOR2I pos = field.GetPosition() - symbol->GetPosition(); + pos = symbol->GetTransform().TransformCoordinate( pos ); + pos += symbol->GetPosition(); + std::shared_ptr ercItem = ERC_ITEM::Create( ERCE_UNRESOLVED_VARIABLE ); ercItem->SetItems( &field ); - SCH_MARKER* marker = new SCH_MARKER( ercItem, field.GetPosition() ); + SCH_MARKER* marker = new SCH_MARKER( ercItem, pos ); screen->Append( marker ); } } @@ -679,7 +683,11 @@ int ERC_TESTER::TestPinToPin() // Multiple pins in the same symbol that share a type, // name and position are considered // "stacked" and shouldn't trigger ERC errors - if( refPin.Pin()->IsStacked( testPin.Pin() ) && refPin.Sheet() == testPin.Sheet() ) + if( refPin.Pin()->GetParent() == testPin.Pin()->GetParent() + && refPin.Pin()->GetPosition() == testPin.Pin()->GetPosition() + && refPin.Pin()->GetName() == testPin.Pin()->GetName() + && refPin.Pin()->GetType() == testPin.Pin()->GetType() + && refPin.Sheet() == testPin.Sheet() ) continue; ELECTRICAL_PINTYPE testType = testPin.Pin()->GetType(); @@ -722,8 +730,6 @@ int ERC_TESTER::TestPinToPin() std::shared_ptr ercItem = ERC_ITEM::Create( err_code ); ercItem->SetItems( needsDriver.Pin() ); - ercItem->SetSheetSpecificPath( needsDriver.Sheet() ); - ercItem->SetItemsSheetPaths( needsDriver.Sheet() ); SCH_MARKER* marker = new SCH_MARKER( ercItem, needsDriver.Pin()->GetTransformedPosition() ); @@ -802,7 +808,7 @@ int ERC_TESTER::TestSimilarLabels() int errors = 0; - std::unordered_map> labelMap; + std::unordered_map labelMap; for( const std::pair> net : nets ) { @@ -822,16 +828,12 @@ int ERC_TESTER::TestSimilarLabels() if( !labelMap.count( normalized ) ) { - labelMap[normalized] = std::make_pair( label, subgraph->GetSheet() ); + labelMap[normalized] = label; } - else if( labelMap.at( normalized ).first->GetShownText() - != label->GetShownText() ) + else if( labelMap.at( normalized )->GetShownText() != label->GetShownText() ) { std::shared_ptr ercItem = ERC_ITEM::Create( ERCE_SIMILAR_LABELS ); - ercItem->SetItems( label, labelMap.at( normalized ).first ); - ercItem->SetSheetSpecificPath( subgraph->GetSheet() ); - ercItem->SetItemsSheetPaths( subgraph->GetSheet(), - labelMap.at( normalized ).second ); + ercItem->SetItems( label, labelMap.at( normalized ) ); SCH_MARKER* marker = new SCH_MARKER( ercItem, label->GetPosition() ); subgraph->m_sheet.LastScreen()->Append( marker ); diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index e04340cf8c..3decd1bf39 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -248,10 +248,10 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetParent() - && GetTransformedPosition() == aPin->GetTransformedPosition() - && GetName() == aPin->GetName() - && ( ( GetType() == aPin->GetType() ) || ( GetType() == ELECTRICAL_PINTYPE::PT_PASSIVE ) - || ( aPin->GetType() == ELECTRICAL_PINTYPE::PT_PASSIVE ) ); + && GetTransformedPosition() == aPin->GetTransformedPosition() + && ( ( GetType() == aPin->GetType() ) + || ( GetType() == ELECTRICAL_PINTYPE::PT_PASSIVE ) + || ( aPin->GetType() == ELECTRICAL_PINTYPE::PT_PASSIVE ) ); }