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

Additional corrections for 2.1.0 #1426

Merged
merged 5 commits into from
May 26, 2024
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
4 changes: 2 additions & 2 deletions printrun/pronsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import traceback
import re

from appdirs import user_cache_dir, user_config_dir, user_data_dir
from platformdirs import user_cache_dir, user_config_dir, user_data_dir
from serial import SerialException

from . import printcore
Expand Down Expand Up @@ -323,7 +323,7 @@ def promptf(self):
progress = 0.0
specials["progress"] = str(progress)
if self.p.printing or self.sdprinting:
specials["progress_fancy"] = " " + str(progress) + "%"
specials["progress_fancy"] = " " + str(round(progress, 2)) + "%"
else:
specials["progress_fancy"] = ""
specials["red"] = "\033[31m"
Expand Down
18 changes: 11 additions & 7 deletions printrun/pronterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ def about(self, event):
% self.settings.total_filament_used

info.SetDescription(description)
info.SetCopyright('(C) 2011 - 2020')
info.SetCopyright('(C) 2011 - 2024')
info.SetWebSite('https://github.com/kliment/Printrun')

licence = """\
Expand Down Expand Up @@ -1273,12 +1273,16 @@ def statuschecker_inner(self):
status_string += _(" Z: %.3f mm") % self.curlayer
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 separator for G-CODE"
self.p.send_now(printer_progress_string.replace(":", "."))
if len(printer_progress_string) > 25:
logging.info(_("Warning: The print progress message might be too long to be displayed properly"))
# 13 chars for up to 99h est.
if self.p.mainqueue is not None:
# Don't try to calculate the printer_progress_string with a None value of self.p.mainqueue.
# This happens in combination with self.p.queueindex = 0
# We pass the calculation and try it next 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 separator for G-CODE"
self.p.send_now(printer_progress_string.replace(":", "."))
if len(printer_progress_string) > 25:
logging.info(_("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
wx.CallAfter(self.statusbar.SetStatusText, status_string)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ numpy (>= 1.8.2)
pyglet >= 1.1, < 2.0
psutil (>= 2.1)
lxml (>= 2.9.1)
appdirs (>= 1.4.0)
platformdirs
dbus-python >= 1.2.0 ; sys_platform == 'linux'
pyobjc-framework-Cocoa ; sys_platform == 'darwin'
pyreadline3 ; sys_platform == 'win32'