Updated Prime95 countdown

This commit is contained in:
2Shirt 2019-11-15 13:13:45 -07:00
parent 21a71d0e67
commit 638796cc44
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -1538,6 +1538,11 @@ def run_mprime_test(state, test):
print_log('Starting Prime95')
test.abort_msg = 'If running too hot, press CTRL+c to abort the test'
run_program(['apple-fans', 'max'], check=False)
run_program('touch /tmp/prime.status'.split(), check=False)
with open('/tmp/prime.status', 'w') as f:
f.write(f'{COLORS["YELLOW"]}{test.abort_msg}{COLORS["CLEAR"]}\n')
clear_screen()
countdown_proc = popen_program('tail -f /tmp/prime.status'.split())
tmux_update_pane(
state.panes['Prime95'],
command=['hw-diags-prime95', global_vars['TmpDir']],
@ -1545,7 +1550,7 @@ def run_mprime_test(state, test):
time_limit = MPRIME_LIMIT * 60
try:
for i in range(time_limit):
clear_screen()
#clear_screen()
sec_left = (time_limit - i) % 60
min_left = int( (time_limit - i) / 60)
_status_str = 'Running Prime95 ('
@ -1557,8 +1562,10 @@ def run_mprime_test(state, test):
sec_left,
's' if sec_left != 1 else '')
# Not using print wrappers to avoid flooding the log
print(_status_str)
print('{YELLOW}{msg}{CLEAR}'.format(msg=test.abort_msg, **COLORS))
#print(_status_str)
#print('{YELLOW}{msg}{CLEAR}'.format(msg=test.abort_msg, **COLORS))
with open('/tmp/prime.status', 'a') as f:
f.write(f'\r{_status_str}')
update_sensor_data(test.sensor_data, THERMAL_LIMIT)
# Wait
@ -1583,6 +1590,7 @@ def run_mprime_test(state, test):
run_program(['killall', '-s', 'INT', 'mprime'], check=False)
sleep(1)
tmux_kill_pane(state.panes.pop('Prime95', None))
countdown_proc.kill()
# Get cooldown temp
run_program(['apple-fans', 'auto'], check=False)