Reworks graphics of tag reading and some api fixes
Reworks the graphics of the NFC-Tag reading process of spool and location tags. Introduces progress bar for reading process. Also first re-work of the spoolman availability (not fixed completly yet). Also fixes an issue where the API request to spoolman and octoprint was sent in parallel. This now happens sequentially to reduce heap load.
This commit is contained in:
25
src/main.cpp
25
src/main.cpp
@@ -218,19 +218,14 @@ void loop() {
|
||||
lastWeight = weight;
|
||||
|
||||
// Wenn ein Tag mit SM id erkannte wurde und der Waage Counter anspricht an SM Senden
|
||||
if (activeSpoolId != "" && weigthCouterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS) {
|
||||
oledShowIcon("loading");
|
||||
if (activeSpoolId != "" && weigthCouterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_READ_SUCCESS && tagProcessed == false && spoolmanApiState == API_IDLE) {
|
||||
// set the current tag as processed to prevent it beeing processed again
|
||||
tagProcessed = true;
|
||||
|
||||
if (updateSpoolWeight(activeSpoolId, weight))
|
||||
{
|
||||
oledShowIcon("success");
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
weightSend = 1;
|
||||
autoSetToBambuSpoolId = activeSpoolId.toInt();
|
||||
|
||||
if (octoEnabled)
|
||||
{
|
||||
updateSpoolOcto(autoSetToBambuSpoolId);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -238,6 +233,16 @@ void loop() {
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
|
||||
if(sendOctoUpdate && spoolmanApiState == API_IDLE){
|
||||
autoSetToBambuSpoolId = activeSpoolId.toInt();
|
||||
|
||||
if(octoEnabled)
|
||||
{
|
||||
updateSpoolOcto(autoSetToBambuSpoolId);
|
||||
}
|
||||
sendOctoUpdate = false;
|
||||
}
|
||||
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
|
Reference in New Issue
Block a user