7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 09:51:40 +00:00

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
// 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 ) )
{

View File

@ -457,7 +457,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
continue;
// 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;
m_holeCount++;
@ -491,7 +491,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// The hole in the body is inflated by copper thickness.
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 ) )
{

View File

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

View File

@ -785,7 +785,7 @@ void RENDER_3D_LEGACY::generateViasAndPads()
{
for( const PAD* pad : footprint->Pads() )
{
if( pad->GetAttribute() != PAD_ATTRIB_NPTH )
if( pad->GetAttribute() != PAD_ATTRIB::NPTH )
{
const wxSize drillsize = pad->GetDrillSize();
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
*/
enum PAD_ATTR_T
enum class PAD_ATTRIB
{
PAD_ATTRIB_PTH, ///< Plated through hole pad
PAD_ATTRIB_SMD, ///< Smd pad, appears on the solder paste layer (default)
PAD_ATTRIB_CONN, ///< Like smd, does not appear on the solder paste layer (default)
PTH, ///< Plated through hole pad
SMD, ///< Smd pad, appears 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
///< 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
};

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
// 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 ) )
{

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
pad = static_cast<PAD*>( item );
if( (pad->GetAttribute() != PAD_ATTRIB_SMD) &&
(pad->GetAttribute() != PAD_ATTRIB_CONN) ) // a hole is present, so multiple layers
if( (pad->GetAttribute() != PAD_ATTRIB::SMD) &&
(pad->GetAttribute() != PAD_ATTRIB::CONN) ) // a hole is present, so multiple layers
{
// proceed to the common tests below, but without the parent footprint test,
// by leaving footprint==NULL, but having pad != null

View File

@ -210,9 +210,9 @@ CN_ITEM* CN_LIST::Add( PAD* pad )
switch( pad->GetAttribute() )
{
case PAD_ATTRIB_SMD:
case PAD_ATTRIB_NPTH:
case PAD_ATTRIB_CONN:
case PAD_ATTRIB::SMD:
case PAD_ATTRIB::NPTH:
case PAD_ATTRIB::CONN:
{
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_padsTypes.clear();
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_CONN, _( "Connector:" ) ) );
m_padsTypes.push_back( padsType_t( PAD_ATTRIB_NPTH, _( "NPTH:" ) ) );
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::CONN, _( "Connector:" ) ) );
m_padsTypes.push_back( padsType_t( PAD_ATTRIB::NPTH, _( "NPTH:" ) ) );
m_viasTypes.clear();
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,
pad->GetDrillShape(), pad->GetAttribute() != PAD_ATTRIB_NPTH,
pad->GetDrillShape(), pad->GetAttribute() != PAD_ATTRIB::NPTH,
true, top, bottom );
auto it = m_drillTypes.begin();

View File

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

View File

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

View File

@ -78,13 +78,13 @@ enum CODE_CHOICE
CHOICE_SHAPE_CUSTOM_RECT_ANCHOR
};
static PAD_ATTR_T code_type[] =
static PAD_ATTRIB code_type[] =
{
PAD_ATTRIB_PTH,
PAD_ATTRIB_SMD,
PAD_ATTRIB_CONN,
PAD_ATTRIB_NPTH,
PAD_ATTRIB_SMD // Aperture pad :type SMD with no copper layers,
PAD_ATTRIB::PTH,
PAD_ATTRIB::SMD,
PAD_ATTRIB::CONN,
PAD_ATTRIB::NPTH,
PAD_ATTRIB::SMD // Aperture pad :type SMD with no copper layers,
// 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() );
// 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 )
{
@ -620,10 +620,10 @@ void DIALOG_PAD_PROPERTIES::initValues()
{
switch( m_dummyPad->GetAttribute() )
{
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_CONN: m_PadType->SetSelection( CONN_DLG_TYPE ); break;
case PAD_ATTRIB_NPTH: m_PadType->SetSelection( NPTH_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::CONN: m_PadType->SetSelection( CONN_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
if( m_dummyPad->GetAttribute() == PAD_ATTRIB_NPTH )
if( m_dummyPad->GetAttribute() == PAD_ATTRIB::NPTH )
{
m_choiceFabProperty->SetSelection( 0 );
m_choiceFabProperty->Enable( false );
@ -1302,7 +1302,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
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 "
"on at least one layer." ) );
@ -1314,8 +1314,8 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
switch( m_dummyPad->GetAttribute() )
{
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::NPTH: // Not plated, but through hole, a hole is expected
case PAD_ATTRIB::PTH: // Pad through hole, a hole is also expected
if( drill_size.x <= 0
|| ( drill_size.y <= 0 && m_dummyPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG ) )
{
@ -1323,7 +1323,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
}
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] )
{
warning_msgs.Add( _( "Warning: Connector pads normally have no solder paste. Use an "
@ -1331,7 +1331,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
}
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();
@ -1343,31 +1343,31 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( ( m_dummyPad->GetProperty() == PAD_PROP_FIDUCIAL_GLBL ||
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." ) );
}
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." ) );
}
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." ) );
}
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." ) );
}
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." ) );
}
@ -1582,8 +1582,8 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
int padNetcode = NETINFO_LIST::UNCONNECTED;
// For PAD_ATTRIB_NPTH, ensure there is no net name selected
if( m_padMaster->GetAttribute() != PAD_ATTRIB_NPTH )
// For PAD_ATTRIB::NPTH, ensure there is no net name selected
if( m_padMaster->GetAttribute() != PAD_ATTRIB::NPTH )
padNetcode = m_PadNetSelector->GetSelectedNetcode();
m_currentPad->SetNetCode( padNetcode );
@ -1830,21 +1830,21 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad )
switch( aPad->GetAttribute() )
{
case PAD_ATTRIB_PTH:
case PAD_ATTRIB::PTH:
break;
case PAD_ATTRIB_CONN:
case PAD_ATTRIB_SMD:
// SMD and PAD_ATTRIB_CONN has no hole.
// 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
case PAD_ATTRIB::CONN:
case PAD_ATTRIB::SMD:
// SMD and PAD_ATTRIB::CONN has no hole.
// 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
// and are intended to be used in virtual edge board connectors
// However we can accept a non null offset,
// mainly to allow complex pads build from a set of basic pad shapes
aPad->SetDrillSize( wxSize( 0, 0 ) );
break;
case PAD_ATTRIB_NPTH:
case PAD_ATTRIB::NPTH:
// Mechanical purpose only:
// no net name, no pad name allowed
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 );
if( aPad->GetAttribute() == PAD_ATTRIB_PTH )
if( aPad->GetAttribute() == PAD_ATTRIB::PTH )
{
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 );
if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) )
if( pad->GetAttribute() == PAD_ATTRIB::NPTH && !pad->FlashLayer( layer ) )
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
// size is the plating thickness larger.
if( pad->GetAttribute() == PAD_ATTRIB_PTH )
if( pad->GetAttribute() == PAD_ATTRIB::PTH )
size += m_board->GetDesignSettings().GetHolePlatingThickness();
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
if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) )
if( pad->GetAttribute() == PAD_ATTRIB::NPTH && !pad->FlashLayer( layer ) )
testClearance = false;
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() )
testClearance = false;
if( otherPad->GetAttribute() == PAD_ATTRIB_NPTH && !otherPad->FlashLayer( layer ) )
if( otherPad->GetAttribute() == PAD_ATTRIB::NPTH && !otherPad->FlashLayer( layer ) )
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();
rk.drill = std::min( drill.x, drill.y );
rk.hole = (rk.drill != 0);
rk.smd = pad->GetAttribute() == PAD_ATTRIB_SMD;
rk.mechanical = ( pad->GetAttribute() == PAD_ATTRIB_NPTH );
rk.smd = pad->GetAttribute() == PAD_ATTRIB::SMD;
rk.mechanical = ( pad->GetAttribute() == PAD_ATTRIB::NPTH );
rk.x_location = pad->GetPosition().x - origin.x;
rk.y_location = origin.y - pad->GetPosition().y;
rk.x_size = pad->GetSize().x;

