diff --git a/html/header.html b/html/header.html
index ec7bbfe..5af712f 100644
--- a/html/header.html
+++ b/html/header.html
@@ -6,7 +6,6 @@
diff --git a/html/rfid.js b/html/rfid.js
index 24f81dc..a816aa1 100644
--- a/html/rfid.js
+++ b/html/rfid.js
@@ -244,23 +244,38 @@ function displayAmsData(amsData) {
tray[field] !== 'null'
);
- if (!hasAnyContent) {
- return `
-
-
Tray ${tray.id}
-
Empty
-
-
`;
- }
+ // Bestimme den Anzeigenamen für das Tray
+ const trayDisplayName = (ams.ams_id === 255) ? 'External' : `Tray ${tray.id}`;
// Nur für nicht-leere Trays den Button-HTML erstellen
const buttonHtml = `
`;
+
+ // Nur für nicht-leere Trays den Button-HTML erstellen
+ const outButtonHtml = `
+
+
+ `;
+
+ if (!hasAnyContent) {
+ return `
+
+
${trayDisplayName}
+
+ ${(ams.ams_id === 255 && tray.tray_type === '') ? buttonHtml : ''}
+ Empty
+
+
+
`;
+ }
// Generiere den Type mit Color-Box zusammen
const typeWithColor = tray.tray_type ?
@@ -297,9 +312,6 @@ function displayAmsData(amsData) {
? `
Nozzle Temp: ${tray.nozzle_temp_min}°C - ${tray.nozzle_temp_max}°C
`
: '';
- // Bestimme den Anzeigenamen für das Tray
- const trayDisplayName = (ams.ams_id === 255) ? 'External' : `Tray ${tray.id}`;
-
return `
@@ -308,7 +320,9 @@ function displayAmsData(amsData) {
${typeWithColor}
${trayDetails}
${tempHTML}
+ ${(ams.ams_id === 255 && tray.tray_type !== '') ? outButtonHtml : ''}
+
`;
}).join('');
@@ -332,6 +346,30 @@ function updateSpoolButtons(show) {
});
}
+function handleSpoolOut() {
+ // Erstelle Payload
+ const payload = {
+ type: 'setBambuSpool',
+ payload: {
+ amsId: 255,
+ trayId: 254,
+ color: "FFFFFF",
+ nozzle_temp_min: 0,
+ nozzle_temp_max: 0,
+ type: "",
+ brand: ""
+ }
+ };
+
+ try {
+ socket.send(JSON.stringify(payload));
+ showNotification(`External Spool removed. Pls wait`, true);
+ } catch (error) {
+ console.error("Fehler beim Senden der WebSocket Nachricht:", error);
+ showNotification("Error while sending!", false);
+ }
+}
+
// Neue Funktion zum Behandeln des Spool-In-Klicks
function handleSpoolIn(amsId, trayId) {
// Prüfe WebSocket Verbindung zuerst
@@ -361,13 +399,13 @@ function handleSpoolIn(amsId, trayId) {
// Temperaturwerte extrahieren
let minTemp = "175";
let maxTemp = "275";
-
+
if (Array.isArray(selectedSpool.filament.nozzle_temperature) &&
selectedSpool.filament.nozzle_temperature.length >= 2) {
minTemp = selectedSpool.filament.nozzle_temperature[0];
maxTemp = selectedSpool.filament.nozzle_temperature[1];
}
-
+
// Erstelle Payload
const payload = {
type: 'setBambuSpool',
@@ -390,7 +428,7 @@ function handleSpoolIn(amsId, trayId) {
showNotification(`Spool set in AMS ${amsId} Tray ${trayId}. Pls wait`, true);
} catch (error) {
console.error("Fehler beim Senden der WebSocket Nachricht:", error);
- showNotification("Fehler beim Senden der Daten", false);
+ showNotification("Error while sending", false);
}
}
@@ -566,4 +604,4 @@ function showNotification(message, isSuccess) {
notification.remove();
}, 300);
}, 3000);
-}
\ No newline at end of file
+}
diff --git a/img/IMG_2546.jpeg b/img/IMG_2546.jpeg
new file mode 100644
index 0000000..6c37070
Binary files /dev/null and b/img/IMG_2546.jpeg differ
diff --git a/img/display_1.png b/img/display_1.png
new file mode 100644
index 0000000..b6f4279
Binary files /dev/null and b/img/display_1.png differ
diff --git a/img/display_2.png b/img/display_2.png
new file mode 100644
index 0000000..5e7e793
Binary files /dev/null and b/img/display_2.png differ
diff --git a/img/display_3.png b/img/display_3.png
new file mode 100644
index 0000000..d495c05
Binary files /dev/null and b/img/display_3.png differ
diff --git a/img/display_4.png b/img/display_4.png
new file mode 100644
index 0000000..ad1f329
Binary files /dev/null and b/img/display_4.png differ
diff --git a/img/scale_1.png b/img/scale_1.png
new file mode 100644
index 0000000..222cb1c
Binary files /dev/null and b/img/scale_1.png differ
diff --git a/img/scale_2.png b/img/scale_2.png
new file mode 100644
index 0000000..ac36ad1
Binary files /dev/null and b/img/scale_2.png differ
diff --git a/img/scale_3.png b/img/scale_3.png
new file mode 100644
index 0000000..1b0ccd1
Binary files /dev/null and b/img/scale_3.png differ
diff --git a/img/scale_4.png b/img/scale_4.png
new file mode 100644
index 0000000..fff0ec0
Binary files /dev/null and b/img/scale_4.png differ
diff --git a/img/scale_side.png b/img/scale_side.png
new file mode 100644
index 0000000..66ff0fe
Binary files /dev/null and b/img/scale_side.png differ
diff --git a/img/scale_trans.png b/img/scale_trans.png
new file mode 100644
index 0000000..9418d4c
Binary files /dev/null and b/img/scale_trans.png differ
diff --git a/src/bambu.cpp b/src/bambu.cpp
index 4347e36..96efd19 100644
--- a/src/bambu.cpp
+++ b/src/bambu.cpp
@@ -192,7 +192,7 @@ bool setBambuSpool(String payload) {
int maxTemp = doc["nozzle_temp_max"];
String type = doc["type"].as
();
String brand = doc["brand"].as();
- String tray_info_idx = findFilamentIdx(brand, type);
+ String tray_info_idx = (brand != "" && type != "") ? findFilamentIdx(brand, type) : "";
doc.clear();
@@ -330,7 +330,7 @@ void mqtt_callback(char* topic, byte* payload, unsigned int length) {
//Serial.println();
// Sende die aktualisierten AMS-Daten an alle WebSocket-Clients
- sendAmsData(nullptr);
+ //sendAmsData(nullptr);
// Verarbeite erst die normalen AMS-Daten
for (int i = 0; i < amsArray.size() && i < 16; i++) {
@@ -366,7 +366,7 @@ void mqtt_callback(char* topic, byte* payload, unsigned int length) {
}
// Sende die aktualisierten AMS-Daten
- sendAmsData(nullptr);
+ //sendAmsData(nullptr);
// Erstelle JSON für WebSocket-Clients
JsonDocument wsDoc;