Update the layer names in cli/python board load of the property grid layer enum because DRC quietly uses it

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16555
This commit is contained in:
Marek Roszko 2024-01-09 20:42:58 -05:00
parent 60cba81a2e
commit 08c2237a94
1 changed files with 15 additions and 0 deletions

View File

@ -179,6 +179,21 @@ BOARD* LoadBoard( wxString& aFileName, PCB_IO_MGR::PCB_FILE_T aFormat )
if( brd )
{
// JEY TODO: move this global to the board
ENUM_MAP<PCB_LAYER_ID>& layerEnum = ENUM_MAP<PCB_LAYER_ID>::Instance();
layerEnum.Choices().Clear();
layerEnum.Undefined( UNDEFINED_LAYER );
for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
{
// Canonical name
layerEnum.Map( *seq, LSET::Name( *seq ) );
// User name
layerEnum.Map( *seq, brd->GetLayerName( *seq ) );
}
brd->SetProject( project );
// Move legacy view settings to local project settings