Index: tests/dg_heat_disinfect_test.py =================================================================== diff -u -rdd42e4d9cfe821b0a755ccc86cc1a4a2a3dd2f37 -r16c42ec1b3d2ee30b81a3a06a130cc9ab00cbe62 --- tests/dg_heat_disinfect_test.py (.../dg_heat_disinfect_test.py) (revision dd42e4d9cfe821b0a755ccc86cc1a4a2a3dd2f37) +++ tests/dg_heat_disinfect_test.py (.../dg_heat_disinfect_test.py) (revision 16c42ec1b3d2ee30b81a3a06a130cc9ab00cbe62) @@ -3,8 +3,6 @@ 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_disinfect import HeatDisinfectStates, CancellationModes from dialin.dg.drain_pump import DrainPumpStates from dialin.dg.thermistors import ThermistorsNames @@ -86,19 +84,29 @@ def get_ro_info(): - info = ('RO, {}, PPi, {:5.3f}, PPo, {:5.3f}, PWM, {:5.3f}, Flow, {:5.3f}, ' + info = ('RO, {}, PPi, {:5.3f}, PPo, {:5.3f}, PWM, {:5.3f}, Flow, {:5.3f}, Tgt_flow, {:5.3f}, ' .format(dg.ro_pump.ro_pump_state, dg.pressures.ro_pump_inlet_pressure, dg.pressures.ro_pump_outlet_pressure, dg.ro_pump.pwm_duty_cycle_pct, - dg.ro_pump.measured_flow_rate_lpm)) + dg.ro_pump.measured_flow_rate_lpm, dg.ro_pump.target_flow_lpm)) return info def get_heaters_info(): - info = ('Pri_main_DC, {:5.3f}, Pri_small_DC, {:5.3f}, Pri_int_temp, {:5.3f}, Trimmer_DC, {:5.3f}, '. + info = ('Pri_main_DC, {:5.3f}, Pri_small_DC, {:5.3f}, Pri_int_temp, {:5.3f}, Prim_CJ_temp, {:5.3f}, ' + 'Prim_TC_temp, {:5.3f}, Trimmer_DC, {:5.3f}, Trim_int_temp, {:5.3f}, Trim_CJ_temp, {:5.3f}, ' + 'Trim_TC_temp, {:5.3f}, Prim_TC_raw, {:5.3f}, Prim_CJ_raw, {:5.3f}, Trimmer_TC_raw, {:5.3f}, ' + 'Trimmer_CJ_raw, {:5.3f}, '. format(dg.heaters.main_primary_heater_duty_cycle, dg.heaters.small_primary_heater_duty_cycle, dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.PRIMARY_HEATER_INTERNAL.name], - dg.heaters.trimmer_heater_duty_cycle)) + dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.PRIMARY_HEATER_COLD_JUNCTION.name], + dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.PRIMARY_HEATER_THERMOCOUPLE.name], + dg.heaters.trimmer_heater_duty_cycle, + dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.TRIMMER_HEATER_INTERNAL.name], + dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.TRIMMER_HEATER_COLD_JUNCTION.name], + dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.TRIMMER_HEATER_THERMOCOUPLE.name], + dg.temperature_sensors.primary_raw_thermo_couple, dg.temperature_sensors.primary_raw_cold_junc, + dg.temperature_sensors.trimmer_raw_thermo_couple, dg.temperature_sensors.trimmer_raw_cold_junc)) return info @@ -128,18 +136,12 @@ return info -def actuate_valve(): - - dg.valves.cmd_valve_override(0, dg.valves.VALVE_RESERVOIR_DRAIN) - sleep(1) - dg.valves.cmd_valve_override(1, dg.valves.VALVE_RESERVOIR_DRAIN) - - def run_heat_disinfect(): complete_counter = 1 - f = open("Heat_disinfect.log", "w") - #dg.heat_disinfect.cmd_start_stop_heat_disinfect() + f = open("/home/fw/projects/dialin/tests/Heat_disinfect.log", "w") + #dg.hd_proxy.cmd_start_stop_heat_disinfect() + try: while True: @@ -158,20 +160,21 @@ f.write(var) sleep(1) - # If the state is complete - if HeatDisinfectStates(dg.heat_disinfect.heat_disinfect_state).name == 'DG_HEAT_DISINFECT_STATE_COMPLETE': + # If the mode came back to standby or standby solo + if dg.dg_operation_mode == 3 or dg.dg_operation_mode == 4: # If it is the first call, stop heat disinfect if complete_counter == 1: - dg.heat_disinfect.cmd_start_stop_heat_disinfect(start=False) + dg.hd_proxy.cmd_start_stop_heat_disinfect(start=False) # Write a few more complete states to make sure the complete state items are recorded elif complete_counter == 3: + #pass f.close() break complete_counter += 1 except KeyboardInterrupt: - dg.heat_disinfect.cmd_start_stop_heat_disinfect(start=False) + dg.hd_proxy.cmd_start_stop_heat_disinfect(start=False) f.close() @@ -185,4 +188,4 @@ run_heat_disinfect() - #actuate_valve() +