|
KiCad PCB EDA Suite
|
Maps PADS layer numbers and names to KiCad layer IDs. More...
#include <pads_layer_mapper.h>
Public Member Functions | |
| PADS_LAYER_MAPPER () | |
| void | SetCopperLayerCount (int aLayerCount) |
| int | GetCopperLayerCount () const |
| PADS_LAYER_TYPE | GetLayerType (int aPadsLayer) const |
| PADS_LAYER_TYPE | ParseLayerName (const std::string &aLayerName) const |
| PCB_LAYER_ID | GetAutoMapLayer (int aPadsLayer, PADS_LAYER_TYPE aType=PADS_LAYER_TYPE::UNKNOWN) const |
| Suggested KiCad layer for a PADS layer. | |
| LSET | GetPermittedLayers (PADS_LAYER_TYPE aType) const |
| std::vector< INPUT_LAYER_DESC > | BuildInputLayerDescriptions (const std::vector< PADS_LAYER_INFO > &aLayerInfos) const |
| void | AddLayerNameMapping (const std::string &aName, PADS_LAYER_TYPE aType) |
Static Public Member Functions | |
| static std::string | LayerTypeToString (PADS_LAYER_TYPE aType) |
Static Public Attributes | |
| static constexpr int | LAYER_PAD_STACK_TOP = -2 |
| static constexpr int | LAYER_PAD_STACK_BOTTOM = -1 |
| static constexpr int | LAYER_PAD_STACK_INNER = 0 |
| static constexpr int | LAYER_DRILL_DRAWING = 18 |
| static constexpr int | LAYER_DIMENSIONS = 19 |
| static constexpr int | LAYER_PLACEMENT_OUTLINE = 20 |
| static constexpr int | LAYER_ASSEMBLY_TOP = 21 |
| static constexpr int | LAYER_ASSEMBLY_BOTTOM = 22 |
| static constexpr int | LAYER_SOLDERMASK_TOP = 25 |
| static constexpr int | LAYER_SILKSCREEN_TOP = 26 |
| static constexpr int | LAYER_SILKSCREEN_BOTTOM = 27 |
| static constexpr int | LAYER_SOLDERMASK_BOTTOM = 28 |
| static constexpr int | LAYER_PASTE_TOP = 29 |
| static constexpr int | LAYER_PASTE_BOTTOM = 30 |
| static constexpr int | LAYER_BOARD_OUTLINE = 1 |
Private Member Functions | |
| PCB_LAYER_ID | mapInnerCopperLayer (int aPadsLayer) const |
| std::string | normalizeLayerName (const std::string &aName) const |
Private Attributes | |
| int | m_copperLayerCount |
| std::map< std::string, PADS_LAYER_TYPE > | m_layerNameMap |
Maps PADS layer numbers and names to KiCad layer IDs.
PADS uses a different layer numbering scheme than KiCad:
This class handles the translation between these systems and provides auto-mapping suggestions for the layer mapping dialog.
Definition at line 77 of file pads_layer_mapper.h.
| PADS_LAYER_MAPPER::PADS_LAYER_MAPPER | ( | ) |
Definition at line 30 of file pads_layer_mapper.cpp.
References ASSEMBLY_BOTTOM, ASSEMBLY_TOP, BOARD_OUTLINE, COPPER_BOTTOM, COPPER_TOP, DOCUMENTATION, DRILL_DRAWING, m_copperLayerCount, m_layerNameMap, PASTE_BOTTOM, PASTE_TOP, SILKSCREEN_BOTTOM, SILKSCREEN_TOP, SOLDERMASK_BOTTOM, and SOLDERMASK_TOP.
| void PADS_LAYER_MAPPER::AddLayerNameMapping | ( | const std::string & | aName, |
| PADS_LAYER_TYPE | aType ) |
Definition at line 358 of file pads_layer_mapper.cpp.
References m_layerNameMap, and normalizeLayerName().
Referenced by BOOST_AUTO_TEST_CASE().
| std::vector< INPUT_LAYER_DESC > PADS_LAYER_MAPPER::BuildInputLayerDescriptions | ( | const std::vector< PADS_LAYER_INFO > & | aLayerInfos | ) | const |
Definition at line 336 of file pads_layer_mapper.cpp.
References INPUT_LAYER_DESC::AutoMapLayer, PADS_COMMON::ConvertText(), GetAutoMapLayer(), GetPermittedLayers(), info, INPUT_LAYER_DESC::Name, INPUT_LAYER_DESC::PermittedLayers, and INPUT_LAYER_DESC::Required.
Referenced by BOOST_AUTO_TEST_CASE().
| PCB_LAYER_ID PADS_LAYER_MAPPER::GetAutoMapLayer | ( | int | aPadsLayer, |
| PADS_LAYER_TYPE | aType = PADS_LAYER_TYPE::UNKNOWN ) const |
Suggested KiCad layer for a PADS layer.
aType overrides the type derived from the layer number when known.
Definition at line 239 of file pads_layer_mapper.cpp.
References ASSEMBLY_BOTTOM, ASSEMBLY_TOP, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, BOARD_OUTLINE, Cmts_User, COPPER_BOTTOM, COPPER_INNER, COPPER_TOP, DOCUMENTATION, DRILL_DRAWING, Dwgs_User, Edge_Cuts, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, GetLayerType(), mapInnerCopperLayer(), PASTE_BOTTOM, PASTE_TOP, SILKSCREEN_BOTTOM, SILKSCREEN_TOP, SOLDERMASK_BOTTOM, SOLDERMASK_TOP, UNDEFINED_LAYER, and UNKNOWN.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BuildInputLayerDescriptions().
|
inline |
Definition at line 84 of file pads_layer_mapper.h.
References m_copperLayerCount.
| PADS_LAYER_TYPE PADS_LAYER_MAPPER::GetLayerType | ( | int | aPadsLayer | ) | const |
Definition at line 125 of file pads_layer_mapper.cpp.
References ASSEMBLY_BOTTOM, ASSEMBLY_TOP, COPPER_BOTTOM, COPPER_INNER, COPPER_TOP, DOCUMENTATION, DRILL_DRAWING, LAYER_ASSEMBLY_BOTTOM, LAYER_ASSEMBLY_TOP, LAYER_DIMENSIONS, LAYER_DRILL_DRAWING, LAYER_PAD_STACK_BOTTOM, LAYER_PAD_STACK_INNER, LAYER_PAD_STACK_TOP, LAYER_PASTE_BOTTOM, LAYER_PASTE_TOP, LAYER_PLACEMENT_OUTLINE, LAYER_SILKSCREEN_BOTTOM, LAYER_SILKSCREEN_TOP, LAYER_SOLDERMASK_BOTTOM, LAYER_SOLDERMASK_TOP, m_copperLayerCount, PASTE_BOTTOM, PASTE_TOP, SILKSCREEN_BOTTOM, SILKSCREEN_TOP, SOLDERMASK_BOTTOM, SOLDERMASK_TOP, and UNKNOWN.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetAutoMapLayer().
| LSET PADS_LAYER_MAPPER::GetPermittedLayers | ( | PADS_LAYER_TYPE | aType | ) | const |
Definition at line 295 of file pads_layer_mapper.cpp.
References LSET::AllCuMask(), LSET::AllLayersMask(), LSET::AllNonCuMask(), ASSEMBLY_BOTTOM, ASSEMBLY_TOP, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, BOARD_OUTLINE, Cmts_User, COPPER_BOTTOM, COPPER_INNER, COPPER_TOP, DOCUMENTATION, DRILL_DRAWING, Dwgs_User, Edge_Cuts, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, PASTE_BOTTOM, PASTE_TOP, SILKSCREEN_BOTTOM, SILKSCREEN_TOP, SOLDERMASK_BOTTOM, SOLDERMASK_TOP, and UNKNOWN.
Referenced by BOOST_AUTO_TEST_CASE(), and BuildInputLayerDescriptions().
|
static |
Definition at line 365 of file pads_layer_mapper.cpp.
References ASSEMBLY_BOTTOM, ASSEMBLY_TOP, BOARD_OUTLINE, COPPER_BOTTOM, COPPER_INNER, COPPER_TOP, DOCUMENTATION, DRILL_DRAWING, PASTE_BOTTOM, PASTE_TOP, SILKSCREEN_BOTTOM, SILKSCREEN_TOP, SOLDERMASK_BOTTOM, SOLDERMASK_TOP, and UNKNOWN.
Referenced by BOOST_AUTO_TEST_CASE().
|
private |
Definition at line 224 of file pads_layer_mapper.cpp.
References In1_Cu.
Referenced by GetAutoMapLayer().
|
private |
Definition at line 111 of file pads_layer_mapper.cpp.
Referenced by AddLayerNameMapping(), and ParseLayerName().
| PADS_LAYER_TYPE PADS_LAYER_MAPPER::ParseLayerName | ( | const std::string & | aLayerName | ) | const |
Definition at line 180 of file pads_layer_mapper.cpp.
References COPPER_BOTTOM, COPPER_INNER, COPPER_TOP, m_layerNameMap, next(), normalizeLayerName(), and UNKNOWN.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| void PADS_LAYER_MAPPER::SetCopperLayerCount | ( | int | aLayerCount | ) |
Definition at line 102 of file pads_layer_mapper.cpp.
References m_copperLayerCount.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
staticconstexpr |
Definition at line 114 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().
|
staticconstexpr |
Definition at line 113 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().
|
staticconstexpr |
Definition at line 121 of file pads_layer_mapper.h.
|
staticconstexpr |
Definition at line 111 of file pads_layer_mapper.h.
Referenced by GetLayerType().
|
staticconstexpr |
Definition at line 110 of file pads_layer_mapper.h.
Referenced by GetLayerType().
|
staticconstexpr |
Definition at line 107 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), GetLayerType(), and PCB_IO_PADS::loadTestPoints().
|
staticconstexpr |
Definition at line 108 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), and GetLayerType().
|
staticconstexpr |
Definition at line 106 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), GetLayerType(), and PCB_IO_PADS::loadTestPoints().
|
staticconstexpr |
Definition at line 120 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().
|
staticconstexpr |
Definition at line 119 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().
|
staticconstexpr |
Definition at line 112 of file pads_layer_mapper.h.
Referenced by GetLayerType().
|
staticconstexpr |
Definition at line 117 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().
|
staticconstexpr |
Definition at line 116 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().
|
staticconstexpr |
Definition at line 118 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), GetLayerType(), and PCB_IO_PADS::loadTestPoints().
|
staticconstexpr |
Definition at line 115 of file pads_layer_mapper.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), GetLayerType(), and PCB_IO_PADS::loadTestPoints().
|
private |
Definition at line 124 of file pads_layer_mapper.h.
Referenced by GetCopperLayerCount(), GetLayerType(), PADS_LAYER_MAPPER(), and SetCopperLayerCount().
|
private |
Definition at line 125 of file pads_layer_mapper.h.
Referenced by AddLayerNameMapping(), PADS_LAYER_MAPPER(), and ParseLayerName().