View File

@ -56,7 +56,7 @@ public:
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
@ -87,7 +87,7 @@ public:
bool isSMD() const
{
return m_type == PAD_ATTRIB_SMD;
return m_type == PAD_ATTRIB::SMD;
}
PCB_LAYER_ID getSMDLayer() const
@ -138,7 +138,7 @@ private:
int m_sx, m_sy;
double m_angle;
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_drill = aPad->GetDrillSize().x;
m_shape = aPad->GetShape();
m_type = PAD_ATTRIB_PTH;
m_type = PAD_ATTRIB::PTH;
m_id = 0;
}
@ -252,7 +252,7 @@ HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const VIA* aVia )
m_layers = LSET::AllCuMask();
m_drill = aVia->GetDrillValue();
m_shape = PAD_SHAPE::CIRCLE;
m_type = PAD_ATTRIB_PTH;
m_type = PAD_ATTRIB::PTH;
m_id = 0;
}

View File

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

View File

@ -675,7 +675,7 @@ void EXPORTER_PCB_VRML::ExportVrmlPadHole( PAD* aPad )
bool pth = false;
if( ( aPad->GetAttribute() != PAD_ATTRIB_NPTH ) )
if( ( aPad->GetAttribute() != PAD_ATTRIB::NPTH ) )
pth = true;
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( !aGenerateNPTH_list && pad->GetAttribute() == PAD_ATTRIB_NPTH )
if( !aGenerateNPTH_list && pad->GetAttribute() == PAD_ATTRIB::NPTH )
continue;
if( aGenerateNPTH_list && pad->GetAttribute() != PAD_ATTRIB_NPTH )
if( aGenerateNPTH_list && pad->GetAttribute() != PAD_ATTRIB::NPTH )
continue;
}
@ -135,7 +135,7 @@ void GENDRILL_WRITER_BASE::buildHolesList( DRILL_LAYER_PAIR aLayerPair,
continue;
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
? HOLE_ATTRIBUTE::HOLE_MECHANICAL
: HOLE_ATTRIBUTE::HOLE_PAD;

View File

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

View File

@ -212,7 +212,7 @@ FOOTPRINT* MICROWAVE_TOOL::createBaseFootprint( const wxString& aValue,
pad->SetPosition( footprint->GetPosition() );
pad->SetShape( PAD_SHAPE::RECT );
pad->SetAttribute( PAD_ATTRIB_SMD );
pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetLayerSet( F_Cu );
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->SetLayerSet( LSET( footprint->GetLayer() ) );
pad->SetAttribute( PAD_ATTRIB_SMD );
pad->SetAttribute( PAD_ATTRIB::SMD );
pad->SetShape( PAD_SHAPE::CIRCLE );
PAD* newpad = new PAD( *pad );

View File

@ -79,7 +79,7 @@ private:
* Create a footprint "GAP" or "STUB" used in micro wave designs.
*
* 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
*
* @param aComponentShape is the component to create.
@ -99,7 +99,7 @@ private:
* Create a basic footprint for micro wave applications.
*
* 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 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
// is PAD_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
m_localClearance = 0;
m_localSolderMaskMargin = 0;
@ -214,7 +214,7 @@ bool PAD::FlashLayer( int aLayer ) const
return false;
/// 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 ) );
/// 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;
if( aAttribute == PAD_ATTRIB_SMD )
if( aAttribute == PAD_ATTRIB::SMD )
m_drill = wxSize( 0, 0 );
SetDirty();
@ -871,7 +871,7 @@ void PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>&
if( IsLocked() )
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() );
// Show the pad shape, attribute and property
@ -1089,10 +1089,10 @@ wxString PAD::ShowPadAttr() const
{
switch( GetAttribute() )
{
case PAD_ATTRIB_PTH: return _( "PTH" );
case PAD_ATTRIB_SMD: return _( "SMD" );
case PAD_ATTRIB_CONN: return _( "Conn" );
case PAD_ATTRIB_NPTH: return _( "NPTH" );
case PAD_ATTRIB::PTH: return _( "PTH" );
case PAD_ATTRIB::SMD: return _( "SMD" );
case PAD_ATTRIB::CONN: return _( "Conn" );
case PAD_ATTRIB::NPTH: return _( "NPTH" );
default: return wxT( "???" );
}
}
@ -1102,7 +1102,7 @@ wxString PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
{
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" ),
GetParent()->GetReference(),
@ -1116,7 +1116,7 @@ wxString PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
}
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" ),
GetName(),
@ -1150,13 +1150,13 @@ void PAD::ViewGetLayers( int aLayers[], int& aCount ) const
aCount = 0;
// 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_HOLEWALLS;
}
if( m_attribute == PAD_ATTRIB_NPTH )
if( m_attribute == PAD_ATTRIB::NPTH )
aLayers[aCount++] = LAYER_NON_PLATEDHOLES;
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
// 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;
else
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
// 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;
else
aLayers[aCount++] = LAYER_PAD_BK_NETNAMES;
@ -1240,7 +1240,7 @@ double PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
visible = board->GetVisibleLayers() & board->GetEnabledLayers();
// 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 ) )
{
return HIDE;
@ -1390,8 +1390,8 @@ void PAD::ImportSettingsFrom( const PAD& aMasterPad )
switch( aMasterPad.GetAttribute() )
{
case PAD_ATTRIB_SMD:
case PAD_ATTRIB_CONN:
case PAD_ATTRIB::SMD:
case PAD_ATTRIB::CONN:
// These pads do not have hole (they are expected to be only on one
// external copper layer)
SetDrillSize( wxSize( 0, 0 ) );
@ -1433,11 +1433,11 @@ static struct PAD_DESC
{
PAD_DESC()
{
ENUM_MAP<PAD_ATTR_T>::Instance()
.Map( PAD_ATTRIB_PTH, _HKI( "Through-hole" ) )
.Map( PAD_ATTRIB_SMD, _HKI( "SMD" ) )
.Map( PAD_ATTRIB_CONN, _HKI( "Edge connector" ) )
.Map( PAD_ATTRIB_NPTH, _HKI( "NPTH, mechanical" ) );
ENUM_MAP<PAD_ATTRIB>::Instance()
.Map( PAD_ATTRIB::PTH, _HKI( "Through-hole" ) )
.Map( PAD_ATTRIB::SMD, _HKI( "SMD" ) )
.Map( PAD_ATTRIB::CONN, _HKI( "Edge connector" ) )
.Map( PAD_ATTRIB::NPTH, _HKI( "NPTH, mechanical" ) );
ENUM_MAP<PAD_SHAPE>::Instance()
.Map( PAD_SHAPE::CIRCLE, _HKI( "Circle" ) )
@ -1461,7 +1461,7 @@ static struct PAD_DESC
REGISTER_TYPE( PAD );
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 );
propMgr.AddProperty( padType );
@ -1529,6 +1529,6 @@ static struct PAD_DESC
}
} _PAD_DESC;
ENUM_TO_WXANY( PAD_ATTR_T );
ENUM_TO_WXANY( PAD_ATTRIB );
ENUM_TO_WXANY( PAD_SHAPE );
ENUM_TO_WXANY( PAD_PROP_T );

View File

@ -95,9 +95,9 @@ public:
{
if( *p == PCB_LOCATE_HOLE_T )
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;
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;
}
}
@ -367,8 +367,8 @@ public:
void SetLayerSet( LSET aLayers ) override { m_layerMask = aLayers; }
LSET GetLayerSet() const override { return m_layerMask; }
void SetAttribute( PAD_ATTR_T aAttribute );
PAD_ATTR_T GetAttribute() const { return m_attribute; }
void SetAttribute( PAD_ATTRIB aAttribute );
PAD_ATTRIB GetAttribute() const { return m_attribute; }
void SetProperty( PAD_PROP_T aProperty );
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
// footprint anchor, orientation 0)
PAD_ATTR_T m_attribute; // PAD_ATTRIB_NORMAL, PAD_ATTRIB_SMD, PAD_ATTRIB_CONN,
// PAD_ATTRIB_NPTH
PAD_ATTRIB m_attribute; // PAD_ATTRIB_NORMAL, PAD_ATTRIB::SMD, PAD_ATTRIB::CONN,
// PAD_ATTRIB::NPTH
PAD_PROP_T m_property; // Property in fab files (BGA, FIDUCIAL, TESTPOINT, etc.)
double m_orient; // in 1/10 degrees

Some files were not shown because too many files have changed in this diff Show More