Index: dialin/dg/flow_sensors.py =================================================================== diff -u -racd09d02879e8add4cf7f694f5db8e423a76c341 -rcd6edb29963419e1a16d8dd5257f12e65f7ffd8a --- dialin/dg/flow_sensors.py (.../flow_sensors.py) (revision acd09d02879e8add4cf7f694f5db8e423a76c341) +++ dialin/dg/flow_sensors.py (.../flow_sensors.py) (revision cd6edb29963419e1a16d8dd5257f12e65f7ffd8a) @@ -54,6 +54,8 @@ self.measured_ro_flow_LPM = 0.0 self.measured_dialysate_flow_LPM = 0.0 self.measured_ro_flow_with_cp_LPM = 0.0 + self.measured_raw_ro_flow_LPM = 0.0 + self.measured_raw_dialysate_flow_LPM = 0.0 if self.can_interface is not None: channel_id = DenaliChannels.dg_sync_broadcast_ch_id @@ -82,15 +84,37 @@ """ return self.measured_ro_flow_with_cp_LPM - @publish(["measured_ro_flow_LPM", "measured_dialysate_flow_LPM", "measured_ro_flow_with_cp_LPM"]) - def _handler_flow_sensors_sync(self, message): + def get_measured_raw_ro_flow(self): + """ + Gets the measured raw (uncalibrated) flow value from DG's ro pump (FMP) + @return: The raw RO flow rate in L/min + """ + return self.measured_raw_ro_flow_LPM + def get_measured_raw_dialysate_flow(self): + """ + Gets the measured raw (uncalibrated) flow value from DG's dialydate flow sensor (FMD) + @return: The raw dialysate flow rate in L/min + """ + return self.measured_raw_dialysate_flow_LPM + + @publish(["measured_ro_flow_LPM", "measured_dialysate_flow_LPM", "measured_ro_flow_with_cp_LPM", + "measured_raw_ro_flow_LPM", "measured_raw_dialysate_flow_LPM"]) + def _handler_flow_sensors_sync(self, message): + """ + Handles incoming DG flow sensor broadcast messages and records latest reported flow rates. + @return: none + """ self.measured_ro_flow_LPM = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] self.measured_ro_flow_with_cp_LPM = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] self.measured_dialysate_flow_LPM = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] + self.measured_raw_ro_flow_LPM = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] + self.measured_raw_dialysate_flow_LPM = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] def cmd_measured_flow_sensor_value_lpm_override(self, sensor_id: int, rate: float, reset: int = NO_RESET) -> int: """