Index: tests/dg_tests.py =================================================================== diff -u -r3ecdad046ab67ae41346a44d758de2e314db2e2d -r7a5d111bbe111ee305ab9da5ee85b98beabe20f4 --- tests/dg_tests.py (.../dg_tests.py) (revision 3ecdad046ab67ae41346a44d758de2e314db2e2d) +++ tests/dg_tests.py (.../dg_tests.py) (revision 7a5d111bbe111ee305ab9da5ee85b98beabe20f4) @@ -1,19 +1,20 @@ ########################################################################### # -# Copyright (c) 2022-2023 Diality Inc. - All Rights Reserved. +# Copyright (c) 2022-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 dg_tests.py # # @author (last) Dara Navaei -# @date (last) 17-Jul-2023 +# @date (last) 24-Oct-2024 # @author (original) Dara Navaei # @date (original) 16-Jan-2022 # ############################################################################ import os +import time from dialin.dg.dialysate_generator import DG from dialin.hd.hemodialysis_device import HD @@ -51,6 +52,7 @@ from dialin.common.dg_defs import DGFlushStates, DGHeatDisinfectActiveCoolStates, DGROPermeateSampleStates from dialin.dg.ro_permeate_sample import ROPermeateDispenseMsgStatus from dialin.common.test_config_defs import DGTestConfigOptions, HDTestConfigOptions +from dialin.hd.blood_leak import EmbModeCommands from time import sleep from datetime import datetime import sys @@ -361,8 +363,11 @@ def get_blood_leak_info(): - info = ('Blood_leak_state, {}, Blood_leak_status, {}, ' - .format(hd.blood_leak.get_blood_leak_state(), hd.blood_leak.get_blood_leak_status())) + info = ('Blood_leak_state, {}, Blood_leak_status, {}, Blood_leak_intensity, {}, Blood_leak_detect, {}, ' + 'Blood_leak_int_mv_avg, {}, ' + .format(hd.blood_leak.get_blood_leak_state(), hd.blood_leak.get_blood_leak_status(), + hd.blood_leak.blood_leak_intensity, hd.blood_leak.blood_leak_blood_detect, + hd.blood_leak.blood_leak_intensity_moving_average)) return info @@ -435,7 +440,7 @@ #dg.voltages.cmd_monitored_voltages_broadcast_interval_override(50) #dg.concentrate_pumps.cmd_concentrate_pump_broadcast_interval_override(50) #sleep(1) - + """ dg.test_configs.cmd_set_test_config(DGTestConfigOptions.TEST_CONFIG_MIX_WITH_WATER.value) sleep(0.5) hd.test_configs.cmd_set_test_config(HDTestConfigOptions.TEST_CONFIG_USE_WET_CARTRIDGE.value) @@ -449,11 +454,16 @@ dg.test_configs.cmd_set_test_config(DGTestConfigOptions.TEST_CONFIG_DISABLE_INLET_WATER_TEMP_CHECK.value) sleep(0.5) hd.test_configs.cmd_set_test_config(HDTestConfigOptions.TEST_CONFIG_SKIP_DISINFECT_AND_SERVICE_TX_BLOCKERS.value) - + """ #dg.hd_proxy.cmd_start_stop_dg() #sleep(4) #dg.hd_proxy.cmd_fill() + hd.cmd_hd_set_operation_mode(4) + sleep(1) + dg.hd_proxy.cmd_start_stop_dg() + sleep(1) + dg.dialysate_fill.cmd_set_mode_fill_cal_check_state(2) try: while True: @@ -529,7 +539,8 @@ # dg.heaters.cmd_heaters_broadcast_interval_override(50) # sleep(1) #dg.hd_proxy.cmd_start_stop_dg_heat_disinfect() - dg.hd_proxy.cmd_start_stop_dg_heat_disinfect_active_cool() + #dg.hd_proxy.cmd_start_stop_dg_heat_disinfect_active_cool() + dg.hd_proxy.cmd_start_stop_dg_passive_cool_heat_disinfect() try: while True: @@ -755,9 +766,9 @@ # print(get_dg_valves_states()) # sleep(1) - while True: - print(dg.rtc.get_rtc_epoch(), hd.rtc.get_rtc_epoch()) - sleep(1) + #while True: + # print(dg.rtc.get_rtc_epoch(), hd.rtc.get_rtc_epoch()) + # sleep(1) #ui = HDSimulator() #ui.cmd_send_hd_operation_mode(3, 1) @@ -768,10 +779,18 @@ #hd.ui.cmd_set_ro_only_mode_status(1) - #while True: - # print(dg.switches.dg_switches_status) - # sleep(1) + #hd.blood_leak.cmd_blood_leak_emb_mode_info_cmds_override(EmbModeCommands.I.value, 1000, reset=1) + hd.blood_leak.cmd_blood_leak_intensity_moving_average_override(1100.3, reset=1) - - - + while True: + # print(dg.switches.dg_switches_status) + print(time.time(), get_blood_leak_info()) + sleep(1) + #dg.hd_proxy.cmd_start_stop_dg_heat_disinfect() + #while True: + # print(hd.alarms.get_alarm_state(286), hd.alarms.get_alarm_state(289), dg.alarms.get_alarm_state(286), + # dg.alarms.get_alarm_state(289)) + # sleep(0.5) + #hd.test_configs.cmd_set_test_config(HDTestConfigOptions.TEST_CONFIG_SKIP_DISINFECT_AND_SERVICE_TX_BLOCKERS.value) + #dg.cmd_dg_set_operation_mode(3) + #hd.cmd_hd_set_operation_mode(1)