Grotti 2.5.1: Druckbericht, Statistik, Spulenakte und Protokoll-Fixes.
This commit is contained in:
1 parent
b277ca48aa
commit
efd0801cd1
30 files changed
+3393
-178
No files matched your search
@@ -103,7 +103,7 @@
|
||||
<select id="send-project"><option value="">keins</option></select>
|
||||
<div id="ace-box" class="ace-box" hidden>
|
||||
<h3>ACE-Zuordnung <span class="tip" title="Datei-Farbe auf ACE-Platz. Ohne Zuordnung startet der ACE oft nicht."><svg class="ico"><use href="#i-info"/></svg></span></h3>
|
||||
<p class="tiny msg" id="ace-trailer-warn" hidden>Für Auto-Feed fehlen Slicer-Metadaten in der Datei.</p>
|
||||
<p class="tiny" id="ace-trailer-warn" hidden>Mehrfarb ohne Slicer-Trailer — Grotti ergänzt `; referenced_tools` beim Senden.</p>
|
||||
<div id="ace-maps"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -252,13 +252,41 @@ function loadSendMemory() {
|
||||
|
||||
/* ---------- ACE / Spule ---------- */
|
||||
|
||||
function slotLabel(slot) {
|
||||
function spoolAtSlot(host, place) {
|
||||
return spoolsOnHost(host).find((s) => Number(s.ace_slot) === Number(place)) || null;
|
||||
}
|
||||
|
||||
function slotLabel(host, slot) {
|
||||
const place = Number(slot.index) + 1;
|
||||
const box = place <= 4 ? "ACE 1 · " + place : "ACE 2 · " + (place - 4);
|
||||
const spool = spoolAtSlot(host, place);
|
||||
if (spool) {
|
||||
const bits = [box];
|
||||
const kind = spool.material_type || slot.type || "";
|
||||
if (kind) bits.push(kind);
|
||||
if (spool.color) bits.push(spool.color);
|
||||
if (spool.name) bits.push(spool.name);
|
||||
bits.push(grams(spool.remaining_g));
|
||||
return bits.join(" · ");
|
||||
}
|
||||
const kind = slot.type ? " · " + slot.type : "";
|
||||
return box + kind;
|
||||
}
|
||||
|
||||
function slotTitle(host, slot) {
|
||||
const place = Number(slot.index) + 1;
|
||||
const spool = spoolAtSlot(host, place);
|
||||
if (!spool) return slot.type ? String(slot.type) : "";
|
||||
const bits = [];
|
||||
if (spool.brand) bits.push(spool.brand);
|
||||
if (spool.name) bits.push(spool.name);
|
||||
if (spool.material_type) bits.push(spool.material_type);
|
||||
if (spool.color) bits.push(spool.color);
|
||||
bits.push(grams(spool.remaining_g) + " Rest");
|
||||
if (spool.chargen_nr) bits.push(spool.chargen_nr);
|
||||
return bits.join(" · ");
|
||||
}
|
||||
|
||||
function filamentLabel(filament, index) {
|
||||
const kind = filament.type || "Filament";
|
||||
const color = filament.color ? " · " + filament.color : "";
|
||||
@@ -369,7 +397,10 @@ function renderAceMaps(force) {
|
||||
const paints = filePaints(file);
|
||||
box.hidden = false;
|
||||
document.getElementById("options").open = true;
|
||||
if (trailerWarn) trailerWarn.hidden = !!file.ace_trailer;
|
||||
// Mono: Trailer fehlt oft und ist kein Fehler — Grotti setzt ihn beim Senden mit ACE-Map.
|
||||
if (trailerWarn) {
|
||||
trailerWarn.hidden = !!file.ace_trailer || paints.length <= 1;
|
||||
}
|
||||
root.innerHTML = "";
|
||||
chosen.forEach((printer) => {
|
||||
const block = document.createElement("div");
|
||||
@@ -393,10 +424,15 @@ function renderAceMaps(force) {
|
||||
printer.slots.forEach((slot) => {
|
||||
const option = document.createElement("option");
|
||||
option.value = String(slot.index);
|
||||
option.textContent = slotLabel(slot);
|
||||
if (slot.color) option.style.borderLeft = "4px solid " + slot.color;
|
||||
// einfache Vorauswahl: gleiche Sorte, sonst Platz in Reihenfolge
|
||||
if (!select.dataset.picked && filament.type && slot.type && filament.type.toLowerCase() === String(slot.type).toLowerCase()) {
|
||||
option.textContent = slotLabel(printer.host, slot);
|
||||
option.title = slotTitle(printer.host, slot);
|
||||
const spool = spoolAtSlot(printer.host, Number(slot.index) + 1);
|
||||
const hex = (spool && spool.colors && spool.colors[0] && spool.colors[0].hex) || slot.color || "";
|
||||
if (hex) option.style.borderLeft = "4px solid " + hex;
|
||||
const spoolType = (spool && spool.material_type) || slot.type || "";
|
||||
// Vorauswahl: gleiche Sorte (Grotti-Spule bevorzugt), sonst Platz in Reihenfolge
|
||||
if (!select.dataset.picked && filament.type && spoolType
|
||||
&& filament.type.toLowerCase() === String(spoolType).toLowerCase()) {
|
||||
option.selected = true;
|
||||
select.dataset.picked = "1";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user