Index: dialin/hd/air_bubbles.py =================================================================== diff -u -rab9f086590a97f92856343bba1263dafa39a566f -r801527f052cc3ca768d768401164c0072892442d --- dialin/hd/air_bubbles.py (.../air_bubbles.py) (revision ab9f086590a97f92856343bba1263dafa39a566f) +++ dialin/hd/air_bubbles.py (.../air_bubbles.py) (revision 801527f052cc3ca768d768401164c0072892442d) @@ -31,6 +31,10 @@ ADV: Air bubble Detector Venous """ + # Air bubble detectors + ADA = 0 # Air bubble Detector Arterial + ADV = 1 # Air bubble Detector Venous + # Air bubble detectors status BUBBLE_DETECTED_STATUS = 0 # Air bubble detected FLUID_DETECTED_STATUS = 1 # Fluid (no air bubble) detected @@ -100,7 +104,7 @@ Must be logged into HD. Given detector must be one of the detectors listed below. - @param detected: unsigned int - detected (0=air bubble, 1=fluid) to override detector with + @param status: unsigned int - status (0=air bubble, 1=fluid) to override detector with @param index: integer - 0 for ADA status override, 1 for ADV status override @param reset: integer - 1 to reset a previous override, 0 to override @return: 1 if successful, zero otherwise @@ -115,9 +119,9 @@ message_id=MsgIds.MSG_ID_HD_BUBBLE_STATUS_OVERRIDE.value, payload=payload) - if index == 0: + if index == self.ADA: self.logger.debug("Override air bubble detector ADA status value") - elif index == 1: + elif index == self.ADV: self.logger.debug("Override air bubble detector ADV status value") # Send message @@ -147,9 +151,9 @@ message_id=MsgIds.MSG_ID_HD_BUBBLES_SELF_TEST_REQUEST.value, payload=payload) - if index == 0: + if index == self.ADA: self.logger.debug("Request air bubble self-test for detector ADA") - elif index == 1: + elif index == self.ADV: self.logger.debug("Request air bubble self-test for detector ADV") # Send message Index: tests/hd_air_bubbles_data.py =================================================================== diff -u -ra09fdc812d51f12d6e9a3639c3f8bcb29536b853 -r801527f052cc3ca768d768401164c0072892442d --- tests/hd_air_bubbles_data.py (.../hd_air_bubbles_data.py) (revision a09fdc812d51f12d6e9a3639c3f8bcb29536b853) +++ tests/hd_air_bubbles_data.py (.../hd_air_bubbles_data.py) (revision 801527f052cc3ca768d768401164c0072892442d) @@ -20,6 +20,10 @@ from time import sleep if __name__ == "__main__": + # Air bubble detectors + ADA = 0 # Air bubble Detector Arterial + ADV = 1 # Air bubble Detector Venous + # Create an HD object called hd hd = HD() sleep(2) @@ -29,9 +33,9 @@ #hd.air_bubbles.cmd_air_bubbles_data_broadcast_interval_override(100) # Self-test state - #hd.air_bubbles.cmd_air_bubble_self_test_request(0) + #hd.air_bubbles.cmd_air_bubble_self_test_request(ADA) #sleep(0.1) - #hd.air_bubbles.cmd_air_bubble_self_test_request(1) + #hd.air_bubbles.cmd_air_bubble_self_test_request(ADV) #sleep(0.1) while True: