Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/WUI/link_content/basic_gets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ JsonResult get_job_octoprint(size_t resume_point, JsonOutput &output) {
if (vars.time_to_end != TIME_TO_END_INVALID) {
JSON_FIELD_INT("printTimeLeft", vars.time_to_end) JSON_COMMA;
}
if (vars.time_to_pause != TIME_TO_END_INVALID) {
JSON_FIELD_INT("filament_change_in", time_to_pause) JSON_COMMA;
}
JSON_FIELD_FFIXED("completion", ((float)vars.sd_percent_done / 100.0f), 2) JSON_COMMA;
JSON_FIELD_INT("printTime", vars.print_duration);
JSON_OBJ_END;
Expand All @@ -375,6 +378,7 @@ JsonResult get_job_octoprint(size_t resume_point, JsonOutput &output) {

json::JsonResult get_job_v1(size_t resume_point, json::JsonOutput &output) {
uint32_t time_to_end = marlin_vars().time_to_end;
uint32_t time_to_pause = marlin_vars().time_to_pause;
const char *state = "ERROR";
auto link_state = printer_state::get_state(false);
switch (link_state) {
Expand Down Expand Up @@ -423,6 +427,9 @@ json::JsonResult get_job_v1(size_t resume_point, json::JsonOutput &output) {
if (time_to_end != TIME_TO_END_INVALID) {
JSON_FIELD_INT("time_remaining", time_to_end) JSON_COMMA;
}
if (time_to_pause != TIME_TO_END_INVALID) {
JSON_FIELD_INT("filament_change_in", time_to_pause) JSON_COMMA;
}
JSON_FIELD_INT("time_printing", marlin_vars().print_duration) JSON_COMMA;
JSON_FIELD_OBJ("file");
JSON_FIELD_OBJ("refs");
Expand Down