Skip to content
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

Add optional custom pinnumbers to connector #10

Merged
merged 1 commit into from
Jun 27, 2020

Conversation

kimmoli
Copy link
Contributor

@kimmoli kimmoli commented Jun 24, 2020

One possible solution for custom pin numbering, e.g. fits needs in #4

  • Pincount is detected automatically if not given.
  • If both, pinout and pinnumbers, are given, their count must match.
  • Freedom to give pin numbers in any order, in alphabetical and mixed notation.

Sample

connectors:
  X1:
    type: D-Sub
    subtype: male
    pincount: 25
    pinnumbers: [1,14,3,16,5,18,7,20,9,22,11,24,13]
    pinout: [ SENSE_P_1, SENSE_N_1, SENSE_P_2, SENSE_N_2, SENSE_P_3, SENSE_N_3, SENSE_P_4,SENSE_N_4, SENSE_P_5, SENSE_N_5, SENSE_P_6, SENSE_N_6, GND ]
  X2:
    type: F48
    subtype: female
    pincount: 48
    pinnumbers: [ z2,b2,d2,z4,b4,d4,z6,b6,d6,z8,b8,d8,z10,b10,d10,z12,b12,d12,z14,b14,d14,z16,b16,d16,z18,b18,d18,z20,b20,d20,z22,b22,d22,z24,b24,d24,z26,b26,d26,z28,b28,d28,z30,b30,d30,z32,b32,d32 ]

cables:
  W1:
    gauge: 0.25 mm2
    length: 0.2
    color_code: DIN
    wirecount: 16
    shield: true

connections:
  -
    - X1: [1,14,3,16,5,18,7,20,9,22,11,24]
    - W1: [2,1,4,3,6,5,8,7,10,9,12,11]
    - X2: [d4,z2,d10,z8,d16,z14,d20,z18,d26,z24,d32,z30]
  -
    - X1: 13
    - W1: s

demo01

src/wireviz.py Outdated Show resolved Hide resolved
@formatc1702
Copy link
Collaborator

This is a fantastic addition, I'll take care of it in the next few days!

@formatc1702 formatc1702 changed the base branch from master to dev June 27, 2020 08:52
@formatc1702 formatc1702 merged commit b4ddbae into wireviz:dev Jun 27, 2020
@formatc1702
Copy link
Collaborator

formatc1702 commented Jun 27, 2020

Unfortunately, this breaks the minimalist way of specifying only a pincount (e.g. Tutorial 01)... fixed in dev branch 8bf296b

@formatc1702
Copy link
Collaborator

formatc1702 commented Jun 27, 2020

Additional idea: Perhaps, instead of having pinout vs pinnumbers, using pin_labels or pin_IDs vs pin_descriptions, pin_functions or similar might be less confusing/ambiguous? Not sure if pinnumbers works when it's not only numerical labels...

@kimmoli
Copy link
Contributor Author

kimmoli commented Jun 27, 2020

Thanks for your efforts on this project.

Additional idea: Perhaps, instead of having pinout vs pinnumbers, using pin_labels or pin_IDs vs pin_descriptions, pin_functions or similar might be less confusing/ambiguous? Not sure if pinnumbers works when it's not only numerical labels...

IMHO pinnumber is pin number, regardles is it number, letter or mixed.

pinout could be pinname

i would avoid underscores ...

@formatc1702
Copy link
Collaborator

pinnumber and pinname could work. I totally agree on the underscore thing. Thanks for helping out!

@kvid
Copy link
Collaborator

kvid commented Jun 27, 2020

IMHO pinnumbers might be confusing when the values might be non-numeric. Why not use pins as suggested in issue#4 if these new pin identifiers will be the only way to reference pins? I would also consider a future possability to reference pins in alternative ways (in addition to the plain identifier - numeric or not), like #3 for the third pin and $GND for the pin named GND in the pinout, etc., but this should be raised as a separate issue. The pinIDs and pinlabels alternatives can also be considered without the underscore.

@kvid
Copy link
Collaborator

kvid commented Jun 27, 2020

I have not tested the proposed code to see if it is possible to specify s as pin identifier and how then a conflict with the shield identifier is handeled. Is this an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants