97 std::string normalized;
98 normalized.reserve( aName.size() );
100 for(
char c : aName )
102 normalized +=
static_cast<char>( std::tolower(
static_cast<unsigned char>( c ) ) );
122 if( aPadsLayer == 1 )
176 if( normalized.find(
"top" ) != std::string::npos ||
177 normalized.find(
"layer 1" ) != std::string::npos ||
183 if( normalized.find(
"bottom" ) != std::string::npos ||
184 normalized.find(
"bot" ) != std::string::npos )
189 if( normalized.find(
"inner" ) != std::string::npos ||
190 normalized.find(
"mid" ) != std::string::npos ||
191 normalized.find(
"internal" ) != std::string::npos )
204 int innerIndex = aPadsLayer - 2;
209 if( innerIndex >= 30 )
315 const std::vector<PADS_LAYER_INFO>& aLayerInfos )
const
317 std::vector<INPUT_LAYER_DESC> descs;
318 descs.reserve( aLayerInfos.size() );
324 desc.
Name = wxString::FromUTF8(
info.name );
329 descs.push_back( desc );
362 default:
return "Unknown";
LSET is a set of PCB_LAYER_IDs.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static const LSET & AllLayersMask()
static LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSET GetPermittedLayers(PADS_LAYER_TYPE aType) const
Get the permitted KiCad layers for a given PADS layer type.
PADS_LAYER_TYPE ParseLayerName(const std::string &aLayerName) const
Parse a PADS layer name and return its type.
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
Parse a PADS layer number and return its type.
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
Get the suggested KiCad layer for a PADS layer.
static constexpr int LAYER_PAD_STACK_BOTTOM
Pad stack: Bottom copper.
std::string normalizeLayerName(const std::string &aName) const
static constexpr int LAYER_PAD_STACK_TOP
Pad stack: Top copper.
static constexpr int LAYER_PASTE_BOTTOM
static std::string LayerTypeToString(PADS_LAYER_TYPE aType)
Convert a layer type to a human-readable string.
void SetCopperLayerCount(int aLayerCount)
Set the total number of copper layers in the PADS design.
static constexpr int LAYER_PAD_STACK_INNER
Pad stack: Inner copper.
std::map< std::string, PADS_LAYER_TYPE > m_layerNameMap
std::vector< INPUT_LAYER_DESC > BuildInputLayerDescriptions(const std::vector< PADS_LAYER_INFO > &aLayerInfos) const
Build a vector of INPUT_LAYER_DESC from parsed PADS layer information.
void AddLayerNameMapping(const std::string &aName, PADS_LAYER_TYPE aType)
Add or update a layer name to type mapping.
static constexpr int LAYER_DRILL_DRAWING
static constexpr int LAYER_SOLDERMASK_BOTTOM
PCB_LAYER_ID
A quick note on layer IDs:
PADS_LAYER_TYPE
PADS layer types.
Information about a single PADS layer.