Additional layers: can't select user-defined layers
TheColorman opened this issue · comments
When exporting using Fabrication Toolkit, we have the ability to write the names of additional layers to be exported, but this doesn't include any user defined layers, e.g. User.[0-9]
. It seems the layers you can use are hardcoded here:
Fabrication-Toolkit/plugins/config.py
Lines 15 to 56 in ab0b336
I suggest using a way to dynamically get the enabled layers, such as
layers = []
i = pcbnew.PCBNEW_LAYER_ID_START
while i < pcbnew.PCBNEW_LAYER_ID_START + pcbnew.PCB_LAYER_ID_COUNT:
layer_std_name = pcbnew.BOARD.GetStandardLayerName(i)
layer_name = pcbnew.BOARD.GetLayerName(board, i)
layers.append((layer_std_name, i, layer_name))
i += 1
Adapted from Board2Pdf.
Additionally, the additional layers input box seems to support a list of comma-separated layer names.
Fabrication-Toolkit/plugins/process.py
Line 72 in ab0b336
This isn't very clear to the user, especially as the autocomplete doesn't acknowledge attempts at adding more than one layer, so I feel like some type hint would be useful.
I'm working on a PR to address these issues, but I'd like to hear some feedback about it here first.
Sounds good.
Regarding the autocomplete, I agree, I could not make it work properly for more than one layer, and the UI is quite limited and could not make it look nice, so I opted to ignore it.
If you could add it properly, I'm all for it.
I've opened PR #152 that makes the autocomplete list dynamically generated. I tried to play around with having a list of layers underneath the text box that you could add/remove from, but couldn't get anything that looked nice, so for now I've just updated the textbox hint.
Thank you!