-
Notifications
You must be signed in to change notification settings - Fork 219
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
Processing Jumpers and Loops, Plus Processing Wires inside the Table as Edges #369
base: dev
Are you sure you want to change the base?
Conversation
Now everything from #350 is implemented. |
Syntax:
|
Changed the syntax and added options for the shorts, see ex15 for more
New Syntax:
|
I'm sorry that I've not yet had time to play with this PR, but it seems to work as proof of concept for the #350 discussions.
|
I mainly have problems with the bom and how I add the shorts to the bom |
Have you considered making the additional components list be a union of shorts and explicitly specified entries, instead of having a separate list for shorts? Then adding to BOM could be handled equally as well. |
@kvid @martinrieder could you look at the new syntax in ex15 & 16? |
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.
This needs a bit of rework. Comments added.
examples/ex15.yml
Outdated
manufacturer: WireViz | ||
mpn: 42XCD42A5 | ||
type: shortPartA | ||
qty: 42 |
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.
I find qty
confusing for unit mm
. How about length
as an alias?
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.
Yes, but Additional Components works with qty
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.
Yes, just leave it, as changing this is not in scope.
examples/ex15.yml
Outdated
shorts: | ||
- SH1: [1, 5, 7] | ||
- SH2: [2, 6] |
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.
Using a list here is fine. Does not match the syntax description though.
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.
Syntax description is yet to be updated.
} | ||
else: | ||
common_args = { | ||
"qty": part.qty * component.get_qty_multiplier(part.qty_multiplier), |
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.
numShorts
could be the return value of the function.
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.
Do not completely understand what you mean
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.
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.
You had the qty_multiplier
choice extended for shorted
, so I thought that the function get_qty_multiplier
might return numShorts
as an integer in that case. The meaning has changed now with references
.
src/wireviz/wv_bom.py
Outdated
else: | ||
numShorts = len(part.shorts) | ||
|
||
if numShorts > 0: |
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.
This could be avoided, see below.
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.
Do not completely understand what you mean
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.
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.
Sorry, the order of comments got mixed up and my statement was possibly misleading.
Overall question is if the syntax is acceptable? |
@tobiasfalk wrote:
I would prefer a solution that does not require using Overall, I would say that this implementation is quite close to what was discussed in #224 (comment). The only difference is that Please also have a look at #288, which also implements some loop handling and might cause some merge issues. What I need for my daily work is having alphanumeric pin names and pinlabels matching to work also on loops. I am currently using a workaround for this. ex15 connectors:
X1:
#[...]
pinlabels: [GND, VCC, RX, TX, GND, VCC, GND]
shorts:
- SH1: [1, 5, 7]
- SH2: [2, 6]
additional_components:
- reference: SH1 # discussed in #224
color: PK
#[...]
- reference: SH2
color: RD
#[...]
X2:
#[...]
pinlabels: [GND, VCC, RX, TX, GND, VCC, GND]
shorts:
- SH1: [1, 5, 7] # same designator as above...
- SH2: [2, 6] # does this imply the same attributes? EDIT: Cross-referring to #224 (comment) for additional details. |
Yes, I was thinking the same. You would also need to name the color, similar to how it is done for wires. For the colorblind it seems impossible to recognize the loops otherwise. What about choosing a connector side for loops? |
@martinrieder |
@tobiasfalk please explain your reasoning... The way I understand this, it could be solved by #376, which also allows defining a connector side for loops. It would not be displayed in the additional components table then. I would call the two approaches:
|
@martinrieder my reasoning behind it was to group it with the same type of wire/cabel in the overall bom. |
If the base is OK, I will add a tutorial and then wait for #251 to then move/reimplement this. Since this will create a bunch of conflicts. |
@martinrieder I thought about that maybe replacing it with an X but then the centering Problem of SVG would be more prominent. |
@tobiasfalk how does the |
You will have the same Problem as with X |
@tobiasfalk I finally got around to test your PR on my dev machine. It fails to run
You may need to use an absolute path for calling this script. I tried to set the environment variable to point to the right path and also moved |
Will look in to it |
@tobiasfalk I fixed it by adding the line os.environ['GVPRPATH'] = str(Path(__file__).parent) |
@martinrieder to where exactly? |
Just before the call to |
@martinrieder could you test it again? |
Some commits back, do not know exactly which one, I implemented #352 and it works without a problem for me |
Then I propose you edit the description of the PR to include this and the other issues from #369 (comment) as well. |
If everything is now Ok, then I would now wait for #251 |
Oh yes I need to clean up the code a bit, I know that |
Here I started to implement Jumpers, and a new way of drawing Wires inside the Wire table.
Currently, only the Black circles are done and nothing else.
See ex15.png
Ps. And now even the right branch
Edit:
![ex15](https://private-user-images.githubusercontent.com/56540480/341122428-a5418975-87da-4511-84de-894891eef45b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5OTUzODQsIm5iZiI6MTcxOTk5NTA4NCwicGF0aCI6Ii81NjU0MDQ4MC8zNDExMjI0MjgtYTU0MTg5NzUtODdkYS00NTExLTg0ZGUtODk0ODkxZWVmNDViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTEl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