FIx layer switching after via placement in PNS router.
This commit is contained in:
parent
0953d5730b
commit
327f307a7f
|
@ -761,6 +761,9 @@ void PNS_LINE_PLACER::splitAdjacentSegments( PNS_NODE* aNode, PNS_ITEM* aSeg, co
|
|||
void PNS_LINE_PLACER::SetLayer( int aLayer )
|
||||
{
|
||||
m_currentLayer = aLayer;
|
||||
|
||||
m_head.SetLayer( aLayer );
|
||||
m_tail.SetLayer( aLayer );
|
||||
}
|
||||
|
||||
|
||||
|
@ -901,7 +904,16 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
|
|||
VECTOR2I p_start = m_placingVia ? p_last : p_pre_last;
|
||||
|
||||
if( m_placingVia )
|
||||
m_currentLayer = Router()->NextCopperLayer( true );
|
||||
{
|
||||
int layerTop = Router()->Settings().GetLayerTop();
|
||||
int layerBottom = Router()->Settings().GetLayerBottom();
|
||||
|
||||
// Change the current layer to the other side of the board
|
||||
if( m_currentLayer == layerTop )
|
||||
m_currentLayer = layerBottom;
|
||||
else
|
||||
m_currentLayer = layerTop;
|
||||
}
|
||||
|
||||
setWorld( Router()->GetWorld()->Branch() );
|
||||
startPlacement( p_start, m_head.Net(), m_head.Width(), m_currentLayer );
|
||||
|
|
|
@ -323,6 +323,7 @@ PNS_ROUTER::PNS_ROUTER()
|
|||
|
||||
m_currentLayer = 1;
|
||||
m_placingVia = false;
|
||||
m_startsOnVia = false;
|
||||
m_currentNet = -1;
|
||||
m_state = IDLE;
|
||||
m_world = NULL;
|
||||
|
@ -758,6 +759,7 @@ void PNS_ROUTER::CommitRouting( PNS_NODE* aNode )
|
|||
via_board->SetWidth( via->Diameter() );
|
||||
via_board->SetDrill( via->Drill() );
|
||||
via_board->SetNetCode( via->Net() );
|
||||
via_board->SetLayerPair( m_settings.GetLayerTop(), m_settings.GetLayerBottom() );
|
||||
newBI = via_board;
|
||||
break;
|
||||
}
|
||||
|
@ -809,6 +811,7 @@ bool PNS_ROUTER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
|
|||
{
|
||||
case ROUTE_TRACK:
|
||||
rv = m_placer->FixRoute( aP, aEndItem );
|
||||
m_startsOnVia = m_placingVia;
|
||||
m_placingVia = false;
|
||||
break;
|
||||
|
||||
|
@ -874,8 +877,7 @@ void PNS_ROUTER::SwitchLayer( int aLayer )
|
|||
if( m_startsOnVia )
|
||||
{
|
||||
m_currentLayer = aLayer;
|
||||
//m_placer->StartPlacement( m_currentStart, m_currentNet, m_currentWidth,
|
||||
// m_currentLayer );
|
||||
m_placer->SetLayer( aLayer );
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -127,6 +127,23 @@ public:
|
|||
int WalkaroundIterationLimit() const { return m_walkaroundIterationLimit; };
|
||||
TIME_LIMIT WalkaroundTimeLimit() const;
|
||||
|
||||
void SetLayerPair( int aLayer1, int aLayer2 )
|
||||
{
|
||||
if( aLayer1 > aLayer2 )
|
||||
{
|
||||
m_layerTop = aLayer1;
|
||||
m_layerBottom = aLayer2;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_layerBottom = aLayer1;
|
||||
m_layerTop = aLayer2;
|
||||
}
|
||||
}
|
||||
|
||||
int GetLayerTop() const { return m_layerTop; }
|
||||
int GetLayerBottom() const { return m_layerBottom; }
|
||||
|
||||
private:
|
||||
bool m_shoveVias;
|
||||
bool m_startDiagonal;
|
||||
|
@ -150,6 +167,10 @@ private:
|
|||
int m_shoveIterationLimit;
|
||||
TIME_LIMIT m_shoveTimeLimit;
|
||||
TIME_LIMIT m_walkaroundTimeLimit;
|
||||
|
||||
// Routing layers pair
|
||||
int m_layerTop;
|
||||
int m_layerBottom;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -566,31 +566,28 @@ void ROUTER_TOOL::performRouting()
|
|||
if( m_router->FixRoute( m_endSnapPoint, m_endItem ) )
|
||||
break;
|
||||
|
||||
// Synchronize the indicated layer
|
||||
frame->SetActiveLayer( m_router->GetCurrentLayer() );
|
||||
|
||||
m_router->Move( m_endSnapPoint, m_endItem );
|
||||
}
|
||||
else if( evt->IsAction( &ACT_PlaceThroughVia ) )
|
||||
{
|
||||
m_router->Settings().SetLayerPair( frame->GetScreen()->m_Route_Layer_TOP,
|
||||
frame->GetScreen()->m_Route_Layer_BOTTOM );
|
||||
m_router->ToggleViaPlacement();
|
||||
frame->GetGalCanvas()->SetTopLayer( ToLAYER_ID( m_router->GetCurrentLayer() ) );
|
||||
m_router->Move( m_endSnapPoint, m_endItem );
|
||||
m_router->Move( m_endSnapPoint, m_endItem ); // refresh
|
||||
}
|
||||
else if( evt->IsAction( &ACT_SwitchPosture ) )
|
||||
{
|
||||
m_router->FlipPosture();
|
||||
m_router->Move( m_endSnapPoint, m_endItem );
|
||||
m_router->Move( m_endSnapPoint, m_endItem ); // refresh
|
||||
}
|
||||
else if( evt->IsAction( &COMMON_ACTIONS::layerNext ) )
|
||||
else if( evt->IsAction( &COMMON_ACTIONS::layerChanged ) )
|
||||
{
|
||||
m_router->SwitchLayer( m_router->NextCopperLayer( true ) );
|
||||
updateEndItem( *evt );
|
||||
frame->SetActiveLayer( ToLAYER_ID( m_router->GetCurrentLayer() ) );
|
||||
m_router->Move( m_endSnapPoint, m_endItem );
|
||||
}
|
||||
else if( evt->IsAction( &COMMON_ACTIONS::layerPrev ) )
|
||||
{
|
||||
m_router->SwitchLayer( m_router->NextCopperLayer( false ) );
|
||||
frame->SetActiveLayer( ToLAYER_ID( m_router->GetCurrentLayer() ) );
|
||||
m_router->Move( m_endSnapPoint, m_endItem );
|
||||
m_router->SwitchLayer( frame->GetActiveLayer() );
|
||||
m_router->Move( m_endSnapPoint, m_endItem ); // refresh
|
||||
}
|
||||
else if( evt->IsAction( &ACT_EndTrack ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue