Index: tests/test_hd_valves.py =================================================================== diff -u -r0035249fd22540886ba093c4e7dc72f9ba8c8353 -r32e628abcbbd3fd70866505d9f2836a6f732ef06 --- tests/test_hd_valves.py (.../test_hd_valves.py) (revision 0035249fd22540886ba093c4e7dc72f9ba8c8353) +++ tests/test_hd_valves.py (.../test_hd_valves.py) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) @@ -1,16 +1,16 @@ ########################################################################### # -# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # -# @file test_hd_valves.py +# @file test_hd_valves.py # -# @author (last) Sean Nash -# @date (last) 15-Oct-2020 -# @author (original) Sean Nash -# @date (original) 15-Oct-2020 +# @author (last) Dara Navaei +# @date (last) 25-Apr-2023 +# @author (original) Sean Nash +# @date (original) 15-Oct-2020 # ############################################################################ @@ -19,18 +19,31 @@ from dialin.hd.hemodialysis_device import HD from dialin.hd.valves import ValvesEnum from time import sleep +import os if __name__ == "__main__": # create an HD object called hd hd = HD() hd.cmd_log_in_to_hd() - hd.valves.cmd_hd_valves_broadcast_interval_override(100) + + address = os.path.join(os.getcwd(), "DVT-006-valves.log") + f = open(address, "w") + + hd.valves.cmd_hd_valves_broadcast_interval_override(50) sleep(1) - hd.valves.cmd_home_hd_valve(ValvesEnum.VBV.value) + #hd.valves.cmd_home_hd_valve(ValvesEnum.VDI.value) - print(hd.valves.valves_status[ValvesEnum.VDI.name]) + #hd.cmd_hd_set_operation_mode(2) + #sleep(1) - """" + while True: + var = str(hd.valves.valves_status) + '\r' + print(var) + f.write(var) + sleep(0.5) + + + """ # print params every second for a while while True: sleep(0.100) @@ -60,4 +73,5 @@ hd.valves.valves_status[ValvesEnum.VBV.name]['Current']) exit(1) - """ \ No newline at end of file + """ +