104 if( aLayerCount < 1 )
113 std::string normalized;
114 normalized.reserve( aName.size() );
116 for(
char c : aName )
118 normalized +=
static_cast<char>( std::tolower(
static_cast<unsigned char>( c ) ) );
137 if( aPadsLayer == 1 )
192 if( normalized ==
"top" || normalized ==
"layer 1" || normalized ==
"1" )
195 if( normalized ==
"bottom" || normalized ==
"bot" )
200 auto isOrdinalWord = [](
const std::string& aName,
const std::string& aWord )
202 if( !aName.starts_with( aWord ) )
205 if( aName.size() == aWord.size() )
208 char next = aName[aWord.size()];
211 || std::isdigit(
static_cast<unsigned char>(
next ) ) != 0;
214 if( isOrdinalWord( normalized,
"internal" ) || isOrdinalWord( normalized,
"inner" )
215 || isOrdinalWord( normalized,
"mid" ) )
227 int innerIndex = aPadsLayer - 2;
232 if( innerIndex >= 30 )
337 const std::vector<PADS_LAYER_INFO>& aLayerInfos )
const
339 std::vector<INPUT_LAYER_DESC> descs;
340 descs.reserve( aLayerInfos.size() );
351 descs.push_back( desc );
384 default:
return "Unknown";
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static const LSET & AllLayersMask()
LSET GetPermittedLayers(PADS_LAYER_TYPE aType) const
PADS_LAYER_TYPE ParseLayerName(const std::string &aLayerName) const
static constexpr int LAYER_ASSEMBLY_TOP
static constexpr int LAYER_SILKSCREEN_BOTTOM
static constexpr int LAYER_PASTE_TOP
static constexpr int LAYER_SILKSCREEN_TOP
PADS_LAYER_TYPE GetLayerType(int aPadsLayer) const
static constexpr int LAYER_PLACEMENT_OUTLINE
static constexpr int LAYER_SOLDERMASK_TOP
static constexpr int LAYER_ASSEMBLY_BOTTOM
PCB_LAYER_ID mapInnerCopperLayer(int aPadsLayer) const
static constexpr int LAYER_DIMENSIONS
PCB_LAYER_ID GetAutoMapLayer(int aPadsLayer, PADS_LAYER_TYPE aType=PADS_LAYER_TYPE::UNKNOWN) const
Suggested KiCad layer for a PADS layer.
static constexpr int LAYER_PAD_STACK_BOTTOM
std::string normalizeLayerName(const std::string &aName) const
static constexpr int LAYER_PAD_STACK_TOP
static constexpr int LAYER_PASTE_BOTTOM
static std::string LayerTypeToString(PADS_LAYER_TYPE aType)
void SetCopperLayerCount(int aLayerCount)
static constexpr int LAYER_PAD_STACK_INNER
std::map< std::string, PADS_LAYER_TYPE > m_layerNameMap
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 constexpr int LAYER_DRILL_DRAWING
static constexpr int LAYER_SOLDERMASK_BOTTOM
PCB_LAYER_ID
A quick note on layer IDs:
wxString ConvertText(const std::string &aText)
Decode text from a PADS file, which uses an 8-bit codepage rather than UTF-8.
PADS_LAYER_TYPE
Functional categories of PADS layers, independent of specific layer numbers.