Index: dialin/common/msg_ids.py =================================================================== diff -u -r32e628abcbbd3fd70866505d9f2836a6f732ef06 -rce76d3660f4f1054bc4495180248405833364a2a --- dialin/common/msg_ids.py (.../msg_ids.py) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision ce76d3660f4f1054bc4495180248405833364a2a) @@ -449,7 +449,7 @@ MSG_ID_DG_SEND_SCHEDULED_RUNS_RECORD = 0xA03E MSG_ID_DG_FLUID_LEAK_SEND_INTERVAL_OVERRIDE = 0xA03F MSG_ID_DG_FLUID_LEAK_STATE_DETECTOR_OVERRIDE = 0xA040 - MSG_ID_MSG_AVAILABLE_11 = 0xA041 + MSG_ID_DG_RUN_MODE_FILL_FOR_CAL_CHECK = 0xA041 MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE = 0xA042 MSG_ID_DG_FANS_RPM_OVERRIDE = 0xA043 MSG_ID_FLOW_DATA_PUBLISH_INTERVAL_OVERRIDE = 0xA044 Index: dialin/dg/dialysate_fill.py =================================================================== diff -u -r32e628abcbbd3fd70866505d9f2836a6f732ef06 -rce76d3660f4f1054bc4495180248405833364a2a --- dialin/dg/dialysate_fill.py (.../dialysate_fill.py) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) +++ dialin/dg/dialysate_fill.py (.../dialysate_fill.py) (revision ce76d3660f4f1054bc4495180248405833364a2a) @@ -238,3 +238,39 @@ else: self.logger.debug("Timeout!!!!") return False + + def cmd_set_mode_fill_cal_check_state(self, cal_check_state: int) -> int: + """ + Constructs and sends a message to set the mode fill calibration check status. + Constraints: + Must be logged into DG. + + @param cal_check_state: the state (0 = prime, 1 = bicarb check, 2 = acid check) + @return: 1 if successful, zero otherwise + """ + state_string = "None" + payload = integer_to_bytearray(cal_check_state) + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_RUN_MODE_FILL_FOR_CAL_CHECK.value, + payload=payload) + if cal_check_state == 0: + state_string = "Prime" + elif cal_check_state == 1: + state_string = "Bicarb Check" + elif cal_check_state == 2: + state_string = "Acid Check" + + self.logger.debug("Setting the Mode Fill calibration check to {}.".format(state_string)) + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + self.logger.debug("Setting the Mode Fill calibration check to {}.".format(state_string)) + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.debug("Timeout!!!!") + return False Index: tests/dg_nvm_scripts.py =================================================================== diff -u -r32e628abcbbd3fd70866505d9f2836a6f732ef06 -rce76d3660f4f1054bc4495180248405833364a2a --- tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) +++ tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision ce76d3660f4f1054bc4495180248405833364a2a) @@ -49,12 +49,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 you computer. - dg.calibration_record.cmd_get_dg_calibration_record_report() + #dg.calibration_record.cmd_get_dg_calibration_record_report() # 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-06-05-DG-Record.xlsx') + dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2024-02-24-DG-Record.xlsx') # For resetting the calibration record to benign values, use the function below #dg.calibration_record.cmd_reset_dg_calibration_record() @@ -114,12 +114,12 @@ #run_sw_configs_commands() - #run_calibration_commands() + run_calibration_commands() #run_system_commands() #run_usage_info_commands() - run_service_commands() + #run_service_commands() Index: tests/dg_tests.py =================================================================== diff -u -r32e628abcbbd3fd70866505d9f2836a6f732ef06 -rce76d3660f4f1054bc4495180248405833364a2a --- tests/dg_tests.py (.../dg_tests.py) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) +++ tests/dg_tests.py (.../dg_tests.py) (revision ce76d3660f4f1054bc4495180248405833364a2a) @@ -436,7 +436,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) @@ -450,11 +450,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: @@ -743,7 +748,7 @@ # cmd_set_disinfect_ui_screen() - #collect_treatment_data() + collect_treatment_data() #run_ro_permeate_sample() @@ -777,9 +782,3 @@ # 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.blood_leak.cmd_blood_leak_set_embedded_mode_command(EmbModeCommands.D.value) - - while True: - print(hd.blood_leak.blood_leak_emb_mode_cmds[EmbModeCommands.D.name]) - sleep(0.2) - \ No newline at end of file