-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make connecting components together easier and more flexible #75
Conversation
Input test file for this branch: connectors:
X1: &proper
type: proper connector
pincount: 4
F1:
auto_generate: true
# category: ferrule
pincount: 1
color: PK
F2:
auto_generate: true
# category: ferrule
pincount: 1
color: VT
X2:
<<: *proper
cables:
W1:
wirecount: 4
color_code: IEC
W2:
category: bundle
wirecount: 4
color_code: DIN
W3:
wirecount: 4
colors: [RD, YE, GN, BU]
W99:
wirecount: 2
connections:
- # very long connection list, alternating connectors and cables
- X1: [1-4] # connector, as usual
- W1: [2,1,4,3] # wire, as usual
- [F1, F1, F1, F2] # list of ferrules, may be different types
- W2: [1-4]
- F2 # single ferrule, will be auto-duplicated
- W3: [2-4,1]
- X2: [1-4]
-
- X1: [1-2]
- W99: [1-2]
- X2: [1-2] |
Would a connector attribute |
Yes, I am working towards removing ferrules altogether, and implementing something like you suggest. The new attribute This example would not use cables:
C1: &cable
type: Mains cable
colors: [BN, BU, GN] # GN to be replaced with GNYE for PE
gauge: 1.5
C2:
<<: *cable
C3:
<<: *cable
connectors:
S1: &wago
pincount: 1 # will appear as ferrule since hide_single_pin will default to true, like kvid suggested
manufacturer: Wago
manufacturer_part_number: 221-413
color: OG
S2:
<<: *wago
S3:
<<: *wago
connections:
-
- C1: [1-3]
- [S1, S2, S3] # these have autogenerate set to false, since we need to manually assign names...
- C3: [1-3]
-
- C2: [1-3]
- [S1, S2, S3] # ...to be able to use them here! |
Closes #67. - Allow defining arbitrarily long lists of alternating connectors and cables in a connection set. - Start work towards removing 'ferrules' as special case, merging them with normal connectors - Stramline auto-generation of simple, one pin connectors (ferrules, wire splices, ...)
4309ec5
to
b479190
Compare
@kvid perhaps you have some ideas on how to implement the Overall I'm quite happy with this refactoring, except for the special case of loops. I'm even considering adding a new section in the YAML file called Or maybe even add a The whole ferrule vs. connector thing and hiding single pins is on my radar, don't worry. |
# populate connection list | ||
connection_list = [] | ||
for i, item in enumerate(connection): | ||
if isinstance(item, str): # one single-pin component was specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the responsibility of the user to make sure it's really a single-pin component. If not, the code doesn't care and simply assumes you want to connect pin 1. Same for the next elif
.
I'm afraid I might have to wait until late this evening to test what's stored in the One thing about the loops, is that they are often made of short wires, and I would prefer to be able to specify wire attributes for them, and have them in the BOM together with other wires in those cases. |
Assumimg pin 1 when only a connector without pin is specified, sounds very well in my mind. |
I've started working on something here, still maturing. |
Thanks @kvid, I've based the system on your proposal, seems to work great! Loops will be reimplemented elsewhere. |
0c8bf82
to
cf6d367
Compare
This will be its own issue/PR.. for now, I'm just restructuring code, loops will remain as primitive as they have been until now, just easier to declare directly, inside a connector's properties: X2:
type: Molex KK 254
subtype: female
pinout: [GND, RX, TX, N/C, IN, OUT]
loops:
- [5, 6] # each entry must be a list of exactly two pins
- ... |
Fixes #67.