KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PADS_LAYER_MAPPER Class Reference

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_DESCBuildInputLayerDescriptions (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_TYPEm_layerNameMap
 

Detailed Description

Maps PADS layer numbers and names to KiCad layer IDs.

PADS uses a different layer numbering scheme than KiCad:

  • Layer 1 is Top copper
  • Layer N (where N is layer count) is Bottom copper
  • Layers 2 through N-1 are inner copper layers
  • Negative layer numbers (-2, -1) are used in pad stacks for Top/Bottom
  • Higher positive numbers (20+) represent non-copper layers

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.

Constructor & Destructor Documentation

◆ PADS_LAYER_MAPPER()

Member Function Documentation

◆ AddLayerNameMapping()

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().

◆ BuildInputLayerDescriptions()

std::vector< INPUT_LAYER_DESC > PADS_LAYER_MAPPER::BuildInputLayerDescriptions ( const std::vector< PADS_LAYER_INFO > & aLayerInfos) const

◆ GetAutoMapLayer()

◆ GetCopperLayerCount()

int PADS_LAYER_MAPPER::GetCopperLayerCount ( ) const
inline

Definition at line 84 of file pads_layer_mapper.h.

References m_copperLayerCount.

◆ GetLayerType()

◆ GetPermittedLayers()

◆ LayerTypeToString()

◆ mapInnerCopperLayer()

PCB_LAYER_ID PADS_LAYER_MAPPER::mapInnerCopperLayer ( int aPadsLayer) const
private

Definition at line 224 of file pads_layer_mapper.cpp.

References In1_Cu.

Referenced by GetAutoMapLayer().

◆ normalizeLayerName()

std::string PADS_LAYER_MAPPER::normalizeLayerName ( const std::string & aName) const
private

Definition at line 111 of file pads_layer_mapper.cpp.

Referenced by AddLayerNameMapping(), and ParseLayerName().

◆ ParseLayerName()

◆ SetCopperLayerCount()

void PADS_LAYER_MAPPER::SetCopperLayerCount ( int aLayerCount)

Member Data Documentation

◆ LAYER_ASSEMBLY_BOTTOM

int PADS_LAYER_MAPPER::LAYER_ASSEMBLY_BOTTOM = 22
staticconstexpr

Definition at line 114 of file pads_layer_mapper.h.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().

◆ LAYER_ASSEMBLY_TOP

int PADS_LAYER_MAPPER::LAYER_ASSEMBLY_TOP = 21
staticconstexpr

Definition at line 113 of file pads_layer_mapper.h.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().

◆ LAYER_BOARD_OUTLINE

int PADS_LAYER_MAPPER::LAYER_BOARD_OUTLINE = 1
staticconstexpr

Definition at line 121 of file pads_layer_mapper.h.

◆ LAYER_DIMENSIONS

int PADS_LAYER_MAPPER::LAYER_DIMENSIONS = 19
staticconstexpr

Definition at line 111 of file pads_layer_mapper.h.

Referenced by GetLayerType().

◆ LAYER_DRILL_DRAWING

int PADS_LAYER_MAPPER::LAYER_DRILL_DRAWING = 18
staticconstexpr

Definition at line 110 of file pads_layer_mapper.h.

Referenced by GetLayerType().

◆ LAYER_PAD_STACK_BOTTOM

int PADS_LAYER_MAPPER::LAYER_PAD_STACK_BOTTOM = -1
staticconstexpr

◆ LAYER_PAD_STACK_INNER

int PADS_LAYER_MAPPER::LAYER_PAD_STACK_INNER = 0
staticconstexpr

Definition at line 108 of file pads_layer_mapper.h.

Referenced by BOOST_AUTO_TEST_CASE(), and GetLayerType().

◆ LAYER_PAD_STACK_TOP

int PADS_LAYER_MAPPER::LAYER_PAD_STACK_TOP = -2
staticconstexpr

◆ LAYER_PASTE_BOTTOM

int PADS_LAYER_MAPPER::LAYER_PASTE_BOTTOM = 30
staticconstexpr

Definition at line 120 of file pads_layer_mapper.h.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().

◆ LAYER_PASTE_TOP

int PADS_LAYER_MAPPER::LAYER_PASTE_TOP = 29
staticconstexpr

Definition at line 119 of file pads_layer_mapper.h.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().

◆ LAYER_PLACEMENT_OUTLINE

int PADS_LAYER_MAPPER::LAYER_PLACEMENT_OUTLINE = 20
staticconstexpr

Definition at line 112 of file pads_layer_mapper.h.

Referenced by GetLayerType().

◆ LAYER_SILKSCREEN_BOTTOM

int PADS_LAYER_MAPPER::LAYER_SILKSCREEN_BOTTOM = 27
staticconstexpr

Definition at line 117 of file pads_layer_mapper.h.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().

◆ LAYER_SILKSCREEN_TOP

int PADS_LAYER_MAPPER::LAYER_SILKSCREEN_TOP = 26
staticconstexpr

Definition at line 116 of file pads_layer_mapper.h.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetLayerType().

◆ LAYER_SOLDERMASK_BOTTOM

int PADS_LAYER_MAPPER::LAYER_SOLDERMASK_BOTTOM = 28
staticconstexpr

◆ LAYER_SOLDERMASK_TOP

int PADS_LAYER_MAPPER::LAYER_SOLDERMASK_TOP = 25
staticconstexpr

◆ m_copperLayerCount

int PADS_LAYER_MAPPER::m_copperLayerCount
private

◆ m_layerNameMap

std::map<std::string, PADS_LAYER_TYPE> PADS_LAYER_MAPPER::m_layerNameMap
private

Definition at line 125 of file pads_layer_mapper.h.

Referenced by AddLayerNameMapping(), PADS_LAYER_MAPPER(), and ParseLayerName().


The documentation for this class was generated from the following files: