Index: tests/uf_test.py =================================================================== diff -u -r0ddc890d792da89bcea0237f349d3a9185b411a3 -r42f9e1c68d750dd5a412aeb23120a57771277417 --- tests/uf_test.py (.../uf_test.py) (revision 0ddc890d792da89bcea0237f349d3a9185b411a3) +++ tests/uf_test.py (.../uf_test.py) (revision 42f9e1c68d750dd5a412aeb23120a57771277417) @@ -28,11 +28,11 @@ sleep(2) # log in to HD and DG as tester - if hd.cmd_log_in_to_hd() == 0: - exit(1) - if dg.cmd_log_in_to_dg() == 0: - exit(1) - sleep(1) +# if hd.cmd_log_in_to_hd() == 0: +# exit(1) +# if dg.cmd_log_in_to_dg() == 0: +# exit(1) +# sleep(1) # create log file with open("UF_test.log", "w") as f: @@ -42,10 +42,17 @@ sleep(1) modes = "HD.m, " + '{:2d}'.format(hd.hd_operation_mode) + \ ", DG.m, " + '{:2d}'.format(dg.dg_operation_mode) + \ - ", Dg.s, " + '{:2d}'.format(dg.dg_operation_sub_mode) + ", DG.s, " + '{:2d}'.format(dg.dg_operation_sub_mode) + loadCells = ", A1, " + '{:8.1f}'.format(dg.load_cells.load_cell_A1) + \ + ", B1, " + '{:8.1f}'.format(dg.load_cells.load_cell_B1) + \ + ", A2, " + '{:8.1f}'.format(dg.load_cells.load_cell_A2) + \ + ", B2, " + '{:8.1f}'.format(dg.load_cells.load_cell_B2) + ultraFilt = ", RfUF, " + '{:9.2f}'.format(hd.dialysate_outlet_flow.reference_dialysate_outlet_uf_volume) + \ + ", MsUF, " + '{:9.2f}'.format(hd.dialysate_outlet_flow.measured_dialysate_outlet_uf_volume) + \ + ", Act.Res, " + '{:1d}'.format(dg.reservoirs.active_reservoir) + valves = ", Vlv, " + '{:4X}'.format(dg.valves.valve_states_all) pumpSetPts = ", B.s, " + '{:4d}'.format(hd.bloodflow.target_blood_flow_rate) + \ ", DI.s, " + '{:4d}'.format(hd.dialysate_inlet_flow.target_dialysate_inlet_flow_rate) + \ - ", DO.s, N/A" + \ ", RO.s, " + '{:4d}'.format(dg.ro_pump.target_pressure_psi) + \ ", DR.s, " + '{:5d}'.format(dg.drain_pump.target_drain_pump_speed_RPM) pumpMeasSpds = ", B.m, " + '{:7.1f}'.format(hd.bloodflow.measured_blood_pump_speed) + \ @@ -62,42 +69,34 @@ ", DO.w, " + '{:6.1f}'.format(hd.dialysate_outlet_flow.pwm_duty_cycle_pct) + \ ", RO.w, " + '{:6.1f}'.format(dg.ro_pump.pwm_duty_cycle_pct) + \ ", DR.w, " + '{:4d}'.format(dg.drain_pump.dac_value) - loadCells = ", A1, " + '{:8.1f}'.format(dg.load_cells.load_cell_A1) + \ - ", B1, " + '{:8.1f}'.format(dg.load_cells.load_cell_B1) + \ - ", A2, " + '{:8.1f}'.format(dg.load_cells.load_cell_A2) + \ - ", B2, " + '{:8.1f}'.format(dg.load_cells.load_cell_B2) - ultraFilt = ", RfUF, " + '{:9.2f}'.format(hd.dialysate_outlet_flow.reference_dialysate_outlet_uf_volume) + \ - ", MsUF, " + '{:9.2f}'.format(hd.dialysate_outlet_flow.measured_dialysate_outlet_uf_volume) + \ - ", Act.Res, " + '{:1d}'.format(dg.reservoirs.active_reservoir) - dgPres = ", ROi, " + '{:8.1f}'.format(dg.pressures.ro_pump_inlet_pressure) + \ - ", ROo, " + '{:8.1f}'.format(dg.pressures.ro_pump_outlet_pressure) + \ - ", DRi, " + '{:8.1f}'.format(dg.pressures.drain_pump_inlet_pressure) + \ - ", DRo, " + '{:8.1f}'.format(dg.pressures.drain_pump_outlet_pressure) - valves = ", Vlv, " + '{:4X}'.format(dg.valves.valve_states_all) + dgPres = ", ROi, " + '{:9.2f}'.format(dg.pressures.ro_pump_inlet_pressure) + \ + ", ROo, " + '{:9.2f}'.format(dg.pressures.ro_pump_outlet_pressure) + \ + ", DRi, " + '{:9.2f}'.format(dg.pressures.drain_pump_inlet_pressure) + \ + ", DRo, " + '{:9.2f}'.format(dg.pressures.drain_pump_outlet_pressure) alarms = ", AL.s, " + hd.alarms.getCurrentAlarmsState() + \ ", AL.t, " + '{:4d}'.format(hd.alarms.alarm_top) # log data f.write(modes) + f.write(loadCells) + f.write(ultraFilt) + f.write(valves) f.write(pumpSetPts) f.write(pumpMeasSpds) f.write(pumpPWMs) - f.write(loadCells) - f.write(ultraFilt) f.write(dgPres) - f.write(valves) f.write(alarms) f.write("\n") # print to console print(" Modes: "+modes) + print(" Load Cells: "+loadCells) + print("Ultrafiltration: "+ultraFilt) + print(" DG Valves: "+valves) print("Pump Set Points: "+pumpSetPts) print(" Pump Speeds: "+pumpMeasSpds) print(" Pump PWMs/DACs: "+pumpPWMs) - print(" Load Cells: "+loadCells) - print("Ultrafiltration: "+ultraFilt) print(" DG Pressures: "+dgPres) - print(" DG Valves: "+valves) print(" Alarms: "+alarms)