|
KiCad PCB EDA Suite
|
Public Types | |
| enum class | TYPE { AUTO , THT , SMD , NPTH , CONNECTOR , PASTE , MASK } |
Public Member Functions | |
| PAD_MASTER_PROVIDER ()=default | |
| PAD | GetMasterPad (TYPE aType, const FOOTPRINT *aFootprint, const PAD *aSelectedPad) const |
| Get the master pad for the given type, footprint, and selected pad. | |
| std::unique_ptr< PAD > | MakeDefaultPad (PAD_MASTER_PROVIDER::TYPE aMasterType) const |
| Create a default pad for the given master pad type when there is no more obvious source. | |
| void | RecordNewMasterPad (const PAD &aPlacedPad) |
| Record the given pad as the most recently placed pad of its type. | |
Static Public Member Functions | |
| static TYPE | TypeFromAction (const TOOL_EVENT &aEvent) |
| static std::optional< TYPE > | TypeFromPad (const PAD &aPad) |
| Determine the master pad type from the given pad. | |
Private Member Functions | |
| TYPE | resolveAutoType (const std::vector< const PAD * > &aFpPads, const PAD *aSelectedPad) const |
| Resolve the type a TYPE::AUTO request actually wants. | |
Private Attributes | |
| std::unordered_map< TYPE, KIID > | m_lastRealPadsForType |
| TYPE | m_lastType = PAD_MASTER_PROVIDER::TYPE::AUTO |
| Persistent store of the last pad type. | |
Definition at line 60 of file pad_tool.cpp.
|
strong |
| Enumerator | |
|---|---|
| AUTO | |
| THT | |
| SMD | |
| NPTH | |
| CONNECTOR | |
| PASTE | |
| MASK | |
Definition at line 63 of file pad_tool.cpp.
|
default |
|
inline |
Get the master pad for the given type, footprint, and selected pad.
If 'auto' is specified for the type, see resolveAutoType for the type resolution logic.
For a given resolved type, the master pad is found by, in order:
Definition at line 90 of file pad_tool.cpp.
References PAD::GetNumber(), m_lastRealPadsForType, MakeDefaultPad(), pad, FOOTPRINT::Pads(), resolveAutoType(), StrNumCmp(), and TypeFromPad().
|
inline |
Create a default pad for the given master pad type when there is no more obvious source.
Definition at line 159 of file pad_tool.cpp.
References PADSTACK::ALL_LAYERS, ANGLE_90, PAD::ApertureMask(), CIRCLE, CONN, PAD::ConnSMDMask(), DEFAULT_PAD_APERTURE_HEIGHT_MM, DEFAULT_PAD_APERTURE_WIDTH_MM, DEFAULT_PAD_DRILL_DIAMETER_MM, DEFAULT_PAD_NPTH_DIAMETER_MM, DEFAULT_PAD_SMD_HEIGHT_MM, DEFAULT_PAD_SMD_WIDTH_MM, DEFAULT_PAD_THT_HEIGHT_MM, DEFAULT_PAD_THT_WIDTH_MM, F_Mask, PAD_UTILS::GetDefaultIpcRoundingRatio(), PADSTACK::NORMAL, NPTH, OVAL, pad, pcbIUScale, PTH, PAD::PTHMask(), RECTANGLE, ROUNDRECT, SMD, PAD::SMDMask(), and PAD::UnplatedHoleMask().
Referenced by GetMasterPad().
|
inline |
Record the given pad as the most recently placed pad of its type.
This can then be used when auto-detecting the pad type for new pads.
Definition at line 268 of file pad_tool.cpp.
References m_lastRealPadsForType, m_lastType, EDA_ITEM::m_Uuid, and TypeFromPad().
|
inlineprivate |
Resolve the type a TYPE::AUTO request actually wants.
The order is:
Definition at line 338 of file pad_tool.cpp.
References m_lastType, pad, and TypeFromPad().
Referenced by GetMasterPad().
|
inlinestatic |
Definition at line 280 of file pad_tool.cpp.
References TOOL_EVENT::IsAction(), PCB_ACTIONS::placeNpthPad, PCB_ACTIONS::placePasteAperturePad, PCB_ACTIONS::placeSmdPad, and PCB_ACTIONS::placeThtPad.
Referenced by PAD_TOOL::PlacePad().
Determine the master pad type from the given pad.
Returns std::nullopt if the pad does not obviously match any master pad type.
Definition at line 299 of file pad_tool.cpp.
References CONN, PAD::GetAttribute(), PAD::GetLayerSet(), PAD::IsAperturePad(), NPTH, PTH, and SMD.
Referenced by GetMasterPad(), RecordNewMasterPad(), and resolveAutoType().
Definition at line 362 of file pad_tool.cpp.
Referenced by GetMasterPad(), and RecordNewMasterPad().
|
private |
Persistent store of the last pad type.
Definition at line 365 of file pad_tool.cpp.
Referenced by RecordNewMasterPad(), and resolveAutoType().