CADSTAR PCB: Handle older boards without construction layers

Use KiCad default stackup for older CADSTAR boards that do not
define any dielectric layers between the electrical layers.

Also fix default stackup calculation to ensure finished board thickness
is 1.6mm
This commit is contained in:
Roberto Fernandez Bautista 2021-10-09 21:11:16 +01:00
parent d62a5ecf46
commit 8f74085ca4
2 changed files with 11 additions and 5 deletions

View File

@ -517,6 +517,7 @@ void BOARD_STACKUP::BuildDefaultStackupList( const BOARD_DESIGN_SETTINGS* aSetti
// Take in account the solder mask thickness:
int sm_count = ( enabledLayer & LSET( 2, F_Mask, B_Mask) ).count();
diel_thickness -= BOARD_STACKUP_ITEM::GetMaskDefaultThickness() * sm_count;
diel_thickness /= std::max( 1, activeCuLayerCount - 1 );
int dielectric_idx = 0;

View File

@ -205,8 +205,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::initStackupItem( const LAYER& aCadstar
//TODO add Resistivity when KiCad supports it
}
aKiCadItem->SetLayerName( aCadstarLayer.Name );
aKiCadItem->SetThickness( getKiCadLength( aCadstarLayer.Thickness ), aDielectricSublayer );
if( !aCadstarLayer.Name.IsEmpty() )
aKiCadItem->SetLayerName( aCadstarLayer.Name );
if( aCadstarLayer.Thickness != 0 )
aKiCadItem->SetThickness( getKiCadLength( aCadstarLayer.Thickness ), aDielectricSublayer );
}
@ -358,11 +361,13 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup()
LAYER_BLOCK layerBlock = cadstarBoardStackup.at( stackIndex );
LAYER_BLOCK layerBlockBelow = cadstarBoardStackup.at( stackIndex + 1 );
// We should have made sure all layer blocks have at least one construction layer
wxASSERT( layerBlock.ConstructionLayers.size() > 0 );
if( layerBlock.ConstructionLayers.size() == 0 )
{
++stackIndex;
continue; // Older cadstar designs have no construction layers - use KiCad defaults
}
int dielectricId = stackIndex + 1;
// item->SetBrdLayerId();
item->SetDielectricLayerId( dielectricId );
//Prepreg or core?