Index: tests/dg_tests.py =================================================================== diff -u -rd784180e6543330849bf7fbb6bd9acfd36323706 -r12a7cb24fdb8f871aa4da49b859e0fef567255b1 --- tests/dg_tests.py (.../dg_tests.py) (revision d784180e6543330849bf7fbb6bd9acfd36323706) +++ tests/dg_tests.py (.../dg_tests.py) (revision 12a7cb24fdb8f871aa4da49b859e0fef567255b1) @@ -48,7 +48,7 @@ from dialin.hd.valves import HDValves from dialin.hd.voltages import HDMonitoredVoltages from dialin.hd.pretreatment import PreTreatmentRsrvrState -from dialin.common.dg_defs import DGFlushStates, DGHeatDisinfectActiveCoolStates +from dialin.common.dg_defs import DGFlushStates, DGHeatDisinfectActiveCoolStates, DGROPermeateSampleSates from dialin.common.test_config_defs import DGTestConfigOptions, HDTestConfigOptions from time import sleep from datetime import datetime @@ -129,6 +129,16 @@ return info +def get_ro_permeate_sample_mode_info(): + state = DGROPermeateSampleSates(dg.ro_permeate_sample.ro_permeate_sample_state).name + overall_elapsed_time = dg.ro_permeate_sample.overall_elapsed_time + state_elapsed_time = dg.ro_permeate_sample.state_elapsed_time + + info = ('State, {}, Overall_elapsed_time, {}, State_elapsed_time, {}, ' + .format(state, overall_elapsed_time, state_elapsed_time)) + return info + + def get_flush_mode_info(): info = ('State, {}, Overall_elapsed_time, {}, State_elapsed_time, {}, Drain_vol, {:5.3f}, Top_alarm, {}, ' .format(DGFlushStates(dg.flush.flush_state).name, dg.flush.overall_elapsed_time, dg.flush.state_elapsed_time, @@ -461,19 +471,15 @@ f.close() -def run_heat_disinfect(): +def run_ro_permeate_sample(): complete_counter = 1 - address = os.path.join(os.getcwd(), "heat_disinfect.log") + address = os.path.join(os.getcwd(), "ro_permeate_sample.log") f = open(address, "w") - #dg.heaters.cmd_heaters_broadcast_interval_override(50) - #sleep(1) - dg.hd_proxy.cmd_start_stop_dg_heat_disinfect() - #dg.hd_proxy.cmd_start_stop_dg_heat_disinfect_active_cool() + dg.hd_proxy.cmd_start_stop_dg_ro_permeate_sample() try: while True: - - disinfect = get_heat_disinfect_mode_info() + ro_perm = get_ro_permeate_sample_mode_info() drain = get_drain_states_info() load_cell = get_load_cells_info() valves = get_dg_valves_states() @@ -485,30 +491,13 @@ hd_fans = get_hd_fans_info() conc = get_concentrate_pumps_info() - var = disinfect + load_cell + drain + ro + temp + heaters + uv + dg_fans + hd_fans + valves + conc + '\r' + var = ro_perm + load_cell + drain + ro + temp + heaters + uv + dg_fans + hd_fans + valves + conc + '\r' print(var) f.write(var) sleep(1) - - # 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.hd_proxy.cmd_start_stop_dg_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.hd_proxy.cmd_start_stop_dg_heat_disinfect(start=False) - sleep(0.2) - dg.hd_proxy.cmd_start_stop_dg_heat_disinfect_active_cool(start=False) + dg.hd_proxy.cmd_start_stop_dg_ro_permeate_sample(start=False) f.close() @@ -678,8 +667,10 @@ # cmd_set_disinfect_ui_screen() - collect_treatment_data() + #collect_treatment_data() + #run_ro_permeate_sample() + #collect_hd_treatment() #run_nelson_support_modes() @@ -702,8 +693,8 @@ #hd.ui.cmd_set_ro_only_mode_status(1) - #while True: - # print(get_dg_voltages_info()) - # sleep(1) + while True: + print(dg.switches.dg_switches_status) + sleep(1)