CADSTAR Schematic: Load line thickness in symbols

This commit is contained in:
Roberto Fernandez Bautista 2021-08-29 19:55:47 +01:00
parent f59e66a897
commit 0cd8a4d846
2 changed files with 9 additions and 4 deletions

View File

@ -1211,12 +1211,15 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
for( std::pair<FIGURE_ID, FIGURE> figPair : symbol.Figures ) for( std::pair<FIGURE_ID, FIGURE> figPair : symbol.Figures )
{ {
FIGURE fig = figPair.second; FIGURE fig = figPair.second;
int lineThickness = getLineThickness( fig.LineCodeID );
loadLibrarySymbolShapeVertices( fig.Shape.Vertices, symbol.Origin, aSymbol, gateNumber ); loadLibrarySymbolShapeVertices( fig.Shape.Vertices, symbol.Origin, aSymbol, gateNumber,
lineThickness );
for( CUTOUT c : fig.Shape.Cutouts ) for( CUTOUT c : fig.Shape.Cutouts )
{ {
loadLibrarySymbolShapeVertices( c.Vertices, symbol.Origin, aSymbol, gateNumber ); loadLibrarySymbolShapeVertices( c.Vertices, symbol.Origin, aSymbol, gateNumber,
lineThickness );
} }
} }
@ -1497,7 +1500,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
void CADSTAR_SCH_ARCHIVE_LOADER::loadLibrarySymbolShapeVertices( void CADSTAR_SCH_ARCHIVE_LOADER::loadLibrarySymbolShapeVertices(
const std::vector<VERTEX>& aCadstarVertices, wxPoint aSymbolOrigin, LIB_SYMBOL* aSymbol, const std::vector<VERTEX>& aCadstarVertices, wxPoint aSymbolOrigin, LIB_SYMBOL* aSymbol,
int aGateNumber ) int aGateNumber, int aLineThickness )
{ {
const VERTEX* prev = &aCadstarVertices.at( 0 ); const VERTEX* prev = &aCadstarVertices.at( 0 );
const VERTEX* cur; const VERTEX* cur;
@ -1561,6 +1564,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadLibrarySymbolShapeVertices(
} }
segment->SetUnit( aGateNumber ); segment->SetUnit( aGateNumber );
segment->SetWidth( aLineThickness );
aSymbol->AddDrawItem( segment ); aSymbol->AddDrawItem( segment );
prev = cur; prev = cur;

View File

@ -137,7 +137,8 @@ private:
const GATE_ID& aGateID, LIB_SYMBOL* aSymbol ); const GATE_ID& aGateID, LIB_SYMBOL* aSymbol );
void loadLibrarySymbolShapeVertices( const std::vector<VERTEX>& aCadstarVertices, void loadLibrarySymbolShapeVertices( const std::vector<VERTEX>& aCadstarVertices,
wxPoint aSymbolOrigin, LIB_SYMBOL* aSymbol, int aGateNumber ); wxPoint aSymbolOrigin, LIB_SYMBOL* aSymbol,
int aGateNumber, int aLineThickness );
void applyToLibraryFieldAttribute( const ATTRIBUTE_LOCATION& aCadstarAttrLoc, void applyToLibraryFieldAttribute( const ATTRIBUTE_LOCATION& aCadstarAttrLoc,
wxPoint aSymbolOrigin, LIB_FIELD* aKiCadField ); wxPoint aSymbolOrigin, LIB_FIELD* aKiCadField );