Runout sets Spoolman to zero; surface prints waiting on a spool

- A roll that ran out is set to 0 g in Spoolman (like a weigh-in) instead
  of booking CC2 Control's delta, so a mirror whose count was off cannot
  book too much or too little.
- A tray that printed while CC2 Control still asked which spool it holds
  (untagged roll) shows the waiting millimetres on the status page and
  gets one log warning after the print.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GcEk5tkfFSYD6NTF66NkC
This commit is contained in:
Jonas MenzelandClaude Opus 5.5 committed 2026-10-25 20:45:05 +01:00
1 parent c04964066f
commit d03668e3c5
3 files changed
+85 -9

No files matched your search

+12 -2
View File
@@ -120,6 +120,14 @@ function info(s) {
out.title = 'Ohne Spoolman-Tag';
out.hint = 'Verbrauch wird nicht gebucht. Rolle taggen und scannen, um sie zu verwalten.';
}
if (s.cc2_question) {
const mm = s.cc2_question_mm || 0;
out.question = 'CC2 fragt: Spule ' + (QUESTION[s.cc2_question] || s.cc2_question);
out.hint = mm >= 1
? `Gedruckt ohne Spule: ${fmtNum(mm)} mm (ca. ${fmtNum(mm * Math.PI * 0.765625 * 1.24 / 1000, 1)} g). CC2 Control hält den Verbrauch, bis die Spule feststeht: Rolle taggen und scannen, dann wird er nachgebucht – oder in CC2 Control „keine Spule“ wählen.`
: 'CC2 Control fragt, welche Spule das ist. Rolle taggen und scannen oder in CC2 Control beantworten.';
out.warn = mm >= 1;
}
}
return out;
}
@@ -195,7 +203,8 @@ function slotCard(p, s) {
<span style="min-width:0"><span class="nm" style="display:block;font-size:15px">${esc(i.title)}</span>
<span class="small muted" style="display:block">${esc(i.sub)}</span></span>
</button>
<p class="hint${i.kind === 'takeout' ? ' warn' : ''}" style="margin-top:auto">${esc(i.hint)}</p>`;
${i.question ? `<div><span class="chip warn">${esc(i.question)}</span></div>` : ''}
<p class="hint${i.kind === 'takeout' || i.warn ? ' warn' : ''}" style="margin-top:auto">${esc(i.hint)}</p>`;
}
return `<article class="card slot"><div class="sh"><b>Slot ${s.slot + 1}</b>${tray}</div>${body}</article>`;
}
@@ -205,6 +214,7 @@ function slotRow(p, s) {
const inner = `<span style="font-weight:800;font-size:13px">${s.slot + 1}</span>`;
let title = i.title, sub = i.sub, rest = '';
if (i.kind === 'empty') { title = 'Leer'; sub = 'Kein Filament'; }
if (i.kind === 'unmanaged' && i.question) sub = i.warn ? `${fmtNum(s.cc2_question_mm)} mm ohne Spule gedruckt` : i.question;
if (i.kind === 'managed') {
rest = i.rest == null ? '?' : Math.round(i.rest) + ' g';
sub = [i.sub, '#' + s.mapping.spool, i.question || i.cc2[0]].filter(Boolean).join(' · ');
@@ -282,7 +292,7 @@ function sheetHtml(p, s) {
<h2 id="sheet-title" style="overflow-wrap:anywhere">${esc(i.title || 'Leer')}</h2>${i.sub ? `<div class="small muted">${esc(i.sub)}</div>` : ''}</div>
<button aria-label="Schließen" onclick="closeSheet()" style="min-width:40px;padding:0;border-radius:99px">✕</button>
</div>
${i.hint ? `<p class="hint${i.kind === 'takeout' ? ' warn' : ''}">${esc(i.hint)}</p>` : ''}
${i.hint ? `<p class="hint${i.kind === 'takeout' || i.warn ? ' warn' : ''}">${esc(i.hint)}</p>` : ''}
<dl class="kv">${rows.map(([k, v]) => `<dt>${k}</dt><dd>${v}</dd>`).join('')}</dl>
${m ? `<div class="row" style="flex-wrap:nowrap"><button style="flex:1;min-height:48px" onclick="slotAction('${p.id}', ${s.slot}, 'reassign')">Erneut senden</button>
<button class="danger" style="flex:1;min-height:48px" onclick="slotAction('${p.id}', ${s.slot}, 'release')">Aufheben</button></div>` : ''}`;