Add generator for DIP switches sym & cmp #152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

The first part for LibrePCB-Libraries/CK.lplib#10: generating symbols & components for DIP switches, to be added to the Base library. Generates DIP switches from 1 to 14 circuits.
Packages and devices for C&K DIP switches are under construction too, but will be added in a separate PR later (and belong to the manufacturer-specific library then).
Symbol of the 3x DIP switch:
Component of the 3x DIP switch:
So there is a symbol variant for a single, "combined" gate, and a "split" variant with each switch as a separate gate.
Everything was straight-forward, except two things:
First, I'm not sure about the look of the symbol. Often, DIP switches are drawn with circles, for example in KiCad:
This seems to be the IEEE 315 style, which we actually also support e.g. in the Relay components where we provide both European and American variants. Not sure if we really also should provide American DIP switches as this would then lead to 4 different symbol variants for each component 🤔
And second, I was not sure how to name the symbol pins and component signals. I have now named the pins like "5" and "5.2" (for circuit number 5) and the signals "5a" and "5b". This allows to display the pin name for "5", but hide "5.2" so the circuit numbers are visible in the symbol in a clean & lean way, though it feels a little bit hacky.
Any inputs welcome.
Library PR: LibrePCB-Libraries/LibrePCB_Base.lplib#164