hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
519 stars 98 forks source link

Compute BOM for difference between variants #510

Closed mdeweerd closed 1 year ago

mdeweerd commented 2 years ago

Use cases

  1. When prototype boards that are already mounted need some changes to implement another variant, one has to make the list of components that has to be added and the ones that need to be removed.
  2. Similarly, while adjusting the initial BOM it is usefull to compare the result of the new variant with the previous one to make sure that the changes correspond to the ones that are expected.

Current method

To make this comparison, I exported the XLSX files generated by KiCOST into CSV files and made a textual comparison of the two. That is not only error prone, I still need to create a new BOM to prepare ordering the extra components.

Proposed evolution

KiCost could help with this if we could provide the target variant expression and the original variant expression.

KiCost would then build a BOM indicating the components that need to be added with a positive count, and components that need to be removed with a negative count. This list can also be used to ensure that the change made to the variant expression has the expected impact.

set-soft commented 2 years ago

Hi @mdeweerd !

Did you try using the diff command to compare the CSVs? This is how developers compare code looking for changes.

mdeweerd commented 2 years ago

Well, I used Notepad to be able to find "in line" differences more easily and update the differences as I reorgized the lines (when U8 is added to U10, U10 becomes "U8,U10" and the new line order does not help with comparing). Here is a screenshot: image

Still, 47 new components, 1 to remove and 5 to replace.

Comparing this way is an error prone and tedious task, I forgot to remove a line, update a quantity, etc (caught by multiple methods of verification).

I always look for ways to make less mistakes.

mdeweerd commented 1 year ago

Stale, closing (limiting my issue backlog).