Attempt two at improving the kiln state logic
This commit is contained in:
parent
15daabd98f
commit
15742b07ca
1 changed files with 7 additions and 7 deletions
|
|
@ -97,12 +97,11 @@ def logger(hostname, csvfile, noprofilestats, pidstats, stdout):
|
|||
if kiln_state == 'IDLE':
|
||||
kiln_state = 'RUNNING'
|
||||
prev_kiln_state = 'IDLE'
|
||||
continue
|
||||
|
||||
if msg.get('state') == 'IDLE':
|
||||
if kiln_state == 'RUNNING':
|
||||
kiln_state = 'IDLE'
|
||||
prev_kiln_state = 'RUNNING'
|
||||
continue
|
||||
|
||||
if not noprofilestats:
|
||||
msg['stamp'] = time.time()
|
||||
|
|
@ -141,7 +140,8 @@ 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']
|
||||
if time_rem == -1 or kiln_state == 'IDLE':
|
||||
if time_rem == -1:
|
||||
if kiln_state == 'IDLE':
|
||||
if prev_kiln_state == 'RUNNING':
|
||||
seg.text = f"DONE....TEMP{temp:4.0f}"
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue