Closed 3d-gussner closed 9 months ago
@jfestrada Please review this PR.
All values in bytes. Δ Delta to base
Target | ΔFlash | ΔSRAM | Used Flash | Used SRAM | Free Flash | Free SRAM |
---|---|---|---|---|---|---|
MK3S_MULTILANG |
478 | 0 | 247236 | 5656 | 6716 | 2536 |
MK3_MULTILANG |
478 | 0 | 246518 | 5663 | 7434 | 2529 |
I hope to be able to review it today night
I miss this code on the last part of the function __lcdui_print_percent_done__
enableReprint = true;
if(usb_timer.running())
{
enableReprintUSB = true;
}else
{
enableReprintUSB = false;
}
This is the initialization of the reprint variables in order to control the behavior of the Reprint menu action.
I miss this code on the last part of the function lcdui_print_percent_done
enableReprint = true; if(usb_timer.running()) { enableReprintUSB = true; }else { enableReprintUSB = false; }
This is the initialization of the reprint variables in order to control the behavior of the Reprint menu action.
@jfestrada Thanks for the review. I use now the PrinterState
to show the menu. For some reason my last commit wasn't included. See https://github.com/prusa3d/Prusa-Firmware/pull/4510/commits/d9d42a06781977bd19dcf63f929ad90d6640c28f
I miss this code on the last part of the function lcdui_print_percent_done
enableReprint = true; if(usb_timer.running()) { enableReprintUSB = true; }else { enableReprintUSB = false; }
This is the initialization of the reprint variables in order to control the behavior of the Reprint menu action.
@jfestrada Thanks for the review. I use now the
PrinterState
to show the menu. For some reason my last commit wasn't included. See d9d42a0
Ok, I see, then everything should be ready.
@jfestrada Is it okay that we merge this copy of your great PR to reduce the commit numbers? Thanks again for providing the PR.
@jfestrada Is it okay that we merge this copy of your great PR to reduce the commit numbers? Thanks again for providing the PR.
Yes of course, go ahead with the merge!!
@jfestrada While testing few other PrusaLink/OctoPrint related things, I have seen in the octoprint actions documentation that a // action:start
will re-start the last selected file. Also the Reprint
menu of a finished host print should not be shown if the host isn't pining the printer with M79
What do you think of these changes?
--- a/Firmware/messages.cpp
+++ b/Firmware/messages.cpp
-const char MSG_OCTOPRINT_REPRINT[] PROGMEM_N1 = "// action:reprint"; ////
+const char MSG_OCTOPRINT_START[] PROGMEM_N1 = "// action:start"; ////
--- a/Firmware/messages.h
+++ b/Firmware/messages.h
-extern const char MSG_OCTOPRINT_REPRINT[];
+extern const char MSG_OCTOPRINT_START[];
--- a/Firmware/ultralcd.cpp
+++ b/Firmware/ultralcd.cpp
- } else if (GetPrinterState() == PrinterState::HostPrintingFinished) {
+ } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) {
- SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_REPRINT);
+ SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_START);
I tested this with MK404 sim and Octoprint and works well.
With the documentation on my hand I would say that will works out of the box so will be better than deal with a new plugin in order to define the "action". The only concern is about the behavior if you don't have any file selected on octoprint, but that will not happen at least that you restart Octoprint and in that case the printer will reconnect and restart so the reprint menu will disappear. To my mind this change will works and will save some bits.
Yes it will not work if Octoprint restarts as no file is selected.
Still an improvement for a working and stable OctoPrint.
Only requirement we defined for PrusaLink/PrusaConnect is that the printer needs to be "pinged" to enable some host related menus and messages.
So for Octoprint would be a Plugin needed that pings the printer that the host is alive with gcode M79
.
M79
is used to ping the printer:
Set Ready
menu only shown while the M79_timer is runningReprint
of a finished Host print is only shown while the M79_timer is runnig @jfestrada Just tested the change
M79 S"OP"
in after printer connected
a. It sends // action:start
but OctoPrint just ignores itthank you, been waiting for this for a long time, will make operating a print farm much easier.
Cherry picked from https://github.com/prusa3d/Prusa-Firmware/pull/4462 as rebase is a pain and broke things. This PR is a the same than #3071 but using the current repository of my fork of your firmware
Kudos to @jfestrada for the idea and original PR.
To support this functionality I have added a extern bool variable which can be read/set from cmdqueue.cpp and ultralcd.cpp so when the card reader reaches the EOF the variable isPrintFinished will be set to true and the main menu will show the REPRINT option. How do I know which file we need to reprint? All the information needed to perform the reprint was stored on the EEPROM in case of a power panic and the fw recover this information in order to start the print from SD again, so using that information the function reprint_from_eeprom() has been implemented.
Translations:
[X] :czech_republic: same as buddy firmware
[X] :de: same as buddy firmware
[X] :es: same as buddy firmware
[X] :fr: same as buddy firmware
[X] :it: same as buddy firmware
[X] :poland: same as buddy firmware
[X] :netherlands: by @3d-gussner @vintagepc please check Firmware_nl.po
[ ] :croatia: @Prime1910 please check Firmware_hr.po
[x] :hungary: @AttilaSVK please check Firmware_hu.po
[ ] :norway: @OS-kar and @trondkla please check Firmware_no.po
[x] :romania: @leptun and @Hauzman please check Firmware_ro.po
[x] :slovakia: @ingbrzy and @shatter136 please check Firmware_sk.po
[ ] :sweden: @Painkiller56 please check Firmware_sv.po
[X] LCD Reprint menu only shown
M79
timer is running. ASet Ready
will change the PrinterState and hide theReprint
LCD menu