########################################################################### # # Copyright (c) 2021-2025 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 dg_hd_switches_test.py # # @author (last) Dara Navaei # @date (last) 20-Apr-2022 # @author (original) Dara Navaei # @date (original) 29-Jul-2021 # ############################################################################ from dialin.dg.dialysate_generator import DG from dialin.dg.switches import DGSwitchesName, DGSwitchStatus from dialin.hd.switches import HDSwitchesNames, HDSwitchStatus from dialin.hd.hemodialysis_device import HD from time import sleep def test_hd_switches(): hd = HD(log_level="DEBUG") if hd.cmd_log_in_to_hd(resend=False): print(hd.switches.get_switches_status()) #hd.switches.cmd_hd_switch_status_override(HDSwitchesNames.FRONT_DOOR.value, HDSwitchStatus.ON.value, reset=1) #hd.switches.cmd_hd_switches_data_broadcast_interval_override(100, reset=1) while True: print(hd.switches.get_switches_status()) sleep(1) def test_dg_switches(): dg = DG(log_level="DEBUG") if dg.cmd_log_in_to_dg(resend=False): #print(dg.switches.get_switches_status()) #dg.switches.cmd_dg_switch_status_override(DGSwitchesName.FLUID_DOOR.value, DGSwitchStatus.ON.value) #dg.switches.cmd_dg_switch_status_override(DGSwitchesName.CONCENTRATE_CAP.value, DGSwitchStatus.OFF.value, reset=1) #dg.switches.cmd_dg_switches_data_broadcast_interval_override(100, reset=1)switch while True: print(dg.switches.get_switches_status()) sleep(0.1) if __name__ == "__main__": test_hd_switches() #test_dg_switches()