Index: dialin/hd/blood_leak.py =================================================================== diff -u -r9bc00e997e91dab8b404aa877b02ae3d4100d417 -rbddfb595199bfe5d01671d31c218a2f647f6d7d3 --- dialin/hd/blood_leak.py (.../blood_leak.py) (revision 9bc00e997e91dab8b404aa877b02ae3d4100d417) +++ dialin/hd/blood_leak.py (.../blood_leak.py) (revision bddfb595199bfe5d01671d31c218a2f647f6d7d3) @@ -88,6 +88,7 @@ self.blood_leak_status = self.NO_BLOOD_LEAK_DETECTED self.blood_leak_state = BloodLeakStates.BLOOD_LEAK_INIT_STATE.value self.blood_leak_emb_mode_cmds = dict() + self.blood_leak_error_persistent_ctr = 0 for cmd in EmbModeCommands.__members__: # Initialize all the embedded mode commands @@ -122,7 +123,8 @@ else: self.logger.debug("Invalid command!") - @publish(['hd_blood_leak_status_timestamp', 'blood_leak_status', 'blood_leak_state']) + @publish(['hd_blood_leak_status_timestamp', 'blood_leak_status', 'blood_leak_state', + 'blood_leak_error_persistent_ctr']) def _handler_blood_leak_sync(self, message, timestamp=0.0): """ Handles published blood leak status messages. Blood leak status is captured @@ -135,6 +137,8 @@ message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] self.blood_leak_state = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] + self.blood_leak_error_persistent_ctr = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] self.hd_blood_leak_status_timestamp = timestamp def cmd_blood_leak_detector_override(self, detected: int, reset=NO_RESET): Index: tests/dg_nvm_scripts.py =================================================================== diff -u -r12a7cb24fdb8f871aa4da49b859e0fef567255b1 -rbddfb595199bfe5d01671d31c218a2f647f6d7d3 --- tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision 12a7cb24fdb8f871aa4da49b859e0fef567255b1) +++ tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision bddfb595199bfe5d01671d31c218a2f647f6d7d3) @@ -27,12 +27,12 @@ # It creates a folder called DG_NV_Records in the destination that is called # If no address is provided, the default location is one folder above the dialin folder wherever it is installed # in your computer. - #dg.sw_configs.cmd_get_dg_sw_config_record() + dg.sw_configs.cmd_get_dg_sw_config_record() # Use cmd_set_dg_sw_config_record() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - dg.sw_configs.cmd_update_dg_sw_config_record('/home/fw/projects/DG_NV_Records/2023-05-05-DG-SW-CONFIGS-Record.xlsx') + # dg.sw_configs.cmd_update_dg_sw_config_record('/home/fw/projects/DG_NV_Records/2023-05-05-DG-SW-CONFIGS-Record.xlsx') # Use this function to reset the configuration records to all be 0 #dg.sw_configs.cmd_reset_dg_sw_config_record() @@ -54,7 +54,7 @@ # Use cmd_set_dg_calibration_excel_to_fw() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - #dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2023-05-20-DG-Record.xlsx') + #dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2023-06-05-DG-Record.xlsx') # For resetting the calibration record to benign values, use the function below #dg.calibration_record.cmd_reset_dg_calibration_record() Index: tests/dg_tests.py =================================================================== diff -u -r12a7cb24fdb8f871aa4da49b859e0fef567255b1 -rbddfb595199bfe5d01671d31c218a2f647f6d7d3 --- tests/dg_tests.py (.../dg_tests.py) (revision 12a7cb24fdb8f871aa4da49b859e0fef567255b1) +++ tests/dg_tests.py (.../dg_tests.py) (revision bddfb595199bfe5d01671d31c218a2f647f6d7d3) @@ -501,11 +501,61 @@ f.close() +def run_heat_disinfect(): + complete_counter = 1 + address = os.path.join(os.getcwd(), "heat_disinfect.log") + f = open(address, "w") + # 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() + + try: + while True: + disinfect = get_heat_disinfect_mode_info() + drain = get_drain_states_info() + load_cell = get_load_cells_info() + valves = get_dg_valves_states() + ro = get_ro_info() + temp = get_temperature_sensors_info() + heaters = get_heaters_info() + uv = get_uv_reactors_info() + dg_fans = get_dg_fans_info() + hd_fans = get_hd_fans_info() + conc = get_concentrate_pumps_info() + + var = disinfect + load_cell + drain + ro + temp + heaters + uv + dg_fans + hd_fans + valves + conc + '\r' + + print(var) + f.write(var) + sleep(1) + + # If the mode came back to standby or standby solo + # if dg.dg_operation_mode == 3 or dg.dg_operation_mode == 4: + # If it is the first call, stop heat disinfect + # if complete_counter == 1: + # dg.hd_proxy.cmd_start_stop_dg_heat_disinfect(start=False) + + # Write a few more complete states to make sure the complete state items are recorded + # elif complete_counter == 3: + # pass + # f.close() + # break + + # complete_counter += 1 + + except KeyboardInterrupt: + dg.hd_proxy.cmd_start_stop_dg_heat_disinfect(start=False) + sleep(0.2) + dg.hd_proxy.cmd_start_stop_dg_heat_disinfect_active_cool(start=False) + f.close() + + def run_chemical_disinfect(): complete_counter = 1 f = open("/home/fw/projects/dialin/tests/chemical_disinfect.log", "w") #dg.hd_proxy.cmd_start_stop_dg_chemical_disinfect() - #dg.hd_proxy.cmd_start_stop_dg_chemical_disinfect_flush() + dg.hd_proxy.cmd_start_stop_dg_chemical_disinfect_flush() try: while True: @@ -669,7 +719,7 @@ #collect_treatment_data() - #run_ro_permeate_sample() + run_ro_permeate_sample() #collect_hd_treatment() @@ -693,8 +743,8 @@ #hd.ui.cmd_set_ro_only_mode_status(1) - while True: - print(dg.switches.dg_switches_status) - sleep(1) + #while True: + # print(dg.switches.dg_switches_status) + # sleep(1)