mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Update DisplayInfoOnLCD.py
Add a line below the ";TIME:" line to convert "seconds" to Hours:Minutes
This commit is contained in:
parent
c2a541f5e1
commit
4d5e4ce3c5
1 changed files with 14 additions and 9 deletions
|
@ -218,16 +218,21 @@ class DisplayInfoOnLCD(Script):
|
|||
for line in lines:
|
||||
if ";TIME:" in line:
|
||||
tindex = lines.index(line)
|
||||
print_time = int(line.split(":")[1])
|
||||
print_time = print_time*speed_factor
|
||||
cura_time = int(line.split(":")[1])
|
||||
print_time = cura_time*speed_factor
|
||||
hhh = print_time/3600
|
||||
hr = round(hhh // 1)
|
||||
mmm = round((hhh % 1) * 60)
|
||||
orig_hhh = cura_time/3600
|
||||
orig_hr = round(orig_hhh // 1)
|
||||
orig_mmm = round((orig_hhh % 1) * 60)
|
||||
if add_m118_line: lines.insert(tindex+1,"M118 Adjusted Print Time " + str(hr) + "hr " + str(mmm) + "min")
|
||||
lines.insert(tindex+1,"M117 ET " + str(hr) + "hr " + str(mmm) + "min")
|
||||
# This line goes in to convert seconds to hours and minutes
|
||||
lines.insert(tindex+1, f";Cura Time: {orig_hr}hr {orig_mmm}min")
|
||||
data[0] = "\n".join(lines)
|
||||
data[len(data)-1] += "M117 Orig Est " + str(hr) + "hr " + str(mmm) + "min\n"
|
||||
if add_m118_line: data[len(data)-1] += "M118 Orig Est w/FudgeFactor at " + str(speed_factor * 100) + "% was " + str(hr) + "hr " + str(mmm) + "min\n"
|
||||
data[len(data)-1] += "M117 Orig Cura Est " + str(orig_hr) + "hr " + str(orig_mmm) + "min\n"
|
||||
if add_m118_line: data[len(data)-1] += "M118 Est w/FudgeFactor " + str(speed_factor * 100) + "% was " + str(hr) + "hr " + str(mmm) + "min\n"
|
||||
if not display_total_layers or not display_remaining_time:
|
||||
base_display_text = "layer "
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue