Removed the ugly bit stuffing for the bottom via layer number
(just replaced it with a member)
This commit is contained in:
parent
c0879414a5
commit
948f22de6d
|
@ -179,6 +179,7 @@ VIA::VIA( BOARD_ITEM* aParent ) :
|
||||||
TRACK( aParent, PCB_VIA_T )
|
TRACK( aParent, PCB_VIA_T )
|
||||||
{
|
{
|
||||||
SetViaType( VIA_THROUGH );
|
SetViaType( VIA_THROUGH );
|
||||||
|
m_BottomLayer = LAYER_N_BACK;
|
||||||
m_Width = Millimeter2iu( 0.5 );
|
m_Width = Millimeter2iu( 0.5 );
|
||||||
SetDrillDefault();
|
SetDrillDefault();
|
||||||
}
|
}
|
||||||
|
@ -432,19 +433,19 @@ LAYER_MSK TRACK::GetLayerMask() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VIA::SetLayerPair( LAYER_NUM top_layer, LAYER_NUM bottom_layer )
|
void VIA::SetLayerPair( LAYER_NUM aTopLayer, LAYER_NUM aBottomLayer )
|
||||||
{
|
{
|
||||||
if( GetViaType() == VIA_THROUGH )
|
if( GetViaType() == VIA_THROUGH )
|
||||||
{
|
{
|
||||||
top_layer = LAYER_N_FRONT;
|
aTopLayer = LAYER_N_FRONT;
|
||||||
bottom_layer = LAYER_N_BACK;
|
aBottomLayer = LAYER_N_BACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( bottom_layer > top_layer )
|
if( aBottomLayer > aTopLayer )
|
||||||
EXCHG( bottom_layer, top_layer );
|
EXCHG( aBottomLayer, aTopLayer );
|
||||||
|
|
||||||
// XXX EVIL usage of LAYER
|
m_Layer = aTopLayer;
|
||||||
m_Layer = (top_layer & 15) + ( (bottom_layer & 15) << 4 );
|
m_BottomLayer = aBottomLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -455,9 +456,8 @@ void VIA::LayerPair( LAYER_NUM* top_layer, LAYER_NUM* bottom_layer ) const
|
||||||
|
|
||||||
if( GetViaType() != VIA_THROUGH )
|
if( GetViaType() != VIA_THROUGH )
|
||||||
{
|
{
|
||||||
// XXX EVIL usage of LAYER
|
b_layer = m_BottomLayer;
|
||||||
b_layer = (m_Layer >> 4) & 15;
|
t_layer = m_Layer;
|
||||||
t_layer = m_Layer & 15;
|
|
||||||
|
|
||||||
if( b_layer > t_layer )
|
if( b_layer > t_layer )
|
||||||
EXCHG( b_layer, t_layer );
|
EXCHG( b_layer, t_layer );
|
||||||
|
|
|
@ -371,15 +371,12 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SetLayerPair
|
* Function SetLayerPair
|
||||||
* set the .m_Layer member param:
|
* For a via m_Layer contains the top layer, the other layer is in
|
||||||
* For a via m_Layer contains the 2 layers :
|
* m_BottomLayer
|
||||||
* top layer and bottom layer used by the via.
|
|
||||||
* The via connect all layers from top layer to bottom layer
|
|
||||||
* 4 bits for the first layer and 4 next bits for the second layer
|
|
||||||
* @param top_layer = first layer connected by the via
|
* @param top_layer = first layer connected by the via
|
||||||
* @param bottom_layer = last layer connected by the via
|
* @param bottom_layer = last layer connected by the via
|
||||||
*/
|
*/
|
||||||
void SetLayerPair( LAYER_NUM top_layer, LAYER_NUM bottom_layer );
|
void SetLayerPair( LAYER_NUM aTopLayer, LAYER_NUM aBottomLayer );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function LayerPair
|
* Function LayerPair
|
||||||
|
@ -453,6 +450,9 @@ protected:
|
||||||
virtual void GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList );
|
virtual void GetMsgPanelInfoBase( std::vector< MSG_PANEL_ITEM >& aList );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// The bottom layer of the via (the top layer is in m_Layer)
|
||||||
|
LAYER_NUM m_BottomLayer;
|
||||||
|
|
||||||
VIATYPE_T m_ViaType; // Type of via
|
VIATYPE_T m_ViaType; // Type of via
|
||||||
|
|
||||||
int m_Drill; // for vias: via drill (- 1 for default value)
|
int m_Drill; // for vias: via drill (- 1 for default value)
|
||||||
|
|
Loading…
Reference in New Issue