router: don't cross DP lines when length tuning, fix swap pair polarity bug

Fixes: lp:1798500
* https://bugs.launchpad.net/kicad/+bug/1798500

Fixes: lp:1798221
* https://bugs.launchpad.net/kicad/+bug/1798221
This commit is contained in:
Tomasz Włostowski 2018-10-18 13:48:19 +02:00
parent ff992f4a64
commit eea949ce0a
3 changed files with 5 additions and 4 deletions

View File

@ -503,7 +503,7 @@ bool DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, ITEM* aItem,
found = true; found = true;
bestDist = dist; bestDist = dist;
if( refNet == netP ) if( refNet != netP )
{ {
aPair = DP_PRIMITIVE_PAIR ( item, primRef ); aPair = DP_PRIMITIVE_PAIR ( item, primRef );
aPair.SetAnchors( *anchor, *refAnchor ); aPair.SetAnchors( *anchor, *refAnchor );

View File

@ -150,7 +150,7 @@ const SEG DP_MEANDER_PLACER::baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS&
} }
static bool pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair ) bool DP_MEANDER_PLACER::pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair )
{ {
VECTOR2I midp = ( aPair.coupledP.A + aPair.coupledN.A ) / 2; VECTOR2I midp = ( aPair.coupledP.A + aPair.coupledN.A ) / 2;
@ -197,7 +197,7 @@ bool DP_MEANDER_PLACER::Move( const VECTOR2I& aP, ITEM* aEndItem )
int offset = ( tuned.Gap() + tuned.Width() ) / 2; int offset = ( tuned.Gap() + tuned.Width() ) / 2;
if( !pairOrientation( coupledSegments[0] ) ) if( pairOrientation( coupledSegments[0] ) )
offset *= -1; offset *= -1;
m_result.SetBaselineOffset( offset ); m_result.SetBaselineOffset( offset );

View File

@ -115,7 +115,8 @@ private:
// void addCorner ( const VECTOR2I& aP ); // void addCorner ( const VECTOR2I& aP );
const SEG baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS& aCoupledSegs ); const SEG baselineSegment( const DIFF_PAIR::COUPLED_SEGMENTS& aCoupledSegs );
bool pairOrientation( const DIFF_PAIR::COUPLED_SEGMENTS& aPair );
void setWorld( NODE* aWorld ); void setWorld( NODE* aWorld );
void release(); void release();