code wiki / (root) / nx_bom_rt.nx

nx_bom_rt.nx

buildroot/runtime/nx_bom_rt.nx

6274 B158 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic bom
docsdependenciesstructsconstsfunctions

about

nx_bom.nx -- GO-TO-MARKET / BILL OF MATERIALS engine. The first hardware rung made concrete: turn a gated DESIGN into a buildable bench prototype -- the real components, their cost, mass, lead time, and make-vs-buy -- with rollups (total cost, total mass, the longest-lead CRITICAL-PATH item that gates the build schedule) and per-category subtotals. Generic across any product; instantiated here for the water AWG bench prototype (advances water-system from MRL 2 toward MRL 3 = manufacturing proof of concept). INTEGER-EXACT: cost in cents, mass in grams, lead time in days. The enclosure is MAKE (we 3D-print it with our own CAD/G-code capability = vertical integration), everything else is BUY. grounded: bill_of_materials + design_for_manufacturability + contract_manufacture genealogy_id: bill_of_materials_bench_prototype + nishi_go_to_market

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_bom_rt.nx nx_market_rt.nx

imports: nx_syscalls.nx

imported by: nx_market_rt.nx

structs

53struct NxPart
92struct NxBom

consts

21const BC_HARVEST: i64 = 0 // cooler + fans + prefilter (pull water from air)
22const BC_COLLECT: i64 = 1 // tray + tubing + pump + tank
23const BC_TREAT: i64 = 2 // UV-C + carbon (make it safe)
24const BC_MINERAL: i64 = 3 // remineralization media (make it taste + healthful)
25const BC_CONTROL: i64 = 4 // MCU + sensors + power + wiring
26const BC_ENCLOSURE: i64 = 5 // the case (we print it)
28const BM_BUY: i64 = 0
29const BM_MAKE: i64 = 1
33const BP_PELTIER: i64 = 0
34const BP_HEATSINK_FAN: i64 = 1
35const BP_INTAKE_FAN: i64 = 2
36const BP_PREFILTER: i64 = 3
37const BP_TRAY: i64 = 4
38const BP_TUBING: i64 = 5
39const BP_PUMP: i64 = 6
40const BP_UVC_LED: i64 = 7
41const BP_CARBON: i64 = 8
42const BP_MINERAL_CART: i64 = 9
43const BP_TANK: i64 = 10
44const BP_MCU: i64 = 11
45const BP_SENSORS: i64 = 12
46const BP_PSU: i64 = 13
47const BP_ENCLOSURE: i64 = 14
48const BP_WIRING: i64 = 15
49const BP_N: i64 = 16

functions

62func nx_bom_part(id: i64) -> *NxPart
100func nx_bom_new() -> *NxBom
called by 1: nx_bom_water_assemble calls 1: sys_mmap
110func nx_bom_add(b: *NxBom, part_id: i64, qty: i64) -> i64
called by 1: nx_bom_water_assemble calls 1: nx_bom_part
124func nx_bom_water_count() -> i64
128func nx_bom_water_qty_at(i: i64) -> i64
133func nx_bom_water_assemble() -> *NxBom
144func nx_bom_water_category_cost(cat: i64) -> i64
156func nx_bom_critical_path_days(b: *NxBom) -> i64