From 086304a90c9ad7498f90efe077e97ae8edc4e048 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 12 Nov 2015 16:08:36 -0800 Subject: [PATCH] partslist-vendor: Generate Mouser format parts list file on request Signed-off-by: Keith Packard --- bin/partslist-vendor | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/partslist-vendor b/bin/partslist-vendor index d8ce957..e813ec7 100755 --- a/bin/partslist-vendor +++ b/bin/partslist-vendor @@ -39,6 +39,7 @@ string[*] required_elements = { "device", "value", "refdes", + "loadstatus" }; bool has_header_member(string member) { @@ -89,7 +90,6 @@ string part_number(string[string] entry) void process_seeed(string[string] entry) { - if (entry["loadstatus"] != "smt") return; @@ -114,6 +114,8 @@ void process_seeed(string[string] entry) void process_digikey(string[string] entry) { + if (entry["loadstatus"] == "noload") + return; printf("%s,%s,%s %s\n", entry["quantity"], part_number(entry), @@ -121,7 +123,16 @@ void process_digikey(string[string] entry) entry["value"]); } +void process_mouser(string[string] entry) +{ + if (entry["loadstatus"] == "noload") + return; + printf("%s|%s\n", part_number(entry), entry["quantity"]); +} + void process_other(string[string] entry) { + if (entry["loadstatus"] == "noload") + return; printf("%s,%s,%s,%s %s\n", entry["vendor"], entry["quantity"], @@ -143,6 +154,9 @@ void process_file(file f) { case "digikey": process_digikey(entry); break; + case "mouser": + process_mouser(entry); + break; default: process_other(entry); break; -- 2.47.2