From 0be2509dbd03cf3a1acc447b704fd0ac5e8ecaa5 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Thu, 28 Nov 2024 14:26:04 -0500 Subject: [PATCH] Improve the organization of the BOM by moving aluminum extrusion to table --- hardware/contact_printer_BOM.csv | 4 ++-- hardware/contact_printer_BOM_total.csv | 23 +++++++++++------------ hardware/prices.csv | 3 +-- scad/contact_printer.scad | 4 ++-- scripts/bom.sh | 2 +- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/hardware/contact_printer_BOM.csv b/hardware/contact_printer_BOM.csv index a77ef90..ef6ad30 100644 --- a/hardware/contact_printer_BOM.csv +++ b/hardware/contact_printer_BOM.csv @@ -1,6 +1,6 @@ module,quantity,part,part_id,description -contact_printer,4,2020 Aluminum extrusion 260mm,N/A,Sides and central frame -contact_printer,2,2020 Aluminum extrusion 420mm,N/A,Top and bottom frame +contact_printer,1040,2020 Aluminum extrusion mm,N/A,Sides and central frame 4x 260mm +contact_printer,840,2020 Aluminum extrusion mm,N/A,Top and bottom frame 2x 420mm electronics_panel,4,M3 hex cap bolt 6mm,N/A,Attach the GPIO breakout board to the panel electronics_panel,1,ESP32 GPIO breakout board,N/A,To make the ESP32 dev board easier to wire electronics_panel,6,M3 sliding t slot nut,N/A,Attach the frame to the electronics_panel diff --git a/hardware/contact_printer_BOM_total.csv b/hardware/contact_printer_BOM_total.csv index 3e32dbf..09b5ff2 100644 --- a/hardware/contact_printer_BOM_total.csv +++ b/hardware/contact_printer_BOM_total.csv @@ -1,15 +1,14 @@ quantity,part,part_id,price -4,"M4 hex bolt 40mm",N/A,240 -25,"M3 sliding t slot nut",N/A,125 -25,"M3 hex cap bolt 8mm",N/A,200 -8,"M3 hex cap bolt 6mm",N/A,56 -1,"M3 hex cap bolt 12mm",N/A,8 -1,"L298N Motor driver module",N/A,287 -1,"ESP32 GPIO breakout board",N/A,599 -1,"ESP32 Dev board",N/A,666 -1,"608-RS Ball Bearing",608-RS,17 +4,"M4 hex bolt 40mm",N/A,244 +25,"M3 sliding t slot nut",N/A,143 +25,"M3 hex cap bolt 8mm",N/A,225 +8,"M3 hex cap bolt 6mm",N/A,59 +1,"M3 hex cap bolt 12mm",N/A,9 +1,"L298N Motor driver module",N/A,288 +1,"ESP32 GPIO breakout board",N/A,600 +1,"ESP32 Dev board",N/A,667 +1,"608-RS Ball Bearing",608-RS,18 2,"250RPM DC geared motor",JSX40-370,2998 -2,"2020 Aluminum extrusion 420mm",N/A,510 -4,"2020 Aluminum extrusion 260mm",N/A,640 +1880,"2020 Aluminum extrusion mm",N/A,1141 1,"100RPM DC geared motor with encoder",N/A,1619 -76,TOTAL,N/A,7965 +1950,TOTAL,N/A,8011 diff --git a/hardware/prices.csv b/hardware/prices.csv index 38d2861..8df8c09 100644 --- a/hardware/prices.csv +++ b/hardware/prices.csv @@ -4,8 +4,7 @@ M3 hex cap bolt 6mm,N/A,726,100,https://amzn.to/3AwiZxo M3 hex cap bolt 8mm,N/A,899,100,https://amzn.to/3YEvWNB M3 hex cap bolt 12mm,N/A,836,100,https://amzn.to/48CGa5Y M3 sliding t slot nut,N/A,599,105,https://amzn.to/48GRrSU -2020 Aluminum extrusion 260mm,N/A,7399,46,https://amzn.to/418OicC -2020 Aluminum extrusion 420mm,N/A,7399,29,https://amzn.to/418OicC +2020 Aluminum extrusion mm,N/A,7399,12200,https://amzn.to/418OicC 100RPM DC geared motor with encoder,N/A,1619,1,https://amzn.to/3UF707G 250RPM DC geared motor,JSX40-370,1499,1,https://amzn.to/3NWkcRL ESP32 Dev board,N/A,1999,3,https://amzn.to/3NXCvGj diff --git a/scad/contact_printer.scad b/scad/contact_printer.scad index 04d683a..164b30b 100644 --- a/scad/contact_printer.scad +++ b/scad/contact_printer.scad @@ -1600,8 +1600,8 @@ module debug_lamp () { gate_carrier([0, -2.5, 11]); } -//BOM: 2, 2020 Aluminum extrusion 420mm,N/A,Top and bottom frame -//BOM: 4, 2020 Aluminum extrusion 260mm,N/A,Sides and central frame +//BOM: 840, 2020 Aluminum extrusion mm,N/A,Top and bottom frame 2x 420mm +//BOM: 1040, 2020 Aluminum extrusion mm,N/A,Sides and central frame 4x 260mm module contact_printer () { //debug module for BOM } diff --git a/scripts/bom.sh b/scripts/bom.sh index 51cd605..e1be15b 100644 --- a/scripts/bom.sh +++ b/scripts/bom.sh @@ -52,7 +52,7 @@ done echo "quantity,part,part_id,price" > "${TOTAL}" sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${DESTINATION} bom" -cmd ".import ${PRICES} prices"\ - 'SELECT SUM(quantity),part,part_id, SUM(quantity) * (COALESCE((SELECT CEIL(prices.price / prices.quantity) FROM prices WHERE prices.part = bom.part LIMIT 1), 0)) as price FROM bom GROUP BY part ORDER BY part DESC;' >> "${TOTAL}" + 'SELECT SUM(quantity),part,part_id, CAST( CEIL( CAST(SUM(quantity) AS FLOAT) * (SELECT CAST(prices.price AS FLOAT) / CAST(prices.quantity AS FLOAT) FROM prices WHERE prices.part = bom.part LIMIT 1) ) AS INTEGER) as price FROM bom GROUP BY part ORDER BY part DESC;' >> "${TOTAL}" sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom" -cmd ".import ${PRICES} prices" -cmd '.mode markdown' \ "SELECT part as Part, quantity as Qty, \