Commit ee1b8e2a authored by Maciej Suminski's avatar Maciej Suminski

Added display of soldermask for pads.

parent 862d5a4b
...@@ -261,12 +261,12 @@ const LAYER_NUM GalLayerOrder[] = ...@@ -261,12 +261,12 @@ const LAYER_NUM GalLayerOrder[] =
UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31, UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31,
ITEM_GAL_LAYER( MOD_TEXT_FR_VISIBLE ), ITEM_GAL_LAYER( MOD_TEXT_FR_VISIBLE ),
ITEM_GAL_LAYER( MOD_REFERENCES_VISIBLE), ITEM_GAL_LAYER( MOD_VALUES_VISIBLE ), ITEM_GAL_LAYER( MOD_REFERENCES_VISIBLE), ITEM_GAL_LAYER( MOD_VALUES_VISIBLE ),
SILKSCREEN_N_FRONT, SOLDERPASTE_N_FRONT, ADHESIVE_N_FRONT, SOLDERMASK_N_FRONT, SILKSCREEN_N_FRONT, SOLDERPASTE_N_FRONT, ADHESIVE_N_FRONT,
ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ),
ITEM_GAL_LAYER( VIAS_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), ITEM_GAL_LAYER( VIAS_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ),
ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ), SOLDERMASK_N_FRONT,
ITEM_GAL_LAYER( LAYER_16_NETNAMES_VISIBLE ), LAYER_N_FRONT, ITEM_GAL_LAYER( LAYER_16_NETNAMES_VISIBLE ), LAYER_N_FRONT,
ITEM_GAL_LAYER( LAYER_15_NETNAMES_VISIBLE ), LAYER_N_15, ITEM_GAL_LAYER( LAYER_15_NETNAMES_VISIBLE ), LAYER_N_15,
ITEM_GAL_LAYER( LAYER_14_NETNAMES_VISIBLE ), LAYER_N_14, ITEM_GAL_LAYER( LAYER_14_NETNAMES_VISIBLE ), LAYER_N_14,
...@@ -282,10 +282,10 @@ const LAYER_NUM GalLayerOrder[] = ...@@ -282,10 +282,10 @@ const LAYER_NUM GalLayerOrder[] =
ITEM_GAL_LAYER( LAYER_4_NETNAMES_VISIBLE ), LAYER_N_4, ITEM_GAL_LAYER( LAYER_4_NETNAMES_VISIBLE ), LAYER_N_4,
ITEM_GAL_LAYER( LAYER_3_NETNAMES_VISIBLE ), LAYER_N_3, ITEM_GAL_LAYER( LAYER_3_NETNAMES_VISIBLE ), LAYER_N_3,
ITEM_GAL_LAYER( LAYER_2_NETNAMES_VISIBLE ), LAYER_N_2, ITEM_GAL_LAYER( LAYER_2_NETNAMES_VISIBLE ), LAYER_N_2,
ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ), SOLDERMASK_N_BACK,
ITEM_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ), LAYER_N_BACK, ITEM_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ), LAYER_N_BACK,
SOLDERMASK_N_BACK, ADHESIVE_N_BACK, SOLDERPASTE_N_BACK, SILKSCREEN_N_BACK, ADHESIVE_N_BACK, SOLDERPASTE_N_BACK, SILKSCREEN_N_BACK,
ITEM_GAL_LAYER( MOD_TEXT_BK_VISIBLE ) ITEM_GAL_LAYER( MOD_TEXT_BK_VISIBLE )
}; };
......
...@@ -391,7 +391,7 @@ int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const ...@@ -391,7 +391,7 @@ int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
// Mask margins handling: // Mask margins handling:
int D_PAD::GetSolderMaskMargin() int D_PAD::GetSolderMaskMargin() const
{ {
int margin = m_LocalSolderMaskMargin; int margin = m_LocalSolderMaskMargin;
MODULE* module = GetParent(); MODULE* module = GetParent();
...@@ -748,21 +748,29 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const ...@@ -748,21 +748,29 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
{ {
aCount = 0; aCount = 0;
// These types of pads contain a hole
if( m_Attribute == PAD_STANDARD || m_Attribute == PAD_HOLE_NOT_PLATED )
aLayers[aCount++] = ITEM_GAL_LAYER( PADS_HOLES_VISIBLE );
if( IsOnLayer( LAYER_N_FRONT ) && IsOnLayer( LAYER_N_BACK ) ) if( IsOnLayer( LAYER_N_FRONT ) && IsOnLayer( LAYER_N_BACK ) )
{ {
// Multi layer pad // Multi layer pad
aLayers[aCount++] = ITEM_GAL_LAYER( PADS_VISIBLE ); aLayers[aCount++] = ITEM_GAL_LAYER( PADS_VISIBLE );
aLayers[aCount++] = ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ); aLayers[aCount++] = ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE );
aLayers[aCount++] = SOLDERMASK_N_FRONT;
aLayers[aCount++] = SOLDERMASK_N_BACK;
} }
else if( IsOnLayer( LAYER_N_FRONT ) ) else if( IsOnLayer( LAYER_N_FRONT ) )
{ {
aLayers[aCount++] = ITEM_GAL_LAYER( PAD_FR_VISIBLE ); aLayers[aCount++] = ITEM_GAL_LAYER( PAD_FR_VISIBLE );
aLayers[aCount++] = ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ); aLayers[aCount++] = ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE );
aLayers[aCount++] = SOLDERMASK_N_FRONT;
} }
else if( IsOnLayer( LAYER_N_BACK ) ) else if( IsOnLayer( LAYER_N_BACK ) )
{ {
aLayers[aCount++] = ITEM_GAL_LAYER( PAD_BK_VISIBLE ); aLayers[aCount++] = ITEM_GAL_LAYER( PAD_BK_VISIBLE );
aLayers[aCount++] = ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ); aLayers[aCount++] = ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE );
aLayers[aCount++] = SOLDERMASK_N_BACK;
} }
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
else // Should not occur else // Should not occur
...@@ -770,10 +778,6 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const ...@@ -770,10 +778,6 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
wxLogWarning( wxT("D_PAD::ViewGetLayers():PAD on layer different than FRONT/BACK") ); wxLogWarning( wxT("D_PAD::ViewGetLayers():PAD on layer different than FRONT/BACK") );
} }
#endif #endif
// These types of pads contain a hole
if( m_Attribute == PAD_STANDARD || m_Attribute == PAD_HOLE_NOT_PLATED )
aLayers[aCount++] = ITEM_GAL_LAYER( PADS_HOLES_VISIBLE );
} }
...@@ -781,14 +785,23 @@ void D_PAD::ViewGetRequiredLayers( int aLayers[], int& aCount ) const ...@@ -781,14 +785,23 @@ void D_PAD::ViewGetRequiredLayers( int aLayers[], int& aCount ) const
{ {
ViewGetLayers( aLayers, aCount ); ViewGetLayers( aLayers, aCount );
// Remove pad description layer from the required layers group // Remove pad description layer & soldermask from the required layers group
aCount--; if( IsOnLayer( LAYER_N_FRONT ) && IsOnLayer( LAYER_N_BACK ) )
{
// Multilayer pads have 2 soldermask layers and one description layer
aCount -= 3;
}
else
{
// Resto of pads have one soldermask layer and one description layer
aCount -= 2;
}
} }
unsigned int D_PAD::ViewGetLOD( int aLayer ) const unsigned int D_PAD::ViewGetLOD( int aLayer ) const
{ {
// Netnames will be shown only if zoom is appropriate // Netnames and soldermasks will be shown only if zoom is appropriate
if( IsNetnameLayer( aLayer ) ) if( IsNetnameLayer( aLayer ) )
{ {
return ( 100000000 / std::max( m_Size.x, m_Size.y ) ); return ( 100000000 / std::max( m_Size.x, m_Size.y ) );
...@@ -797,3 +810,14 @@ unsigned int D_PAD::ViewGetLOD( int aLayer ) const ...@@ -797,3 +810,14 @@ unsigned int D_PAD::ViewGetLOD( int aLayer ) const
// Other layers are shown without any conditions // Other layers are shown without any conditions
return 0; return 0;
} }
const BOX2I D_PAD::ViewBBox() const
{
// Bounding box includes soldermask too
int solderMaskMargin = GetSolderMaskMargin();
EDA_RECT bbox = GetBoundingBox();
return BOX2I( VECTOR2I( bbox.GetOrigin() ) - solderMaskMargin,
VECTOR2I( bbox.GetSize() ) + 2 * solderMaskMargin );
}
...@@ -247,7 +247,7 @@ public: ...@@ -247,7 +247,7 @@ public:
* 2 - if null, the parent footprint value * 2 - if null, the parent footprint value
* 1 - if null, the global value * 1 - if null, the global value
*/ */
int GetSolderMaskMargin(); int GetSolderMaskMargin() const;
/** /**
* Function GetSolderPasteMargin * Function GetSolderPasteMargin
...@@ -442,6 +442,9 @@ public: ...@@ -442,6 +442,9 @@ public:
/// @copydoc VIEW_ITEM::ViewGetLOD() /// @copydoc VIEW_ITEM::ViewGetLOD()
virtual unsigned int ViewGetLOD( int aLayer ) const; virtual unsigned int ViewGetLOD( int aLayer ) const;
/// @copydoc VIEW_ITEM::ViewBBox()
virtual const BOX2I ViewBBox() const;
/** /**
* Function CopyNetlistSettings * Function CopyNetlistSettings
* copies the netlist settings to \a aPad. * copies the netlist settings to \a aPad.
......
...@@ -522,6 +522,14 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) ...@@ -522,6 +522,14 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
size = VECTOR2D( aPad->GetDrillSize() ) / 2.0; size = VECTOR2D( aPad->GetDrillSize() ) / 2.0;
shape = aPad->GetDrillShape(); shape = aPad->GetDrillShape();
} }
else if( aLayer == SOLDERMASK_N_FRONT || aLayer == SOLDERMASK_N_BACK )
{
// Drawing soldermask
m_gal->Translate( VECTOR2D( aPad->GetOffset() ) );
size = VECTOR2D( aPad->GetSize().x / 2.0 + aPad->GetSolderMaskMargin(),
aPad->GetSize().y / 2.0 + aPad->GetSolderMaskMargin() );
shape = aPad->GetShape();
}
else else
{ {
// Drawing every kind of pad // Drawing every kind of pad
......
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