0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-02-18 07:10:58 +00:00

sv06p - get progress status from core marlin

This commit is contained in:
saddfox 2024-05-26 11:59:16 +02:00
parent 25b9bb35ab
commit 12b47b1b0a

View file

@ -55,7 +55,7 @@ RTS rts;
#include "../../feature/tmc_util.h"
#include "../../gcode/queue.h"
#include "../../gcode/gcode.h"
//#include "../marlinui.h"
#include "../marlinui.h"
//#include "../utf8.h"
#include "../../libs/BL24CXX.h"
@ -118,7 +118,7 @@ char commandbuf[30];
static SovolPage change_page_number = ID_Startup;
uint16_t remain_time = 0;
uint32_t remain_time = 0;
static bool last_card_insert_st;
bool card_insert_st;
@ -1530,7 +1530,7 @@ void RTS::handleData() {
updateFan0();
job_percent = card.percentDone() + 1;
job_percent = ui.get_progress_percent();
if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP);
sendData(uint8_t(card.percentDone()), PRINT_PROCESS_VP);
@ -1626,13 +1626,13 @@ void RTS::onIdle() {
if (card.isPrinting() && (last_cardpercentValue != card.percentDone())) {
if (card.percentDone() > 0) {
job_percent = card.percentDone();
job_percent = ui.get_progress_percent();
if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP);
// Estimate remaining time every 20 seconds
static millis_t next_remain_time_update = 0;
if (ELAPSED(ms, next_remain_time_update)) {
if (thermalManager.degHotend(0) >= thermalManager.degTargetHotend(0) - 5) {
remain_time = elapsed.value / (job_percent * 0.01f) - elapsed.value;
remain_time = ui.get_remaining_time();
next_remain_time_update += 20 * 1000UL;
sendData(remain_time / 3600, PRINT_SURPLUS_TIME_HOUR_VP);
sendData((remain_time % 3600) / 60, PRINT_SURPLUS_TIME_MIN_VP);