Index: leahi_dialin/fp/modules/pressure_sensors.py =================================================================== diff -u -r5b9473d9ca6a66d4d03c509fae6051710895b498 -r80f84ad5638667894e9df2161b9c5d9b8f27ed9b --- leahi_dialin/fp/modules/pressure_sensors.py (.../pressure_sensors.py) (revision 5b9473d9ca6a66d4d03c509fae6051710895b498) +++ leahi_dialin/fp/modules/pressure_sensors.py (.../pressure_sensors.py) (revision 80f84ad5638667894e9df2161b9c5d9b8f27ed9b) @@ -33,6 +33,10 @@ P13_PRES = 3 P17_PRES = 4 X1_PRES = 5 + X2_PRES = 6 + X3_PRES = 7 + X4_PRES = 8 + X5_PRES = 9 class FPPressureSensors(AbstractSubSystem): @@ -62,28 +66,26 @@ self.p13_pres = 0.0 self.p17_pres = 0.0 self.x1_pres = 0.0 + self.x2_pres = 0.0 + self.x3_pres = 0.0 + self.x4_pres = 0.0 + self.x5_pres = 0.0 self.m1_pres_temp = 0.0 self.m3_pres_temp = 0.0 self.p8_pres_temp = 0.0 self.p13_pres_temp = 0.0 self.p17_pres_temp = 0.0 self.x1_pres_temp = 0.0 + self.x2_pres_temp = 0.0 + self.x3_pres_temp = 0.0 + self.x4_pres_temp = 0.0 + self.x5_pres_temp = 0.0 - @publish([ - "fp_pressure_timestamp", - "m1_pres", - "m3_pres", - "p8_pres", - "p13_pres", - "p17_pres", - "x1_pres", - "m1_pres_temp", - "m3_pres_temp", - "p8_pres_temp", - "p13_pres_temp", - "p17_pres_temp", - "x1_pres_temp" + "fp_pressure_timestamp", "m1_pres", "m3_pres", "p8_pres", "p13_pres", "p17_pres", + "x1_pres", "x2_pres", "x3_pres", "x4_pres", "x5_pres", + "m1_pres_temp", "m3_pres_temp", "p8_pres_temp", "p13_pres_temp", "p17_pres_temp", + "x1_pres_temp", "x2_pres_temp", "x3_pres_temp", "x4_pres_temp", "x5_pres_temp", ]) def _handler_pressure_sync(self, message, timestamp=0.0): """ @@ -94,46 +96,48 @@ @return: none """ - pre_reg_wi = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1])) - post_reg_wi = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2])) - pre_cond_wi = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3])) - pre_ro = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4])) - post_ro = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5])) - pre_pump = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6])) + self.m1_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] + self.m3_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] + self.p8_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] + self.p13_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] + self.p17_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] + self.x1_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] + self.x2_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7]))[0] + self.x3_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] + self.x4_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] + self.x5_pres = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_10:MsgFieldPositions.END_POS_FIELD_10]))[0] - pre_reg_wi_temp = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7])) - post_reg_wi_temp = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8])) - pre_cond_wi_temp = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9])) - pre_ro_temp = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_10:MsgFieldPositions.END_POS_FIELD_10])) - post_ro_temp = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_11:MsgFieldPositions.END_POS_FIELD_11])) - pre_pump_temp = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_12:MsgFieldPositions.END_POS_FIELD_12])) + self.m1_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_11:MsgFieldPositions.END_POS_FIELD_11]))[0] + self.m3_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_12:MsgFieldPositions.END_POS_FIELD_12]))[0] + self.p8_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_13:MsgFieldPositions.END_POS_FIELD_13]))[0] + self.p13_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_14:MsgFieldPositions.END_POS_FIELD_14]))[0] + self.p17_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_15:MsgFieldPositions.END_POS_FIELD_15]))[0] + self.x1_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_16:MsgFieldPositions.END_POS_FIELD_16]))[0] + self.x2_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_17:MsgFieldPositions.END_POS_FIELD_17]))[0] + self.x3_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_18:MsgFieldPositions.END_POS_FIELD_18]))[0] + self.x4_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_19:MsgFieldPositions.END_POS_FIELD_19]))[0] + self.x5_pres_temp = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_20:MsgFieldPositions.END_POS_FIELD_20]))[0] - self.m1_pres = pre_reg_wi[0] - self.m3_pres = post_reg_wi[0] - self.p8_pres = pre_cond_wi[0] - self.p13_pres = pre_ro[0] - self.p17_pres = post_ro[0] - self.x1_pres = pre_pump[0] - - self.m1_pres_temp = pre_reg_wi_temp[0] - self.m3_pres_temp = post_reg_wi_temp[0] - self.p8_pres_temp = pre_cond_wi_temp[0] - self.p13_pres_temp = pre_ro_temp[0] - self.p17_pres_temp = post_ro_temp[0] - self.x1_pres_temp = pre_pump_temp[0] - self.fp_pressure_timestamp = timestamp def cmd_pressure_sensor_override(self, sensor: int, pressure: float, reset: int = NO_RESET) -> int: