Commit 948f22de authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio

Removed the ugly bit stuffing for the bottom via layer number

(just replaced it with a member)
parent c0879414
...@@ -179,6 +179,7 @@ VIA::VIA( BOARD_ITEM* aParent ) : ...@@ -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 ...@@ -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 ...@@ -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: ...@@ -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: ...@@ -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)
......
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