Revert "Consolidated ERC fixes"

This reverts commit 2127712115.

Version uses functions only available in the master branch.  Will revert
for 7.0.2 to allow targeted update
This commit is contained in:
Seth Hillbrand 2023-03-06 21:22:55 -08:00
parent 04f4ca9772
commit 839301f81e
2 changed files with 18 additions and 16 deletions

View File

@ -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<ERC_ITEM> 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<ERC_ITEM> 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<wxString, std::pair<SCH_LABEL_BASE*, SCH_SHEET_PATH>> labelMap;
std::unordered_map<wxString, SCH_LABEL_BASE*> labelMap;
for( const std::pair<NET_NAME_CODE_CACHE_KEY, std::vector<CONNECTION_SUBGRAPH*>> 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<ERC_ITEM> 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 );

View File

@ -248,10 +248,10 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
bool SCH_PIN::IsStacked( const SCH_PIN* aPin ) const
{
return m_parent == aPin->GetParent()
&& 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 ) );
}