Enum class PAD_ATTR_T

Renamed such that python stays the same
This commit is contained in:
Marek Roszko 2021-05-01 10:46:50 -04:00
parent e20562b09b
commit 03cf2b517f
47 changed files with 179 additions and 179 deletions

View File

@ -511,7 +511,7 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint,
// NPTH pads are not drawn on layers if the // NPTH pads are not drawn on layers if the
// shape size and pos is the same as their hole: // shape size and pos is the same as their hole:
if( aSkipNPTHPadsWihNoCopper && ( pad->GetAttribute() == PAD_ATTRIB_NPTH ) ) if( aSkipNPTHPadsWihNoCopper && ( pad->GetAttribute() == PAD_ATTRIB::NPTH ) )
{ {
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) ) if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
{ {

View File

@ -457,7 +457,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
continue; continue;
// The hole in the body is inflated by copper thickness, if not plated, no copper // The hole in the body is inflated by copper thickness, if not plated, no copper
const int inflate = ( pad->GetAttribute () != PAD_ATTRIB_NPTH ) ? const int inflate = ( pad->GetAttribute () != PAD_ATTRIB::NPTH ) ?
GetHolePlatingThickness() / 2 : 0; GetHolePlatingThickness() / 2 : 0;
m_holeCount++; m_holeCount++;
@ -491,7 +491,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// The hole in the body is inflated by copper thickness. // The hole in the body is inflated by copper thickness.
const int inflate = GetHolePlatingThickness(); const int inflate = GetHolePlatingThickness();
if( pad->GetAttribute () != PAD_ATTRIB_NPTH ) if( pad->GetAttribute () != PAD_ATTRIB::NPTH )
{ {
if( GetFlag( FL_CLIP_SILK_ON_VIA_ANNULUS ) && GetFlag( FL_USE_REALISTIC_MODE ) ) if( GetFlag( FL_CLIP_SILK_ON_VIA_ANNULUS ) && GetFlag( FL_USE_REALISTIC_MODE ) )
{ {

View File

@ -1268,7 +1268,7 @@ void RENDER_3D_RAYTRACE::addPadsAndVias()
{ {
for( PAD* pad : footprint->Pads() ) for( PAD* pad : footprint->Pads() )
{ {
if( pad->GetAttribute() != PAD_ATTRIB_NPTH ) if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
{ {
insertHole( pad ); insertHole( pad );
} }

View File

@ -785,7 +785,7 @@ void RENDER_3D_LEGACY::generateViasAndPads()
{ {
for( const PAD* pad : footprint->Pads() ) for( const PAD* pad : footprint->Pads() )
{ {
if( pad->GetAttribute() != PAD_ATTRIB_NPTH ) if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
{ {
const wxSize drillsize = pad->GetDrillSize(); const wxSize drillsize = pad->GetDrillSize();
const bool hasHole = drillsize.x && drillsize.y; const bool hasHole = drillsize.x && drillsize.y;

View File

@ -76,14 +76,14 @@ enum PAD_DRILL_SHAPE_T
* *
* The double name is for convenience of Python devs * The double name is for convenience of Python devs
*/ */
enum PAD_ATTR_T enum class PAD_ATTRIB
{ {
PAD_ATTRIB_PTH, ///< Plated through hole pad PTH, ///< Plated through hole pad
PAD_ATTRIB_SMD, ///< Smd pad, appears on the solder paste layer (default) SMD, ///< Smd pad, appears on the solder paste layer (default)
PAD_ATTRIB_CONN, ///< Like smd, does not appear on the solder paste layer (default) CONN, ///< Like smd, does not appear on the solder paste layer (default)
///< note also has a special attribute in Gerber X files ///< note also has a special attribute in Gerber X files
///< Used for edgecard connectors for instance ///< Used for edgecard connectors for instance
PAD_ATTRIB_NPTH, ///< like PAD_PTH, but not plated NPTH, ///< like PAD_PTH, but not plated
///< mechanical use only, no connection allowed ///< mechanical use only, no connection allowed
}; };

View File

@ -154,7 +154,7 @@ void FOOTPRINT::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuff
// NPTH pads are not drawn on layers if the shape size and pos is the same // NPTH pads are not drawn on layers if the shape size and pos is the same
// as their hole: // as their hole:
if( aSkipNPTHPadsWihNoCopper && pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( aSkipNPTHPadsWihNoCopper && pad->GetAttribute() == PAD_ATTRIB::NPTH )
{ {
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) ) if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
{ {

View File

@ -243,8 +243,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
// for through pads: pads on Front or Back board sides must be visible // for through pads: pads on Front or Back board sides must be visible
pad = static_cast<PAD*>( item ); pad = static_cast<PAD*>( item );
if( (pad->GetAttribute() != PAD_ATTRIB_SMD) && if( (pad->GetAttribute() != PAD_ATTRIB::SMD) &&
(pad->GetAttribute() != PAD_ATTRIB_CONN) ) // a hole is present, so multiple layers (pad->GetAttribute() != PAD_ATTRIB::CONN) ) // a hole is present, so multiple layers
{ {
// proceed to the common tests below, but without the parent footprint test, // proceed to the common tests below, but without the parent footprint test,
// by leaving footprint==NULL, but having pad != null // by leaving footprint==NULL, but having pad != null

View File

@ -210,9 +210,9 @@ CN_ITEM* CN_LIST::Add( PAD* pad )
switch( pad->GetAttribute() ) switch( pad->GetAttribute() )
{ {
case PAD_ATTRIB_SMD: case PAD_ATTRIB::SMD:
case PAD_ATTRIB_NPTH: case PAD_ATTRIB::NPTH:
case PAD_ATTRIB_CONN: case PAD_ATTRIB::CONN:
{ {
LSET lmsk = pad->GetLayerSet(); LSET lmsk = pad->GetLayerSet();

View File

@ -138,10 +138,10 @@ void DIALOG_BOARD_STATISTICS::refreshItemsTypes()
m_componentsTypes.push_back( componentsType_t( FP_SMD, _( "SMD:" ) ) ); m_componentsTypes.push_back( componentsType_t( FP_SMD, _( "SMD:" ) ) );
m_padsTypes.clear(); m_padsTypes.clear();
m_padsTypes.push_back( padsType_t( PAD_ATTRIB_PTH, _( "Through hole:" ) ) ); m_padsTypes.push_back( padsType_t( PAD_ATTRIB::PTH, _( "Through hole:" ) ) );
m_padsTypes.push_back( padsType_t( PAD_ATTRIB_SMD, _( "SMD:" ) ) ); m_padsTypes.push_back( padsType_t( PAD_ATTRIB::SMD, _( "SMD:" ) ) );
m_padsTypes.push_back( padsType_t( PAD_ATTRIB_CONN, _( "Connector:" ) ) ); m_padsTypes.push_back( padsType_t( PAD_ATTRIB::CONN, _( "Connector:" ) ) );
m_padsTypes.push_back( padsType_t( PAD_ATTRIB_NPTH, _( "NPTH:" ) ) ); m_padsTypes.push_back( padsType_t( PAD_ATTRIB::NPTH, _( "NPTH:" ) ) );
m_viasTypes.clear(); m_viasTypes.clear();
m_viasTypes.push_back( viasType_t( VIATYPE::THROUGH, _( "Through vias:" ) ) ); m_viasTypes.push_back( viasType_t( VIATYPE::THROUGH, _( "Through vias:" ) ) );
@ -229,7 +229,7 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB()
} }
drillType_t drill( pad->GetDrillSize().x, pad->GetDrillSize().y, drillType_t drill( pad->GetDrillSize().x, pad->GetDrillSize().y,
pad->GetDrillShape(), pad->GetAttribute() != PAD_ATTRIB_NPTH, pad->GetDrillShape(), pad->GetAttribute() != PAD_ATTRIB::NPTH,
true, top, bottom ); true, top, bottom );
auto it = m_drillTypes.begin(); auto it = m_drillTypes.begin();

View File

@ -62,7 +62,7 @@ public:
int qty; int qty;
}; };
using padsType_t = typeContainer_t<PAD_ATTR_T>; using padsType_t = typeContainer_t<PAD_ATTRIB>;
using viasType_t = typeContainer_t<VIATYPE>; using viasType_t = typeContainer_t<VIATYPE>;
/** /**

View File

@ -148,7 +148,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
{ {
if( pad->GetDrillSize().x != 0 ) if( pad->GetDrillSize().x != 0 )
{ {
if( pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
m_notplatedPadsHoleCount++; m_notplatedPadsHoleCount++;
else else
m_platedPadsHoleCount++; m_platedPadsHoleCount++;
@ -158,7 +158,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
{ {
if( pad->GetDrillSize().x != 0 && pad->GetDrillSize().y != 0 ) if( pad->GetDrillSize().x != 0 && pad->GetDrillSize().y != 0 )
{ {
if( pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
m_notplatedPadsHoleCount++; m_notplatedPadsHoleCount++;
else else
m_platedPadsHoleCount++; m_platedPadsHoleCount++;

View File

@ -78,13 +78,13 @@ enum CODE_CHOICE
CHOICE_SHAPE_CUSTOM_RECT_ANCHOR CHOICE_SHAPE_CUSTOM_RECT_ANCHOR
}; };
static PAD_ATTR_T code_type[] = static PAD_ATTRIB code_type[] =
{ {
PAD_ATTRIB_PTH, PAD_ATTRIB::PTH,
PAD_ATTRIB_SMD, PAD_ATTRIB::SMD,
PAD_ATTRIB_CONN, PAD_ATTRIB::CONN,
PAD_ATTRIB_NPTH, PAD_ATTRIB::NPTH,
PAD_ATTRIB_SMD // Aperture pad :type SMD with no copper layers, PAD_ATTRIB::SMD // Aperture pad :type SMD with no copper layers,
// only on tech layers (usually only on paste layer // only on tech layers (usually only on paste layer
}; };
@ -610,7 +610,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
enablePrimitivePage( PAD_SHAPE::CUSTOM == m_dummyPad->GetShape() ); enablePrimitivePage( PAD_SHAPE::CUSTOM == m_dummyPad->GetShape() );
// Type of pad selection // Type of pad selection
bool aperture = m_dummyPad->GetAttribute() == PAD_ATTRIB_SMD && m_dummyPad->IsAperturePad(); bool aperture = m_dummyPad->GetAttribute() == PAD_ATTRIB::SMD && m_dummyPad->IsAperturePad();
if( aperture ) if( aperture )
{ {
@ -620,10 +620,10 @@ void DIALOG_PAD_PROPERTIES::initValues()
{ {
switch( m_dummyPad->GetAttribute() ) switch( m_dummyPad->GetAttribute() )
{ {
case PAD_ATTRIB_PTH: m_PadType->SetSelection( PTH_DLG_TYPE ); break; case PAD_ATTRIB::PTH: m_PadType->SetSelection( PTH_DLG_TYPE ); break;
case PAD_ATTRIB_SMD: m_PadType->SetSelection( SMD_DLG_TYPE ); break; case PAD_ATTRIB::SMD: m_PadType->SetSelection( SMD_DLG_TYPE ); break;
case PAD_ATTRIB_CONN: m_PadType->SetSelection( CONN_DLG_TYPE ); break; case PAD_ATTRIB::CONN: m_PadType->SetSelection( CONN_DLG_TYPE ); break;
case PAD_ATTRIB_NPTH: m_PadType->SetSelection( NPTH_DLG_TYPE ); break; case PAD_ATTRIB::NPTH: m_PadType->SetSelection( NPTH_DLG_TYPE ); break;
} }
} }
@ -639,7 +639,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
} }
// Ensure the pad property is compatible with the pad type // Ensure the pad property is compatible with the pad type
if( m_dummyPad->GetAttribute() == PAD_ATTRIB_NPTH ) if( m_dummyPad->GetAttribute() == PAD_ATTRIB::NPTH )
{ {
m_choiceFabProperty->SetSelection( 0 ); m_choiceFabProperty->SetSelection( 0 );
m_choiceFabProperty->Enable( false ); m_choiceFabProperty->Enable( false );
@ -1302,7 +1302,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( !padlayers_mask[F_Cu] && !padlayers_mask[B_Cu] ) if( !padlayers_mask[F_Cu] && !padlayers_mask[B_Cu] )
{ {
if( ( drill_size.x || drill_size.y ) && m_dummyPad->GetAttribute() != PAD_ATTRIB_NPTH ) if( ( drill_size.x || drill_size.y ) && m_dummyPad->GetAttribute() != PAD_ATTRIB::NPTH )
{ {
warning_msgs.Add( _( "Warning: Plated through holes should normally have a copper pad " warning_msgs.Add( _( "Warning: Plated through holes should normally have a copper pad "
"on at least one layer." ) ); "on at least one layer." ) );
@ -1314,8 +1314,8 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
switch( m_dummyPad->GetAttribute() ) switch( m_dummyPad->GetAttribute() )
{ {
case PAD_ATTRIB_NPTH: // Not plated, but through hole, a hole is expected case PAD_ATTRIB::NPTH: // Not plated, but through hole, a hole is expected
case PAD_ATTRIB_PTH: // Pad through hole, a hole is also expected case PAD_ATTRIB::PTH: // Pad through hole, a hole is also expected
if( drill_size.x <= 0 if( drill_size.x <= 0
|| ( drill_size.y <= 0 && m_dummyPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG ) ) || ( drill_size.y <= 0 && m_dummyPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG ) )
{ {
@ -1323,7 +1323,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
} }
break; break;
case PAD_ATTRIB_CONN: // Connector pads are smd pads, just they do not have solder paste. case PAD_ATTRIB::CONN: // Connector pads are smd pads, just they do not have solder paste.
if( padlayers_mask[B_Paste] || padlayers_mask[F_Paste] ) if( padlayers_mask[B_Paste] || padlayers_mask[F_Paste] )
{ {
warning_msgs.Add( _( "Warning: Connector pads normally have no solder paste. Use an " warning_msgs.Add( _( "Warning: Connector pads normally have no solder paste. Use an "
@ -1331,7 +1331,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
} }
KI_FALLTHROUGH; KI_FALLTHROUGH;
case PAD_ATTRIB_SMD: // SMD and Connector pads (One external copper layer only) case PAD_ATTRIB::SMD: // SMD and Connector pads (One external copper layer only)
{ {
LSET innerlayers_mask = padlayers_mask & LSET::InternalCuMask(); LSET innerlayers_mask = padlayers_mask & LSET::InternalCuMask();
@ -1343,31 +1343,31 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( ( m_dummyPad->GetProperty() == PAD_PROP_FIDUCIAL_GLBL || if( ( m_dummyPad->GetProperty() == PAD_PROP_FIDUCIAL_GLBL ||
m_dummyPad->GetProperty() == PAD_PROP_FIDUCIAL_LOCAL ) && m_dummyPad->GetProperty() == PAD_PROP_FIDUCIAL_LOCAL ) &&
m_dummyPad->GetAttribute() == PAD_ATTRIB_NPTH ) m_dummyPad->GetAttribute() == PAD_ATTRIB::NPTH )
{ {
warning_msgs.Add( _( "Warning: Fiducial property makes no sense on NPTH pads." ) ); warning_msgs.Add( _( "Warning: Fiducial property makes no sense on NPTH pads." ) );
} }
if( m_dummyPad->GetProperty() == PAD_PROP_TESTPOINT && if( m_dummyPad->GetProperty() == PAD_PROP_TESTPOINT &&
m_dummyPad->GetAttribute() == PAD_ATTRIB_NPTH ) m_dummyPad->GetAttribute() == PAD_ATTRIB::NPTH )
{ {
warning_msgs.Add( _( "Warning: Testpoint property makes no sense on NPTH pads." ) ); warning_msgs.Add( _( "Warning: Testpoint property makes no sense on NPTH pads." ) );
} }
if( m_dummyPad->GetProperty() == PAD_PROP_HEATSINK && if( m_dummyPad->GetProperty() == PAD_PROP_HEATSINK &&
m_dummyPad->GetAttribute() == PAD_ATTRIB_NPTH ) m_dummyPad->GetAttribute() == PAD_ATTRIB::NPTH )
{ {
warning_msgs.Add( _( "Warning: Heatsink property makes no sense of NPTH pads." ) ); warning_msgs.Add( _( "Warning: Heatsink property makes no sense of NPTH pads." ) );
} }
if( m_dummyPad->GetProperty() == PAD_PROP_CASTELLATED && if( m_dummyPad->GetProperty() == PAD_PROP_CASTELLATED &&
m_dummyPad->GetAttribute() != PAD_ATTRIB_PTH ) m_dummyPad->GetAttribute() != PAD_ATTRIB::PTH )
{ {
warning_msgs.Add( _( "Warning: Castellated property is for PTH pads." ) ); warning_msgs.Add( _( "Warning: Castellated property is for PTH pads." ) );
} }
if( m_dummyPad->GetProperty() == PAD_PROP_BGA && if( m_dummyPad->GetProperty() == PAD_PROP_BGA &&
m_dummyPad->GetAttribute() != PAD_ATTRIB_SMD ) m_dummyPad->GetAttribute() != PAD_ATTRIB::SMD )
{ {
warning_msgs.Add( _( "Warning: BGA property is for SMD pads." ) ); warning_msgs.Add( _( "Warning: BGA property is for SMD pads." ) );
} }
@ -1582,8 +1582,8 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
int padNetcode = NETINFO_LIST::UNCONNECTED; int padNetcode = NETINFO_LIST::UNCONNECTED;
// For PAD_ATTRIB_NPTH, ensure there is no net name selected // For PAD_ATTRIB::NPTH, ensure there is no net name selected
if( m_padMaster->GetAttribute() != PAD_ATTRIB_NPTH ) if( m_padMaster->GetAttribute() != PAD_ATTRIB::NPTH )
padNetcode = m_PadNetSelector->GetSelectedNetcode(); padNetcode = m_PadNetSelector->GetSelectedNetcode();
m_currentPad->SetNetCode( padNetcode ); m_currentPad->SetNetCode( padNetcode );
@ -1830,21 +1830,21 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad )
switch( aPad->GetAttribute() ) switch( aPad->GetAttribute() )
{ {
case PAD_ATTRIB_PTH: case PAD_ATTRIB::PTH:
break; break;
case PAD_ATTRIB_CONN: case PAD_ATTRIB::CONN:
case PAD_ATTRIB_SMD: case PAD_ATTRIB::SMD:
// SMD and PAD_ATTRIB_CONN has no hole. // SMD and PAD_ATTRIB::CONN has no hole.
// basically, SMD and PAD_ATTRIB_CONN are same type of pads // basically, SMD and PAD_ATTRIB::CONN are same type of pads
// PAD_ATTRIB_CONN has just a default non technical layers that differs from SMD // PAD_ATTRIB::CONN has just a default non technical layers that differs from SMD
// and are intended to be used in virtual edge board connectors // and are intended to be used in virtual edge board connectors
// However we can accept a non null offset, // However we can accept a non null offset,
// mainly to allow complex pads build from a set of basic pad shapes // mainly to allow complex pads build from a set of basic pad shapes
aPad->SetDrillSize( wxSize( 0, 0 ) ); aPad->SetDrillSize( wxSize( 0, 0 ) );
break; break;
case PAD_ATTRIB_NPTH: case PAD_ATTRIB::NPTH:
// Mechanical purpose only: // Mechanical purpose only:
// no net name, no pad name allowed // no net name, no pad name allowed
aPad->SetName( wxEmptyString ); aPad->SetName( wxEmptyString );

View File

@ -1286,7 +1286,7 @@ std::shared_ptr<SHAPE> DRC_ENGINE::GetShape( BOARD_ITEM* aItem, PCB_LAYER_ID aLa
{ {
PAD* aPad = static_cast<PAD*>( aItem ); PAD* aPad = static_cast<PAD*>( aItem );
if( aPad->GetAttribute() == PAD_ATTRIB_PTH ) if( aPad->GetAttribute() == PAD_ATTRIB::PTH )
{ {
BOARD_DESIGN_SETTINGS& bds = aPad->GetBoard()->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = aPad->GetBoard()->GetDesignSettings();

View File

@ -250,7 +250,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem( TRACK* track, SHA
{ {
PAD* pad = static_cast<PAD*>( other ); PAD* pad = static_cast<PAD*>( other );
if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH && !pad->FlashLayer( layer ) )
testClearance = false; testClearance = false;
} }
@ -400,7 +400,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aItem
// Note: drill size represents finish size, which means the actual hole // Note: drill size represents finish size, which means the actual hole
// size is the plating thickness larger. // size is the plating thickness larger.
if( pad->GetAttribute() == PAD_ATTRIB_PTH ) if( pad->GetAttribute() == PAD_ATTRIB::PTH )
size += m_board->GetDesignSettings().GetHolePlatingThickness(); size += m_board->GetDesignSettings().GetHolePlatingThickness();
itemShape = std::make_shared<SHAPE_SEGMENT>( hole->GetSeg(), size ); itemShape = std::make_shared<SHAPE_SEGMENT>( hole->GetSeg(), size );
@ -514,7 +514,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
} }
// A NPTH has no cylinder, but it may still have pads on some layers // A NPTH has no cylinder, but it may still have pads on some layers
if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH && !pad->FlashLayer( layer ) )
testClearance = false; testClearance = false;
if( !IsCopperLayer( layer ) ) if( !IsCopperLayer( layer ) )
@ -612,7 +612,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
if( pad->GetNetCode() && otherPad->GetNetCode() == pad->GetNetCode() ) if( pad->GetNetCode() && otherPad->GetNetCode() == pad->GetNetCode() )
testClearance = false; testClearance = false;
if( otherPad->GetAttribute() == PAD_ATTRIB_NPTH && !otherPad->FlashLayer( layer ) ) if( otherPad->GetAttribute() == PAD_ATTRIB::NPTH && !otherPad->FlashLayer( layer ) )
testClearance = false; testClearance = false;
} }

View File

@ -111,8 +111,8 @@ static void build_pad_testpoints( BOARD *aPcb, std::vector <D356_RECORD>& aRecor
const wxSize& drill = pad->GetDrillSize(); const wxSize& drill = pad->GetDrillSize();
rk.drill = std::min( drill.x, drill.y ); rk.drill = std::min( drill.x, drill.y );
rk.hole = (rk.drill != 0); rk.hole = (rk.drill != 0);
rk.smd = pad->GetAttribute() == PAD_ATTRIB_SMD; rk.smd = pad->GetAttribute() == PAD_ATTRIB::SMD;
rk.mechanical = ( pad->GetAttribute() == PAD_ATTRIB_NPTH ); rk.mechanical = ( pad->GetAttribute() == PAD_ATTRIB::NPTH );
rk.x_location = pad->GetPosition().x - origin.x; rk.x_location = pad->GetPosition().x - origin.x;
rk.y_location = origin.y - pad->GetPosition().y; rk.y_location = origin.y - pad->GetPosition().y;
rk.x_size = pad->GetSize().x; rk.x_size = pad->GetSize().x;

View File

@ -56,7 +56,7 @@ public:
bool isThrough() const bool isThrough() const
{ {
return m_type == PAD_ATTRIB_NPTH || m_type == PAD_ATTRIB_PTH; return m_type == PAD_ATTRIB::NPTH || m_type == PAD_ATTRIB::PTH;
} }
bool operator==( const HYPERLYNX_PAD_STACK& other ) const bool operator==( const HYPERLYNX_PAD_STACK& other ) const
@ -87,7 +87,7 @@ public:
bool isSMD() const bool isSMD() const
{ {
return m_type == PAD_ATTRIB_SMD; return m_type == PAD_ATTRIB::SMD;
} }
PCB_LAYER_ID getSMDLayer() const PCB_LAYER_ID getSMDLayer() const
@ -138,7 +138,7 @@ private:
int m_sx, m_sy; int m_sx, m_sy;
double m_angle; double m_angle;
LSET m_layers; LSET m_layers;
PAD_ATTR_T m_type; PAD_ATTRIB m_type;
}; };
@ -238,7 +238,7 @@ HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const PAD* aPad )
m_layers = aPad->GetLayerSet(); m_layers = aPad->GetLayerSet();
m_drill = aPad->GetDrillSize().x; m_drill = aPad->GetDrillSize().x;
m_shape = aPad->GetShape(); m_shape = aPad->GetShape();
m_type = PAD_ATTRIB_PTH; m_type = PAD_ATTRIB::PTH;
m_id = 0; m_id = 0;
} }
@ -252,7 +252,7 @@ HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const VIA* aVia )
m_layers = LSET::AllCuMask(); m_layers = LSET::AllCuMask();
m_drill = aVia->GetDrillValue(); m_drill = aVia->GetDrillValue();
m_shape = PAD_SHAPE::CIRCLE; m_shape = PAD_SHAPE::CIRCLE;
m_type = PAD_ATTRIB_PTH; m_type = PAD_ATTRIB::PTH;
m_id = 0; m_id = 0;
} }

View File

@ -324,7 +324,7 @@ static void idf_export_footprint( BOARD* aPcb, FOOTPRINT* aFootprint, IDF3_BOARD
if( drill > 0.0 ) if( drill > 0.0 )
{ {
// plating // plating
if( pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
kplate = IDF3::NPTH; kplate = IDF3::NPTH;
else else
kplate = IDF3::PTH; kplate = IDF3::PTH;

View File

@ -675,7 +675,7 @@ void EXPORTER_PCB_VRML::ExportVrmlPadHole( PAD* aPad )
bool pth = false; bool pth = false;
if( ( aPad->GetAttribute() != PAD_ATTRIB_NPTH ) ) if( ( aPad->GetAttribute() != PAD_ATTRIB::NPTH ) )
pth = true; pth = true;
if( aPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG ) if( aPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG )

View File

@ -124,10 +124,10 @@ void GENDRILL_WRITER_BASE::buildHolesList( DRILL_LAYER_PAIR aLayerPair,
{ {
if( !m_merge_PTH_NPTH ) if( !m_merge_PTH_NPTH )
{ {
if( !aGenerateNPTH_list && pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( !aGenerateNPTH_list && pad->GetAttribute() == PAD_ATTRIB::NPTH )
continue; continue;
if( aGenerateNPTH_list && pad->GetAttribute() != PAD_ATTRIB_NPTH ) if( aGenerateNPTH_list && pad->GetAttribute() != PAD_ATTRIB::NPTH )
continue; continue;
} }
@ -135,7 +135,7 @@ void GENDRILL_WRITER_BASE::buildHolesList( DRILL_LAYER_PAIR aLayerPair,
continue; continue;
new_hole.m_ItemParent = pad; new_hole.m_ItemParent = pad;
new_hole.m_Hole_NotPlated = (pad->GetAttribute() == PAD_ATTRIB_NPTH); new_hole.m_Hole_NotPlated = (pad->GetAttribute() == PAD_ATTRIB::NPTH);
new_hole.m_HoleAttribute = new_hole.m_Hole_NotPlated new_hole.m_HoleAttribute = new_hole.m_Hole_NotPlated
? HOLE_ATTRIBUTE::HOLE_MECHANICAL ? HOLE_ATTRIBUTE::HOLE_MECHANICAL
: HOLE_ATTRIBUTE::HOLE_PAD; : HOLE_ATTRIBUTE::HOLE_PAD;

View File

@ -1010,7 +1010,7 @@ unsigned FOOTPRINT::GetPadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
for( PAD* pad : m_pads ) for( PAD* pad : m_pads )
{ {
if( pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
continue; continue;
cnt++; cnt++;
@ -1040,7 +1040,7 @@ unsigned FOOTPRINT::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
if( !aIncludeNPTH ) if( !aIncludeNPTH )
{ {
// skip NPTH // skip NPTH
if( pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
{ {
continue; continue;
} }
@ -1995,7 +1995,7 @@ bool FOOTPRINT::HasThroughHolePads() const
{ {
for( PAD* pad : Pads() ) for( PAD* pad : Pads() )
{ {
if( pad->GetAttribute() != PAD_ATTRIB_SMD ) if( pad->GetAttribute() != PAD_ATTRIB::SMD )
return true; return true;
} }

View File

@ -212,7 +212,7 @@ FOOTPRINT* MICROWAVE_TOOL::createBaseFootprint( const wxString& aValue,
pad->SetPosition( footprint->GetPosition() ); pad->SetPosition( footprint->GetPosition() );
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECT );
pad->SetAttribute( PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetLayerSet( F_Cu ); pad->SetLayerSet( F_Cu );
Line.Printf( wxT( "%d" ), pad_num ); Line.Printf( wxT( "%d" ), pad_num );

View File

@ -449,7 +449,7 @@ FOOTPRINT* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN&
pad->SetSize( wxSize( aInductorPattern.m_Width, aInductorPattern.m_Width ) ); pad->SetSize( wxSize( aInductorPattern.m_Width, aInductorPattern.m_Width ) );
pad->SetLayerSet( LSET( footprint->GetLayer() ) ); pad->SetLayerSet( LSET( footprint->GetLayer() ) );
pad->SetAttribute( PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetShape( PAD_SHAPE::CIRCLE ); pad->SetShape( PAD_SHAPE::CIRCLE );
PAD* newpad = new PAD( *pad ); PAD* newpad = new PAD( *pad );

View File

@ -79,7 +79,7 @@ private:
* Create a footprint "GAP" or "STUB" used in micro wave designs. * Create a footprint "GAP" or "STUB" used in micro wave designs.
* *
* This footprint has 2 pads: * This footprint has 2 pads:
* PAD_ATTRIB_SMD, rectangular, H size = V size = current track width. * PAD_ATTRIB::SMD, rectangular, H size = V size = current track width.
* the "gap" is isolation created between this 2 pads * the "gap" is isolation created between this 2 pads
* *
* @param aComponentShape is the component to create. * @param aComponentShape is the component to create.
@ -99,7 +99,7 @@ private:
* Create a basic footprint for micro wave applications. * Create a basic footprint for micro wave applications.
* *
* The default pad settings are: * The default pad settings are:
* PAD_ATTRIB_SMD, rectangular, H size = V size = current track width. * PAD_ATTRIB::SMD, rectangular, H size = V size = current track width.
* *
* @param aValue is the text value. * @param aValue is the text value.
* @param aTextSize is the size of ref and value texts ( <= 0 to use board default values ). * @param aTextSize is the size of ref and value texts ( <= 0 to use board default values ).

View File

@ -67,7 +67,7 @@ PAD::PAD( FOOTPRINT* parent ) :
SetAnchorPadShape( PAD_SHAPE::CIRCLE ); // Default shape for custom shaped pads SetAnchorPadShape( PAD_SHAPE::CIRCLE ); // Default shape for custom shaped pads
// is PAD_CIRCLE. // is PAD_CIRCLE.
SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle. SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); // Default pad drill shape is a circle.
m_attribute = PAD_ATTRIB_PTH; // Default pad type is plated through hole m_attribute = PAD_ATTRIB::PTH; // Default pad type is plated through hole
SetProperty( PAD_PROP_NONE ); // no special fabrication property SetProperty( PAD_PROP_NONE ); // no special fabrication property
m_localClearance = 0; m_localClearance = 0;
m_localSolderMaskMargin = 0; m_localSolderMaskMargin = 0;
@ -214,7 +214,7 @@ bool PAD::FlashLayer( int aLayer ) const
return false; return false;
/// We don't remove the copper from non-PTH pads /// We don't remove the copper from non-PTH pads
if( GetAttribute() != PAD_ATTRIB_PTH ) if( GetAttribute() != PAD_ATTRIB::PTH )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) ); return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
/// Heatsink pads always get copper /// Heatsink pads always get copper
@ -556,11 +556,11 @@ void PAD::SetLocalCoord()
} }
void PAD::SetAttribute( PAD_ATTR_T aAttribute ) void PAD::SetAttribute( PAD_ATTRIB aAttribute )
{ {
m_attribute = aAttribute; m_attribute = aAttribute;
if( aAttribute == PAD_ATTRIB_SMD ) if( aAttribute == PAD_ATTRIB::SMD )
m_drill = wxSize( 0, 0 ); m_drill = wxSize( 0, 0 );
SetDirty(); SetDirty();
@ -871,7 +871,7 @@ void PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>&
if( IsLocked() ) if( IsLocked() )
aList.emplace_back( _( "Status" ), _( "Locked" ) ); aList.emplace_back( _( "Status" ), _( "Locked" ) );
if( GetAttribute() == PAD_ATTRIB_SMD || GetAttribute() == PAD_ATTRIB_CONN ) if( GetAttribute() == PAD_ATTRIB::SMD || GetAttribute() == PAD_ATTRIB::CONN )
aList.emplace_back( _( "Layer" ), layerMaskDescribe() ); aList.emplace_back( _( "Layer" ), layerMaskDescribe() );
// Show the pad shape, attribute and property // Show the pad shape, attribute and property
@ -1089,10 +1089,10 @@ wxString PAD::ShowPadAttr() const
{ {
switch( GetAttribute() ) switch( GetAttribute() )
{ {
case PAD_ATTRIB_PTH: return _( "PTH" ); case PAD_ATTRIB::PTH: return _( "PTH" );
case PAD_ATTRIB_SMD: return _( "SMD" ); case PAD_ATTRIB::SMD: return _( "SMD" );
case PAD_ATTRIB_CONN: return _( "Conn" ); case PAD_ATTRIB::CONN: return _( "Conn" );
case PAD_ATTRIB_NPTH: return _( "NPTH" ); case PAD_ATTRIB::NPTH: return _( "NPTH" );
default: return wxT( "???" ); default: return wxT( "???" );
} }
} }
@ -1102,7 +1102,7 @@ wxString PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
{ {
if( GetName().IsEmpty() ) if( GetName().IsEmpty() )
{ {
if( GetAttribute() == PAD_ATTRIB_SMD || GetAttribute() == PAD_ATTRIB_CONN ) if( GetAttribute() == PAD_ATTRIB::SMD || GetAttribute() == PAD_ATTRIB::CONN )
{ {
return wxString::Format( _( "Pad of %s on %s" ), return wxString::Format( _( "Pad of %s on %s" ),
GetParent()->GetReference(), GetParent()->GetReference(),
@ -1116,7 +1116,7 @@ wxString PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
} }
else else
{ {
if( GetAttribute() == PAD_ATTRIB_SMD || GetAttribute() == PAD_ATTRIB_CONN ) if( GetAttribute() == PAD_ATTRIB::SMD || GetAttribute() == PAD_ATTRIB::CONN )
{ {
return wxString::Format( _( "Pad %s of %s on %s" ), return wxString::Format( _( "Pad %s of %s on %s" ),
GetName(), GetName(),
@ -1150,13 +1150,13 @@ void PAD::ViewGetLayers( int aLayers[], int& aCount ) const
aCount = 0; aCount = 0;
// These 2 types of pads contain a hole // These 2 types of pads contain a hole
if( m_attribute == PAD_ATTRIB_PTH ) if( m_attribute == PAD_ATTRIB::PTH )
{ {
aLayers[aCount++] = LAYER_PAD_PLATEDHOLES; aLayers[aCount++] = LAYER_PAD_PLATEDHOLES;
aLayers[aCount++] = LAYER_PAD_HOLEWALLS; aLayers[aCount++] = LAYER_PAD_HOLEWALLS;
} }
if( m_attribute == PAD_ATTRIB_NPTH ) if( m_attribute == PAD_ATTRIB::NPTH )
aLayers[aCount++] = LAYER_NON_PLATEDHOLES; aLayers[aCount++] = LAYER_NON_PLATEDHOLES;
if( IsOnLayer( F_Cu ) && IsOnLayer( B_Cu ) ) if( IsOnLayer( F_Cu ) && IsOnLayer( B_Cu ) )
@ -1171,7 +1171,7 @@ void PAD::ViewGetLayers( int aLayers[], int& aCount ) const
// Is this a PTH pad that has only front copper? If so, we need to also display the // Is this a PTH pad that has only front copper? If so, we need to also display the
// net name on the PTH netname layer so that it isn't blocked by the drill hole. // net name on the PTH netname layer so that it isn't blocked by the drill hole.
if( m_attribute == PAD_ATTRIB_PTH ) if( m_attribute == PAD_ATTRIB::PTH )
aLayers[aCount++] = LAYER_PAD_NETNAMES; aLayers[aCount++] = LAYER_PAD_NETNAMES;
else else
aLayers[aCount++] = LAYER_PAD_FR_NETNAMES; aLayers[aCount++] = LAYER_PAD_FR_NETNAMES;
@ -1182,7 +1182,7 @@ void PAD::ViewGetLayers( int aLayers[], int& aCount ) const
// Is this a PTH pad that has only back copper? If so, we need to also display the // Is this a PTH pad that has only back copper? If so, we need to also display the
// net name on the PTH netname layer so that it isn't blocked by the drill hole. // net name on the PTH netname layer so that it isn't blocked by the drill hole.
if( m_attribute == PAD_ATTRIB_PTH ) if( m_attribute == PAD_ATTRIB::PTH )
aLayers[aCount++] = LAYER_PAD_NETNAMES; aLayers[aCount++] = LAYER_PAD_NETNAMES;
else else
aLayers[aCount++] = LAYER_PAD_BK_NETNAMES; aLayers[aCount++] = LAYER_PAD_BK_NETNAMES;
@ -1240,7 +1240,7 @@ double PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
visible = board->GetVisibleLayers() & board->GetEnabledLayers(); visible = board->GetVisibleLayers() & board->GetEnabledLayers();
// Handle Render tab switches // Handle Render tab switches
if( ( GetAttribute() == PAD_ATTRIB_PTH || GetAttribute() == PAD_ATTRIB_NPTH ) if( ( GetAttribute() == PAD_ATTRIB::PTH || GetAttribute() == PAD_ATTRIB::NPTH )
&& !aView->IsLayerVisible( LAYER_PADS_TH ) ) && !aView->IsLayerVisible( LAYER_PADS_TH ) )
{ {
return HIDE; return HIDE;
@ -1390,8 +1390,8 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad )
switch( aMasterPad.GetAttribute() ) switch( aMasterPad.GetAttribute() )
{ {
case PAD_ATTRIB_SMD: case PAD_ATTRIB::SMD:
case PAD_ATTRIB_CONN: case PAD_ATTRIB::CONN:
// These pads do not have hole (they are expected to be only on one // These pads do not have hole (they are expected to be only on one
// external copper layer) // external copper layer)
SetDrillSize( wxSize( 0, 0 ) ); SetDrillSize( wxSize( 0, 0 ) );
@ -1433,11 +1433,11 @@ static struct PAD_DESC
{ {
PAD_DESC() PAD_DESC()
{ {
ENUM_MAP<PAD_ATTR_T>::Instance() ENUM_MAP<PAD_ATTRIB>::Instance()
.Map( PAD_ATTRIB_PTH, _HKI( "Through-hole" ) ) .Map( PAD_ATTRIB::PTH, _HKI( "Through-hole" ) )
.Map( PAD_ATTRIB_SMD, _HKI( "SMD" ) ) .Map( PAD_ATTRIB::SMD, _HKI( "SMD" ) )
.Map( PAD_ATTRIB_CONN, _HKI( "Edge connector" ) ) .Map( PAD_ATTRIB::CONN, _HKI( "Edge connector" ) )
.Map( PAD_ATTRIB_NPTH, _HKI( "NPTH, mechanical" ) ); .Map( PAD_ATTRIB::NPTH, _HKI( "NPTH, mechanical" ) );
ENUM_MAP<PAD_SHAPE>::Instance() ENUM_MAP<PAD_SHAPE>::Instance()
.Map( PAD_SHAPE::CIRCLE, _HKI( "Circle" ) ) .Map( PAD_SHAPE::CIRCLE, _HKI( "Circle" ) )
@ -1461,7 +1461,7 @@ static struct PAD_DESC
REGISTER_TYPE( PAD ); REGISTER_TYPE( PAD );
propMgr.InheritsAfter( TYPE_HASH( PAD ), TYPE_HASH( BOARD_CONNECTED_ITEM ) ); propMgr.InheritsAfter( TYPE_HASH( PAD ), TYPE_HASH( BOARD_CONNECTED_ITEM ) );
auto padType = new PROPERTY_ENUM<PAD, PAD_ATTR_T>( _HKI( "Pad Type" ), auto padType = new PROPERTY_ENUM<PAD, PAD_ATTRIB>( _HKI( "Pad Type" ),
&PAD::SetAttribute, &PAD::GetAttribute ); &PAD::SetAttribute, &PAD::GetAttribute );
propMgr.AddProperty( padType ); propMgr.AddProperty( padType );
@ -1529,6 +1529,6 @@ static struct PAD_DESC
} }
} _PAD_DESC; } _PAD_DESC;
ENUM_TO_WXANY( PAD_ATTR_T ); ENUM_TO_WXANY( PAD_ATTRIB );
ENUM_TO_WXANY( PAD_SHAPE ); ENUM_TO_WXANY( PAD_SHAPE );
ENUM_TO_WXANY( PAD_PROP_T ); ENUM_TO_WXANY( PAD_PROP_T );

View File

@ -95,9 +95,9 @@ public:
{ {
if( *p == PCB_LOCATE_HOLE_T ) if( *p == PCB_LOCATE_HOLE_T )
return true; return true;
else if( *p == PCB_LOCATE_PTH_T && m_attribute != PAD_ATTRIB_NPTH ) else if( *p == PCB_LOCATE_PTH_T && m_attribute != PAD_ATTRIB::NPTH )
return true; return true;
else if( *p == PCB_LOCATE_NPTH_T && m_attribute == PAD_ATTRIB_NPTH ) else if( *p == PCB_LOCATE_NPTH_T && m_attribute == PAD_ATTRIB::NPTH )
return true; return true;
} }
} }
@ -367,8 +367,8 @@ public:
void SetLayerSet( LSET aLayers ) override { m_layerMask = aLayers; } void SetLayerSet( LSET aLayers ) override { m_layerMask = aLayers; }
LSET GetLayerSet() const override { return m_layerMask; } LSET GetLayerSet() const override { return m_layerMask; }
void SetAttribute( PAD_ATTR_T aAttribute ); void SetAttribute( PAD_ATTRIB aAttribute );
PAD_ATTR_T GetAttribute() const { return m_attribute; } PAD_ATTRIB GetAttribute() const { return m_attribute; }
void SetProperty( PAD_PROP_T aProperty ); void SetProperty( PAD_PROP_T aProperty );
PAD_PROP_T GetProperty() const { return m_property; } PAD_PROP_T GetProperty() const { return m_property; }
@ -744,8 +744,8 @@ private:
wxPoint m_pos0; // Initial Pad position (i.e. pad position relative to the wxPoint m_pos0; // Initial Pad position (i.e. pad position relative to the
// footprint anchor, orientation 0) // footprint anchor, orientation 0)
PAD_ATTR_T m_attribute; // PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN, PAD_ATTRIB m_attribute; // PAD_ATTRIB_NORMAL, PAD_ATTRIB::SMD, PAD_ATTRIB::CONN,
// PAD_ATTRIB_NPTH // PAD_ATTRIB::NPTH
PAD_PROP_T m_property; // Property in fab files (BGA, FIDUCIAL, TESTPOINT, etc.) PAD_PROP_T m_property; // Property in fab files (BGA, FIDUCIAL, TESTPOINT, etc.)
double m_orient; // in 1/10 degrees double m_orient; // in 1/10 degrees

View File

@ -30,7 +30,7 @@ bool PAD_NAMING::PadCanHaveName( const PAD& aPad )
return false; return false;
// NPTH pads don't get numbers // NPTH pads don't get numbers
if( aPad.GetAttribute() == PAD_ATTRIB_NPTH ) if( aPad.GetAttribute() == PAD_ATTRIB::NPTH )
return false; return false;
return true; return true;

View File

@ -1035,7 +1035,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
// Round-corner rects are expensive to draw, but are mostly found on // Round-corner rects are expensive to draw, but are mostly found on
// SMD pads which only need redrawing on an active-to-not-active // SMD pads which only need redrawing on an active-to-not-active
// switch. // switch.
if( pad->GetAttribute() == PAD_ATTRIB_SMD ) if( pad->GetAttribute() == PAD_ATTRIB::SMD )
{ {
if( ( oldLayer == F_Cu || aLayer == F_Cu ) && pad->IsOnLayer( F_Cu ) ) if( ( oldLayer == F_Cu || aLayer == F_Cu ) && pad->IsOnLayer( F_Cu ) )
return true; return true;

View File

@ -128,7 +128,7 @@ static void isPlated( LIBEVAL::CONTEXT* aCtx, void* self )
if( !item ) if( !item )
return; return;
if( item->Type() == PCB_PAD_T && static_cast<PAD*>( item )->GetAttribute() == PAD_ATTRIB_PTH ) if( item->Type() == PCB_PAD_T && static_cast<PAD*>( item )->GetAttribute() == PAD_ATTRIB::PTH )
result->Set( 1.0 ); result->Set( 1.0 );
else if( item->Type() == PCB_VIA_T ) else if( item->Type() == PCB_VIA_T )
result->Set( 1.0 ); result->Set( 1.0 );

View File

@ -237,7 +237,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
int holeLayer = aLayer; int holeLayer = aLayer;
int annularRingLayer = UNDEFINED_LAYER; int annularRingLayer = UNDEFINED_LAYER;
if( pad && pad->GetAttribute() == PAD_ATTRIB_PTH ) if( pad && pad->GetAttribute() == PAD_ATTRIB::PTH )
annularRingLayer = LAYER_PADS_TH; annularRingLayer = LAYER_PADS_TH;
else if( via && via->GetViaType() == VIATYPE::MICROVIA ) else if( via && via->GetViaType() == VIATYPE::MICROVIA )
annularRingLayer = LAYER_VIA_MICROVIA; annularRingLayer = LAYER_VIA_MICROVIA;

View File

@ -305,7 +305,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
if( aPlotOpt.GetSkipPlotNPTH_Pads() && if( aPlotOpt.GetSkipPlotNPTH_Pads() &&
( aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::NO_DRILL_SHAPE ) && ( aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::NO_DRILL_SHAPE ) &&
( pad->GetSize() == pad->GetDrillSize() ) && ( pad->GetSize() == pad->GetDrillSize() ) &&
( pad->GetAttribute() == PAD_ATTRIB_NPTH ) ) ( pad->GetAttribute() == PAD_ATTRIB::NPTH ) )
break; break;
itemplotter.PlotPad( pad, color, padPlotMode ); itemplotter.PlotPad( pad, color, padPlotMode );

View File

@ -47,7 +47,7 @@
#include <gbr_metadata.h> #include <gbr_metadata.h>
#include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA #include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA
#include <layers_id_colors_and_visibility.h> // for LSET, IsCopperLayer #include <layers_id_colors_and_visibility.h> // for LSET, IsCopperLayer
#include <pad_shapes.h> // for PAD_ATTRIB_NPTH #include <pad_shapes.h> // for PAD_ATTRIB::NPTH
#include <pcbplot.h> #include <pcbplot.h>
#include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL... #include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL...
#include <advanced_config.h> #include <advanced_config.h>
@ -123,7 +123,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, COLOR4D aColor, OUTLINE_MODE aP
// Some pads are mechanical pads ( through hole or smd ) // Some pads are mechanical pads ( through hole or smd )
// when this is the case, they have no pad name and/or are not plated. // when this is the case, they have no pad name and/or are not plated.
// In this case gerber files have slightly different attributes. // In this case gerber files have slightly different attributes.
if( aPad->GetAttribute() == PAD_ATTRIB_NPTH || aPad->GetName().IsEmpty() ) if( aPad->GetAttribute() == PAD_ATTRIB::NPTH || aPad->GetName().IsEmpty() )
gbr_metadata.m_NetlistMetadata.m_NotInNet = true; gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
if( !plotOnExternalCopperLayer ) if( !plotOnExternalCopperLayer )
@ -142,24 +142,24 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, COLOR4D aColor, OUTLINE_MODE aP
// Some attributes are reserved to the external copper layers: // Some attributes are reserved to the external copper layers:
// GBR_APERTURE_ATTRIB_CONNECTORPAD and GBR_APERTURE_ATTRIB_SMDPAD_CUDEF // GBR_APERTURE_ATTRIB_CONNECTORPAD and GBR_APERTURE_ATTRIB_SMDPAD_CUDEF
// for instance. // for instance.
// Pad with type PAD_ATTRIB_CONN or PAD_ATTRIB_SMD that is not on outer layer // Pad with type PAD_ATTRIB::CONN or PAD_ATTRIB::SMD that is not on outer layer
// has its aperture attribute set to GBR_APERTURE_ATTRIB_CONDUCTOR // has its aperture attribute set to GBR_APERTURE_ATTRIB_CONDUCTOR
switch( aPad->GetAttribute() ) switch( aPad->GetAttribute() )
{ {
case PAD_ATTRIB_NPTH: // Mechanical pad through hole case PAD_ATTRIB::NPTH: // Mechanical pad through hole
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD ); gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD );
break; break;
case PAD_ATTRIB_PTH : // Pad through hole, a hole is also expected case PAD_ATTRIB::PTH : // Pad through hole, a hole is also expected
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD ); gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD );
break; break;
case PAD_ATTRIB_CONN: // Connector pads, no solder paste but with solder mask. case PAD_ATTRIB::CONN: // Connector pads, no solder paste but with solder mask.
if( plotOnExternalCopperLayer ) if( plotOnExternalCopperLayer )
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD ); gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD );
break; break;
case PAD_ATTRIB_SMD: // SMD pads (on external copper layer only) case PAD_ATTRIB::SMD: // SMD pads (on external copper layer only)
// with solder paste and mask // with solder paste and mask
if( plotOnExternalCopperLayer ) if( plotOnExternalCopperLayer )
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF ); gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF );
@ -201,7 +201,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, COLOR4D aColor, OUTLINE_MODE aP
} }
// Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute // Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute
if( aPad->GetAttribute() == PAD_ATTRIB_NPTH ) if( aPad->GetAttribute() == PAD_ATTRIB::NPTH )
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD ); gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD );
} }
else else

View File

@ -1797,7 +1797,7 @@ void ALTIUM_PCB::ParsePads6Data( const CFB::CompoundFileReader& aReader,
if( elem.holesize == 0 ) if( elem.holesize == 0 )
{ {
pad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
} }
else else
{ {
@ -1808,8 +1808,8 @@ void ALTIUM_PCB::ParsePads6Data( const CFB::CompoundFileReader& aReader,
"Pad '%s' of Footprint %s is not marked as multilayer, but it is an THT pad", "Pad '%s' of Footprint %s is not marked as multilayer, but it is an THT pad",
elem.name, footprint->GetReference() ) ); elem.name, footprint->GetReference() ) );
} }
pad->SetAttribute( elem.plated ? PAD_ATTR_T::PAD_ATTRIB_PTH : pad->SetAttribute( elem.plated ? PAD_ATTRIB::PTH :
PAD_ATTR_T::PAD_ATTRIB_NPTH ); PAD_ATTRIB::NPTH );
if( !elem.sizeAndShape || elem.sizeAndShape->holeshape == ALTIUM_PAD_HOLE_SHAPE::ROUND ) if( !elem.sizeAndShape || elem.sizeAndShape->holeshape == ALTIUM_PAD_HOLE_SHAPE::ROUND )
{ {
pad->SetDrillShape( PAD_DRILL_SHAPE_T::PAD_DRILL_SHAPE_CIRCLE ); pad->SetDrillShape( PAD_DRILL_SHAPE_T::PAD_DRILL_SHAPE_CIRCLE );

View File

@ -727,7 +727,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers( const SYMDEF_PCB& aComponen
PAD* pad = new PAD( aFootprint ); PAD* pad = new PAD( aFootprint );
pad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetLayerSet( LSET( 1, copperLayer ) ); pad->SetLayerSet( LSET( 1, copperLayer ) );
pad->SetName( anchorPad.Identifier.IsEmpty() pad->SetName( anchorPad.Identifier.IsEmpty()
? wxString::Format( wxT( "%ld" ), anchorPad.ID ) ? wxString::Format( wxT( "%ld" ), anchorPad.ID )
@ -863,20 +863,20 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
switch( aCadstarPad.Side ) switch( aCadstarPad.Side )
{ {
case PAD_SIDE::MAXIMUM: //Bottom side case PAD_SIDE::MAXIMUM: //Bottom side
pad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
padLayerSet |= LSET( 3, B_Cu, B_Paste, B_Mask ); padLayerSet |= LSET( 3, B_Cu, B_Paste, B_Mask );
break; break;
case PAD_SIDE::MINIMUM: //TOP side case PAD_SIDE::MINIMUM: //TOP side
pad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
padLayerSet |= LSET( 3, F_Cu, F_Paste, F_Mask ); padLayerSet |= LSET( 3, F_Cu, F_Paste, F_Mask );
break; break;
case PAD_SIDE::THROUGH_HOLE: case PAD_SIDE::THROUGH_HOLE:
if( csPadcode.Plated ) if( csPadcode.Plated )
pad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_PTH ); pad->SetAttribute( PAD_ATTRIB::PTH );
else else
pad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_NPTH ); pad->SetAttribute( PAD_ATTRIB::NPTH );
padLayerSet = LSET::AllCuMask() | LSET( 4, F_Mask, B_Mask, F_Paste, B_Paste ); padLayerSet = LSET::AllCuMask() | LSET( 4, F_Mask, B_Mask, F_Paste, B_Paste );
break; break;
@ -947,7 +947,7 @@ PAD* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad( const COMPONENT_PAD& aCadstarPad,
// Through-hole, zero sized pad?. Lets load this just on the F_Mask for now to // Through-hole, zero sized pad?. Lets load this just on the F_Mask for now to
// prevent DRC errors. // prevent DRC errors.
// TODO: This could be a custom padstack, update when KiCad supports padstacks // TODO: This could be a custom padstack, update when KiCad supports padstacks
pad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetLayerSet( LSET( 1, F_Mask ) ); pad->SetLayerSet( LSET( 1, F_Mask ) );
} }

View File

@ -838,7 +838,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
{ {
m_xpath->push( "hole" ); m_xpath->push( "hole" );
// Fabricate a FOOTPRINT with a single PAD_ATTRIB_NPTH pad. // Fabricate a FOOTPRINT with a single PAD_ATTRIB::NPTH pad.
// Use m_hole_count to gen up a unique name. // Use m_hole_count to gen up a unique name.
FOOTPRINT* footprint = new FOOTPRINT( m_board ); FOOTPRINT* footprint = new FOOTPRINT( m_board );
@ -2142,12 +2142,12 @@ void EAGLE_PLUGIN::packageHole( FOOTPRINT* aFootprint, wxXmlNode* aTree, bool aC
{ {
EHOLE e( aTree ); EHOLE e( aTree );
// we add a PAD_ATTRIB_NPTH pad to this footprint. // we add a PAD_ATTRIB::NPTH pad to this footprint.
PAD* pad = new PAD( aFootprint ); PAD* pad = new PAD( aFootprint );
aFootprint->Add( pad ); aFootprint->Add( pad );
pad->SetShape( PAD_SHAPE::CIRCLE ); pad->SetShape( PAD_SHAPE::CIRCLE );
pad->SetAttribute( PAD_ATTRIB_NPTH ); pad->SetAttribute( PAD_ATTRIB::NPTH );
// Mechanical purpose only: // Mechanical purpose only:
// no offset, no net name, no pad name allowed // no offset, no net name, no pad name allowed
@ -2190,7 +2190,7 @@ void EAGLE_PLUGIN::packageSMD( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
transferPad( e, pad ); transferPad( e, pad );
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECT );
pad->SetAttribute( PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
wxSize padSize( e.dx.ToPcbUnits(), e.dy.ToPcbUnits() ); wxSize padSize( e.dx.ToPcbUnits(), e.dy.ToPcbUnits() );
pad->SetSize( padSize ); pad->SetSize( padSize );

View File

@ -2297,12 +2297,12 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
{ {
if( pad.plated ) if( pad.plated )
{ {
newpad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_PTH ); newpad->SetAttribute( PAD_ATTRIB::PTH );
newpad->SetLayerSet( PAD::PTHMask() ); newpad->SetLayerSet( PAD::PTHMask() );
} }
else else
{ {
newpad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_NPTH ); newpad->SetAttribute( PAD_ATTRIB::NPTH );
newpad->SetLayerSet( PAD::UnplatedHoleMask() ); newpad->SetLayerSet( PAD::UnplatedHoleMask() );
} }
@ -2315,7 +2315,7 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
} }
else else
{ {
newpad->SetAttribute( PAD_ATTR_T::PAD_ATTRIB_SMD ); newpad->SetAttribute( PAD_ATTRIB::SMD );
if( pad.top ) if( pad.top )
newpad->SetLayerSet( PAD::SMDMask() ); newpad->SetLayerSet( PAD::SMDMask() );

View File

@ -541,7 +541,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader )
static const LSET pad_back( 3, B_Cu, B_Mask, B_Paste ); static const LSET pad_back( 3, B_Cu, B_Mask, B_Paste );
pad->SetShape( PAD_SHAPE::RECT ); pad->SetShape( PAD_SHAPE::RECT );
pad->SetAttribute( PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetLayerSet( pad_front ); pad->SetLayerSet( pad_front );
if( testFlags( parameters[paramCnt-2], 0x0080, wxT( "onsolder" ) ) ) if( testFlags( parameters[paramCnt-2], 0x0080, wxT( "onsolder" ) ) )

View File

@ -1323,10 +1323,10 @@ void PCB_IO::format( const PAD* aPad, int aNestLevel ) const
switch( aPad->GetAttribute() ) switch( aPad->GetAttribute() )
{ {
case PAD_ATTRIB_PTH: type = "thru_hole"; break; case PAD_ATTRIB::PTH: type = "thru_hole"; break;
case PAD_ATTRIB_SMD: type = "smd"; break; case PAD_ATTRIB::SMD: type = "smd"; break;
case PAD_ATTRIB_CONN: type = "connect"; break; case PAD_ATTRIB::CONN: type = "connect"; break;
case PAD_ATTRIB_NPTH: type = "np_thru_hole"; break; case PAD_ATTRIB::NPTH: type = "np_thru_hole"; break;
default: default:
THROW_IO_ERROR( wxString::Format( "unknown pad attribute: %d", aPad->GetAttribute() ) ); THROW_IO_ERROR( wxString::Format( "unknown pad attribute: %d", aPad->GetAttribute() ) );
@ -1397,7 +1397,7 @@ void PCB_IO::format( const PAD* aPad, int aNestLevel ) const
formatLayers( aPad->GetLayerSet() ); formatLayers( aPad->GetLayerSet() );
if( aPad->GetAttribute() == PAD_ATTRIB_PTH ) if( aPad->GetAttribute() == PAD_ATTRIB::PTH )
{ {
if( aPad->GetRemoveUnconnected() ) if( aPad->GetRemoveUnconnected() )
{ {

View File

@ -3727,11 +3727,11 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent )
switch( token ) switch( token )
{ {
case T_thru_hole: case T_thru_hole:
pad->SetAttribute( PAD_ATTRIB_PTH ); pad->SetAttribute( PAD_ATTRIB::PTH );
break; break;
case T_smd: case T_smd:
pad->SetAttribute( PAD_ATTRIB_SMD ); pad->SetAttribute( PAD_ATTRIB::SMD );
// Default PAD object is thru hole with drill. // Default PAD object is thru hole with drill.
// SMD pads have no hole // SMD pads have no hole
@ -3739,7 +3739,7 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent )
break; break;
case T_connect: case T_connect:
pad->SetAttribute( PAD_ATTRIB_CONN ); pad->SetAttribute( PAD_ATTRIB::CONN );
// Default PAD object is thru hole with drill. // Default PAD object is thru hole with drill.
// CONN pads have no hole // CONN pads have no hole
@ -3747,7 +3747,7 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent )
break; break;
case T_np_thru_hole: case T_np_thru_hole:
pad->SetAttribute( PAD_ATTRIB_NPTH ); pad->SetAttribute( PAD_ATTRIB::NPTH );
break; break;
default: default:
@ -3888,7 +3888,7 @@ PAD* PCB_PARSER::parsePAD( FOOTPRINT* aParent )
// than 0 used to fix a bunch of debug assertions even though it is defined as a // than 0 used to fix a bunch of debug assertions even though it is defined as a
// through hole pad. Wouldn't a though hole pad with no drill be a surface mount // through hole pad. Wouldn't a though hole pad with no drill be a surface mount
// pad (or a conn pad which is a smd pad with no solder paste)? // pad (or a conn pad which is a smd pad with no solder paste)?
if( ( pad->GetAttribute() != PAD_ATTRIB_SMD ) && ( pad->GetAttribute() != PAD_ATTRIB_CONN ) ) if( ( pad->GetAttribute() != PAD_ATTRIB::SMD ) && ( pad->GetAttribute() != PAD_ATTRIB::CONN ) )
pad->SetDrillSize( drillSize ); pad->SetDrillSize( drillSize );
else else
pad->SetDrillSize( wxSize( 0, 0 ) ); pad->SetDrillSize( wxSize( 0, 0 ) );

View File

@ -1496,18 +1496,18 @@ void LEGACY_PLUGIN::loadPAD( FOOTPRINT* aFootprint )
// e.g. "At SMD N 00888000" // e.g. "At SMD N 00888000"
// sscanf( PtLine, "%s %s %X", BufLine, BufCar, &m_layerMask ); // sscanf( PtLine, "%s %s %X", BufLine, BufCar, &m_layerMask );
PAD_ATTR_T attribute; PAD_ATTRIB attribute;
data = strtok_r( line + SZ( "At" ), delims, &saveptr ); data = strtok_r( line + SZ( "At" ), delims, &saveptr );
if( !strcmp( data, "SMD" ) ) if( !strcmp( data, "SMD" ) )
attribute = PAD_ATTRIB_SMD; attribute = PAD_ATTRIB::SMD;
else if( !strcmp( data, "CONN" ) ) else if( !strcmp( data, "CONN" ) )
attribute = PAD_ATTRIB_CONN; attribute = PAD_ATTRIB::CONN;
else if( !strcmp( data, "HOLE" ) ) else if( !strcmp( data, "HOLE" ) )
attribute = PAD_ATTRIB_NPTH; attribute = PAD_ATTRIB::NPTH;
else else
attribute = PAD_ATTRIB_PTH; attribute = PAD_ATTRIB::PTH;
strtok_r( NULL, delims, &saveptr ); // skip unused prm strtok_r( NULL, delims, &saveptr ); // skip unused prm
data = strtok_r( NULL, delims, &saveptr ); data = strtok_r( NULL, delims, &saveptr );

View File

@ -190,7 +190,7 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps
{ {
PCB_PAD_SHAPE* padShape; PCB_PAD_SHAPE* padShape;
wxString padShapeName = wxT( "Ellipse" ); wxString padShapeName = wxT( "Ellipse" );
PAD_ATTR_T padType; PAD_ATTRIB padType;
int i; int i;
int width = 0; int width = 0;
int height = 0; int height = 0;
@ -201,7 +201,7 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps
{ {
// mechanical hole // mechanical hole
pad->SetShape( PAD_SHAPE::CIRCLE ); pad->SetShape( PAD_SHAPE::CIRCLE );
pad->SetAttribute( PAD_ATTRIB_NPTH ); pad->SetAttribute( PAD_ATTRIB::NPTH );
pad->SetDrillShape( PAD_DRILL_SHAPE_CIRCLE ); pad->SetDrillShape( PAD_DRILL_SHAPE_CIRCLE );
pad->SetDrillSize( wxSize( m_Hole, m_Hole ) ); pad->SetDrillSize( wxSize( m_Hole, m_Hole ) );
@ -220,7 +220,7 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps
} }
else else
{ {
( m_Hole ) ? padType = PAD_ATTRIB_PTH : padType = PAD_ATTRIB_SMD; ( m_Hole ) ? padType = PAD_ATTRIB::PTH : padType = PAD_ATTRIB::SMD;
// form layer mask // form layer mask
for( i = 0; i < (int) m_Shapes.GetCount(); i++ ) for( i = 0; i < (int) m_Shapes.GetCount(); i++ )
@ -252,7 +252,7 @@ void PCB_PAD::AddToFootprint( FOOTPRINT* aFootprint, int aRotation, bool aEncaps
return; return;
} }
if( padType == PAD_ATTRIB_PTH ) if( padType == PAD_ATTRIB::PTH )
// actually this is a thru-hole pad // actually this is a thru-hole pad
pad->SetLayerSet( LSET::AllCuMask() | LSET( 2, B_Mask, F_Mask ) ); pad->SetLayerSet( LSET::AllCuMask() | LSET( 2, B_Mask, F_Mask ) );

View File

@ -165,7 +165,7 @@ bool isCopper( const PNS::ITEM* aItem )
if( parent && parent->Type() == PCB_PAD_T ) if( parent && parent->Type() == PCB_PAD_T )
{ {
PAD* pad = static_cast<PAD*>( parent ); PAD* pad = static_cast<PAD*>( parent );
return pad->IsOnCopperLayer() && pad->GetAttribute() != PAD_ATTRIB_NPTH; return pad->IsOnCopperLayer() && pad->GetAttribute() != PAD_ATTRIB::NPTH;
} }
return true; return true;
@ -863,12 +863,12 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
switch( aPad->GetAttribute() ) switch( aPad->GetAttribute() )
{ {
case PAD_ATTRIB_PTH: case PAD_ATTRIB::PTH:
case PAD_ATTRIB_NPTH: case PAD_ATTRIB::NPTH:
break; break;
case PAD_ATTRIB_CONN: case PAD_ATTRIB::CONN:
case PAD_ATTRIB_SMD: case PAD_ATTRIB::SMD:
{ {
LSET lmsk = aPad->GetLayerSet(); LSET lmsk = aPad->GetLayerSet();
bool is_copper = false; bool is_copper = false;
@ -879,7 +879,7 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
{ {
is_copper = true; is_copper = true;
if( aPad->GetAttribute() != PAD_ATTRIB_NPTH ) if( aPad->GetAttribute() != PAD_ATTRIB::NPTH )
layers = LAYER_RANGE( i ); layers = LAYER_RANGE( i );
break; break;
@ -902,7 +902,7 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
{ {
SHAPE_SEGMENT* slot = (SHAPE_SEGMENT*) aPad->GetEffectiveHoleShape()->Clone(); SHAPE_SEGMENT* slot = (SHAPE_SEGMENT*) aPad->GetEffectiveHoleShape()->Clone();
if( aPad->GetAttribute() != PAD_ATTRIB_NPTH ) if( aPad->GetAttribute() != PAD_ATTRIB::NPTH )
{ {
BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings(); BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings();
slot->SetWidth( slot->GetWidth() + bds.GetHolePlatingThickness() * 2 ); slot->SetWidth( slot->GetWidth() + bds.GetHolePlatingThickness() * 2 );
@ -911,7 +911,7 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( PAD* aPad )
solid->SetHole( slot ); solid->SetHole( slot );
} }
if( aPad->GetAttribute() == PAD_ATTRIB_NPTH ) if( aPad->GetAttribute() == PAD_ATTRIB::NPTH )
solid->SetRoutable( false ); solid->SetRoutable( false );
solid->SetLayers( layers ); solid->SetLayers( layers );

View File

@ -208,7 +208,7 @@ bool ROUTER::isStartingPointRoutable( const VECTOR2I& aWhere, ITEM* aStartItem,
{ {
PAD* pad = static_cast<PAD*>( parent ); PAD* pad = static_cast<PAD*>( parent );
if( pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( pad->GetAttribute() == PAD_ATTRIB::NPTH )
SetFailureReason( _( "Cannot start routing from a non-plated hole." ) ); SetFailureReason( _( "Cannot start routing from a non-plated hole." ) );
} }
break; break;

View File

@ -155,7 +155,7 @@ void BOARD_INSPECTION_TOOL::reportZoneConnection( ZONE* aZone, PAD* aPad, REPORT
// Resolve complex connection types into simple types // Resolve complex connection types into simple types
if( connection == ZONE_CONNECTION::THT_THERMAL ) if( connection == ZONE_CONNECTION::THT_THERMAL )
{ {
if( aPad->GetAttribute() == PAD_ATTRIB_PTH ) if( aPad->GetAttribute() == PAD_ATTRIB::PTH )
{ {
connection = ZONE_CONNECTION::THERMAL; connection = ZONE_CONNECTION::THERMAL;
} }
@ -329,7 +329,7 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
{ {
layer = b->GetLayer(); layer = b->GetLayer();
} }
else if( a->Type() == PCB_PAD_T && static_cast<PAD*>( a )->GetAttribute() == PAD_ATTRIB_SMD ) else if( a->Type() == PCB_PAD_T && static_cast<PAD*>( a )->GetAttribute() == PAD_ATTRIB::SMD )
{ {
PAD* pad = static_cast<PAD*>( a ); PAD* pad = static_cast<PAD*>( a );
@ -338,7 +338,7 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
else else
layer = B_Cu; layer = B_Cu;
} }
else if( b->Type() == PCB_PAD_T && static_cast<PAD*>( a )->GetAttribute() == PAD_ATTRIB_SMD ) else if( b->Type() == PCB_PAD_T && static_cast<PAD*>( a )->GetAttribute() == PAD_ATTRIB::SMD )
{ {
PAD* pad = static_cast<PAD*>( b ); PAD* pad = static_cast<PAD*>( b );

View File

@ -207,7 +207,7 @@ static void doPushPadProperties( BOARD& board, const PAD& aSrcPad, BOARD_COMMIT&
continue; continue;
// Special-case for aperture pads // Special-case for aperture pads
if( aPadTypeFilter && pad->GetAttribute() == PAD_ATTRIB_CONN ) if( aPadTypeFilter && pad->GetAttribute() == PAD_ATTRIB::CONN )
{ {
if( pad->IsAperturePad() != aSrcPad.IsAperturePad() ) if( pad->IsAperturePad() != aSrcPad.IsAperturePad() )
continue; continue;

View File

@ -2085,7 +2085,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
pad = static_cast<const PAD*>( aItem ); pad = static_cast<const PAD*>( aItem );
if( pad->GetAttribute() == PAD_ATTRIB_PTH || pad->GetAttribute() == PAD_ATTRIB_NPTH ) if( pad->GetAttribute() == PAD_ATTRIB::PTH || pad->GetAttribute() == PAD_ATTRIB::NPTH )
{ {
// Check render mode (from the Items tab) first // Check render mode (from the Items tab) first
if( !board()->IsElementVisible( LAYER_PADS_TH ) ) if( !board()->IsElementVisible( LAYER_PADS_TH ) )

View File

@ -511,7 +511,7 @@ bool hasThermalConnection( PAD* pad, const ZONE* aZone )
{ {
// Rejects non-standard pads with tht-only thermal reliefs // Rejects non-standard pads with tht-only thermal reliefs
if( aZone->GetPadConnection( pad ) == ZONE_CONNECTION::THT_THERMAL if( aZone->GetPadConnection( pad ) == ZONE_CONNECTION::THT_THERMAL
&& pad->GetAttribute() != PAD_ATTRIB_PTH ) && pad->GetAttribute() != PAD_ATTRIB::PTH )
{ {
return false; return false;
} }
@ -634,7 +634,7 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer
// Note: drill size represents finish size, which means the actual holes size is // Note: drill size represents finish size, which means the actual holes size is
// the plating thickness larger. // the plating thickness larger.
if( pad->GetAttribute() == PAD_ATTRIB_PTH ) if( pad->GetAttribute() == PAD_ATTRIB::PTH )
gap += pad->GetBoard()->GetDesignSettings().GetHolePlatingThickness(); gap += pad->GetBoard()->GetDesignSettings().GetHolePlatingThickness();
pad->TransformHoleWithClearanceToPolygon( holes, gap, m_maxError, ERROR_OUTSIDE ); pad->TransformHoleWithClearanceToPolygon( holes, gap, m_maxError, ERROR_OUTSIDE );
@ -708,7 +708,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
// Note: drill size represents finish size, which means the actual hole // Note: drill size represents finish size, which means the actual hole
// size is the plating thickness larger. // size is the plating thickness larger.
if( aPad->GetAttribute() == PAD_ATTRIB_PTH ) if( aPad->GetAttribute() == PAD_ATTRIB::PTH )
gap += aPad->GetBoard()->GetDesignSettings().GetHolePlatingThickness(); gap += aPad->GetBoard()->GetDesignSettings().GetHolePlatingThickness();
aPad->TransformHoleWithClearanceToPolygon( aHoles, gap, m_maxError, aPad->TransformHoleWithClearanceToPolygon( aHoles, gap, m_maxError,

View File

@ -39,7 +39,7 @@ struct PAD_FIXTURE
{ {
PAD pad( &m_footprint ); PAD pad( &m_footprint );
pad.SetAttribute( PAD_ATTRIB_NPTH ); pad.SetAttribute( PAD_ATTRIB::NPTH );
pad.SetLayerSet( PAD::UnplatedHoleMask() ); pad.SetLayerSet( PAD::UnplatedHoleMask() );
return pad; return pad;
@ -49,7 +49,7 @@ struct PAD_FIXTURE
{ {
PAD pad( &m_footprint ); PAD pad( &m_footprint );
pad.SetAttribute( PAD_ATTRIB_PTH ); pad.SetAttribute( PAD_ATTRIB::PTH );
pad.SetLayerSet( PAD::ApertureMask() ); pad.SetLayerSet( PAD::ApertureMask() );
return pad; return pad;
@ -59,7 +59,7 @@ struct PAD_FIXTURE
{ {
PAD pad( &m_footprint ); PAD pad( &m_footprint );
pad.SetAttribute( PAD_ATTRIB_SMD ); pad.SetAttribute( PAD_ATTRIB::SMD );
pad.SetLayerSet( PAD::SMDMask() ); pad.SetLayerSet( PAD::SMDMask() );
return pad; return pad;