Index: dialin/common/msg_ids.py =================================================================== diff -u -rbff28676dd855ea33707bbb26a624abc94aebdf0 -r248afd4f09cc4ee8b6cc3f042256e43044dfc65f --- dialin/common/msg_ids.py (.../msg_ids.py) (revision bff28676dd855ea33707bbb26a624abc94aebdf0) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision 248afd4f09cc4ee8b6cc3f042256e43044dfc65f) @@ -63,7 +63,7 @@ MSG_ID_DG_RESERVOIRS_DATA = 0x28 MSG_ID_DG_SAMPLE_WATER_CMD = 0x29 MSG_ID_DG_VALVES_STATES = 0x2A - MSG_ID_DG_START_STOP_TRIMMER_HEATER_CMD = 0x2B + MSG_ID_HD_START_STOP_TRIMMER_HEATER_CMD = 0x2B MSG_ID_DG_HEATERS_DATA = 0x2C MSG_ID_DG_TEMPERATURE_DATA = 0x2D MSG_ID_USER_UF_SETTINGS_CHANGE_CONFIRMATION_RESPONSE = 0x2E @@ -234,7 +234,7 @@ MSG_ID_PRESSURE_VENOUS_OVERRIDE = 0x8018 MSG_ID_OCCLUSION_BLOOD_PUMP_OVERRIDE = 0x8019 MSG_ID_BLOOD_PUMP_ROTOR_COUNT_OVERRIDE = 0x801A - MSG_ID_SET_ARTERIAL_PRESSURE_OFFSET = 0x801B + MSG_ID____AVAILABLE_11 = 0x801B MSG_ID_PRES_OCCL_SEND_INTERVAL_OVERRIDE = 0x801C MSG_ID_SET_RTC_DATE_TIME = 0x801D MSG_ID_DIAL_OUT_FLOW_SEND_INTERVAL_OVERRIDE = 0x801E @@ -414,7 +414,7 @@ MSG_ID_DG_DRAIN_PUMP_MEASURED_RPM_OVERRIDE = 0xA046 MSG_ID_DG_SUPER_CLEAR_ALARMS_CMD = 0xA047 MSG_ID_DG_ALARM_INFO_SEND_INTERVAL_OVERRIDE = 0xA048 - MSG_ID_DG_FAN_RPM_ALARM_START_TIME_OFFSET_OVERRIDE = 0xA049 + MSG_ID_DG_START_STOP_TRIMMER_HEATER_CMD = 0xA049 MSG_ID_DG_GET_SW_CONFIG_RECORD = 0xA04A MSG_ID_DG_SET_SW_CONFIG_RECORD = 0xA04B MSG_ID_DG_SEND_SW_CONFIG_RECORD = 0xA04C Index: dialin/dg/heaters.py =================================================================== diff -u -rbff28676dd855ea33707bbb26a624abc94aebdf0 -r248afd4f09cc4ee8b6cc3f042256e43044dfc65f --- dialin/dg/heaters.py (.../heaters.py) (revision bff28676dd855ea33707bbb26a624abc94aebdf0) +++ dialin/dg/heaters.py (.../heaters.py) (revision 248afd4f09cc4ee8b6cc3f042256e43044dfc65f) @@ -144,7 +144,7 @@ self.trimmer_calc_target_temperature = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_10:MsgFieldPositions.END_POS_FIELD_10]))[0] - def cmd_start_stop_primary_heater(self, state: int = HeatersStartStop.STOP.name) -> None: + def cmd_start_stop_primary_heater(self, state: int = HeatersStartStop.STOP.value) -> None: """ Constructs and sends a start/stop primary heater command Constraints: @@ -153,7 +153,7 @@ @param state: (int) start/stop state of the primary heater. The default is stop. @returns none """ - if state == HeatersStartStop.START.name: + if state == HeatersStartStop.START.value: payload = integer_to_bytearray(1) operation = 'Turning on ' else: @@ -164,50 +164,53 @@ message_id=MsgIds.MSG_ID_START_STOP_PRIMARY_HEATER.value, payload=payload) - self.logger.debug(operation + " the Primary heater") + self.logger.debug(operation + " the primary heater") self.can_interface.send(message, 0) - def cmd_start_stop_trimmer_heater(self, state: int = HeatersStartStop.STOP.name) -> None: + def cmd_start_stop_trimmer_heater(self, state: int = HeatersStartStop.STOP.value) -> None: """ - Constructs and sends start trimmer heater command + Constructs and sends a start/stop trimmer heater command Constraints: A target temperature for trimmer heater between 10 and 90 deg C must have been given to DG previously. @param state: (int) start/stop state of the trimmer heater. The default is stop. @returns none """ - if state == HeatersStartStop.START.name: + if state == HeatersStartStop.START.value: payload = integer_to_bytearray(1) operation = 'Turning on ' else: payload = integer_to_bytearray(0) - operation = 'Turning off' + operation = 'Turning off ' message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, message_id=MsgIds.MSG_ID_DG_START_STOP_TRIMMER_HEATER_CMD.value, payload=payload) - self.logger.debug(operation + " the Primary heater") + self.logger.debug(operation + " the trimmer heater") self.can_interface.send(message, 0) - def cmd_set_dialysate_target_temperature(self, - primary_target_temp: float = 37.0, - trimmer_target_temp: float = 38.0) -> None: + def cmd_hd_proxy_start_stop_trimmer_heater(self, state: int = HeatersStartStop.STOP.value) -> None: """ - Constructs and sends primary and trimmer heater target temperature + Constructs and sends start trimmer heater command + Constraints: + A target temperature for trimmer heater between 10 and 90 deg C must have been given to DG previously. - @param primary_target_temp: (float) Primary heater target temperature - @param trimmer_target_temp: (float) Trimmer heater target temperature + @param state: (int) start/stop state of the trimmer heater. The default is stop. @returns none """ - primary_target = float_to_bytearray(primary_target_temp) - trimmer_target = float_to_bytearray(trimmer_target_temp) - payload = primary_target + trimmer_target + if state == HeatersStartStop.START.value: + payload = integer_to_bytearray(1) + operation = 'Turning on ' + else: + payload = integer_to_bytearray(0) + operation = 'Turning off' + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, - message_id=MsgIds.MSG_ID_SET_DG_DIALYSATE_TEMP_TARGETS.value, + message_id=MsgIds.MSG_ID_HD_START_STOP_TRIMMER_HEATER_CMD.value, payload=payload) - self.logger.debug("Setting Primary Heater to {} C and Trimmer Heater to {} C".format(primary_target_temp, - trimmer_target_temp)) + + self.logger.debug(operation + " the Primary heater") self.can_interface.send(message, 0) def cmd_set_primary_and_trimmer_heaters_target_temperature(self, Index: dialin/hd/pressure_occlusion.py =================================================================== diff -u -r3a70bfb451b74106348c064c34f19934aadd9119 -r248afd4f09cc4ee8b6cc3f042256e43044dfc65f --- dialin/hd/pressure_occlusion.py (.../pressure_occlusion.py) (revision 3a70bfb451b74106348c064c34f19934aadd9119) +++ dialin/hd/pressure_occlusion.py (.../pressure_occlusion.py) (revision 248afd4f09cc4ee8b6cc3f042256e43044dfc65f) @@ -260,41 +260,3 @@ else: self.logger.debug("Timeout!!!!") return False - - def cmd_arterial_pressure_offset_override(self, offset: float, reset: int = NO_RESET) -> int: - """ - Constructs and sends the arterial pressure offset override command - Constraints: - Must be logged into HD. - - @param offset: float - offset (in mmHg) for arterial pressure sensor - @param reset: integer - 1 to reset a previous override, 0 to override - @return: 1 if successful, zero otherwise - """ - - rst = integer_to_bytearray(reset) - off = float_to_bytearray(offset) - payload = rst + off - - message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, - message_id=MsgIds.MSG_ID_SET_ARTERIAL_PRESSURE_OFFSET.value, - payload=payload) - - self.logger.debug("override arterial pressure offset") - - # Send message - received_message = self.can_interface.send(message) - - # If there is content... - if received_message is not None: - if reset == RESET: - str_res = "reset back to normal: " - else: - str_res = str(offset) + " mmHg: " - self.logger.debug("Arterial pressure offset overridden to " + str_res + - str(received_message['message'][DenaliMessage.PAYLOAD_START_INDEX])) - # 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 -rbff28676dd855ea33707bbb26a624abc94aebdf0 -r248afd4f09cc4ee8b6cc3f042256e43044dfc65f --- tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision bff28676dd855ea33707bbb26a624abc94aebdf0) +++ tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision 248afd4f09cc4ee8b6cc3f042256e43044dfc65f) @@ -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/2022-08-17-DG-Record.xlsx') + dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2022-08-17-DG-Record.xlsx') # For resetting the calibration record to benign values, use the function below #dg.calibration_record.cmd_reset_dg_calibration_record() @@ -85,9 +85,9 @@ #run_sw_configs_commands() - run_calibration_commands() + #run_calibration_commands() - #run_system_commands() + run_system_commands() #dg.usage_record.cmd_get_dg_usage_info_record() #dg.usage_record.cmd_update_dg_usage_info_record('/home/fw/projects/DG_NV_Records/2022-04-22-DG-Record.xlsx') Index: tests/dg_tests.py =================================================================== diff -u -rbff28676dd855ea33707bbb26a624abc94aebdf0 -r248afd4f09cc4ee8b6cc3f042256e43044dfc65f --- tests/dg_tests.py (.../dg_tests.py) (revision bff28676dd855ea33707bbb26a624abc94aebdf0) +++ tests/dg_tests.py (.../dg_tests.py) (revision 248afd4f09cc4ee8b6cc3f042256e43044dfc65f) @@ -699,7 +699,7 @@ # cmd_set_disinfect_ui_screen() - collect_treatment_data() + #collect_treatment_data() #collect_hd_treatment() @@ -735,5 +735,7 @@ # print(get_ro_info()) # sleep(1) - #dg.heaters.cmd_set_primary_and_trimmer_heaters_target_temperature(primary_target_temp=40, trimmer_target_temp=52) + dg.heaters.cmd_set_primary_and_trimmer_heaters_target_temperature(primary_target_temp=40, trimmer_target_temp=52) + sleep(1) + dg.heaters.cmd_start_stop_trimmer_heater(0)