From fdb50d45e5d68a5a1bf8db2d54559a1e974d7472 Mon Sep 17 00:00:00 2001 From: dlawler489 <104159223@student.swin.edu.au> Date: Thu, 17 Sep 2026 21:14:03 +1000 Subject: [PATCH] Label AMS units by their range, so the A2L's AMS lite isn't 'AMS 17' Co-Authored-By: Claude Opus 5 --- public/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index f397739..0b3e6f2 100644 --- a/public/app.js +++ b/public/app.js @@ -2450,7 +2450,15 @@ function slotLabel(slot) { const p = printerList.find((x) => x.serial === serial); const name = p ? printerName(p) : ''; if (unit === 'ext') return name ? `on the ${name}’s external holder` : 'on the external holder'; - return `in ${name ? `${name}, ` : ''}AMS ${Number(unit) + 1}, slot ${Number(idx) + 1}`; + return `in ${name ? `${name}, ` : ''}${amsUnitLabel(Number(unit))}, slot ${Number(idx) + 1}`; +} + +// Printers number AMS units in ranges: 0–15 for an AMS or AMS 2 Pro, 128 and up +// for an AMS HT, and newer printers (the A2L, for one) put an AMS lite at 16. +function amsUnitLabel(id) { + if (id >= 128) return `AMS HT ${id - 127}`; + if (id >= 16) return `AMS ${id - 15}`; + return `AMS ${id + 1}`; } function spoolHtml(s) {