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

[feature] ignore additional components in bom #300

Open
ask6483 opened this issue Jan 5, 2023 · 2 comments
Open

[feature] ignore additional components in bom #300

ask6483 opened this issue Jan 5, 2023 · 2 comments

Comments

@ask6483
Copy link

ask6483 commented Jan 5, 2023

Is it possible to also ignore additional components in bom generation?
For example ignore_in_bom will hide connector housing but not crimp terminals:

  J1:
    pincount: 2
    type: PicoBlade 1.25 mm 
    subtype: Receptacle Crimp Housing
    manufacturer: Molex
    mpn: '510210200'
    pinlabels: [GND, VCC]
    notes: Camber Main PCB
    ignore_in_bom: true
    additional_components:
      -
        type: Female Crimp Terminal
        subtype: |
          PicoBlade 1.25 mm 
          Tin Plating, 26-28AWG
        qty_multiplier: populated
        manufacturer: Molex
        mpn: '500798001'

I want to create cable diagram but the part is available as pre-crimped wire so there is only one item in bom.

@ask6483 ask6483 changed the title [feauture] ignore additional components in bom [feature] ignore additional components in bom Jan 5, 2023
@kvid
Copy link
Collaborator

kvid commented Jan 6, 2023

Thank you for reporting your use case. This must be a simple bug, was my first impression, and I quickly located two code locations where I added one extra indentation level to make them part of the if not ignore_in_bom: block just above.

https://github.com/wireviz/WireViz/blob/v0.3.2/src/wireviz/wv_bom.py#L83-L84
https://github.com/wireviz/WireViz/blob/v0.3.2/src/wireviz/wv_bom.py#L114-L115

That simple fix described above does indeed what you ask for, but only if options.mini_bom_mode is False, and the default value is True. When options.mini_bom_mode is True, then any list of additional components in the diagram nodes are supposed to contain the BOM entry IDs as a reference for more information details. That code fails with an exception when there is no matching entry in the BOM. We need to decide how to handle such a conflict.

  • One way could be to disallow hiding a connector/cable with additional components when options.mini_bom_mode is True.
  • Another way could be to ignore options.mini_bom_mode for additional components that are hidden from the BOM.
  • Please suggest other alternatives.

@kvid
Copy link
Collaborator

kvid commented Jan 16, 2023

@ask6483, do you also request controlling ignore_in_bom for each additional component? That would enable ignoring any combination of connector/cable entry and additional component entries in the BOM. However, the same conflicts as described above, still exist, and must be handled.

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

No branches or pull requests

2 participants