-
Notifications
You must be signed in to change notification settings - Fork 227
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
[feature] connector pin attributes #291
Comments
Thank you @T0jan for this feature suggestion. I'm sorry you had to wait so long without any feed-back. I'm not against your suggestion, but I just want to present a possible/optional alternative syntax to specify the same attributes: connectors:
J101:
pinlabels:
- [+5V, PWR, 5V]
- [+5V, PWR, 5V]
- [GND, PWR-RET, GND]
- [GND, PWR-RET, GND]
- [RX+, IN, RS422]
- [RX-, IN, RS422]
- [TX+, OUT, RS422]
- [TX-, OUT, RS422]
- [SDA, IO, 3V3]
- [SCL, OUT, 3V3] |
@kvid All good, I am glad too see this is not dead. I like your suggestion much more then my initial idea as it is much better readable. I think my idea was based on how it was done for the other properties like colors or pin numbers so I wanted to keep it similar but I think your solution is better to work with for the user. Would there be a limit on how many custom columns a user can add like this? |
@T0jan wrote:
Don't worry! Open issues are not dead, but sometimes it might take a while before someone reply, and even after a reply with suggestions, it doesn't always mean that someone will implement such suggestions soon. However, if you (or someone else) are motivated to try some Python coding yourself, feel free to make a note of it here and then submit a PR. It's often useful to discuss alternative functionalities and visual appearances in this open issue first, before diving into the coding job, but problems or design choices that appear during coding might also be discussed here (or in the PR when that is created).
The same attribute can be able to take simple values for simple use cases, and more complex values when needed for complex use cases. I think this is a convenient way to expand the functionality without breaking compatibility with the original simple use case.
I haven't tried coding any of this, so I don't know for sure, but in principle, it doesn't need to be such a limit. |
@kvid wrote:
I've been thinking about a similar approach lately. I had some issues that my pinlabels did not match with the alphanumeric designators defined in pins. In order to make them match, I wished there was a way to define them together in a table similar to yours. I find that transposed definition much better to handle, also for copying it from my spreadsheet application. PROPOSAL connectors:
J101:
pintable:
- [pins, pinlabels, pincolors]
- [A, +5V, RD]
- [B, 0V, BK]
- [C, CANH, YE]
- [D, CANL, GN] Note that the first line is a header that would define a reference to any possible attribute that accepts a list. Being able to load these as a table i.e. from CSV provides a big usability improvement. Defining the keys of each column is important, so they would not need to be reordered before inserting. PS: the same principle applies to wires, which could then be defined through |
@martinrieder - I'm not against your approach. The syntax is very similar to my suggestion from last year above, but the functionality of your approach is perhaps closer to the suggestion in #279 that also is an optional alternative syntax for existing list attributes. The different approaches don't exclude each other, though. Any conflicts between specifying different values for the same attribute via the different approaches should raise an exception. Comments about your syntax:
|
I agree that my suggestion is not exclusive to yours in #279. It contains reference to independent approaches though, where each would work, though I suggest some slight modifications below. What seems totally evident to me is the fact that it handles sub-components:
The table would only describe them at this level. Separate components require separate tables. While the issue description suggests some automatic ordering of wires, @Halfwalker suggests an ordered list for pins. This effectively represents a sparse table that is compatible with my proposal: Connectors:
A4:
pinlist: # or simply keep 'pins' ?
- name: A
label: AC lock sensor
color: GNYE
- name: B
color: VTWH
- name: C
label: NC
- # auto-assign to name: 4
label: AC magnetic clutch
color: BU @Tyler-Ward suggested a wire definition, for which the key-value assignment represents an unordered list. In effect, this proposes the same as #275. It is different to a table with defined order, which might need some smart algorithm to do the sorting. templates:
- &blueWire
part_number: 12345
color: BU
cables:
W1:
wireinfo:
A: # name could also be numbered
part_number: 12344
color: BK
B: <<: &blueWire
C: <<: &blueWire
4: # no sorting here
part_number: 12343
color: WH @formatc1702 suggested a transposed version of the table. There is no real difference to my suggestion. Both should be allowed. W1:
colors: [BK, BU, BU, RD ]
gauge: [0.25, 0.25, 0.5, 0.5 ]
mpn: [12344, 12345, 12346, 12343] Coming back to the suggested table syntax, which makes definitions a bit more compact than the previous example:
Yes, this should accept any attribute that is presented as a list, even future custom attributes.
Maybe simply name it
Not sure about this. It seems to be a separate issue to me. This file would definitely require the same header in the first row... It could possibly be included through Jinja as an advanced feature:
I prefer warnings or error messages over exceptions. The implementation of additional components needs to be discussed with respect to #224. |
@kvid wrote
Some additional thought that might lead to a separate feature request: If so, it would need to be added to the output stage, similar to PR #382 by @liambeguin. |
@martinrieder wrote:
Of these two alternatives, I prefer
Then we forget about this. It's not a feature I want. I just asked if you considered something like this because you wrote "Being able to load these as a table i.e. from CSV provides a big usability improvement."
I agree about preferring warnings when it makes sense to ignore the unexpected event and continue, but what do you mean by preferring "error messages over exceptions"? All exceptions provide an error message describing the problem. In some cases it might make sense to catch some low level exceptions and raise a higher level exception with more context information, but in most such cases it's useful to also include the low level error message as the root cause.
How does this issue affects anything about additional components? |
I meant to say that copying data from spreadsheets is a common task for most users. It usually requires some manual processing to assign the right columns. I consider this nice to have, but I also see that it adds some degree of complexity. We should keep it in mind for the future, maybe only processing CSV strings as a PoC, before adding the file handling. The proposal is a separate issue to me, but related and seems absolutely feasible.
By error message, I mean printing only a single line. You might call it a handled exception that limits the output to the highest level only. FileNotFoundError might be a good example that does not require any traceback to the lowest level.
These components would usually be related to the ones defined in the table. They might either be added to the same table or defined in a separate table. Think of a connector having different gauges for individual pins. It might have additional wire seals for each pin, but only a single connector housing. I see the following options for those additional components on a connector (and similar ones for cables and wires):
Having separate tables seems to be less complex. Both could be linked using reference designators as discussed in #224. The additional component quantity could either be defined explicitly or implicitly determined by counting the number of references. |
@Jachimo wrote:
It's one of many feature requests that are still open for discussions, but not yet have any suggested implementation.
I agree, and personally, I argue for accepting alternative ways to specify such information, because different use cases might have different needs.
I agree this might be useful, but it seems like a duplicate of what was already suggested in #275 and then split out to #279, so please add your comments to that issue. The only detail that seems to differ, is your |
Hello,
I usually use additional parameters in my harness plans like the signal direction or the voltage levels as additional layers of security. One could add them to the pinlabels ofc but I would like to see them in an additional column for each connector. If it is not already implemented and I missed it somewhere I would suggest a solution with optional attributes for the pinout definition:
I think giving the option to add two or three individual attribute fields should cover the most cases in which this could be useful.
The text was updated successfully, but these errors were encountered: