CADSTAR Schematic Archive Importer: Load signal name even if no net label (global labels and power symbols)

Fixes error that prevented global net names from being loaded properly
This commit is contained in:
Roberto Fernandez Bautista 2020-12-29 23:38:51 +00:00 committed by Wayne Stambaugh
parent f6ec173ba7
commit a33ccf48b9
1 changed files with 13 additions and 11 deletions

View File

@ -557,25 +557,27 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadNets()
{ {
NET_SCH::SYM_TERM netTerm = terminalPair.second; NET_SCH::SYM_TERM netTerm = terminalPair.second;
if( netTerm.HasNetLabel ) if( mPowerSymMap.find( netTerm.SymbolID ) != mPowerSymMap.end() )
{ {
if( mPowerSymMap.find( netTerm.SymbolID ) != mPowerSymMap.end() ) SCH_FIELD* val = mPowerSymMap.at( netTerm.SymbolID )->GetField( VALUE_FIELD );
val->SetText( netName );
val->SetBold( false );
val->SetVisible( false );
if( netTerm.HasNetLabel )
{ {
SCH_FIELD* val = mPowerSymMap.at( netTerm.SymbolID )->GetField( VALUE_FIELD ); val->SetVisible( true );
val->SetText( netName );
val->SetPosition( getKiCadPoint( netTerm.NetLabel.Position ) ); val->SetPosition( getKiCadPoint( netTerm.NetLabel.Position ) );
val->SetTextAngle( getAngleTenthDegree( netTerm.NetLabel.OrientAngle ) ); val->SetTextAngle( getAngleTenthDegree( netTerm.NetLabel.OrientAngle ) );
val->SetBold( false );
val->SetVisible( true );
applyTextSettings( netTerm.NetLabel.TextCodeID, netTerm.NetLabel.Alignment, applyTextSettings( netTerm.NetLabel.TextCodeID, netTerm.NetLabel.Alignment,
netTerm.NetLabel.Justification, val ); netTerm.NetLabel.Justification, val );
}
else if( mGlobLabelMap.find( netTerm.SymbolID ) != mGlobLabelMap.end() )
{
mGlobLabelMap.at( netTerm.SymbolID )->SetText( netName );
} }
} }
else if( mGlobLabelMap.find( netTerm.SymbolID ) != mGlobLabelMap.end() )
{
mGlobLabelMap.at( netTerm.SymbolID )->SetText( netName );
}
} }
auto getHierarchicalLabel = [&]( NETELEMENT_ID aNode ) -> SCH_HIERLABEL* auto getHierarchicalLabel = [&]( NETELEMENT_ID aNode ) -> SCH_HIERLABEL*