########################################################################### # # 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 air_trap_levels.py # # @author (last) Sean Nash # @date (last) 24-Sep-2020 # @author (original) Sean Nash # @date (original) 24-Sep-2020 # ############################################################################ import sys sys.path.append("..") from dialin.hd.hemodialysis_device import HD from time import sleep if __name__ == "__main__": # create an HD object called hd hd = HD() sleep(2) #hd.cmd_log_in_to_hd() sleep(1) #hd.air_trap.cmd_air_trap_data_broadcast_interval_override(100) lower = "Air" upper = "Air" while True: if hd.air_trap.get_air_trap_lower_level() == hd.air_trap.AIR_DETECTED_AT_LEVEL: lower = "Air" else: lower = "Liq" if hd.air_trap.get_air_trap_upper_level() == hd.air_trap.AIR_DETECTED_AT_LEVEL: upper = "Air" else: upper = "Liq" print("Lower Level = " + lower + " Upper Level = " + upper) sleep(0.1)