Index: leahi_dialin/td/modules/air_trap.py =================================================================== diff -u -r648db1c6ddd297bb1dcb04a4fec37dc4dee7656c -r43fec7787f9a4115d19deeb5cbc1d7bbf23134fe --- leahi_dialin/td/modules/air_trap.py (.../air_trap.py) (revision 648db1c6ddd297bb1dcb04a4fec37dc4dee7656c) +++ leahi_dialin/td/modules/air_trap.py (.../air_trap.py) (revision 43fec7787f9a4115d19deeb5cbc1d7bbf23134fe) @@ -48,8 +48,8 @@ if self.can_interface is not None: channel_id = DenaliChannels.td_sync_broadcast_ch_id - msg_id = MsgIds.MSG_ID_TD_AIR_TRAP_DATA.value - self.can_interface.register_receiving_publication_function(channel_id, msg_id, + self.msg_id_td_air_trap_data = MsgIds.MSG_ID_TD_AIR_TRAP_DATA.value + self.can_interface.register_receiving_publication_function(channel_id, self.msg_id_td_air_trap_data, self._handler_air_trap_sync) self.air_trap_level_sensors = { @@ -69,10 +69,11 @@ self.air_control = 0 self.td_air_trap_timestamp = 0.0 - @publish(["td_air_trap_timestamp", + @publish(["msg_id_td_air_trap_data", "air_trap_level_sensors", "air_trap_valve_states", - "air_control"]) + "air_control", + "td_air_trap_timestamp"]) def _handler_air_trap_sync(self, message, timestamp=0.0): """ Handles published air trap data messages. Air trap data are captured Index: leahi_dialin/td/modules/blood_flow.py =================================================================== diff -u -rec8a2600b9e8cf6fe7e02c200a1c24221ca86863 -r43fec7787f9a4115d19deeb5cbc1d7bbf23134fe --- leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision ec8a2600b9e8cf6fe7e02c200a1c24221ca86863) +++ leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision 43fec7787f9a4115d19deeb5cbc1d7bbf23134fe) @@ -383,6 +383,30 @@ self.logger.debug("Timeout!!!!") return False + def cmd_hard_stop_blood_pump(self) -> int: + """ + Constructs and sends hard stop blood pump command. + Constraints: + Must be logged into TD. + + @return: 1 if successful, zero otherwise + """ + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_td_ch_id, + message_id=MsgIds.MSG_ID_TD_HARD_STOP_BLOOD_PUMP.value) + + self.logger.debug("Hard stopping blood pump") + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return True + else: + self.logger.debug("Timeout!!!!") + return False + def cmd_blood_flow_alpha_y_intercept_override(self, intercept: float, reset: int = NO_RESET) -> int: """ Constructs and sends the blood flow alpha y intercept override.