nx_maint_specs.nx source
↩ module page · 74 lines · 3204 B
1// nx_maint_specs.nx -- the appliance/HVAC spec CATALOG (the water-heater
2// vertical's data layer). Proves "a new thermal asset = a spec row" with real
3// per-class starter envelopes, fed to the SAME thermal kernel.
4//
5// Operator-chosen first vertical after the spine = appliances & water heater.
6//
7// HONEST: these are REASONED STARTER DEFAULTS from general HVAC/appliance field
8// practice -- the STARTING envelope, not precision per-model manufacturer specs.
9// The live system CALIBRATES per-unit from the asset's own measured history (a
10// specific furnace learns its own normal response rate); the catalog is just
11// the cold-start. #11: in production these live in svc-config, not code.
12//
13// NEVER-BRICK (#26): pure data fill; no syscalls, no device writes.
14//
15// genealogy_id: project-maintenance-platform-sclass-2026-06-23 (water-heater vertical)
16// license_tier: ORIGINAL
17
18import "nx_maint_asset.nx" // AssetSpec + NX_MAINT_CLASS_* + NX_MAINT_KERNEL_* + NX_HVAC_MODE_*
19const K_MAGIC_21000: i64 = 21000
20const K_MAGIC_49000: i64 = 49000
21const K_MAGIC_2000: i64 = 2000
22const K_MAGIC_4000: i64 = 4000
23const K_MAGIC_1500: i64 = 1500
24const K_MAGIC_60000: i64 = 60000
25const K_MAGIC_3000: i64 = 3000
26
27// Fill *out with the starter-default thermal spec for an asset class.
28// Returns 1 if the class is in the thermal catalog, 0 if unknown (loud -- the
29// caller must check; no fabricated spec for an unknown asset).
30func nx_maint_spec_load(asset_class: i64, out: *AssetSpec) -> i64 {
31 out.asset_class = asset_class
32 out.kernel = NX_MAINT_KERNEL_THERMAL_RESPONSE
33
34 if asset_class == NX_MAINT_CLASS_HVAC {
35 out.target_mC = K_MAGIC_21000 // 21 C heating setpoint
36 out.mode = NX_HVAC_MODE_HEAT
37 out.max_cph_x10 = 35 // 3.5 cycles/hr short-cycle ceiling
38 out.min_resp_mC_per_min = 150 // forced air ~0.15+ C/min
39 out.max_overshoot_mC = 600
40 return 1
41 }
42 if asset_class == NX_MAINT_CLASS_WATER_HEATER {
43 out.target_mC = K_MAGIC_49000 // ~120 F tank setpoint
44 out.mode = NX_HVAC_MODE_HEAT
45 out.max_cph_x10 = 200 // tanks cycle slowly
46 out.min_resp_mC_per_min = 100 // electric tank ~0.1+ C/min; slower = sediment
47 out.max_overshoot_mC = K_MAGIC_2000
48 return 1
49 }
50 if asset_class == NX_MAINT_CLASS_REFRIGERATOR {
51 out.target_mC = K_MAGIC_4000 // 4 C cabinet
52 out.mode = NX_HVAC_MODE_COOL
53 out.max_cph_x10 = 40
54 out.min_resp_mC_per_min = 30 // small box, slow pulldown; slower = low charge
55 out.max_overshoot_mC = K_MAGIC_1500
56 return 1
57 }
58 if asset_class == NX_MAINT_CLASS_DRYER {
59 out.target_mC = K_MAGIC_60000 // ~60 C drum
60 out.mode = NX_HVAC_MODE_HEAT
61 out.max_cph_x10 = 60
62 out.min_resp_mC_per_min = 300 // heats fast; declining = CLOGGED VENT (fire hazard)
63 out.max_overshoot_mC = K_MAGIC_3000
64 return 1
65 }
66
67 // unknown / non-thermal class -> zero the spec + return loud.
68 out.target_mC = 0
69 out.mode = NX_HVAC_MODE_HEAT
70 out.max_cph_x10 = 0
71 out.min_resp_mC_per_min = 0
72 out.max_overshoot_mC = 0
73 return 0
74}