From fe4056742644ab57180f4a7e96405cafad81c5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= Date: Mon, 2 Mar 2015 17:21:04 +0100 Subject: [PATCH] router: shove now respects diff pair gap --- pcbnew/router/pns_diff_pair_placer.cpp | 13 +------------ pcbnew/router/pns_router.cpp | 19 +++---------------- pcbnew/router/pns_shove.cpp | 2 -- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/pcbnew/router/pns_diff_pair_placer.cpp b/pcbnew/router/pns_diff_pair_placer.cpp index 7617fd5d73..e8a3d4f27f 100644 --- a/pcbnew/router/pns_diff_pair_placer.cpp +++ b/pcbnew/router/pns_diff_pair_placer.cpp @@ -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 items; diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index b3dff4e1c2..d35973c878 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -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 ) + if( linesOnly && 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( 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 ); diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 7ed1a985c7..8ee6ebfb76 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -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 );