|
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) |
| 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. | |
Private Member Functions | |
| PCB_LAYER_ID | mapCustomLayer (const LAYER_INFO &aLayerInfo, const wxString &aLayerName) |
| 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 468 of file allegro_builder.cpp.
|
inline |
Definition at line 484 of file allegro_builder.cpp.
References m_board, m_brdDb, and m_layerMappingHandler.
|
inlineprivate |
Definition at line 789 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 531 of file allegro_builder.cpp.
References LSET::AllCuMask(), LSET::AllLayersMask(), INPUT_LAYER_DESC::AutoMapLayer, ALLEGRO::LAYER_INFO::ETCH, getNthCopperLayer(), getNthUserLayer(), layerInfoDisplayName(), m_board, m_ClassCustomLayerLists, m_customLayerDialogNames, m_customLayerToKiMap, m_layerMappingHandler, m_staticLayerOverrides, INPUT_LAYER_DESC::Name, INPUT_LAYER_DESC::PermittedLayers, INPUT_LAYER_DESC::Required, s_LayerKiMap, traceAllegroBuilder, and UNDEFINED_LAYER.
|
inline |
Definition at line 642 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.
|
inlinestaticprivate |
Definition at line 733 of file allegro_builder.cpp.
References B_Cu, F_Cu, and ToLAYER_ID().
Referenced by FinalizeLayers(), and GetLayer().
|
inlinestaticprivate |
Definition at line 742 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 710 of file allegro_builder.cpp.
References mapCustomLayerByName(), and name.
|
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 720 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.
|
inlineprivate |
Definition at line 748 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:sublcass need to be placed on a KiCad layer other than the usual mapping (non-polygon PLACE_BOUND_TOP items, for example)
Definition at line 776 of file allegro_builder.cpp.
References addUserLayer(), and m_MappedOptionalLayers.
Referenced by GetPlaceBounds().
|
inline |
Definition at line 489 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 844 of file allegro_builder.cpp.
Referenced by addUserLayer(), FinalizeLayers(), and LAYER_MAPPER().
|
private |
Definition at line 843 of file allegro_builder.cpp.
Referenced by LAYER_MAPPER(), and ProcessLayerList().
|
private |
Definition at line 803 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 829 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 811 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), GetLayer(), and mapCustomLayer().
|
private |
Definition at line 841 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), and LAYER_MAPPER().
|
private |
Definition at line 800 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 818 of file allegro_builder.cpp.
Referenced by mapCustomLayer(), and mapCustomLayerByName().
|
private |
Definition at line 836 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 823 of file allegro_builder.cpp.
Referenced by FinalizeLayers(), and GetLayer().
|
private |
A record of what we failed to map.
Definition at line 834 of file allegro_builder.cpp.
Referenced by GetLayer().
|
private |
Definition at line 839 of file allegro_builder.cpp.
Referenced by GetLayer().