Index: leahi_dialin/dd/modules/piston_pump.py =================================================================== diff -u -r4e60dc04a4526be59962b3be2cb149b9bf536623 -rdfbb4f080638b65d9836b22bd5c76d46d53abba5 --- leahi_dialin/dd/modules/piston_pump.py (.../piston_pump.py) (revision 4e60dc04a4526be59962b3be2cb149b9bf536623) +++ leahi_dialin/dd/modules/piston_pump.py (.../piston_pump.py) (revision dfbb4f080638b65d9836b22bd5c76d46d53abba5) @@ -5,7 +5,7 @@ # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # -# @file piston_pumps.py +# @file piston_pump.py # # @author (last) Micahel Garthwaite # @date (last) 07-Mar-2023 @@ -20,13 +20,20 @@ from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels -from leahi_dialin.utils.base import AbstractSubSystem, publish +from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum from leahi_dialin.utils.checks import check_broadcast_interval_override_ms from leahi_dialin.utils.conversions import integer_to_bytearray, float_to_bytearray +@unique +class DDPistonPumpsEnum(DialinEnum): + ACID = 0 # Acid piston pump + BICARB = 1 # Bicarbonate piston pump + UF = 2 # Ultrafilteration piston pump + NUM_OF_PISTON_PUMPS = 3 # Number of piston pumps + class DDPistonPumps(AbstractSubSystem): """ - PistonPumps + DDPistonPumps Dialysate Delivery (DD) Dialin API sub-class for piston pumps related commands. """ @@ -126,14 +133,14 @@ self.logger.error("Timeout!!!!") return False - def cmd_piston_set_start_stop(self, pump_id: int, command: int, count: int, speed: float, volume: float ) -> int: + def cmd_piston_set_start_stop_override(self, pump_id: int, command: int, count: int, flow_rate: float, volume: float ) -> int: """ Constructs and sends the piston pump start stop command @param pump_id: unsigned int - concentrate pump ID @param command: int - value to command the concentrate pump @param count: int - vale to set the cycle count to - @param speed: float - ml/min to set the speed to + @param flow_rate: float - ml/min to set the speed to @param volume: float - the volume to set to @return: 1 if successful, zero otherwise @@ -142,7 +149,7 @@ pmp = integer_to_bytearray(pump_id) cmd = integer_to_bytearray(command) cyc = integer_to_bytearray(count) - spd = float_to_bytearray(speed) + spd = float_to_bytearray(flow_rate) vlm = float_to_bytearray(volume) payload = pmp + cmd + cyc + vlm + spd