Index: leahi_dialin/fp/modules/conductivity_sensors.py =================================================================== diff -u -r7ce778dc51b7dba5a7a7ca14244ed7eea7bf029d -r1411b91a9f096d88791241d015eb2837699f5c8e --- leahi_dialin/fp/modules/conductivity_sensors.py (.../conductivity_sensors.py) (revision 7ce778dc51b7dba5a7a7ca14244ed7eea7bf029d) +++ leahi_dialin/fp/modules/conductivity_sensors.py (.../conductivity_sensors.py) (revision 1411b91a9f096d88791241d015eb2837699f5c8e) @@ -79,6 +79,31 @@ self.fp_conductivity_timestamp = timestamp + + @publish(["msg_id_ro_rejection_ratio_data", "ro_rejection_ratio", "ro_rejection_ratio_timestamp"]) + def _handler_ro_rejection_ratio_sync(self, message, timestamp=0.0): + """ + Handles published FP RO Rejection Ratio data messages. RO Rejection Ratio data are captured + for reference. + + @param message: Published RO Rejection Ratio data message + @return: None + """ + + self.ro_rejection_ratio[FPRORejectionRatioEnum.RAW_RO_REJECTION_RATIO.name] = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] + self.ro_rejection_ratio[FPRORejectionRatioEnum.RAW_RO_REJECTION_RATIO_TANK_FILL.name] = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] + self.ro_rejection_ratio[FPRORejectionRatioEnum.AVG_RO_REJECTION_RATIO.name] = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] + self.ro_rejection_ratio[FPRORejectionRatioEnum.AVG_RO_REJECTION_RATIO_TANK_FILL.name] = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] + self.ro_rejection_ratio[FPRORejectionRatioEnum.GEN_PERMEATE_STATE.name] = struct.unpack('i', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] + + self.ro_rejection_ratio_timestamp = timestamp + + def cmd_conductivity_sensor_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the FP conductivity sensor data broadcast interval override command