Bugfix: Bottom layer not correctly handled in (PNS) Interactive router.

This commit is contained in:
Maciej Suminski 2014-07-07 10:48:47 +02:00
parent a3b421b02c
commit fb0045a898
7 changed files with 19 additions and 17 deletions

View File

@ -255,6 +255,9 @@ public:
*/
inline virtual void SetLayerDepth( double aLayerDepth )
{
assert( aLayerDepth <= depthRange.y );
assert( aLayerDepth >= depthRange.x );
layerDepth = aLayerDepth;
}

View File

@ -138,7 +138,7 @@ enum LAYER_ID
#define LAST_COPPER_LAYER brain dead
#define FIRST_LAYER brain dead
#define NB_LAYERS use LAYER_ID_COUNT instead
#define NB_COPPER_LAYERS was always a max, not a number, use MAX_CU_COUNT now.
#define NB_COPPER_LAYERS was always a max, not a number, use MAX_CU_LAYERS now.
*/

View File

@ -108,7 +108,7 @@ public:
///> Shortcut for comparisons/overlap tests
static PNS_LAYERSET All()
{
return PNS_LAYERSET( 0, 256 );
return PNS_LAYERSET( 0, 64 );
}
private:

View File

@ -379,7 +379,7 @@ bool PNS_LINE_PLACER::handleViaPlacement( PNS_LINE& aHead )
if( !m_placingVia )
return true;
PNS_LAYERSET allLayers( 0, 15 );
PNS_LAYERSET allLayers( 0, MAX_CU_LAYERS - 1 );
PNS_VIA v( aHead.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill, aHead.Net() );
VECTOR2I force;
@ -439,7 +439,7 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
}
else if( m_placingVia && viaOk )
{
PNS_LAYERSET allLayers( 0, 15 );
PNS_LAYERSET allLayers( 0, MAX_CU_LAYERS - 1 );
PNS_VIA v1( walkFull.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill );
walkFull.AppendVia( v1 );
}
@ -464,7 +464,7 @@ bool PNS_LINE_PLACER::rhMarkObstacles( const VECTOR2I& aP, PNS_LINE& aNewHead )
if( m_placingVia )
{
PNS_LAYERSET allLayers( 0, 15 );
PNS_LAYERSET allLayers( 0, MAX_CU_LAYERS - 1 );
PNS_VIA v1( m_head.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill );
m_head.AppendVia( v1 );
}
@ -507,7 +507,7 @@ bool PNS_LINE_PLACER::rhShoveOnly ( const VECTOR2I& aP, PNS_LINE& aNewHead )
if( m_placingVia )
{
PNS_LAYERSET allLayers( 0, 15 );
PNS_LAYERSET allLayers( 0, MAX_CU_LAYERS - 1 );
PNS_VIA v1( l.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill );
PNS_VIA v2( l2.CPoint( -1 ), allLayers, m_viaDiameter, m_viaDrill );

View File

@ -116,12 +116,12 @@ private:
PNS_ITEM* PNS_ROUTER::syncPad( D_PAD* aPad )
{
PNS_LAYERSET layers( 0, 15 );
PNS_LAYERSET layers( 0, MAX_CU_LAYERS - 1 );
switch( aPad->GetAttribute() )
{
case PAD_STANDARD:
layers = PNS_LAYERSET( 0, 15 );
layers = PNS_LAYERSET( 0, MAX_CU_LAYERS - 1 ); // TODO necessary? it is already initialized
break;
case PAD_SMD:
@ -191,7 +191,7 @@ PNS_ITEM* PNS_ROUTER::syncPad( D_PAD* aPad )
else
delta = VECTOR2I( 0, ( sz.y - sz.x ) / 2 );
SHAPE_SEGMENT* shape = new SHAPE_SEGMENT( c - delta, c + delta,
SHAPE_SEGMENT* shape = new SHAPE_SEGMENT( c - delta, c + delta,
std::min( sz.x, sz.y ) );
solid->SetShape( shape );
}
@ -229,7 +229,7 @@ PNS_ITEM* PNS_ROUTER::syncVia( VIA* aVia )
{
PNS_VIA* v = new PNS_VIA(
aVia->GetPosition(),
PNS_LAYERSET( 0, 15 ),
PNS_LAYERSET( 0, MAX_CU_LAYERS - 1 ),
aVia->GetWidth(),
aVia->GetDrillValue(),
aVia->GetNetCode() );
@ -260,7 +260,7 @@ int PNS_ROUTER::NextCopperLayer( bool aUp )
l = 0;
if( l < 0 )
l = MAX_CU_LAYERS-1;
l = MAX_CU_LAYERS - 1;
if( mask[l] )
return l;

View File

@ -41,7 +41,7 @@ ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM( const PNS_ITEM* aItem, VIEW_GROUP* aPa
m_shape = NULL;
m_clearance = -1;
m_originLayer = m_layer = ITEM_GAL_LAYER ( GP_OVERLAY );
m_originLayer = m_layer = ITEM_GAL_LAYER( GP_OVERLAY );
if( aItem )
Update( aItem );
@ -70,7 +70,6 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS_ITEM* aItem )
case PNS_ITEM::LINE:
m_type = PR_SHAPE;
m_width = ( (PNS_LINE*) aItem )->Width();
break;
case PNS_ITEM::SEGMENT:
@ -174,7 +173,7 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
if( m_clearance > 0 )
{
aGal->SetLayerDepth( ClearanceOverlayDepth );
aGal->SetStrokeColor( COLOR4D( DARKDARKGRAY ));
aGal->SetStrokeColor( COLOR4D( DARKDARKGRAY ) );
aGal->SetLineWidth( m_width + 2 * m_clearance );
aGal->DrawLine( s->GetSeg().A, s->GetSeg().B );
}

View File

@ -84,7 +84,7 @@ public:
aCount = 1;
}
void drawLineChain( const SHAPE_LINE_CHAIN& aL, KIGFX::GAL *aGal ) const;
void drawLineChain( const SHAPE_LINE_CHAIN& aL, KIGFX::GAL* aGal ) const;
private:
const KIGFX::COLOR4D assignColor( int aStyle ) const;
@ -105,7 +105,7 @@ private:
// fixme: shouldn't this go to VIEW?
static const int ClearanceOverlayDepth = -2000;
static const int BaseOverlayDepth = -2020;
static const int BaseOverlayDepth = -2010;
static const int ViaOverlayDepth = -2046;
double m_depth;