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

BOM import #273

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

shaun-leach
Copy link
Contributor

Add support for importing BOMs via CSV and excel.

Curious if this is something you're interested in and if so, would love your input on this as I'm a hacker at times when it comes to stuff like this. ;) Also I want to clean up the import code to reduce the amount of duplicated code between the CSV and excel importers.

@replaysMike
Copy link
Owner

Hi Sean - absolutely interested in this. It's been on my todo list for a while :)

I'll review the code and see if we can get to an approval by Monday. Cheers!

@replaysMike replaysMike self-assigned this Jun 30, 2024
@replaysMike replaysMike added the enhancement New feature or request label Jun 30, 2024
@shaun-leach
Copy link
Contributor Author

Excellent!

Let me know any changes you'd like.

@RoyalGamerTV
Copy link

Hello Jean,
I am testing your pull request right now and it does not work for me. I tried to import a KiCad BOM and there was a error. Could you maybe send me a example BOM that works to upload?
Thank you

@shaun-leach
Copy link
Contributor Author

ContinuitySMT.csv

Ah yes that would help. I'm using the new BOM support in KiCAD 8 and then I added MPN for the manufacturer part number.

I want to make it more robust to support other styles but this was a 1st pass.

@RoyalGamerTV
Copy link

Hi Shaun,

Thank you for your quick reply. I successfully imported your BOM. I had an idea for supporting multiple BOM formats: When you upload your BOM, it would display the contents of each column. Above each column, there could be a button to select the type of information it contains. If there are columns with data that aren't useful for the Binner, you could simply select "skip," and the program would ignore that column. This approach would allow for the upload of various types of BOMs. I got the idea from DigiKey, where you can upload BOMs into your basket and specify the type of information for each column.

Best regards,
max

@shaun-leach
Copy link
Contributor Author

shaun-leach commented Aug 2, 2024 via email

@@ -62,7 +50,7 @@ public async Task<ImportResult> ImportAsync(Project project, Stream stream, IUse
// read csv header
Header? header = null;
var headerRow = rows.First();
if (headerRow.StartsWith("#"))
if (headerRow.StartsWith("\"#\""))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should likely be if (headerRow.StartsWith("#") || headerRow.StartsWith("\"#\"")) as many CSV formats don't require quoted headers

@replaysMike replaysMike added this to the v2.6.4 milestone Aug 5, 2024
@replaysMike
Copy link
Owner

@shaun-leach once the conflicts are resolved I can merge this if all of your changes are complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants