Ensure that layer names are unique when importing
Altium allows duplicate layer names but KiCad prefers to have unique names for each layer. This enforces a unique name for each layer when importing Fixes https://gitlab.com/kicad/code/kicad/-/issues/15583
This commit is contained in:
parent
06428e0161
commit
c772d116b2
|
@ -274,6 +274,13 @@ ABOARD6::ABOARD6( ALTIUM_PARSER& aReader )
|
|||
ABOARD6_LAYER_STACKUP l;
|
||||
|
||||
l.name = ALTIUM_PARSER::ReadString( props, layername, wxT( "" ) );
|
||||
wxString originalName = l.name;
|
||||
int ii = 2;
|
||||
|
||||
// Ensure that layer names are unique in KiCad
|
||||
while( !layerNames.insert( l.name ).second )
|
||||
l.name = wxString::Format( wxT( "%s %d" ), originalName, ii++ );
|
||||
|
||||
l.nextId = ALTIUM_PARSER::ReadInt( props, layeri + wxT( "NEXT" ), 0 );
|
||||
l.prevId = ALTIUM_PARSER::ReadInt( props, layeri + wxT( "PREV" ), 0 );
|
||||
l.copperthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + wxT( "COPTHICK" ), wxT( "1.4mil" ) );
|
||||
|
|
|
@ -377,6 +377,7 @@ struct ABOARD6
|
|||
|
||||
int layercount;
|
||||
std::vector<ABOARD6_LAYER_STACKUP> stackup;
|
||||
std::set<wxString> layerNames;
|
||||
|
||||
std::vector<ALTIUM_VERTICE> board_vertices;
|
||||
|
||||
|
|
Loading…
Reference in New Issue