Code cleanup.

This commit is contained in:
Jeff Young 2021-07-02 15:53:49 +01:00
parent 780a8a5154
commit 400f4ae506
1 changed files with 16 additions and 20 deletions

View File

@ -873,20 +873,19 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
viaType = VIATYPE::THROUGH; viaType = VIATYPE::THROUGH;
} }
switch( viaType ) if( targetLayer == UNDEFINED_LAYER )
{ {
case VIATYPE::THROUGH: // Implicic layer selection
if( targetLayer == UNDEFINED_LAYER )
switch( viaType )
{ {
case VIATYPE::THROUGH:
// use the default layer pair // use the default layer pair
currentLayer = pairTop; currentLayer = pairTop;
targetLayer = pairBottom; targetLayer = pairBottom;
} break;
break;
case VIATYPE::MICROVIA: case VIATYPE::MICROVIA:
if( targetLayer == UNDEFINED_LAYER )
{
if( currentLayer == F_Cu || currentLayer == In1_Cu ) if( currentLayer == F_Cu || currentLayer == In1_Cu )
{ {
// front-side microvia // front-side microvia
@ -901,15 +900,12 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
} }
else else
{ {
wxASSERT_MSG( false, "Invalid implicit layer pair for microvia (must be on or " wxFAIL_MSG( "Invalid implicit layer pair for microvia (must be on "
"adjacent to an outer layer)." ); "or adjacent to an outer layer)." );
} }
} break;
break;
case VIATYPE::BLIND_BURIED: case VIATYPE::BLIND_BURIED:
if( targetLayer == UNDEFINED_LAYER )
{
if( currentLayer == pairTop || currentLayer == pairBottom ) if( currentLayer == pairTop || currentLayer == pairBottom )
{ {
// the current layer is on the defined layer pair, // the current layer is on the defined layer pair,
@ -923,12 +919,12 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
// so fallback and swap to the top layer of the pair by default // so fallback and swap to the top layer of the pair by default
targetLayer = pairTop; targetLayer = pairTop;
} }
} break;
break;
default: default:
wxASSERT( false ); wxFAIL_MSG( "unexpected via type" );
break; break;
}
} }
sizes.SetViaDiameter( bds.m_ViasMinSize ); sizes.SetViaDiameter( bds.m_ViasMinSize );