Index: dialin/hd/syringe_pump.py =================================================================== diff -u -r0b18cfb156484335a10a6ff0947f2ef874bd9928 -re75b8c0ebfdb35c2fc1fb2a66edf30ed1d23ada9 --- dialin/hd/syringe_pump.py (.../syringe_pump.py) (revision 0b18cfb156484335a10a6ff0947f2ef874bd9928) +++ dialin/hd/syringe_pump.py (.../syringe_pump.py) (revision e75b8c0ebfdb35c2fc1fb2a66edf30ed1d23ada9) @@ -143,6 +143,14 @@ """ return self.syringe_pump_force_v + def get_syringe_pump_safety_volume(self): + """ + Gets the current syringe pump safety volume reading + + @return: latest published safety volume calculated by HD firmware + """ + return self.syringe_pump_safety_volume_ml + @_publish(["syringe_pump_state", "syringe_pump_set_rate_ml_hr", "syringe_pump_meas_rate_ml_hr","syringe_pump_position", "syringe_pump_volume_ml","syringe_pump_home_v", Index: tests/test_voltages.py =================================================================== diff -u -r3fb7646b2d2a5346ac5b6eecbcee97ccc643d8be -re75b8c0ebfdb35c2fc1fb2a66edf30ed1d23ada9 --- tests/test_voltages.py (.../test_voltages.py) (revision 3fb7646b2d2a5346ac5b6eecbcee97ccc643d8be) +++ tests/test_voltages.py (.../test_voltages.py) (revision e75b8c0ebfdb35c2fc1fb2a66edf30ed1d23ada9) @@ -19,42 +19,47 @@ from dialin.hd.hemodialysis_device import HD from time import sleep from dialin.hd.voltages import HDMonitoredVoltages +from dialin.hd.constants import RESET, NO_RESET if __name__ == "__main__": # create an HD object called hd hd = HD() sleep(2) # log in to HD and DG as tester -# if hd.cmd_log_in_to_hd() == 0: -# print("Failed to log into HD.") -# exit(1) -# sleep(1) + if hd.cmd_log_in_to_hd() == 0: + print("Failed to log into HD.") + exit(1) + sleep(1) + # override alarms/voltages broadcast interval to 100 ms + hd.voltages.cmd_monitored_voltages_broadcast_interval_override(100,NO_RESET) + hd.alarms.cmd_alarm_info_broadcast_interval_override(100,NO_RESET) + # create log file - with open("voltages_test.log", "w") as f: + with open("/home/fw/projects/dialin/tests/v_test.log", "w") as f: # write column header labels to log file header = "1.2V, 3.3V, 5V Logic, 5V Sensors, 24V, 24V Regen, FPGA RefV, PBA RefV, AlmCurrHg, AlmCurrLg, AlmBckpCurr\n" f.write(header) # write monitored voltages related data from HD to log file while True: - sleep(1) + sleep(0.1) v = hd.voltages.get_monitored_voltages() a1 = hd.alarms.alarm_audio_curr_hg a2 = hd.alarms.alarm_audio_curr_lg a3 = hd.alarms.alarm_backup_audio_curr - voltageData = '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_1_2V.value]) + \ - ", " + '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_3_3V.value]) + \ - ", " + '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_5V_LOGIC.value]) + \ - ", " + '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_5V_SENSORS.value]) + \ - ", " + '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_24V.value]) + \ - ", " + '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_24V_REGEN.value]) + \ - ", " + '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_FPGA_REF_V.value]) + \ - ", " + '{:15.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_PBA_REF_V.value]) + \ - ", " + '{:15.6f}'.format(hd.alarms.alarm_audio_curr_hg) + \ - ", " + '{:15.6f}'.format(hd.alarms.alarm_audio_curr_lg) + \ - ", " + '{:15.6f}'.format(hd.alarms.alarm_backup_audio_curr) + voltageData = '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_1_2V.value]) + \ + ", " + '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_3_3V.value]) + \ + ", " + '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_5V_LOGIC.value]) + \ + ", " + '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_5V_SENSORS.value]) + \ + ", " + '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_24V.value]) + \ + ", " + '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_24V_REGEN.value]) + \ + ", " + '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_FPGA_REF_V.value]) + \ + ", " + '{:11.6f}'.format(v[HDMonitoredVoltages.MONITORED_LINE_PBA_REF_V.value]) + \ + ", " + '{:11.6f}'.format(hd.alarms.alarm_audio_curr_hg) + \ + ", " + '{:11.6f}'.format(hd.alarms.alarm_audio_curr_lg) + \ + ", " + '{:11.6f}'.format(hd.alarms.alarm_backup_audio_curr) # log data f.write(voltageData+"\n")