CADSTAR Schematic: Ensure connectivity with tiny labels at Bus Entries

Always add a label at bus terminals to ensure connectivity. The original
design might already have a bus terminal with a given location.
If the original design does not have a label, just make it very small
to keep connectivity but make the design look visually similar to
the original.
This commit is contained in:
Roberto Fernandez Bautista 2021-02-19 12:38:47 +00:00
parent 3279e295ac
commit 5a74fb9bb1
1 changed files with 16 additions and 8 deletions

View File

@ -766,20 +766,28 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadNets()
m_sheetMap.at( bus.LayerID )->GetScreen()->Append( busEntry );
// Always add a label at bus terminals to ensure connectivity.
// If the original design does not have a label, just make it very small
// to keep connectivity but make the design look visually similar to
// the original.
SCH_LABEL* label = new SCH_LABEL();
label->SetText( netName );
label->SetPosition( getKiCadPoint( busTerm.SecondPoint ) );
label->SetVisible( true );
if( busTerm.HasNetLabel )
{
SCH_LABEL* label = new SCH_LABEL();
label->SetText( netName );
label->SetPosition( getKiCadPoint( busTerm.SecondPoint ) );
label->SetVisible( true );
applyTextSettings( busTerm.NetLabel.TextCodeID, busTerm.NetLabel.Alignment,
busTerm.NetLabel.Justification, label );
netlabels.insert( { busTerm.ID, label } );
m_sheetMap.at( bus.LayerID )->GetScreen()->Append( label );
}
else
{
label->SetTextSize( wxSize( 1000, 1000 ) );
}
netlabels.insert( { busTerm.ID, label } );
m_sheetMap.at( bus.LayerID )->GetScreen()->Append( label );
}