########################################################################### # # Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file test_lc.py # # @author (last) Sean Nash # @date (last) 24-Mar-2021 # @author (original) Sean Nash # @date (original) 15-Mar-2021 # ############################################################################ import sys sys.path.append("..") from dialin.dg.dialysate_generator import DG from time import sleep if __name__ == "__main__": # create a DG object called dg dg = DG() sleep(2) # log in to DG as tester # if dg.cmd_log_in_to_dg() == 0: # exit(1) # sleep(1) # create log file with open("LC_test.log", "w") as f: # collect load cell related data from DG while True: sleep(0.1) loadCells = "FILTERED:, A1, " + '{:8.2f}'.format(dg.load_cells.load_cell_A1) + \ ", B1, " + '{:8.2f}'.format(dg.load_cells.load_cell_B1) + \ ", A2, " + '{:8.2f}'.format(dg.load_cells.load_cell_A2) + \ ", B2, " + '{:8.2f}'.format(dg.load_cells.load_cell_B2) # log data f.write(loadCells) f.write("\n") # print to console print(" Load Cells: "+loadCells)