Add new logic for the status of kiln to reflect DONE or READY with the current temp.

This commit is contained in:
Charles Descamps 2025-11-22 20:42:55 -07:00
parent e5c6b9886e
commit 75ce5d4fe1

View file

@ -125,11 +125,16 @@ def logger(hostname, csvfile, noprofilestats, pidstats, stdout):
temp = round(msg['temperature'])
# time remaining for the display, calculated for rounded seconds
time_rem = msg['totaltime'] - msg['runtime']
hours = round(time_rem // 3600)
minutes = round((time_rem - (hours * 3600)) // 60)
seconds = round((time_rem - (hours * 3600) - (minutes * 60)))
seg.text = f"{hours:2.0f}-{minutes:2.0f}-{seconds:2.0f}TEMP{temp:4.0f}"
if time_rem == -1 or msg['state'] == "IDLE":
if msg['state'] == "IDLE":
seg.text = f"READY...TEMP{temp:4.0f}"
else:
seg.text = f"DONE....TEMP{temp:4.0f}"
else:
hours = round(time_rem // 3600)
minutes = round((time_rem - (hours * 3600)) // 60)
seconds = round((time_rem - (hours * 3600) - (minutes * 60)))
seg.text = f"{hours:2.0f}-{minutes:2.0f}-{seconds:2.0f}TEMP{temp:4.0f}"
# END ADD TEMP