Index: tests/dg_heat_disinfect_test.py =================================================================== diff -u -r0035249fd22540886ba093c4e7dc72f9ba8c8353 -r2cbba85a1d29583fef38e818844c9dbe64933598 --- tests/dg_heat_disinfect_test.py (.../dg_heat_disinfect_test.py) (revision 0035249fd22540886ba093c4e7dc72f9ba8c8353) +++ tests/dg_heat_disinfect_test.py (.../dg_heat_disinfect_test.py) (revision 2cbba85a1d29583fef38e818844c9dbe64933598) @@ -3,6 +3,7 @@ import sys sys.path.append("..") from dialin.dg.dialysate_generator import DG +from dialin.hd.hemodialysis_device import HD from dialin.dg.hd_proxy import DGHDProxy from dialin.dg.heat_disinfection import HeatDisinfectStates from dialin.dg.drain_pump import DrainPumpStates @@ -16,24 +17,27 @@ dg = DG(log_level='DEBUG') dg.cmd_log_in_to_dg() + sleep(1) + f = open("RO_Pump_Low.log", "w") - #dg.uv_reactors.cmd_start_stop_inlet_uv_reactor(state=ReactorsStates.UV_REACTOR_STATE_ON.name) - #sleep(1) - #dg.thermistors.cmd_thermistors_value_override(52.2, ThermistorsNames.THERMISTOR_ONBOARD_NTC.value, reset=1) - #sleep(2) try: - #dg.hd_proxy.cmd_start_stop_dg(start=False) - #sleep(4) dg.hd_proxy.cmd_start_stop_dg() + sleep(1) while True: - sleep(0.5) - print("Duty, {}, Pressure, {}, Flow, {}, state, {}".format(dg.ro_pump.pwm_duty_cycle_pct, - dg.pressures.ro_pump_outlet_pressure, - dg.ro_pump.measured_flow_rate_lpm, - dg.ro_pump.ro_pump_state)) + sleep(0.1) + var = "Mode, {}, Duty, {:5.3f}, Pres, {:5.3f}, Tgt_Pres, {:5.3f}, Flow, {:5.3f}, State, {}\r".format( + dg.dg_operation_mode, + dg.ro_pump.pwm_duty_cycle_pct, + dg.pressures.ro_pump_outlet_pressure, + dg.ro_pump.target_pressure_psi, + dg.ro_pump.measured_flow_rate_lpm, + dg.ro_pump.ro_pump_state) + print(var) + f.write(var) + except KeyboardInterrupt: - print('here') dg.hd_proxy.cmd_start_stop_dg(start=False) + f.close() """"