From 27f4575bb4dd3e9686ac61a4952d55112159e95c Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Wed, 12 Oct 2016 20:39:21 +0200 Subject: [PATCH 1/9] added display print progress on printer lcd feature+ --- printrun/pronterface.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index 5ec1f3a2e..5c97fba5e 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -114,6 +114,9 @@ def get_specific_widget(self, parent): class PronterWindow(MainWindow, pronsole.pronsole): _fgcode = None + display_progress_on_printer = True + printer_progress_time = time.time() + printer_progress_update_interval = 10 def _get_fgcode(self): return self._fgcode @@ -393,7 +396,7 @@ def do_settemp(self, l = ""): f = float(l) if f >= 0: if self.p.online: - self.p.send_now("M104 S" + l) + self.p.send_now("M104 S" + l) self self.log(_("Setting hotend temperature to %f degrees Celsius.") % f) self.sethotendgui(f) else: @@ -1007,6 +1010,14 @@ def statuschecker_inner(self): status_string += _(" Est: %s of %s remaining | ") % (format_duration(secondsremain), format_duration(secondsestimate)) status_string += _(" Z: %.3f mm") % self.curlayer + if self.display_progress_on_printer and time.time() - self.printer_progress_time >= self.printer_progress_update_interval: + self.printer_progress_time = time.time() + printer_progress_string = "M117 " + str(round(100 * float(self.p.queueindex) / len(self.p.mainqueue), 2)) + "% Est " + format_duration(secondsremain) + #":" seems to be some kind of seperator for G-CODE" + self.p.send_now(printer_progress_string.replace(":", ".")) + print("The progress should be updated on the printer now: " + printer_progress_string) + print("M117 %04.2f%% Est: %s") % (100 * float(self.p.queueindex) / len(self.p.mainqueue),format_duration(secondsremain)) + #13 chars for up to 99h est. elif self.loading_gcode: status_string = self.loading_gcode_message wx.CallAfter(self.statusbar.SetStatusText, status_string) From a7f747515e8bf310c0369efde3d85f957d162d8b Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Wed, 12 Oct 2016 20:51:46 +0200 Subject: [PATCH 2/9] fixed a typo --- printrun/pronterface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index 5c97fba5e..9d5ccdcf0 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -396,7 +396,7 @@ def do_settemp(self, l = ""): f = float(l) if f >= 0: if self.p.online: - self.p.send_now("M104 S" + l) self + self.p.send_now("M104 S" + l) self.log(_("Setting hotend temperature to %f degrees Celsius.") % f) self.sethotendgui(f) else: From b4ec87ff8c977050b32e9f758c9f042ff87197ff Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Wed, 12 Oct 2016 20:53:13 +0200 Subject: [PATCH 3/9] removed duplication in debug prining --- printrun/pronterface.py | 1 - 1 file changed, 1 deletion(-) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index 9d5ccdcf0..4e619a4bf 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -1016,7 +1016,6 @@ def statuschecker_inner(self): #":" seems to be some kind of seperator for G-CODE" self.p.send_now(printer_progress_string.replace(":", ".")) print("The progress should be updated on the printer now: " + printer_progress_string) - print("M117 %04.2f%% Est: %s") % (100 * float(self.p.queueindex) / len(self.p.mainqueue),format_duration(secondsremain)) #13 chars for up to 99h est. elif self.loading_gcode: status_string = self.loading_gcode_message From c447373d12b3a3939eedb1b0f558b7fc21565385 Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Wed, 12 Oct 2016 20:56:19 +0200 Subject: [PATCH 4/9] added warning if printed string is longer then 20 chars --- printrun/pronterface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index 4e619a4bf..d1d3f7743 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -1016,6 +1016,8 @@ def statuschecker_inner(self): #":" seems to be some kind of seperator for G-CODE" self.p.send_now(printer_progress_string.replace(":", ".")) print("The progress should be updated on the printer now: " + printer_progress_string) + if len(printer_progress_string) > 25: + print("Warning: The print progress message might be too long to be displayed properly") #13 chars for up to 99h est. elif self.loading_gcode: status_string = self.loading_gcode_message From 7265266a0f892248c81a44641495d2401ebaa31e Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Mon, 31 Oct 2016 17:43:04 +0100 Subject: [PATCH 5/9] added finished, paused and resumed status displaying --- printrun/pronterface.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index d1d3f7743..d0644054d 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -1207,6 +1207,10 @@ def endupload(self): def pause(self, event = None): if not self.paused: self.log(_("Print paused at: %s") % format_time(time.time())) + if self.display_progress_on_printer: + printer_progress_string = "M117 PausedInPronterface" + self.p.send_now(printer_progress_string) + print("The status should be updated on the printer now: " + printer_progress_string) if self.sdprinting: self.p.send_now("M25") else: @@ -1221,6 +1225,10 @@ def pause(self, event = None): wx.CallAfter(self.toolbarsizer.Layout) else: self.log(_("Resuming.")) + if self.display_progress_on_printer: + printer_progress_string = "M117 Resuming" + self.p.send_now(printer_progress_string) + print("The status should be updated on the printer now: " + printer_progress_string) self.paused = False if self.sdprinting: self.p.send_now("M24") @@ -1551,6 +1559,10 @@ def endcb(self): pronsole.pronsole.endcb(self) if self.p.queueindex == 0: self.p.runSmallScript(self.endScript) + if self.display_progress_on_printer: + printer_progress_string = "M117 Finished Print" + self.p.send_now(printer_progress_string) + print("The status should be updated on the printer now: " + printer_progress_string) wx.CallAfter(self.pausebtn.Disable) wx.CallAfter(self.printbtn.SetLabel, _("Print")) wx.CallAfter(self.toolbarsizer.Layout) From e89a14edfdab84f65a28df4f39028fcb83c55155 Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Wed, 28 Dec 2016 00:55:45 +0100 Subject: [PATCH 6/9] removed debugging notes --- printrun/pronterface.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index d0644054d..82d530e59 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -1210,7 +1210,6 @@ def pause(self, event = None): if self.display_progress_on_printer: printer_progress_string = "M117 PausedInPronterface" self.p.send_now(printer_progress_string) - print("The status should be updated on the printer now: " + printer_progress_string) if self.sdprinting: self.p.send_now("M25") else: @@ -1228,7 +1227,6 @@ def pause(self, event = None): if self.display_progress_on_printer: printer_progress_string = "M117 Resuming" self.p.send_now(printer_progress_string) - print("The status should be updated on the printer now: " + printer_progress_string) self.paused = False if self.sdprinting: self.p.send_now("M24") @@ -1562,7 +1560,6 @@ def endcb(self): if self.display_progress_on_printer: printer_progress_string = "M117 Finished Print" self.p.send_now(printer_progress_string) - print("The status should be updated on the printer now: " + printer_progress_string) wx.CallAfter(self.pausebtn.Disable) wx.CallAfter(self.printbtn.SetLabel, _("Print")) wx.CallAfter(self.toolbarsizer.Layout) From f6979254bcdae649014869b62499df8308ebe706 Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Wed, 28 Dec 2016 01:33:22 +0100 Subject: [PATCH 7/9] added and implemented options checkbox (under printer settings) --- printrun/pronterface.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index 82d530e59..dea33ac94 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -114,7 +114,6 @@ def get_specific_widget(self, parent): class PronterWindow(MainWindow, pronsole.pronsole): _fgcode = None - display_progress_on_printer = True printer_progress_time = time.time() printer_progress_update_interval = 10 @@ -850,6 +849,7 @@ def _add_settings(self, size): self.settings._add(BooleanSetting("circular_bed", False, _("Circular build platform"), _("Draw a circular (or oval) build platform instead of a rectangular one"), "Printer"), self.update_bed_viz) self.settings._add(SpinSetting("extruders", 0, 1, 5, _("Extruders count"), _("Number of extruders"), "Printer")) self.settings._add(BooleanSetting("clamp_jogging", False, _("Clamp manual moves"), _("Prevent manual moves from leaving the specified build dimensions"), "Printer")) + self.settings._add(BooleanSetting("settings.display_progress_on_printer", False, _("Display progress on printer"), _("Show progress on printers display (sent via M117, might not be supported by all printers)"), "Printer")) self.settings._add(ComboSetting("uimode", _("Standard"), [_("Standard"), _("Compact"), _("Tabbed"), _("Tabbed with platers")], _("Interface mode"), _("Standard interface is a one-page, three columns layout with controls/visualization/log\nCompact mode is a one-page, two columns layout with controls + log/visualization\nTabbed mode is a two-pages mode, where the first page shows controls and the second one shows visualization and log.\nTabbed with platers mode is the same as Tabbed, but with two extra pages for the STL and G-Code platers."), "UI"), self.reload_ui) self.settings._add(ComboSetting("controlsmode", "Standard", ["Standard", "Mini"], _("Controls mode"), _("Standard controls include all controls needed for printer setup and calibration, while Mini controls are limited to the ones needed for daily printing"), "UI"), self.reload_ui) self.settings._add(BooleanSetting("slic3rintegration", False, _("Enable Slic3r integration"), _("Add a menu to select Slic3r profiles directly from Pronterface"), "UI"), self.reload_ui) @@ -1010,7 +1010,7 @@ def statuschecker_inner(self): status_string += _(" Est: %s of %s remaining | ") % (format_duration(secondsremain), format_duration(secondsestimate)) status_string += _(" Z: %.3f mm") % self.curlayer - if self.display_progress_on_printer and time.time() - self.printer_progress_time >= self.printer_progress_update_interval: + if self.settings.display_progress_on_printer and time.time() - self.printer_progress_time >= self.printer_progress_update_interval: self.printer_progress_time = time.time() printer_progress_string = "M117 " + str(round(100 * float(self.p.queueindex) / len(self.p.mainqueue), 2)) + "% Est " + format_duration(secondsremain) #":" seems to be some kind of seperator for G-CODE" @@ -1207,7 +1207,7 @@ def endupload(self): def pause(self, event = None): if not self.paused: self.log(_("Print paused at: %s") % format_time(time.time())) - if self.display_progress_on_printer: + if self.settings.display_progress_on_printer: printer_progress_string = "M117 PausedInPronterface" self.p.send_now(printer_progress_string) if self.sdprinting: @@ -1224,7 +1224,7 @@ def pause(self, event = None): wx.CallAfter(self.toolbarsizer.Layout) else: self.log(_("Resuming.")) - if self.display_progress_on_printer: + if self.settings.display_progress_on_printer: printer_progress_string = "M117 Resuming" self.p.send_now(printer_progress_string) self.paused = False @@ -1557,7 +1557,7 @@ def endcb(self): pronsole.pronsole.endcb(self) if self.p.queueindex == 0: self.p.runSmallScript(self.endScript) - if self.display_progress_on_printer: + if self.settings.display_progress_on_printer: printer_progress_string = "M117 Finished Print" self.p.send_now(printer_progress_string) wx.CallAfter(self.pausebtn.Disable) From aa2317663413e820221d1dc9cca98ff71d297173 Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Wed, 28 Dec 2016 01:47:51 +0100 Subject: [PATCH 8/9] added and implemented printer progress update interval option --- printrun/pronterface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index dea33ac94..6749bf749 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -115,7 +115,6 @@ class PronterWindow(MainWindow, pronsole.pronsole): _fgcode = None printer_progress_time = time.time() - printer_progress_update_interval = 10 def _get_fgcode(self): return self._fgcode @@ -850,6 +849,7 @@ def _add_settings(self, size): self.settings._add(SpinSetting("extruders", 0, 1, 5, _("Extruders count"), _("Number of extruders"), "Printer")) self.settings._add(BooleanSetting("clamp_jogging", False, _("Clamp manual moves"), _("Prevent manual moves from leaving the specified build dimensions"), "Printer")) self.settings._add(BooleanSetting("settings.display_progress_on_printer", False, _("Display progress on printer"), _("Show progress on printers display (sent via M117, might not be supported by all printers)"), "Printer")) + self.settings._add(SpinSetting("printer_progress_update_interval", 10., 0, 120, _("Printer progress update interval"), _("Interval in which pronterface sends the progress to the printer if enabled, in seconds"), "Printer")) self.settings._add(ComboSetting("uimode", _("Standard"), [_("Standard"), _("Compact"), _("Tabbed"), _("Tabbed with platers")], _("Interface mode"), _("Standard interface is a one-page, three columns layout with controls/visualization/log\nCompact mode is a one-page, two columns layout with controls + log/visualization\nTabbed mode is a two-pages mode, where the first page shows controls and the second one shows visualization and log.\nTabbed with platers mode is the same as Tabbed, but with two extra pages for the STL and G-Code platers."), "UI"), self.reload_ui) self.settings._add(ComboSetting("controlsmode", "Standard", ["Standard", "Mini"], _("Controls mode"), _("Standard controls include all controls needed for printer setup and calibration, while Mini controls are limited to the ones needed for daily printing"), "UI"), self.reload_ui) self.settings._add(BooleanSetting("slic3rintegration", False, _("Enable Slic3r integration"), _("Add a menu to select Slic3r profiles directly from Pronterface"), "UI"), self.reload_ui) @@ -1010,7 +1010,7 @@ def statuschecker_inner(self): status_string += _(" Est: %s of %s remaining | ") % (format_duration(secondsremain), format_duration(secondsestimate)) status_string += _(" Z: %.3f mm") % self.curlayer - if self.settings.display_progress_on_printer and time.time() - self.printer_progress_time >= self.printer_progress_update_interval: + if self.settings.display_progress_on_printer and time.time() - self.printer_progress_time >= self.settings.printer_progress_update_interval: self.printer_progress_time = time.time() printer_progress_string = "M117 " + str(round(100 * float(self.p.queueindex) / len(self.p.mainqueue), 2)) + "% Est " + format_duration(secondsremain) #":" seems to be some kind of seperator for G-CODE" From 04440d14f1a8a33a07bd06d84c87b5573de98799 Mon Sep 17 00:00:00 2001 From: SparkyCola Date: Thu, 29 Dec 2016 06:46:32 +0100 Subject: [PATCH 9/9] fixed bug --- printrun/pronterface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printrun/pronterface.py b/printrun/pronterface.py index 6749bf749..3bcbac79a 100644 --- a/printrun/pronterface.py +++ b/printrun/pronterface.py @@ -848,7 +848,7 @@ def _add_settings(self, size): self.settings._add(BooleanSetting("circular_bed", False, _("Circular build platform"), _("Draw a circular (or oval) build platform instead of a rectangular one"), "Printer"), self.update_bed_viz) self.settings._add(SpinSetting("extruders", 0, 1, 5, _("Extruders count"), _("Number of extruders"), "Printer")) self.settings._add(BooleanSetting("clamp_jogging", False, _("Clamp manual moves"), _("Prevent manual moves from leaving the specified build dimensions"), "Printer")) - self.settings._add(BooleanSetting("settings.display_progress_on_printer", False, _("Display progress on printer"), _("Show progress on printers display (sent via M117, might not be supported by all printers)"), "Printer")) + self.settings._add(BooleanSetting("display_progress_on_printer", False, _("Display progress on printer"), _("Show progress on printers display (sent via M117, might not be supported by all printers)"), "Printer")) self.settings._add(SpinSetting("printer_progress_update_interval", 10., 0, 120, _("Printer progress update interval"), _("Interval in which pronterface sends the progress to the printer if enabled, in seconds"), "Printer")) self.settings._add(ComboSetting("uimode", _("Standard"), [_("Standard"), _("Compact"), _("Tabbed"), _("Tabbed with platers")], _("Interface mode"), _("Standard interface is a one-page, three columns layout with controls/visualization/log\nCompact mode is a one-page, two columns layout with controls + log/visualization\nTabbed mode is a two-pages mode, where the first page shows controls and the second one shows visualization and log.\nTabbed with platers mode is the same as Tabbed, but with two extra pages for the STL and G-Code platers."), "UI"), self.reload_ui) self.settings._add(ComboSetting("controlsmode", "Standard", ["Standard", "Mini"], _("Controls mode"), _("Standard controls include all controls needed for printer setup and calibration, while Mini controls are limited to the ones needed for daily printing"), "UI"), self.reload_ui)