Index: HD/HD_DialOutFlow.py =================================================================== diff -u -rc5826238ca4b80671231a9c564af3ea01b9be06f -r0da0106eca868b9144298c60911710b3414a5837 --- HD/HD_DialOutFlow.py (.../HD_DialOutFlow.py) (revision c5826238ca4b80671231a9c564af3ea01b9be06f) +++ HD/HD_DialOutFlow.py (.../HD_DialOutFlow.py) (revision 0da0106eca868b9144298c60911710b3414a5837) @@ -25,7 +25,7 @@ class DialOutStates(Enum): """ - Defines dialout states, i.e., STOP, RUN and PAUSE + Defines dialout states, i.e., STOP, RUN and PAUSE """ STOP = 0 RUN = 1 @@ -34,7 +34,7 @@ class HDDialOut: """ - Encapsulates command for testing dialout flow module. + Encapsulates command for testing dialout flow module. """ can = None @@ -50,14 +50,14 @@ def __init__(self, can_interface): """ - Constructor for the HDDialOut class + Constructor for the HDDialOut class - \param can_interface: reference to DenaliMessenger + \param can_interface: reference to DenaliMessenger """ self.can_interface = can_interface self.can_interface.register_receiving_publication_function(channel_id=DenaliChannels.hd_sync_broadcast_ch_id, message_id=self.MSG_ID_DIALYSATE_UF_DATA, - function=self.receiveDialysateUFDataHandler) + function=self.handler_receive_dialysate_uf_data) ## DialOutBroadcast a dictionary storing latest broadcast values of the following keys: # state, target_volume, measured_volume, pwm, motor_current, motor_speed. self.DialOutBroadcast = {'target_volume': 0, @@ -76,9 +76,9 @@ # 'pwm': []} #self.__time = 0 - def setUFState(self, new_state): + def set_uf_state(self, new_state): """ - setUFState function sets the new states to STOP, RUN or PAUSE + set_uf_state function sets the new states to STOP, RUN or PAUSE \param new_state: from DialOutStates.STOP, DialOutStates.RUN or DialoutStates.PAUSE \return: TRUE if confirmed, FALSE if HD had error or None for time out or incorrect parameters """ @@ -92,16 +92,16 @@ payload=payload) received_msg = self.can_interface.send(msg) else: - print("Argument to setUFState method are incorrect", file=sys.stderr) + print("Argument to set_uf_state method are incorrect", file=sys.stderr) if received_msg is not None: return_value = True if DenaliMessage.get_payload(received_msg)[0] == 1 else False return return_value - def setUFRx(self, rx_total_volume_ml, rx_time_min, rx_flow_rate): + def set_uf_rx(self, rx_total_volume_ml, rx_time_min, rx_flow_rate): """ - setUFRx function sets prescription for UF. Total Volume, time in minutes and flow rate + set_uf_rx function sets prescription for UF. Total Volume, time in minutes and flow rate \param rx_total_volume_ml (integer) is total volume in ml \param rx_time_min (integer) is rx time \param rx_flow_rate (integer) is described flow rate @@ -123,14 +123,14 @@ received_msg = self.can_interface.send(msg) print(received_msg) else: - print("Arguments to setUFRx are incorrect", file=sys.stderr) + print("Arguments to set_uf_rx are incorrect", file=sys.stderr) if received_msg is not None: return_value = True if DenaliMessage.get_payload(received_msg)[0] == 1 else False return return_value - def receiveDialysateUFDataHandler(self, message): + def handler_receive_dialysate_uf_data(self, message): """ Receiver method that handles UF broadcast data from the HD. \param message: Denali message received @@ -162,7 +162,7 @@ #self.__BroadCastSignals['pwm'].append(self.DialOutBroadcast['pwm']) #self.__time += 1 - def plotBroadCastSignals(self): + def plot_broadcast_signals(self): """ Temporary method to demo STOP, PLAY and PAUSE behavior with simulator. \return: None