Index: dialin/common/msg_ids.py =================================================================== diff -u -r63b4319afbaac8d4e6df4eb62978d201d81bd6e8 -raf8db2686fbbf566d677c38dfdf367f7c49b7764 --- dialin/common/msg_ids.py (.../msg_ids.py) (revision 63b4319afbaac8d4e6df4eb62978d201d81bd6e8) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision af8db2686fbbf566d677c38dfdf367f7c49b7764) @@ -438,6 +438,8 @@ MSG_ID_CPLD_PUBLISH_INTERVAL_OVERRIDE = 0xA058 MSG_ID_DG_DRAIN_PUMP_CURRENT_OVERRIDE = 0xA059 MSG_ID_DG_DRAIN_PUMP_DIRECTION_OVERRIDE = 0xA05A + MSG_ID_DG_RO_FEEDBACK_VOLTAGE_OVERRIDE = 0xA05B + MSG_ID_DG_DIALYSATE_FILL_INTEGRATED_VOLUME_OVERRIDE = 0xA05C MSG_ID_HD_DEBUG_EVENT = 0xFFF1 MSG_ID_DG_DEBUG_EVENT = 0xFFF2 Index: dialin/dg/ro_pump.py =================================================================== diff -u -r16e000873965ed64ed3dc96050739bd958a4d912 -raf8db2686fbbf566d677c38dfdf367f7c49b7764 --- dialin/dg/ro_pump.py (.../ro_pump.py) (revision 16e000873965ed64ed3dc96050739bd958a4d912) +++ dialin/dg/ro_pump.py (.../ro_pump.py) (revision af8db2686fbbf566d677c38dfdf367f7c49b7764) @@ -230,3 +230,43 @@ else: self.logger.debug("Timeout!!!!") return False + + def cmd_ro_pump_measured_feedback_pwm_override(self, pwm: float, reset: int = NO_RESET) -> int: + """ + Constructs and sends the feedback pwm override command. + Constraints: + Must be logged into DG. + Given RPM must be within 0.0 <= PWM <= 0.99 + + @param pwm: (float) pwm to override with + @param reset: (int) 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise + """ + + rst = integer_to_bytearray(reset) + pwm = float_to_bytearray(pwm) + payload = rst + pwm + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_RO_FEEDBACK_VOLTAGE_OVERRIDE.value, + payload=payload) + + self.logger.debug("Override RO Pump measured Feedback PWM.") + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + if reset == RESET: + str_res = "back to normal" + else: + str_res = str(pwm) + self.logger.debug( + "Feedback PWM has been overridden " + str_res + " % " + + str(received_message['message'][DenaliMessage.PAYLOAD_START_INDEX])) + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.debug("Timeout!!!!") + return False \ No newline at end of file Index: dialin/ui/hd_simulator.py =================================================================== diff -u -r7ea5ac03559012bfdd33081906d530b2d6ef3210 -raf8db2686fbbf566d677c38dfdf367f7c49b7764 --- dialin/ui/hd_simulator.py (.../hd_simulator.py) (revision 7ea5ac03559012bfdd33081906d530b2d6ef3210) +++ dialin/ui/hd_simulator.py (.../hd_simulator.py) (revision af8db2686fbbf566d677c38dfdf367f7c49b7764) @@ -7,8 +7,8 @@ # # @file hd_simulator.py # -# @author (last) Behrouz NematiPour -# @date (last) 03-Oct-2022 +# @author (last) Darren Cox +# @date (last) 08-Nov-2022 # @author (original) Peter Lucia # @date (original) 06-Aug-2020 #