From 204f48f596378d31b0822696ddfda160dd8d95e3 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Mon, 30 Dec 2024 17:48:35 +0100 Subject: [PATCH] Fix Remaining time counter --- marlin2.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/marlin2.cpp b/marlin2.cpp index 0e16b74..73ca218 100644 --- a/marlin2.cpp +++ b/marlin2.cpp @@ -191,14 +191,14 @@ namespace esphome { return; } - //Print Paused - if(MarlinOutput.find("Printer halted") != std::string::npos) { - set_printer_state("PAUSED"); + // //Print Paused + // if(MarlinOutput.find("Printer halted") != std::string::npos) { + // set_printer_state("PAUSED"); - //reset string for next line - MarlinOutput=""; - return; - } + // //reset string for next line + // MarlinOutput=""; + // return; + // } // //Print Stoped if(MarlinOutput.find("Print Aborted") != std::string::npos) { @@ -271,7 +271,7 @@ namespace esphome { *current = round(((d)*24*60*60) + ((h)*60*60) + ((m)*60) + (s)); if(progress != 0.0 && progress != 100.0) { - *remaining = ((100 * *current) / progress); + *remaining = (((100 * *current) / progress) -*current); } return 1;