Comments (8)
Hi @EdwinSD,
I think this may just be a misunderstanding of intended and expected behavior, maybe a documentation change is required. I will try to explain.
You have flagged ignore_dnf = 0
. When to use any find of fit_field
sensibly you need to set ignore_dnf = 1
. This is because the fit_field
appropriately determines which items to set as DNF, these are then ignored and the items are included (quantity set to 1 in your example), but are appended with DNF because if you'd set ignore_dnf = 1
they would have been DNF and not appeared on the BoM.
When you run KiBOM without any variant specified, only the fit_field
s which are blank will be output to the BoM as these are the 'base' items used across all variants.
In your given example you will see that if you ran python "C:\Program Files\KiCad\bin\plugins\KiBoM-master\KiBOM_CLI.py" "%I" "%O_BOM.html" -r CFG1
with ignore_dnf = 0
then you would be presented with:
Nr. | References | Value | Quantity Per PCB | Fitted |
---|---|---|---|---|
63 | U5 | 24LC256 | 1 | +CFG1 |
64 | U14 | AMS1117-3.3 | 1 (DNF) | -CFG1 |
65 | U11 | CRE1S0505SC | 1 (DNF) | DNF |
66 | U18 | FT230XS | 1 (DNF) | RandomText |
If you'd run python "C:\Program Files\KiCad\bin\plugins\KiBoM-master\KiBOM_CLI.py" "%I" "%O_BOM.html"
with ignore_dnf = 1
then you would have gotten:
Nr. | References | Value | Quantity Per PCB | Fitted |
---|
Finally, if you'd run python "C:\Program Files\KiCad\bin\plugins\KiBoM-master\KiBOM_CLI.py" "%I" "%O_BOM.html" -r CFG1
with ignore_dnf = 1
then you would get:
Nr. | References | Value | Quantity Per PCB | Fitted |
---|---|---|---|---|
63 | U5 | 24LC256 | 1 | +CFG1 |
After having read the PCB Variants
and Configuration
sections of the README.md
, do you think there are any changes that could be made to make this functionality more clear?
Cheers.
from kibom.
Hi @trentks
Thanks for looking into the issue. I understand what your saying and I've checked the outputs, and they are exactly like you said.
My expected behavior probably differs from the intended behavior of the script. I would expected a component marked -CFG1, only to be excluded when ran with -r CFG1
with ignore_dnf = 1
For example: Following the example explained in the readme.md
- C1 -> "-production,+test"
- C2 -> "+production,+test"
- R1 -> ""
- R2 -> "-test"
Running the script with -r production
# | References | Fitted |
---|---|---|
1 | C2 | +production,+test |
2 | R1 |
R2 doesn't show up, but it should
Running the script with -r test
# | References | Fitted |
---|---|---|
1 | C2 | +production,+test |
2 | C1 | -production,+test |
3 | R1 |
Running the script without any variant specified returns:
# | References | Fitted |
---|---|---|
3 | R1 |
I've commented out the following line
; Default PCB variant if none given on CLI with -r
; board_variant = Default
As you can see, the script doesn't output what is expected, at least from what I understand of what it should do
Thanks again. Regards,
Edwin
from kibom.
Ah,
I think I understand @EdwinSD, I'll have a look at this at some stage. I think basically to sum up, variants which are tagged "-" are being excluded when they should not be. So in essence this is the same issue as #53.
To go back to your original example, I think that "RandomText" should probably be interpreted the same as "+RandomText" though nowhere does it say explicitly that such a thing is supported or what the behavior should be. I will look into this, and implement it this way if it is not already so, and add a note in the README to that effect. But I believe that your "DNF" is behaving as it should, as is your "+CFG1", but perhaps not your "-CFG1" as discussed.
Cheers.
from kibom.
I've just updated the KiBom to the latest version, deleted bom.ini, so it would be generated again, and it seems that the problem is resolved, except for running it without arguments.
The readme.md states:
If the script is run with the flag --variant production then C2, R1 and R2 will be loaded.
If the script is run without the --variant production flag, then C1, R1 and R2 will be loaded.
If the script is run with the flag --variant test, then C1, C2 and R1 will be loaded.
If the script is run with the flags --variant production,test, then C2 and R1 will be loaded.
If I run the script without a variant, only R1 and R2 are loaded. The rest is generated correctly
Regards,
Edwin
from kibom.
HI @EdwinSD
That's the expected behavior, no? Not explicitly stated, but expected?
- C1 -> "-production,+test"
- C2 -> "+production,+test"
- R1 -> ""
- R2 -> "-test"
C1 will be included in test, unless it's a "test,production" variant, in which case it will be excluded. All other cases it is excluded.
C2 will be included in production, and included in test, but is otherwise excluded.
R1 will be included always.
R2 will be excluded only in the case of test.
Running without a variant therefore should include R1, and R2 but exclude the rest. What is your expected behavior?
Edit: Ah I see, the second entry "If the script is run without the --variant production flag, then C1, R1 and R2 will be loaded." is incorrectly stated and should read "If the script is run without the --variant production flag, then R1 and R2 will be loaded. I will amend this to my #60 pull request.
from kibom.
Hi @trentks,
I think that's correct, fixing the documentation should resolve this.
Thanks for your assistance. Keep up the good work!
Regards,
Edwin
from kibom.
Closed in #60
@EdwinSD can you please confirm that you're happy with this fix?
from kibom.
Hi @SchrodingersGat,
Yes, resolved. I've tried various of my projects and now it's working correctly.
Thanks!
from kibom.
Related Issues (20)
- Add 'PCB_Variant' to PCB Info when creating BOMs in XLSX format HOT 1
- Default REGEX_EXCLUDE footprint name filter excludes components whose footprint names contain "MountingHoles" HOT 4
- KiCAD 6 Plugin Manager Support? HOT 1
- Output does not match source
- Column content is picked up from library, but not from Current Schematics HOT 4
- Generated Digi-Key links do not link to component web pages HOT 2
- "Description" in BOM being pulled from symbol library description which isn't useful HOT 12
- LED footprint excluded from BOM HOT 2
- Feature Request: Date filename wildcard HOT 1
- KiCad v7 DNP HOT 3
- Error, mis-combining components HOT 4
- Feature Request: Set new DNP field based on configured variant HOT 4
- The plugin does not allow kicad to close completely HOT 1
- board_variant with --cfg not building BOM's with joined variants HOT 1
- Part is excluded if footprint name is too long HOT 3
- Include Multiple Manufacturers and Part Numbers HOT 3
- "Exclude from Bill of Materials" Still Included In the BOM HOT 8
- Missing description in some native symbols HOT 1
- Problem with group_connector option HOT 1
- FEATURE REQUEST: Create plugin repository HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kibom.