Index: leahi_dialin/common/td_defs.py =================================================================== diff -u -r776be9fb446685fb492a2b7bd6faf4eac7dfe714 -r7c8e829c563547ee50c517f1d6b84cb800b72027 --- leahi_dialin/common/td_defs.py (.../td_defs.py) (revision 776be9fb446685fb492a2b7bd6faf4eac7dfe714) +++ leahi_dialin/common/td_defs.py (.../td_defs.py) (revision 7c8e829c563547ee50c517f1d6b84cb800b72027) @@ -219,13 +219,12 @@ MEASURED_BLOOD_FLOW_RATE = 1 # Measured Blood Flow Rate for Blood Flow Motor MEASURED_BLOOD_PUMP_ROTOR_SPEED = 2 # Measured Bloop Pump Rotor Speed for Blood Flow Motor MEASURED_BLOOD_PUMP_SPEED = 3 # Measured Blood Pump Speed for Blood Flow Motor - MEASURED_BLOOD_PUMP_MOTOR_CURRENT = 4 # Measured Blood Pump Motor Current for Blood Flow Motor + MEASURED_BLOOD_PUMP_TORQUE = 4 # Measured Blood Pump torque SET_RPM = 5 # Set Revolutions per minute for Blood Flow Motor ROTOR_COUNT = 6 # Rotor Count for Blood Flow Motor PRES_BLOOD_FLOW_RATE = 7 # Pressure Blood Flow Rate for Blood Flow Motor ROTOR_HALL_STATE = 8 # Rotor Hall State for Blood Flow Motor - MEASURED_BLOOD_PUMP_TORQUE = 9 # Measured Blood Pump torque - NUM_OF_BLOOD_FLOW_MOTOR_ATTRIBUTES = 10 # Number of Blood Flow Motor Attributes + NUM_OF_BLOOD_FLOW_MOTOR_ATTRIBUTES = 9 # Number of Blood Flow Motor Attributes @unique class TDAirBubbleDetectorNames(DialinEnum): @@ -253,7 +252,8 @@ class TDPressureSensorNames(DialinEnum): H2_PRES = 0 # Arterial Pressure Sensor H14_PRES = 1 # Venous Pressure Sensor - NUM_OF_PRESSURE_SENSORS = 2 # Number of Pressure Sensors + H23_PRES = 2 # Barometric Pressure Sensor + NUM_OF_PRESSURE_SENSORS = 3 # Number of Pressure Sensors @unique class TDPressureSensorAttributes(DialinEnum): Index: leahi_dialin/td/modules/blood_flow.py =================================================================== diff -u -r23d97164899d37cb70f73beda28e790996e18abc -r7c8e829c563547ee50c517f1d6b84cb800b72027 --- leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision 23d97164899d37cb70f73beda28e790996e18abc) +++ leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision 7c8e829c563547ee50c517f1d6b84cb800b72027) @@ -50,12 +50,11 @@ TDBloodFlowMotorAttributes.MEASURED_BLOOD_FLOW_RATE.name: 0.0, TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_ROTOR_SPEED.name: 0.0, TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_SPEED.name: 0.0, - TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_MOTOR_CURRENT.name: 0.0, + TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_TORQUE : 0.0, TDBloodFlowMotorAttributes.SET_RPM.name: 0.0, TDBloodFlowMotorAttributes.ROTOR_COUNT.name: 0, TDBloodFlowMotorAttributes.PRES_BLOOD_FLOW_RATE.name: 0, TDBloodFlowMotorAttributes.ROTOR_HALL_STATE.name: 0, - TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_TORQUE : 0.0 } @publish(["msg_id_td_blood_pump_data", "h4_motor", "td_blood_flow_timestamp"]) @@ -76,7 +75,7 @@ message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] self.h4_motor[TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_SPEED.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] - self.h4_motor[TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_MOTOR_CURRENT.name] = struct.unpack('f', bytearray( + self.h4_motor[TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_TORQUE.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] self.h4_motor[TDBloodFlowMotorAttributes.SET_RPM.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] @@ -86,8 +85,6 @@ message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] self.h4_motor[TDBloodFlowMotorAttributes.ROTOR_HALL_STATE.name] = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] - self.h4_motor[TDBloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_TORQUE.name] = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_10:MsgFieldPositions.END_POS_FIELD_10]))[0] self.td_blood_flow_timestamp = timestamp Index: leahi_dialin/td/modules/pressure_sensors.py =================================================================== diff -u -rec8a2600b9e8cf6fe7e02c200a1c24221ca86863 -r7c8e829c563547ee50c517f1d6b84cb800b72027 --- leahi_dialin/td/modules/pressure_sensors.py (.../pressure_sensors.py) (revision ec8a2600b9e8cf6fe7e02c200a1c24221ca86863) +++ leahi_dialin/td/modules/pressure_sensors.py (.../pressure_sensors.py) (revision 7c8e829c563547ee50c517f1d6b84cb800b72027) @@ -32,7 +32,7 @@ def __init__(self, can_interface, logger: Logger): """ - TDPressureOcclusion constructor + TDPressureSensors constructor """ super().__init__() @@ -44,7 +44,6 @@ self.msg_id_td_pressure_data = MsgIds.MSG_ID_TD_PRESSURE_DATA.value self.can_interface.register_receiving_publication_function(channel_id, self.msg_id_td_pressure_data, self._handler_pressure_sync) - self.td_pressure_timestamp = 0.0 self.td_pressure_sensors = { TDPressureSensorNames.H2_PRES.name: { @@ -58,6 +57,9 @@ TDPressureSensorAttributes.LONG_FILTERED_PRESSURE.name: 0.0, TDPressureSensorAttributes.PRES_LIMIT_MIN.name: 0, TDPressureSensorAttributes.PRES_LIMIT_MAX.name: 0 + }, + TDPressureSensorNames.H23_PRES.name: { + TDPressureSensorAttributes.PRES.name : 0.0 } } self.pressure_limits_state = 0 @@ -102,11 +104,13 @@ lfv = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9])) tps = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9])) + message['message'][MsgFieldPositions.START_POS_FIELD_10:MsgFieldPositions.END_POS_FIELD_10])) tmin = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9])) + message['message'][MsgFieldPositions.START_POS_FIELD_11:MsgFieldPositions.END_POS_FIELD_11])) tmax = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9])) + message['message'][MsgFieldPositions.START_POS_FIELD_12:MsgFieldPositions.END_POS_FIELD_12])) + baro = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_13:MsgFieldPositions.END_POS_FIELD_13])) self.td_pressure_sensors[TDPressureSensorNames.H2_PRES.name][TDPressureSensorAttributes.PRES.name] = art[0] self.td_pressure_sensors[TDPressureSensorNames.H14_PRES.name][TDPressureSensorAttributes.PRES.name] = ven[0] @@ -120,6 +124,7 @@ self.tmp_pressure = tps[0] self.tmp_min_limit = tmin[0] self.tmp_max_limit = tmax[0] + self.td_pressure_sensors[TDPressureSensorNames.H23_PRES.name][TDPressureSensorAttributes.PRES.name] = baro[0] self.td_pressure_timestamp = timestamp def cmd_pressure_sensor_override(self, sensor: int, pressure: float, reset: int = NO_RESET) -> int: