Index: .gitignore =================================================================== diff -u -r61479ce1965fdcf793913f5e58af92e56c3aea67 -rc6596d42d995bed3789849bd85c83da5a3837fac --- .gitignore (.../.gitignore) (revision 61479ce1965fdcf793913f5e58af92e56c3aea67) +++ .gitignore (.../.gitignore) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -14,3 +14,11 @@ build/ dialin.egg-info/ README.pdf +docs/build +docs/source/dialin.dg.rst +docs/source/dialin.hd.rst +docs/source/dialin.protocols.rst +docs/source/dialin.rst +docs/source/dialin.utils.rst +docs/source/modules.rst + Index: README.md =================================================================== diff -u -rf5992e425a0fea2f531119bd762853227a4bed77 -rc6596d42d995bed3789849bd85c83da5a3837fac --- README.md (.../README.md) (revision f5992e425a0fea2f531119bd762853227a4bed77) +++ README.md (.../README.md) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -3,8 +3,8 @@ This repository contains the source code for the Dialin API. The Dialin API supports cross-functional testing of the Denali system. -It supports the Systems level testing, Software Verification & Validation, and pre-release SW and FW developmental testing by exposing and simulating interaction with - the UI, HD, and DG sub-components. +It supports the Systems level testing, Software Verification & Validation, and pre-release SW and FW developmental +testing by exposing and simulating interaction with the UI, HD, and DG sub-components. To use this API, it is recommended to install the API directly from this locally hosted git repository. It is also possible to install it from a pre-packaged .whl file. Once installed to your local Index: dialin/dg/dialysate_generator.py =================================================================== diff -u -rf1ac0e8ba99d1ddb0138918e408dffc0f5eba3c5 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision f1ac0e8ba99d1ddb0138918e408dffc0f5eba3c5) +++ dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -27,11 +27,8 @@ class DG: """ - \class DG - Dialysate Generator (DG) Dialin object API. It provides the basic interface to communicate with the DG firmware. - """ # DG message IDs @@ -77,14 +74,12 @@ """ DG constructor using can bus - \param can_interface: string with can bus name, e.g. "can0" - \returns DG object that allows communication with board via port - - \details For example: - + For example: dg_object = DG(can_interface='can0') or dg_object = DG('can0') + @param can_interface: string with can bus name, e.g. "can0" + @return: DG object that allows communication with board via port """ # Create listener self.can_interface = DenaliCanMessenger(can_interface=can_interface) @@ -119,13 +114,13 @@ """ Handler for response from DG regarding its version. - \param message: response message from HD regarding valid treatment parameter ranges.\n + @param message: response message from HD regarding valid treatment parameter ranges.\n U08 Major \n U08 Minor \n U08 Micro \n U16 Build \n - \returns None if unsuccessful, the version string if unpacked successfully + @return: None if unsuccessful, the version string if unpacked successfully """ major = struct.unpack('B', bytearray( message['message'][self.START_POS_MAJOR:self.END_POS_MAJOR])) @@ -146,8 +141,8 @@ Handles published DG operation mode messages. Current DG operation mode is captured for reference. - \param message: published DG operation mode broadcast message - \returns none + @param message: published DG operation mode broadcast message + @return: None """ mode = struct.unpack('i', bytearray( @@ -163,7 +158,7 @@ Constructs and sends a login command via CAN bus. Login required before \n other commands can be sent to the DG. - \returns 1 if logged in, 0 if log in failed + @return: 1 if logged in, 0 if log in failed """ message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, @@ -190,9 +185,9 @@ Constructs and sends the insert DG message command. Given message will \n be inserted into the DG's received message queue for processing. - \param msg: byte array - properly formatted DG message to insert + @param msg: byte array - properly formatted DG message to insert - \returns 1 if successful, zero otherwise + @return: 1 if successful, zero otherwise """ message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, Index: dialin/dg/drain_pump.py =================================================================== diff -u -rcd974f59a331830091dc9518dc217f03b1ebd969 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/drain_pump.py (.../drain_pump.py) (revision cd974f59a331830091dc9518dc217f03b1ebd969) +++ dialin/dg/drain_pump.py (.../drain_pump.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -22,10 +22,7 @@ class DGDrainPump: """ - \class DGDrainPump - - \brief Dialysate Generator (DG) Dialin API sub-class for drain pump related commands. - + Dialysate Generator (DG) Dialin API sub-class for drain pump related commands. """ # Drain pump message IDs @@ -43,7 +40,7 @@ """ DGDrainPump constructor - \param outer_instance: reference to the DG (outer) class. + @param outer_instance: reference to the DG (outer) class. """ self.can_interface = can_interface @@ -61,8 +58,8 @@ Handles published drain pump data messages. Drain pump data are captured for reference. - \param message: published drain pump data message - \returns none + @param message: published drain pump data message + @return: none """ tgt = struct.unpack('i', bytearray( @@ -77,9 +74,9 @@ """ Constructs and sends the drain pump speed set point override command - \param speed: integer - speed set point (in RPM) to override with - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param speed: integer - speed set point (in RPM) to override with + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ rst = integer_to_bytearray(reset) @@ -115,9 +112,9 @@ """ Constructs and sends the drain pump speed set point override command - \param ms: integer - interval (in ms) to override with - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param ms: integer - interval (in ms) to override with + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ rst = integer_to_bytearray(reset) Index: dialin/dg/hd_proxy.py =================================================================== diff -u -rb3aa5c2a28904bdd0571efd4ec3273938babf3d1 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision b3aa5c2a28904bdd0571efd4ec3273938babf3d1) +++ dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -39,18 +39,18 @@ """ DGHDProxy constructor - \param outer_instance: reference to the DG (outer) class. + @param outer_instance: reference to the DG (outer) class. - \returns DGHDProxy object. + @return: DGHDProxy object. """ self.can_interface = can_interface def cmd_switch_reservoirs(self, reservoirID=RESERVOIR1): """ Constructs and sends the switch reservoirs command - \param res: unsigned int - reservoir to set as active (HD will draw from this reservoir). - \returns 1 if successful, zero otherwise + @param res: unsigned int - reservoir to set as active (HD will draw from this reservoir). + @return: 1 if successful, zero otherwise \details Reservoir IDs: \n 0 = RESERVOIR 1 \n @@ -81,8 +81,8 @@ """ Constructs and sends the fill command - \param volume: unsigned int - volume (in mL) to fill inactive reservoir to. - \returns 1 if successful, zero otherwise + @param volume: unsigned int - volume (in mL) to fill inactive reservoir to. + @return: 1 if successful, zero otherwise """ vol = integer_to_bytearray(volume) @@ -109,8 +109,8 @@ """ Constructs and sends the drain command - \param volume: unsigned int - volume (in mL) to drain the inactive reservoir to. - \returns 1 if successful, zero otherwise + @param volume: unsigned int - volume (in mL) to drain the inactive reservoir to. + @return: 1 if successful, zero otherwise """ vol = integer_to_bytearray(volume) @@ -137,8 +137,8 @@ """ Constructs and sends the start/stop DG command - \param start: boolean - True = start DG, False = stop DG. - \returns 1 if successful, zero otherwise + @param start: boolean - True = start DG, False = stop DG. + @return: 1 if successful, zero otherwise """ if start: @@ -170,8 +170,8 @@ """ Constructs and sends the start/stop DG trimmer heater command - \param start: boolean - True = start heater, False = stop heater. - \returns non-zero integer if successful, False otherwise + @param start: boolean - True = start heater, False = stop heater. + @return: non-zero integer if successful, False otherwise """ if start: Index: dialin/dg/load_cells.py =================================================================== diff -u -r28c6de16995eccda5170c5385752da0cc4277183 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/load_cells.py (.../load_cells.py) (revision 28c6de16995eccda5170c5385752da0cc4277183) +++ dialin/dg/load_cells.py (.../load_cells.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -52,9 +52,9 @@ """ DGLoadCells constructor - \param outer_instance: reference to the DG (outer) class. + @param outer_instance: reference to the DG (outer) class. - \returns DGLoadCells object. + @return: DGLoadCells object. """ self.can_interface = can_interface @@ -74,8 +74,8 @@ Handles published load cell data messages. Load cell data are captured for reference. - \param message: published load cell data message - \returns none + @param message: published load cell data message + @return: none """ a1 = struct.unpack('f', bytearray( @@ -96,10 +96,10 @@ """ Constructs and sends the load cell override command - \param grams: float - weight (in grams) to override sensor with - \param sensor: unsigned int - sensor ID - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param grams: float - weight (in grams) to override sensor with + @param sensor: unsigned int - sensor ID + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise \details Load Cell sensor IDs: \n 0 = A1 \n @@ -134,9 +134,9 @@ """ Constructs and sends the load cell data broadcast interval override command - \param ms: integer - interval (in ms) to override with - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param ms: integer - interval (in ms) to override with + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ rst = integer_to_bytearray(reset) Index: dialin/dg/pressures.py =================================================================== diff -u -rc260906118f578a6d20e5579ed660466ee874fee -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/pressures.py (.../pressures.py) (revision c260906118f578a6d20e5579ed660466ee874fee) +++ dialin/dg/pressures.py (.../pressures.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -52,9 +52,9 @@ """ DGPressures constructor - \param outer_instance: reference to the DG (outer) class. + @param outer_instance: reference to the DG (outer) class. - \returns HDPressureOcclusion object. + @return: HDPressureOcclusion object. """ self.can_interface = can_interface @@ -74,8 +74,8 @@ Handles published pressure data messages. Pressure data are captured for reference. - \param message: published pressure data message - \returns none + @param message: published pressure data message + @return: none """ roi = struct.unpack('f', bytearray( @@ -96,10 +96,10 @@ """ Constructs and sends the pressure override command - \param pressure: unsigned int - pressure (in PSI) - \param sensor: unsigned int - sensor ID - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param pressure: unsigned int - pressure (in PSI) + @param sensor: unsigned int - sensor ID + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise \details pressure sensor IDs: \n 0 = RO Pump Inlet \n @@ -134,9 +134,9 @@ """ Constructs and sends the pressure override command - \param ms: unsigned int - broadcast interval (in ms) - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param ms: unsigned int - broadcast interval (in ms) + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ Index: dialin/dg/reservoirs.py =================================================================== diff -u -r9d9105c7dc3379c2e14996522291b23a19e7ba46 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/reservoirs.py (.../reservoirs.py) (revision 9d9105c7dc3379c2e14996522291b23a19e7ba46) +++ dialin/dg/reservoirs.py (.../reservoirs.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -20,9 +20,9 @@ class DGReservoirs: """ - \class DGReservoirs + DGReservoirs - \brief Dialysate Generator (DG) Dialin API sub-class for reservoir related commands. + Dialysate Generator (DG) Dialin API sub-class for reservoir related commands. """ # Reservoir message IDs @@ -44,9 +44,9 @@ """ DGReservoirs constructor - \param outer_instance: reference to the DG (outer) class. + @param outer_instance: reference to the DG (outer) class. - \returns HDPressureOcclusion object. + @return: HDPressureOcclusion object. """ self.can_interface = can_interface @@ -65,8 +65,8 @@ Handles published reservoir data messages. Reservoir data are captured for reference. - \param message: published reservoir data message - \returns none + @param message: published reservoir data message + @return: none """ res = struct.unpack('i', bytearray( Index: dialin/dg/ro_pump.py =================================================================== diff -u -r832c90d58ce012f8c4dbfb3cfaa6fcf631724dbb -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/ro_pump.py (.../ro_pump.py) (revision 832c90d58ce012f8c4dbfb3cfaa6fcf631724dbb) +++ dialin/dg/ro_pump.py (.../ro_pump.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -22,10 +22,9 @@ class DGROPump: """ - \class DGROPump + DGROPump + Dialysate Generator (DG) Dialin API sub-class for RO pump related commands. - \brief Dialysate Generator (DG) Dialin API sub-class for RO pump related commands. - """ # RO pump message IDs @@ -46,7 +45,7 @@ """ DGROPump constructor - \param outer_instance: reference to the DG (outer) class. + @param outer_instance: reference to the DG (outer) class. """ self.can_interface = can_interface @@ -65,8 +64,8 @@ Handles published ro pump data messages. RO pump data are captured for reference. - \param message: published RO pump data message - \returns none + @param message: published RO pump data message + @return: none """ tgt = struct.unpack('i', bytearray( @@ -84,9 +83,9 @@ """ Constructs and sends the RO pump set point override command - \param pressure: integer - pressure set point (in PSI) to override with - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param pressure: integer - pressure set point (in PSI) to override with + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ rst = integer_to_bytearray(reset) @@ -122,9 +121,9 @@ """ Constructs and sends the RO rate override command - \param flow: float - flow rate (in L/min) to override with - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param flow: float - flow rate (in L/min) to override with + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ rst = integer_to_bytearray(reset) @@ -160,9 +159,9 @@ """ Constructs and sends the RO pump set point override command - \param ms: integer - time interval (in ms) to broadcast RO pump data - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param ms: integer - time interval (in ms) to broadcast RO pump data + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ rst = integer_to_bytearray(reset) Index: dialin/dg/valves.py =================================================================== diff -u -r0ddc890d792da89bcea0237f349d3a9185b411a3 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/dg/valves.py (.../valves.py) (revision 0ddc890d792da89bcea0237f349d3a9185b411a3) +++ dialin/dg/valves.py (.../valves.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -59,9 +59,9 @@ """ DGValves constructor - \param outer_instance: reference to the DG (outer) class. + @param outer_instance: reference to the DG (outer) class. - \returns DGValvesStates object. + @return: DGValvesStates object. """ self.can_interface = can_interface @@ -95,8 +95,8 @@ """ Handles published valves states message. - \param message: published valves states message - \returns none + @param message: published valves states message + @return: none """ vst = struct.unpack('H', bytearray(message['message'][self.START_POS_VALVES_STATES:self.END_POS_VALVES_STATES])) @@ -120,10 +120,10 @@ """ Constructs and sends the valve state override command - \param state: bool - valve state - \param valve: unsigned int - valve ID - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param state: bool - valve state + @param valve: unsigned int - valve ID + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise \details valve IDs: \n 0 = Valve Reservoir Fill @@ -167,9 +167,9 @@ """ Constructs and sends the valve state override command - \param ms: unsigned int - broadcast interval (in ms) - \param reset: integer - 1 to reset a previous override, 0 to override - \returns 1 if successful, zero otherwise + @param ms: unsigned int - broadcast interval (in ms) + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ Index: dialin/hd/alarms.py =================================================================== diff -u -ra0ed06c29521c6492a25eeb1070f2bc26d9224c1 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/hd/alarms.py (.../alarms.py) (revision a0ed06c29521c6492a25eeb1070f2bc26d9224c1) +++ dialin/hd/alarms.py (.../alarms.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -69,9 +69,9 @@ """ HD_Alarms constructor - \param outer_instance: reference to the HD (outer) class. + @param outer_instance: reference to the HD (outer) class. - \returns HD_Alarms object. + @return: HD_Alarms object. """ self.can_interface = can_interface @@ -105,8 +105,8 @@ Handles published alarms status messages. alarms status data are captured for reference. - \param message: published blood flow data message - \returns none + @param message: published blood flow data message + @return: none """ self.alarms_state = int.from_bytes(bytearray( @@ -129,8 +129,8 @@ """ Handles published HD alarm activation messages. - \param message: published HD alarm activation message - \returns none + @param message: published HD alarm activation message + @return: none """ alarm_id = struct.unpack('= the current log level. Also logs the message. - \param message: The message to print and log - \param log_level: The logging level, indicates the severity of the message + @param message: The message to print and log + @param log_level: The logging level, indicates the severity of the message - \returns: None + @return:: None """ if not self.logging_enabled: return Index: dialin/utils/conversions.py =================================================================== diff -u -r8c39fe1f9affe360ee6a97c5e6243e58a5c27509 -rc6596d42d995bed3789849bd85c83da5a3837fac --- dialin/utils/conversions.py (.../conversions.py) (revision 8c39fe1f9affe360ee6a97c5e6243e58a5c27509) +++ dialin/utils/conversions.py (.../conversions.py) (revision c6596d42d995bed3789849bd85c83da5a3837fac) @@ -6,8 +6,8 @@ """ Converts an integer value into a byte array (little endian) - \param val: integer to convert to byte array - \returns byte array + @param val: integer to convert to byte array + @return: byte array """ fmt = '%08x' # integer to hex string formatter b = unhexlify(fmt % val) # convert int to byte array @@ -19,8 +19,8 @@ """ Converts a float value into a byte array (little endian) - \param val: float to convert to byte array - \returns byte array + @param val: float to convert to byte array + @return:: byte array """ b = struct.pack('