Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes printing from (remote) onboard media #2692

Merged
merged 6 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ the following options must be enabled in Marlin firmware.
`BABYSTEPPING` (in Configuration_adv.h)<br>
`AUTO_REPORT_TEMPERATURES` (in Configuration_adv.h)<br>
`AUTO_REPORT_POSITION` (in Configuration_adv.h)<br>
`EXTENDED_CAPABILITIES_REPORT` (in Configuration_adv.h)<br>
`M115_GEOMETRY_REPORT` (in Configuration_adv.h)<br>
`M114_DETAIL` (in Configuration_adv.h)<br>
`EXTENDED_CAPABILITIES_REPORT` (in Configuration_adv.h)<br>
`REPORT_FAN_CHANGE` (in Configuration_adv.h)<br>

**Options to support printing from onboard media:**
Expand All @@ -138,6 +138,12 @@ the following options must be enabled in Marlin firmware.
`HOST_PROMPT_SUPPORT` (in Configuration_adv.h)<br>
`HOST_STATUS_NOTIFICATIONS` (in Configuration_adv.h)<br>

**Options to support M73 with host:**

`Options to support dialog with host` (as pre requisite)<br>
`SET_PROGRESS_MANUALLY` (in Configuration_adv.h)<br>
`M73_REPORT` (in Configuration_adv.h)<br>

**Options to support M600 with host & (Un)Load menu:**

`Options to support dialog with host` (as pre requisite)<br>
Expand Down
49 changes: 40 additions & 9 deletions TFT/src/User/API/parseACK.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,29 +649,60 @@ void parseACK(void)
// (print from remote onboard media) and open Printing menu
startPrintingFromRemoteHost(file_name);
}
else if (infoMachineSettings.onboardSD == ENABLED && WITHIN(infoFile.source, FS_ONBOARD_MEDIA, FS_ONBOARD_MEDIA_REMOTE))
// parse and store M24, M27 and M73, if printing from (remote) onboard media
else if (infoMachineSettings.onboardSD == ENABLED && WITHIN(infoFile.source, FS_ONBOARD_MEDIA, FS_ONBOARD_MEDIA_REMOTE) &&
(ack_starts_with("Done printing file") || ack_seen("SD printing") || ack_starts_with("echo: M73")))
{
// parse and store M27
if (ack_seen("SD printing")) // received "SD printing byte" or "Not SD printing"
// NOTE FOR "M73": Required "SET_PROGRESS_MANUALLY" and "M73_REPORT" settings in Marlin

// parse and store M24, received "Done printing file" (printing from (remote) onboard media completed)
if (ack_starts_with("Done"))
{
endPrint();
}
// parse and store M27, received "SD printing byte" or "Not SD printing"
else if (ack_seen("SD"))
{
if (infoHost.status == HOST_STATUS_RESUMING)
setPrintResume(HOST_STATUS_PRINTING);

if (infoHost.status == HOST_STATUS_PAUSING)
else if (infoHost.status == HOST_STATUS_PAUSING)
setPrintPause(HOST_STATUS_PAUSED, PAUSE_EXTERNAL);

if (infoHost.status == HOST_STATUS_PRINTING)
{
if (ack_continue_seen("byte")) // received "SD printing byte"
{
// parse file data progress.
// Format: "SD printing byte <XXXX>/<YYYY>" (e.g. "SD printing byte 123/12345")
//
setPrintProgressData(ack_value(), ack_second_value());
}
else // received "Not SD printing"
{
setPrintAbort();
}
}
}
// parse and store M24, printing from (remote) onboard media completed
else if (ack_seen("Done printing file")) // if printing from (remote) onboard media
// parse and store M73
else
{
endPrint();
// parse progress percentage and remaining time.
// Format: "M73 Progress: <XX>%; Time left: <YY>m;" (e.g. "M73 Progress: 40%; Time left: 2m;")

if (ack_seen("Progress:"))
{
setPrintProgressSource(PROG_SLICER);
setPrintProgressPercentage(ack_value());
}

if (ack_seen("Time left:"))
{
setPrintRemainingTime(ack_value() * 60);
setTimeFromSlicer(true); // disable parsing remaning time from gcode comments

if (getPrintProgressSource() < PROG_TIME && infoSettings.prog_source == 1)
setPrintProgressSource(PROG_TIME);
}
}
}

Expand Down Expand Up @@ -1210,7 +1241,7 @@ void parseACK(void)
{
infoMachineSettings.babyStepping = ack_value();
}
else if (ack_continue_seen("BUILD_PERCENT:")) // M73 support. Required "LCD_SET_PROGRESS_MANUALLY" in Marlin
else if (ack_continue_seen("BUILD_PERCENT:")) // M73 support. Required "SET_PROGRESS_MANUALLY" in Marlin
{
infoMachineSettings.buildPercent = ack_value();
}
Expand Down
7 changes: 6 additions & 1 deletion TFT/src/User/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
# BABYSTEPPING (in Configuration_adv.h)
# AUTO_REPORT_TEMPERATURES (in Configuration_adv.h)
# AUTO_REPORT_POSITION (in Configuration_adv.h)
# EXTENDED_CAPABILITIES_REPORT (in Configuration_adv.h)
# M115_GEOMETRY_REPORT (in Configuration_adv.h)
# M114_DETAIL (in Configuration_adv.h)
# EXTENDED_CAPABILITIES_REPORT (in Configuration_adv.h)
# REPORT_FAN_CHANGE (in Configuration_adv.h)
#
# Options to support printing from onboard media:
Expand All @@ -59,6 +59,11 @@
# HOST_PROMPT_SUPPORT (in Configuration_adv.h)
# HOST_STATUS_NOTIFICATIONS (in Configuration_adv.h)
#
# Options to support M73 with host:
# Options to support dialog with host (as pre requisite)
# SET_PROGRESS_MANUALLY (in Configuration_adv.h)
# M73_REPORT (in Configuration_adv.h)
#
# Options to support M600 with host & (Un)Load menu:
# Options to support dialog with host (as pre requisite)
# NOZZLE_PARK_FEATURE (in Configuration.h)
Expand Down