Index: DialysateGenerator.py =================================================================== diff -u -reeded10f89bd0722474d326a6423c755a11cc988 -r775bd1d38729a446678d843b8d36a5ae0eae5f97 --- DialysateGenerator.py (.../DialysateGenerator.py) (revision eeded10f89bd0722474d326a6423c755a11cc988) +++ DialysateGenerator.py (.../DialysateGenerator.py) (revision 775bd1d38729a446678d843b8d36a5ae0eae5f97) @@ -17,12 +17,12 @@ from DialityCoreCanProtocol import * from time import sleep -""" :mainpage Dialin API +""" \mainpage Dialin API Dialin API is comprised primarily by 3 classes: - - :ref DialysateGenerator.DG - - :ref HemodialysisDevice.HD + - \ref DialysateGenerator.DG + - \ref HemodialysisDevice.HD """ @@ -32,7 +32,7 @@ class DG: """ - :class DG + \class DG Dialysate Generator (DG) Dialin object API. It provides the basic interface to communicate with the DG board @@ -43,32 +43,34 @@ """ DG constructor using can bus - :param can__interface: can bus, e.g. "can0" + \param can__interface: string with can bus name, e.g. "can0" - :returns DG object that allows communication with board via port + \returns DG object that allows communication with board via port - :details For example: + \details For example: - dg_object = DG(can__interface='can0') or - dg_object = DG('can0') + dg_object = DG(can__interface='can0') or + dg_object = DG('can0') """ # Create listener - self.__can_interface = DialinCanMessenger(can_interface=can__interface) - self.__can_interface.registerReceivingPublicationFunction(channel_id=DialinChannels.dg_sync_broadcast_ch_id, + self.__can_interface = DenaliCanMessenger(can_interface=can__interface) + self.__can_interface.registerReceivingPublicationFunction(channel_id=DenaliChannels.dg_sync_broadcast_ch_id, message_id=0x7100, function=PublicationReceiverHandler) self.__can_interface.start() def fill(self, start_or_stop='start'): """ - request the DG board to fill + request the DG board to 'start' or to 'stop' fill - :returns True if ran the command, False otherwise, returns None if timeout + \param start_or_stop is a string indicating which action to take, e.g., 'start' or 'stop' + + \returns True if ran the command, False otherwise, returns None if timeout """ payload = [1] if start_or_stop == 'start' else [0] - msg = DialinMessage.buildMessage(channel_id=DialinChannels.ui_to_hd_ch_id, + msg = DenaliMessage.buildMessage(channel_id=DenaliChannels.hd_to_dg_ch_id, message_id=1000, payload=payload) @@ -77,7 +79,7 @@ returnValue = None if received_msg is not None: - returnValue = True if DialinMessage.getPayload(received_msg)[0] == 1 else False + returnValue = True if DenaliMessage.getPayload(received_msg)[0] == 1 else False return returnValue @@ -100,6 +102,8 @@ test_packet = test_dg.fill('stop') test_fill_print(test_packet) +# del test_dg + # sleep(1) # test_packet = test_dg.fill('start') # test_fill_print(test_packet)