Commit fe405674 authored by Tomasz Włostowski's avatar Tomasz Włostowski

router: shove now respects diff pair gap

parent bf3128c6
......@@ -167,29 +167,20 @@ bool PNS_DIFF_PAIR_PLACER::attemptWalk ( PNS_NODE* aNode, PNS_DIFF_PAIR* aCurren
int mask = aSolidsOnly ? PNS_ITEM::SOLID : PNS_ITEM::ANY;
Router()->DisplayDebugLine( aCurrent->CP(), 4, 10000 );
Router()->DisplayDebugLine( aCurrent->CN(), 5, 10000 );
printf("WStart\n");
do
{
PNS_LINE preWalk = ( currentIsP ? cur.PLine() : cur.NLine() );
PNS_LINE preShove = ( currentIsP ? cur.NLine() : cur.PLine() );
PNS_LINE postWalk;
printf("iter %d\n", iter);
if( !aNode->CheckColliding ( &preWalk, mask ) )
{
printf("PreWalkIsColl\n");
currentIsP = !currentIsP;
if( !aNode->CheckColliding( &preShove, mask ) )
break;
else
{
printf("PreShoveIsColl\n");
continue;
}
}
wf1 = walkaround.Route( preWalk, postWalk, false );
......@@ -199,7 +190,7 @@ bool PNS_DIFF_PAIR_PLACER::attemptWalk ( PNS_NODE* aNode, PNS_DIFF_PAIR* aCurren
PNS_LINE postShove( preShove );
shove.ForceClearance( true, cur.Gap() );
shove.ForceClearance( true, cur.Gap() - 2 * PNS_HULL_MARGIN );
PNS_SHOVE::SHOVE_STATUS sh1;
......@@ -474,7 +465,6 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI
BOARD* brd = Router()->GetBoard();
PNS_ITEM *primRef = NULL, *primP = NULL, *primN = NULL;
// printf("Current %p\n", m_currentNode);
int refNet;
wxString suffix;
......@@ -503,7 +493,6 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI
else
refNet = netP;
// printf("Net: P: %s N: %s\n", (const char *)(netNameP.c_str()), (const char *)(netNameN.c_str()));
std::set<PNS_ITEM*> items;
......
......@@ -82,8 +82,6 @@ PNS_PCBNEW_CLEARANCE_FUNC::PNS_PCBNEW_CLEARANCE_FUNC( PNS_ROUTER *aRouter ) :
CLEARANCE_ENT ent;
ent.coupledNet = topo.DpCoupledNet( i );
printf("net %d coupled %d\n", i, ent.coupledNet);
wxString netClassName = ni->GetClassName();
NETCLASSPTR nc = brd->GetDesignSettings().m_NetClasses.Find( netClassName );
......@@ -122,22 +120,11 @@ int PNS_PCBNEW_CLEARANCE_FUNC::operator()( const PNS_ITEM* aA, const PNS_ITEM* a
int net_b = aB->Net();
int cl_b = ( net_b >= 0 ? m_clearanceCache[net_b].clearance : m_defaultClearance );
bool segsOnly = aA->OfKind( PNS_ITEM::SEGMENT ) && aB->OfKind( PNS_ITEM::SEGMENT );
bool linesOnly = aA->OfKind( PNS_ITEM::SEGMENT | PNS_ITEM::LINE ) && aB->OfKind( PNS_ITEM::SEGMENT | PNS_ITEM::LINE );
#if 0
if( segsOnly && net_a >= 0 && net_b >= 0 && m_clearanceCache[net_a].coupledNet == net_b )
{
cl_a = cl_b = m_router->Sizes().DiffPairGap() - 3 * PNS_HULL_MARGIN;
printf("Cl %d\n", cl_a);
}
#endif
if( m_overrideEnabled && segsOnly )
if( linesOnly && net_a >= 0 && net_b >= 0 && m_clearanceCache[net_a].coupledNet == net_b )
{
if( net_a == m_overrideNetA && net_b == m_overrideNetB )
return m_overrideClearance;
else if( net_a == m_overrideNetB && net_b == m_overrideNetA )
return m_overrideClearance;
cl_a = cl_b = m_router->Sizes().DiffPairGap() - 2 * PNS_HULL_MARGIN;
}
int pad_a = localPadClearance( aA );
......
......@@ -387,8 +387,6 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingLine( PNS_LINE* aCurrent, PNS_LINE
PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE* aCurrent, PNS_SOLID* aObstacleSolid )
{
//printf("pre2-v %d\n", aCurrent->EndsWithVia());
PNS_WALKAROUND walkaround( m_currentNode, Router() );
PNS_LINE* walkaroundLine = clone( aCurrent );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment