Index: leahi_dialin/td/modules/blood_flow.py =================================================================== diff -u -rd28c8c54ba1f74adf348d1db6f5bfe034628c812 -rf4759a283992acdf2e66198ce4ab0747a5aa34a1 --- leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision d28c8c54ba1f74adf348d1db6f5bfe034628c812) +++ leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision f4759a283992acdf2e66198ce4ab0747a5aa34a1) @@ -55,7 +55,7 @@ self.h4_rotor_hall_state = 0 - @publish(["td_blood_flow_timestamp", "set_blood_flow_rate", "h4_measured_blood_flow_rate", "h4_measured_blood_pump_rotor_speed", + @publish(["td_blood_flow_timestamp", "h4_set_blood_flow_rate", "h4_measured_blood_flow_rate", "h4_measured_blood_pump_rotor_speed", "h4_measured_blood_pump_speed", "h4_measured_blood_pump_motor_current", "h4_set_rpm", "h4_rotor_count", "h4_pres_blood_flow_rate", "h4_rotor_hall_state"]) def _handler_blood_flow_sync(self, message, timestamp=0.0): @@ -67,34 +67,25 @@ @return: none """ - tgt = struct.unpack('i', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1])) - flow = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2])) - rotor = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3])) - speed = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4])) - mccurr = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5])) - rpm = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6])) - rot = struct.unpack('I', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7])) - pres = struct.unpack('I', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8])) - hal = struct.unpack('I', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9])) + self.h4_set_blood_flow_rate = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] + self.h4_measured_blood_flow_rate = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] + self.h4_measured_blood_pump_rotor_speed = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] + self.h4_measured_blood_pump_speed = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] + self.h4_measured_blood_pump_motor_current = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] + self.h4_set_rpm = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] + self.h4_rotor_count = struct.unpack('I', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7]))[0] + self.h4_pres_blood_flow_rate = struct.unpack('I', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] + self.h4_rotor_hall_state = struct.unpack('I', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] - self.h4_set_blood_flow_rate = tgt[0] - self.h4_measured_blood_flow_rate = flow[0] - self.h4_measured_blood_pump_rotor_speed = rotor[0] - self.h4_measured_blood_pump_speed = speed[0] - self.h4_measured_blood_pump_motor_current = mccurr[0] - self.h4_set_rpm = rpm[0] - self.h4_rotor_count = rot[0] - self.h4_pres_blood_flow_rate = pres[0] - self.h4_rotor_hall_state = hal[0] self.td_blood_flow_timestamp = timestamp def cmd_blood_flow_set_flow_rate_request(self, flow: int, mode: int = PUMP_CONTROL_MODE_CLOSED_LOOP) -> int: