|
KiCad PCB EDA Suite
|
Class to handle the mapping for Allegro CLASS/SUBCLASS idiom to KiCad layers. More...
Classes | |
| struct | CUSTOM_LAYER |
| Represents the information found in a single entry of a layer list. More... | |
Public Member Functions | |
| LAYER_MAPPER (const BRD_DB &aRawBoard, BOARD &aBoard, const LAYER_MAPPING_HANDLER &aLayerMappingHandler) | |
| void | ProcessLayerList (uint8_t aClass, const BLK_0x2A_LAYER_LIST &aList) |
| void | FinalizeLayers () |
| Called after all the custom layers are loaded. | |
| PCB_LAYER_ID | GetLayer (const LAYER_INFO &aLayerInfo) |
| bool | IsLayerMapped (PCB_LAYER_ID aLayerId) const |
| Return whether this layer ID is something we mapped to, or the catch-all unmapped layer. | |
| PCB_LAYER_ID | GetPlaceBounds (bool aTop) |
| Allegro puts more graphics than just the polygon on PBT/B, but we don't want to always make a static mapping, because some things on PBT/B do belong to the courtyard layer in KiCad (polygons). | |
| bool | IsOutlineLayer (const LAYER_INFO &aLayerInfo) const |
| Resolve the subclass name for a given class:subclass pair using the per-class custom layer list. | |
| PCB_LAYER_ID | MapCustomLayer (const LAYER_INFO &aLayerInfo, const wxString &aLayerName) |
| Record a specific class:subclass layer as mapping to some KiCad user layer, with a given name. | |
| LSET | GetRuleAreaLayers (const LAYER_INFO &aLayerInfo) |
Private Member Functions | |
| PCB_LAYER_ID | mapCustomLayerByName (const wxString &aLayerName) |
| Create or find a mapped layer with a given name, but not specifically bound to a specific class:subclass. | |
| PCB_LAYER_ID | addUserLayer (const wxString &aName) |
Static Private Member Functions | |
| static PCB_LAYER_ID | getNthCopperLayer (int aNum, int aTotal) |
| static PCB_LAYER_ID | getNthUserLayer (int aNum) |
Private Attributes | |
| std::unordered_map< const BLK_0x2A_LAYER_LIST *, std::vector< CUSTOM_LAYER > > | m_Lists |
| std::unordered_map< uint8_t, std::vector< CUSTOM_LAYER > * > | m_ClassCustomLayerLists |
| std::unordered_map< LAYER_INFO, PCB_LAYER_ID > | m_customLayerToKiMap |
| The main map from CLASS:SUBCLASS custom mappings to KiCadLayers. | |
| std::unordered_map< wxString, PCB_LAYER_ID > | m_MappedOptionalLayers |
| This is a map of optional, Allegro layers that we have mapped to KiCad layers with given names. | |
| std::unordered_map< LAYER_INFO, PCB_LAYER_ID > | m_staticLayerOverrides |
| Overrides for the static s_LayerKiMap entries, populated by the layer mapping handler. | |
| std::unordered_map< LAYER_INFO, wxString > | m_customLayerDialogNames |
| Names used in the layer mapping dialog for custom (non-ETCH, non-static) layers. | |
| std::unordered_map< LAYER_INFO, int > | m_unknownLayers |
| A record of what we failed to map. | |
| int | m_numUserLayersUsed = 0 |
| PCB_LAYER_ID | m_unmappedLayer = Cmts_User |
| const LAYER_MAPPING_HANDLER & | m_layerMappingHandler |
| const BRD_DB & | m_brdDb |
| BOARD & | m_board |
Class to handle the mapping for Allegro CLASS/SUBCLASS idiom to KiCad layers.
Definition at line 456 of file allegro_builder.cpp.
|
inline |
Definition at line 472 of file allegro_builder.cpp.
References m_board, m_brdDb, and m_layerMappingHandler.
|
inlineprivate |
Definition at line 878 of file allegro_builder.cpp.
References getNthUserLayer(), LayerName(), m_board, m_numUserLayersUsed, and traceAllegroBuilder.
Referenced by MapCustomLayer(), and mapCustomLayerByName().
|
inline |
Called after all the custom layers are loaded.
Finalises things like layer counts and stores into the board
Definition at line 520 of file allegro_builder.cpp.
References LSET::AllCuMask(), LSET::AllLayersMask(), INPUT_LAYER_DESC::AutoMapLayer, ALLEGRO::LAYER_INFO::ETCH, getNthCopperLayer(), getNthUserLayer(), IsUserLayer(), layerInfoDisplayName(), m_board, m_ClassCustomLayerLists, m_customLayerDialogNames, m_customLayerToKiMap, m_layerMappingHandler, m_MappedOptionalLayers, m_staticLayerOverrides, INPUT_LAYER_DESC::Name, name, INPUT_LAYER_DESC::PermittedLayers, INPUT_LAYER_DESC::Required, s_LayerKiMap, traceAllegroBuilder, and UNDEFINED_LAYER.
|
inline |
Definition at line 663 of file allegro_builder.cpp.
References ALLEGRO::LAYER_INFO::ETCH, getNthCopperLayer(), ALLEGRO::LAYER_INFO::m_Class, m_ClassCustomLayerLists, m_customLayerToKiMap, ALLEGRO::LAYER_MAPPER::CUSTOM_LAYER::m_Name, m_staticLayerOverrides, ALLEGRO::LAYER_INFO::m_Subclass, m_unknownLayers, m_unmappedLayer, MapCustomLayer(), s_LayerKiMap, s_OptionalFixedMappings, and traceAllegroBuilder.
Referenced by GetRuleAreaLayers().
|
inlinestaticprivate |
Definition at line 844 of file allegro_builder.cpp.
References B_Cu, F_Cu, and ToLAYER_ID().
Referenced by FinalizeLayers(), and GetLayer().
|
inlinestaticprivate |
Definition at line 853 of file allegro_builder.cpp.
References MAX_USER_DEFINED_LAYERS, ToLAYER_ID(), and User_1.
Referenced by addUserLayer(), and FinalizeLayers().
|
inline |
Allegro puts more graphics than just the polygon on PBT/B, but we don't want to always make a static mapping, because some things on PBT/B do belong to the courtyard layer in KiCad (polygons).
Use this function to create/choose a user layer instead.
Definition at line 744 of file allegro_builder.cpp.
References mapCustomLayerByName(), and name.
|
inline |
Definition at line 796 of file allegro_builder.cpp.
References LSET::AllCuMask(), B_Cu, F_Cu, GetLayer(), ALLEGRO::LAYER_INFO::KEEPOUT_ALL, ALLEGRO::LAYER_INFO::KEEPOUT_BOTTOM, ALLEGRO::LAYER_INFO::KEEPOUT_TOP, ALLEGRO::LAYER_INFO::m_Class, ALLEGRO::LAYER_INFO::m_Subclass, ALLEGRO::LAYER_INFO::PACKAGE_KEEPIN, ALLEGRO::LAYER_INFO::PACKAGE_KEEPOUT, ALLEGRO::LAYER_INFO::ROUTE_KEEPIN, ALLEGRO::LAYER_INFO::ROUTE_KEEPOUT, traceAllegroBuilder, and ALLEGRO::LAYER_INFO::VIA_KEEPOUT.
|
inline |
Return whether this layer ID is something we mapped to, or the catch-all unmapped layer.
Definition at line 733 of file allegro_builder.cpp.
References m_unmappedLayer.
|
inline |
Resolve the subclass name for a given class:subclass pair using the per-class custom layer list.
Returns empty string if not found.
Definition at line 754 of file allegro_builder.cpp.
References ALLEGRO::LAYER_INFO::BGEOM_OUTLINE, ALLEGRO::LAYER_INFO::BOARD_GEOMETRY, ALLEGRO::LAYER_INFO::DFMT_OUTLINE, ALLEGRO::LAYER_INFO::DRAWING_FORMAT, ALLEGRO::LAYER_INFO::m_Class, and ALLEGRO::LAYER_INFO::m_Subclass.
|
inline |
Record a specific class:subclass layer as mapping to some KiCad user layer, with a given name.
Usually, you don't need this as they are registered as needed based on layers found in the board, but sometimes you need to override the default mapping, say when you detect that the "lumped" layers need to be split.
Definition at line 773 of file allegro_builder.cpp.
References addUserLayer(), ALLEGRO::LAYER_INFO::m_Class, m_customLayerToKiMap, m_MappedOptionalLayers, ALLEGRO::LAYER_INFO::m_Subclass, and traceAllegroBuilder.
Referenced by GetLayer().
|
inlineprivate |
Create or find a mapped layer with a given name, but not specifically bound to a specific class:subclass.
This is useful when some items on a class:subclass need to be placed on a KiCad layer other than the usual mapping (non-polygon PLACE_BOUND_TOP items, for example)
Definition at line 865 of file allegro_builder.cpp.
References addUserLayer(), and m_MappedOptionalLayers.
Referenced by GetPlaceBounds().
|
inline |
Definition at line 478 of file allegro_builder.cpp.
References m_brdDb, m_ClassCustomLayerLists, ALLEGRO::BLK_0x2A_LAYER_LIST::m_Key, m_Lists, ALLEGRO::BLK_0x2A_LAYER_LIST::m_NonRefEntries, ALLEGRO::BLK_0x2A_LAYER_LIST::m_RefEntries, THROW_IO_ERROR, and traceAllegroBuilder.
|
private |
Definition at line 933 of file allegro_builder.cpp.
Referenced by addUserLayer(), FinalizeLayers(), and LAYER_MAPPER().
|
private |
Definition at line 932 of file allegro_builder.cpp.
Referenced by LAYER_MAPPER(), and ProcessLayerList().
|
private |
Definition at line 892 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), GetLayer(), and ProcessLayerList().
|
private |
Names used in the layer mapping dialog for custom (non-ETCH, non-static) layers.
Populated during FinalizeLayers(), consumed when applying the handler result.
Definition at line 918 of file allegro_builder.cpp.
Referenced by FinalizeLayers().
|
private |
The main map from CLASS:SUBCLASS custom mappings to KiCadLayers.
This doesn't cover all the fixed layers, just created custom ones, including the copper layers.
Definition at line 900 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), GetLayer(), and MapCustomLayer().
|
private |
Definition at line 930 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), and LAYER_MAPPER().
|
private |
Definition at line 889 of file allegro_builder.cpp.
Referenced by ProcessLayerList().
|
private |
This is a map of optional, Allegro layers that we have mapped to KiCad layers with given names.
This is done by name, because multiple class:subclass pairs may share the same name.
Definition at line 907 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), MapCustomLayer(), and mapCustomLayerByName().
|
private |
Definition at line 925 of file allegro_builder.cpp.
Referenced by addUserLayer().
|
private |
Overrides for the static s_LayerKiMap entries, populated by the layer mapping handler.
Definition at line 912 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), and GetLayer().
|
private |
A record of what we failed to map.
Definition at line 923 of file allegro_builder.cpp.
Referenced by GetLayer().
|
private |
Definition at line 928 of file allegro_builder.cpp.
Referenced by GetLayer(), and IsLayerMapped().