mirror of
https://github.com/suchmememanyskill/CYD-Klipper.git
synced 2026-03-21 05:33:24 +00:00
Retry slicer print time fetch
This commit is contained in:
@@ -123,6 +123,8 @@ void move_printer(const char* axis, float amount, bool relative) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int last_slicer_time_query = -15000;
|
||||||
|
|
||||||
void fetch_printer_data()
|
void fetch_printer_data()
|
||||||
{
|
{
|
||||||
freeze_request_thread();
|
freeze_request_thread();
|
||||||
@@ -298,13 +300,16 @@ void fetch_printer_data()
|
|||||||
|
|
||||||
if (printer.state != printer_state || emit_state_update)
|
if (printer.state != printer_state || emit_state_update)
|
||||||
{
|
{
|
||||||
if (printer_state == PRINTER_STATE_PRINTING){
|
|
||||||
printer.slicer_estimated_print_time_s = get_slicer_time_estimate_s();
|
|
||||||
}
|
|
||||||
|
|
||||||
printer.state = printer_state;
|
printer.state = printer_state;
|
||||||
lv_msg_send(DATA_PRINTER_STATE, &printer);
|
lv_msg_send(DATA_PRINTER_STATE, &printer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (printer.state == PRINTER_STATE_PRINTING && millis() - last_slicer_time_query > 30000 && printer.slicer_estimated_print_time_s <= 0)
|
||||||
|
{
|
||||||
|
delay(10);
|
||||||
|
last_slicer_time_query = millis();
|
||||||
|
printer.slicer_estimated_print_time_s = get_slicer_time_estimate_s();
|
||||||
|
}
|
||||||
|
|
||||||
unfreeze_render_thread();
|
unfreeze_render_thread();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ connection_status_t verify_ip(){
|
|||||||
client.addHeader("X-Api-Key", global_config.klipper_auth);
|
client.addHeader("X-Api-Key", global_config.klipper_auth);
|
||||||
|
|
||||||
httpCode = client.GET();
|
httpCode = client.GET();
|
||||||
Serial.printf("%d %s", httpCode, url.c_str());
|
Serial.printf("%d %s\n", httpCode, url.c_str());
|
||||||
|
|
||||||
if (httpCode == 401)
|
if (httpCode == 401)
|
||||||
return CONNECT_AUTH_REQUIRED;
|
return CONNECT_AUTH_REQUIRED;
|
||||||
|
|||||||
Reference in New Issue
Block a user