Try Change a reading, or set a hypothetical outage, and watch the result.
Observe Compare the motor current change, the temperature against its limit, the estimated boxes left and the work orders after a replay.
Explain Explain why each signal prompts a different action owner and why a reading alone is not a diagnosis.
Technical boundaries. Three independent single-reading checks and one hypothetical replay count from the SuperWidget story. The reading defaults are the chapter's illustrative story values (the chapter gives no outage or duplicate numbers, so those inputs start at zero and are hypothetical); the weight-based box count is an estimate from an approximate shelf weight. The replay panel is a hypothetical expected-value count of work orders only (extra copies = alerts raised x the duplicate percentage, and orders = alerts raised plus those copies when the sequence check is off, so the counts can be fractional; it is not a list of individual alerts); it has no per-message timestamps, ordering or reconnect timing.
Readings are illustrative story values. Chapter case restores zero outage alerts and no duplicates, plus 50 A to 62 A, 72 F limit with 74 F, and 24 boxes at about 18 kg falling to 12 kg.
viewof normalA = Inputs.range([0,200], {value:50,step:1,label:"Motor normal current (A)"})viewof readA = Inputs.range([0,200], {value:62,step:1,label:"Motor current reading (A)"})viewof limitF = Inputs.range([0,120], {value:72,step:1,label:"Storage limit: stay below (F)"})viewof readF = Inputs.range([0,120], {value:74,step:1,label:"Temperature reading (F)"})viewof boxes = Inputs.range([0,200], {value:24,step:1,label:"Boxes when full"})viewof fullKg = Inputs.range([0,200], {value:18,step:0.5,label:"Shelf weight when full (kg)"})viewof nowKg = Inputs.range([0,200], {value:12,step:0.5,label:"Shelf weight now (kg)"})viewof alerts = Inputs.range([0,500], {value:0,step:1,label:"Hypothetical motor alerts raised while the link is down"})viewof dupPct = Inputs.range([0,100], {value:0,step:1,label:"Hypothetical share replayed twice on reconnect (%)"})viewof dedupe = Inputs.toggle({label:"Check each alert's sequence number before creating a work order",value:true}){const button =html`<button type="button">Chapter case</button>` button.addEventListener("click", () => { (viewof normalA).value=50; (viewof normalA).dispatchEvent(newEvent("input", {bubbles:true})); (viewof readA).value=62; (viewof readA).dispatchEvent(newEvent("input", {bubbles:true})); (viewof limitF).value=72; (viewof limitF).dispatchEvent(newEvent("input", {bubbles:true})); (viewof readF).value=74; (viewof readF).dispatchEvent(newEvent("input", {bubbles:true})); (viewof boxes).value=24; (viewof boxes).dispatchEvent(newEvent("input", {bubbles:true})); (viewof fullKg).value=18; (viewof fullKg).dispatchEvent(newEvent("input", {bubbles:true})); (viewof nowKg).value=12; (viewof nowKg).dispatchEvent(newEvent("input", {bubbles:true})); (viewof alerts).value=0; (viewof alerts).dispatchEvent(newEvent("input", {bubbles:true})); (viewof dupPct).value=0; (viewof dupPct).dispatchEvent(newEvent("input", {bubbles:true})); (viewof dedupe).value=true; (viewof dedupe).dispatchEvent(newEvent("input", {bubbles:true})); })return button}
fmt = n => n.toFixed(1)// a small positive count must not display as 0.0fmtP = n => n >0&& n <0.05? n.toPrecision(2) : n.toFixed(1)// a count a little below or above a whole number must not round to it (0.9975 boxes is not 1.0)// never show a whole number next to a nonzero difference: six significant digits, or twelve when six would round to a whole numberfmtX = n => { const r =Number(n.toPrecision(6));returnString(Number.isInteger(r) &&Math.abs(n - r) >1e-12*Math.max(1,Math.abs(n)) ?Number(n.toPrecision(12)) : r) }fmtB = n =>Number.isInteger(n) ? n.toFixed(1) :fmtX(n)// kg per box and percentages keep the digits that matter (0.9975 is not 1.00)fmtK = n =>fmtX(n)fmtR = n =>fmtX(n)rise = readA - normalArisePct = normalA >0? rise / normalA *100:nullover = readF - limitFperBox = boxes >0? fullKg / boxes :null// micro-kilogram integers keep equal weights exact (8.5 kg and 8.5 kg on 7 boxes is exactly 7 boxes, not 7.000000000000001) without snapping typed values such as 9.99 kg to a half-kilogram// remove only floating-point noise (about 1e-16), so off-grid readings keep their real difference (199.9999999 kg of 200 is not 200)cleanF = x =>Math.abs(x -Math.round(x)) <1e-12?Math.round(x) : xleft = perBox && perBox >0?cleanF(nowKg * boxes / fullKg) :nullshort = left ===null?null:cleanF((fullKg - nowKg) * boxes / fullKg)dupC = alerts * dupPctcnt = c => { const v = c /100;returnNumber.isInteger(v) ? v.toLocaleString("en-US") : v.toFixed(2).replace(/0$/,"") }ordersC = dedupe ? alerts *100: alerts *100+ dupChtml`<div aria-live="polite"><p><strong>Motor current:</strong> ${rise >0?`up ${fmt(rise)} A`: rise <0?`down ${fmt(-rise)} A`:"unchanged"}${risePct ===null?" (percentage not defined when the normal current is 0 A)": rise ===0?" (equal to normal; the chapter sets no current alarm threshold)":` (${fmtR(Math.abs(risePct))}% ${rise >0?"above":"below"} normal; the chapter sets no current alarm threshold)`}</p><p><strong>Temperature:</strong> ${over >=0?`${over ===0?"at the limit, not below it":`${fmt(over)} F over the limit`}: warn the driver`:`below the limit with ${fmt(-over)} F margin`}</p><p><strong>Shelf:</strong> ${left ===null?"box count not defined without a full-shelf weight and box count":`about ${fmtK(perBox)} kg per box; about ${fmtB(left)} boxes left${left > boxes ?" (reading exceeds the full-shelf weight)":`, ${fmtB(short)} fewer than full`} (an estimate assuming equal box weights; the chapter sets no replenishment threshold)`}</p><p><strong>Replay after reconnect</strong> (expected values, not individual work orders: extra copies = alerts raised x the assumed duplicate-replay percentage; orders = alerts raised, plus those extra copies when the sequence-number check is off; the page does not model individual alerts, timestamps or ordering)<strong>:</strong> ${cnt(alerts *100)} alerts raised, ${cnt(dupC)} expected extra copies delivered, ${cnt(ordersC)} expected work orders created${dedupe ?" (copies rejected by the sequence-number check)":""}${!dedupe && dupC >0?`, ${cnt(dupC)} of them expected duplicates`:""}</p></div>`