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,21 +766,29 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadNets()
m_sheetMap.at( bus.LayerID )->GetScreen()->Append( busEntry ); m_sheetMap.at( bus.LayerID )->GetScreen()->Append( busEntry );
if( busTerm.HasNetLabel ) // 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(); SCH_LABEL* label = new SCH_LABEL();
label->SetText( netName ); label->SetText( netName );
label->SetPosition( getKiCadPoint( busTerm.SecondPoint ) ); label->SetPosition( getKiCadPoint( busTerm.SecondPoint ) );
label->SetVisible( true ); label->SetVisible( true );
if( busTerm.HasNetLabel )
{
applyTextSettings( busTerm.NetLabel.TextCodeID, busTerm.NetLabel.Alignment, applyTextSettings( busTerm.NetLabel.TextCodeID, busTerm.NetLabel.Alignment,
busTerm.NetLabel.Justification, label ); busTerm.NetLabel.Justification, label );
}
else
{
label->SetTextSize( wxSize( 1000, 1000 ) );
}
netlabels.insert( { busTerm.ID, label } ); netlabels.insert( { busTerm.ID, label } );
m_sheetMap.at( bus.LayerID )->GetScreen()->Append( label ); m_sheetMap.at( bus.LayerID )->GetScreen()->Append( label );
} }
}
for( std::pair<NETELEMENT_ID, NET_SCH::DANGLER> danglerPair : net.Danglers ) for( std::pair<NETELEMENT_ID, NET_SCH::DANGLER> danglerPair : net.Danglers )