import sys sys.path.append("..") from dialin.hd.hemodialysis_device import HD from time import sleep if __name__ == "__main__": # create an HD object called hd hd = HD(log_level='DEBUG') if hd.cmd_log_in_to_hd() == 0: exit(1) sleep(2) cal = hd.calibration_record print(cal.hd_calibration_record) #cal.hd_calibration_record['pumps']['bp']['pwm_to_speed'][1] = 17.0 #print(cal.hd_calibration_record) status = False try: if status: dara = [] cal.get_hd_calibration_record() while True: sleep(0.2) #print(cal.current_message, cal.total_messages, cal.cal_data) if cal.cal_data != 0: #f.write(str(cal.cal_data) + '\r') dara.append(cal.cal_data) if cal.current_message == cal.total_messages: #f.close() break else: cal.set_hd_calibration_record() print(cal.hd_calibration_record) except KeyboardInterrupt: #f.close() pass #cal.set_hd_calibration_record()