Index: dialin/dg/events.py =================================================================== diff -u -r6f442619cef8a8368c452f04e578c3b20e50218d -r0a83db66e0df99be5dbac9cd9e9aceb25e7ce7ac --- dialin/dg/events.py (.../events.py) (revision 6f442619cef8a8368c452f04e578c3b20e50218d) +++ dialin/dg/events.py (.../events.py) (revision 0a83db66e0df99be5dbac9cd9e9aceb25e7ce7ac) @@ -113,7 +113,7 @@ """ Handles published events message - @param message: published DG events data message + @param message: published DG events data message @returns none """ event_id = struct.unpack('i', bytearray( @@ -138,6 +138,8 @@ # Convert the event ID to enum event_state_name = DGEventList(event_id).name + #print(event_data_1, event_data_2) + # Check if the event state name is operation mode change. If it is, get the name of the operation modes # from the op modes enum class if event_state_name == DGEventList.DG_EVENT_OP_MODE_CHANGE.name: @@ -146,45 +148,65 @@ # Check if the event state name is sub mode change. elif event_state_name == DGEventList.DG_EVENT_SUB_MODE_CHANGE.name: # Get the length of the list of the sub mode list - event_list_len = len(self._dg_event_dictionary[DGEventList.DG_EVENT_OP_MODE_CHANGE.name]) + op_list_len = len(self._dg_event_dictionary[DGEventList.DG_EVENT_OP_MODE_CHANGE.name]) # Get the last tuple of the sub mode # It is a list of tuples that each tuple is (timestamp, event type, prev op mode, current op mode) - last_op_mode = self._dg_event_dictionary[DGEventList.DG_EVENT_OP_MODE_CHANGE.name][event_list_len - 1] + last_op_tuple = self._dg_event_dictionary[DGEventList.DG_EVENT_OP_MODE_CHANGE.name][op_list_len - 1] + # Get the current and previous operation modes of the last tuple in the list of the sub modes # i.e. (timestamp, event type, prev, current) - last_current = last_op_mode[len(last_op_mode) - 1] - last_previous = last_op_mode[len(last_op_mode) - 2] + current_op_mode = last_op_tuple[len(last_op_tuple) - 1] + current_op_mode_timestamp = datetime.strptime(last_op_tuple[0], '%Y-%m-%d %H:%M:%S.%f') - # Get the tuple prior to the last tuple and get its previous and current operation modes - prev_to_last_op = self._dg_event_dictionary[DGEventList.DG_EVENT_OP_MODE_CHANGE.name][event_list_len - 2] - prev_current = prev_to_last_op[len(prev_to_last_op) - 1] - prev_previous = prev_to_last_op[len(prev_to_last_op) - 2] + sub_mode_list_len = len(self._dg_event_dictionary[DGEventList.DG_EVENT_SUB_MODE_CHANGE.name]) + if sub_mode_list_len != 0: + # Get the tuple prior to the last tuple and get its previous and current operation modes + current_sub_tuple = self._dg_event_dictionary[DGEventList.DG_EVENT_SUB_MODE_CHANGE.name][ + sub_mode_list_len - 1] + + current_sub_mode_timestamp = datetime.strptime(current_sub_tuple[0], '%Y-%m-%d %H:%M:%S.%f') + else: + current_sub_mode_timestamp = 0 + # Get the class of the states enums of the current operation mode that is running - current_sub_mode_enum_class = self._dg_op_mode_2_sub_mode[last_current] + current_sub_mode_enum_class = self._dg_op_mode_2_sub_mode[current_op_mode] # Check if the operation modes of the two tuples match # i.e. last = (timestamp, event type, prev, current) and one before = (timestamp, event type, prev, current) # If the prev and current match respectively, it means the current operation mode has not changed so the # operation mode states can be converted from the current sub mode enum class - if last_current == prev_current and last_previous == prev_previous: + if current_sub_mode_timestamp != 0: + if current_op_mode_timestamp <= current_sub_mode_timestamp: - event_data_1 = current_sub_mode_enum_class(event_data_1).name - event_data_2 = current_sub_mode_enum_class(event_data_2).name + event_data_1 = current_sub_mode_enum_class(event_data_1).name + event_data_2 = current_sub_mode_enum_class(event_data_2).name + elif current_op_mode_timestamp > current_sub_mode_timestamp: + # If the previous and current of the last two tuples do not match, then an operation modes transition + # has occurred and and the previous state is converted from the previous class and the current op mode + # is converted from current operation states enum class. + # i.e last = (timestamp, event type, 3, 8) and one before = (timestamp, event type, 8, 3) + # previous and current do not match so in the last type (timestamp, event type, 8, 3) the prev state + # should be from op mode 8 and the current state should be from op mode 3 + previous_sub_mode = current_sub_tuple[len(current_sub_tuple) - 2] + previous_sub_mode_enum_class = self._dg_op_mode_2_sub_mode[previous_sub_mode] + event_data_1 = previous_sub_mode_enum_class(event_data_1).name + event_data_2 = current_sub_mode_enum_class(event_data_2).name else: - # If the previous and current of the last two tuples do not match, then an operation modes transition - # has occurred and and the previous state is converted from the previous class and the current op mode - # is converted from current operation states enum class. - # i.e last = (timestamp, event type, 3, 8) and one before = (timestamp, event type, 8, 3) - # previous and current do not match so in the last type (timestamp, event type, 8, 3) the prev state - # should be from op mode 8 and the current state should be from op mode 3 - previous_sub_mode_enum_class = self._dg_op_mode_2_sub_mode[last_previous] - event_data_1 = previous_sub_mode_enum_class(event_data_1).name - event_data_2 = current_sub_mode_enum_class(event_data_2).name + #print(event_data_1, event_data_2) + if event_data_2 != 0: + event_data_1 = current_sub_mode_enum_class(event_data_1).name + event_data_2 = current_sub_mode_enum_class(event_data_2).name + else: + previous_sub_mode = current_sub_tuple[len(current_sub_tuple) - 2] + previous_sub_mode_enum_class = self._dg_op_mode_2_sub_mode[previous_sub_mode] + event_data_1 = previous_sub_mode_enum_class(event_data_1).name + event_data_2 = current_sub_mode_enum_class(event_data_2).name + # Get the current timestamp and create a tuple of the current events - event_tuple = (str(datetime.now()), event_state_name, event_data_1, event_data_2) + event_tuple = (datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f'), event_state_name, event_data_1, event_data_2) # Update event dictionary self._dg_event_dictionary[event_state_name].append(event_tuple) Index: tests/dg_heat_and_chemical_disinfect_test.py =================================================================== diff -u -r35c62a4a697d9741b93ca2dfbd7afba33988a953 -r0a83db66e0df99be5dbac9cd9e9aceb25e7ce7ac --- tests/dg_heat_and_chemical_disinfect_test.py (.../dg_heat_and_chemical_disinfect_test.py) (revision 35c62a4a697d9741b93ca2dfbd7afba33988a953) +++ tests/dg_heat_and_chemical_disinfect_test.py (.../dg_heat_and_chemical_disinfect_test.py) (revision 0a83db66e0df99be5dbac9cd9e9aceb25e7ce7ac) @@ -26,15 +26,16 @@ from dialin.dg.temperature_sensors import TemperatureSensorsNames from dialin.dg.dialysate_generator import DGOperationModes from dialin.hd.temperatures import HDTemperaturesNames +from dialin.common.hd_defs import HDOpModes, HDOpSubModes from dialin.common.dg_defs import DGEventList from time import sleep from datetime import datetime import sys + sys.path.append("..") def get_chemical_disinfect_mode_info(): - info = ('State, {}, Overall_elapsed_time, {}, State_elapsed_time, {}, Disinfect_elapsed_time, {}, ' 'Cancellation_mode, {}, R1_level, {:5.3f}, R2_level, {:5.3f}, Current_rinse_count, {}, ' 'Total_rinse_count, {}, UI_state, {}, ' @@ -49,7 +50,6 @@ def get_concentrate_pumps_info(): - info = ('Bicarb_tgt_speed, {:5.3f}, Bicarb_speed, {:5.3f}, CPo, {:5.3f}, CD1, {:5.3f}, CD2, {:5.3f}, ' .format(dg.concentrate_pumps.concentrate_pump_cp2_current_set_speed, dg.concentrate_pumps.concentrate_pump_cp2_measured_speed, @@ -59,7 +59,6 @@ def get_heat_disinfect_mode_info(): - info = ('State, {}, Overall_elapsed_time, {}, State_elapsed_time, {}, Disinfect_elapsed_time, {}, ' 'R1_level, {:5.3f}, R2_level, {:5.3f}, Top_alarm, {}, UI_state, {} ' .format(DGHeatDisinfectStates(dg.heat_disinfect.heat_disinfect_state).name, @@ -70,17 +69,24 @@ return info +def get_hd_run_info(): + info = ('HD_op_mode, {}, HD_sub_mode, {}, '.format(HDOpModes(hd.hd_operation_mode).name, + hd.hd_operation_sub_mode)) + return info + + def get_dg_run_info(): + # info = ('DG_op_mode, {}, DG_sub_mode, {}, Op, {}, Sub, {}, '.format(DGOperationModes(dg.dg_operation_mode).name, + # dg.dg_operation_sub_mode, + # dg.events.get_dg_events(DGEventList(1).value, 3), + # dg.events.get_dg_events(DGEventList(2).value, 3))) - info = ('DG_op_mode, {}, DG_sub_mode, {}, Op, {}, Sub, {}, '.format(DGOperationModes(dg.dg_operation_mode).name, - dg.dg_operation_sub_mode, - dg.events.get_dg_events(DGEventList(1).value, 3), - dg.events.get_dg_events(DGEventList(2).value, 3))) + info = ('DG_op_mode, {}, DG_sub_mode, {}, '.format(DGOperationModes(dg.dg_operation_mode).name, + dg.dg_operation_sub_mode)) return info def get_dg_valves_states(): - info = ('VPi, {}, VSP, {}, VPd, {}, VBf, {}, VPo, {}, VDr, {}, VRc, {}, VRo, {}, VRd, {}, VRi, {}, VRf, {}, ' 'VRD1, {}, VRD2, {}, ' .format(dg.valves.valve_states_enum[dg.valves.VALVE_PRESSURE_INLET], @@ -100,7 +106,6 @@ def get_drain_states_info(): - info = ('Drain, {}, DAC, {}, Tgt_RPM, {}, Curr_RPM, {}, PRd, {:5.3f}, PDr, {:5.3f}, '. format(DrainPumpStates(dg.drain_pump.drain_pump_state).name, dg.drain_pump.dac_value, dg.drain_pump.target_drain_pump_rpm, dg.drain_pump.current_drain_pump_rpm, @@ -110,15 +115,13 @@ def get_load_cells_info(): - info = ('A1, {:5.3f}, A2, {:5.3f}, B1, {:5.3f}, B2, {:5.3f}, '. format(dg.load_cells.load_cell_A1, dg.load_cells.load_cell_A2, dg.load_cells.load_cell_B1, dg.load_cells.load_cell_B2)) return info def get_ro_info(): - info = ('RO, {}, PPi, {:5.3f}, PPo, {:5.3f}, PWM, {:5.3f}, Flow, {:5.3f}, Tgt_flow, {:5.3f}, Temp_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, @@ -127,35 +130,24 @@ def get_heaters_with_no_temp_info(): - info = ('Pri_main_DC, {:5.3f}, Pri_small_DC, {:5.3f}, Pri_state, {}, Trimmer_DC, {:5.3f}, ' 'Primary_target_temp, {:5.3f}, Trimmer_target_temp, {:5.3f}, '. format(dg.heaters.main_primary_heater_duty_cycle, dg.heaters.small_primary_heater_duty_cycle, - dg.heaters.primary_heater_state, dg.heaters.trimmer_heater_duty_cycle, + dg.heaters.primary_heater_state, dg.heaters.trimmer_heater_duty_cycle, dg.heaters.primary_heaters_target_temperature, dg.heaters.trimmer_heater_target_temperature)) return info def get_heaters_info(): - - info = ('Pri_main_DC, {:5.3f}, Pri_small_DC, {:5.3f}, Pri_state, {}, 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}, Primary_target_temp, {:5.3f}, Trimmer_target_temp, {:5.3f}, '. + info = ('Pri_main_DC, {:5.3f}, Pri_small_DC, {:5.3f}, Pri_state, {}, Trimmer_DC, {:5.3f}, ' + 'Primary_target_temp, {:5.3f}, Trimmer_target_temp, {:5.3f}, '. format(dg.heaters.main_primary_heater_duty_cycle, dg.heaters.small_primary_heater_duty_cycle, - dg.heaters.primary_heater_state, - dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.PRIMARY_HEATER_INTERNAL.name], - 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.heaters.primary_heater_state, dg.heaters.trimmer_heater_duty_cycle, dg.heaters.primary_heaters_target_temperature, dg.heaters.trimmer_heater_target_temperature)) return info def get_temperature_sensors_info(): - info = ('TPi, {:5.3f}, TPo, {:5.3f}, TD1, {:5.3f}, TD2, {:5.3f}, TRo, {:5.3f}, TDi, {:5.3f}, ' .format(dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.INLET_PRIMARY_HEATER.name], dg.temperature_sensors.temperature_sensors[TemperatureSensorsNames.OUTLET_PRIMARY_HEATER.name], @@ -167,7 +159,6 @@ def get_dg_fans_info(): - info = ('Target_fans_DC, {:5.3f}, Inlet1_RPM, {:5.3f}, Outlet1_RPM, {:5.3f}, Inlet2_RPM, {:5.3f}, ' 'Outlet2_RPM, {:5.3f}, Inlet3_RPM, {:5.3f}, Outlet3_RPM, {:5.3f}, Board_temp, {:5.3f}, ' 'Power_supply_1, {:5.3f}, Power_supply_2, {:5.3f}, FPGA_temp, {:5.3f}, Load_cell_A1_B1, {:5.3f}, ' @@ -184,7 +175,6 @@ def get_hd_fans_info(): - info = ('HD_Fan_DC, {:5.3f}, Target_HD_RPM, {:5.3f}, Inlet1_RPM, {:5.3f}, HD_Board_temp, {:5.3f}, ' 'HD_Power_supply, {:5.3f}, HD_FPGA_temp, {:5.3f}, PBA_ADC_temp, {:5.3f}, Venous_temp, {:5.3f}, ' .format(hd.fans.duty_cycle, hd.fans.target_rpm, hd.fans.inlet_1_rpm, @@ -197,22 +187,19 @@ def get_uv_reactors_info(): - info = ('Inlet_status, {}, Outlet_status, {}, ' .format(dg.uv_reactors.inlet_uv_reactor_state, dg.uv_reactors.outlet_uv_reactor_state)) return info def cmd_test_heaters(): - f = open("/home/fw/projects/dialin/tests/test_heaters.log", "w") dg.hd_proxy.cmd_start_stop_dg() sleep(0.1) try: while True: - """ command = input() @@ -278,7 +265,6 @@ def run_dg(): - counter = 1 timer = 0.1 sleep_time = 1 @@ -301,7 +287,7 @@ valves = get_dg_valves_states() var = str(datetime.now()) + ', ' + str(run_number) + ', ' + str(recirc_delay) + ', ' + dg_run + \ - temperature + heaters + load_cell + drain + ro + fans + valves + '\r' + temperature + heaters + load_cell + drain + ro + fans + valves + '\r' print(var) f.write(var) @@ -311,8 +297,8 @@ f.close() break - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 1: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 1: if recirc_delay < 5: recirc_delay += 1 @@ -321,27 +307,27 @@ dg.hd_proxy.cmd_switch_reservoirs(reservoirID=1) timer += 1 - if timer > ((1/sleep_time) * 1): + if timer > ((1 / sleep_time) * 1): timer = 1 recirc_delay = 1 counter += 1 - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 2: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 2: dg.hd_proxy.cmd_drain(tare_load_cell=True) counter += 1 timer = 1 - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 3: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 3: timer += 1 if timer > 4: dg.hd_proxy.cmd_fill(volume=1700) counter += 1 - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 4: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 4: counter = 1 run_number += 1 @@ -354,7 +340,6 @@ def run_ro_pump_duty_cycles(): - counter = 1 timer = 0.1 sleep_time = 1 @@ -382,7 +367,7 @@ valves = get_dg_valves_states() var = str(datetime.now()) + ', ' + str(run_number) + ', ' + str(ro_dc) + ', ' + dg_run + \ - temperature + heaters + load_cell + drain + ro + uv_reactors + fans + valves + '\r' + temperature + heaters + load_cell + drain + ro + uv_reactors + fans + valves + '\r' print(var) f.write(var) @@ -392,8 +377,8 @@ f.close() break - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 1: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 1: if recirc_delay < 1: recirc_delay += 1 @@ -403,27 +388,27 @@ timer += 1 - if timer > ((1/sleep_time) * 1): + if timer > ((1 / sleep_time) * 1): timer = 1 recirc_delay = 1 counter += 1 - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 2: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 2: dg.hd_proxy.cmd_drain(tare_load_cell=True) counter += 1 timer = 1 - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 3: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 3: timer += 1 if timer > 4: dg.hd_proxy.cmd_fill(volume=1700) counter += 1 - elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and\ - dg.dg_operation_sub_mode == 2 and counter == 4: + elif DGOperationModes(dg.dg_operation_mode).name == DGOperationModes.DG_OP_MODE_RECIRCULATE.name and \ + dg.dg_operation_sub_mode == 2 and counter == 4: counter = 1 run_number += 1 ro_dc += ro_dc_step @@ -437,8 +422,33 @@ pass -def run_heat_disinfect(): +def collect_treatment_data(): + f = open("/home/fw/projects/dialin/tests/treatment_run.log", "w") + try: + while True: + hd_run = get_hd_run_info() + dg_run = get_dg_run_info() + drain = get_drain_states_info() + load_cell = get_load_cells_info() + valves = get_dg_valves_states() + ro = get_ro_info() + temp = get_temperature_sensors_info() + heaters = get_heaters_info() + dg_fans = get_dg_fans_info() + + var = str(datetime.now()) + ', ' + hd_run + dg_run + load_cell + drain + ro + temp + heaters + dg_fans + \ + valves + '\r' + + print(var) + f.write(var) + sleep(1) + except KeyboardInterrupt: + dg.hd_proxy.cmd_start_stop_dg(start=False) + f.close() + + +def run_heat_disinfect(): complete_counter = 1 f = open("/home/fw/projects/dialin/tests/Heat_disinfect.log", "w") dg.hd_proxy.cmd_start_stop_heat_disinfect() @@ -467,10 +477,10 @@ # If it is the first call, stop heat disinfect if complete_counter == 1: 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 + # pass f.close() break @@ -482,7 +492,6 @@ def run_chemical_disinfect(): - complete_counter = 1 f = open("/home/fw/projects/dialin/tests/chemical_disinfect.log", "w") dg.hd_proxy.cmd_start_stop_dg_chemical_disinfect() @@ -511,7 +520,7 @@ # Write a few more complete states to make sure the complete state items are recorded if complete_counter == 3: - #pass + # pass f.close() break @@ -523,7 +532,6 @@ def cmd_set_disinfect_ui_screen(): - hd = HD() sleep(0.5) hd.ui.cmd_ui_set_standby_submode_to_disinfect() @@ -534,24 +542,27 @@ if __name__ == "__main__": - dg = DG(log_level='DEBUG') dg.cmd_log_in_to_dg() sleep(1) hd = HD(log_level='DEBUG') hd.cmd_log_in_to_hd() sleep(1) - run_heat_disinfect() + # run_heat_disinfect() - #run_chemical_disinfect() + # run_chemical_disinfect() - #run_dg() + # run_dg() + # run_ro_pump_duty_cycles() + run_ro_pump_duty_cycles() - #cmd_set_disinfect_ui_screen() + # cmd_set_disinfect_ui_screen() - #cmd_test_heaters() + # cmd_test_heaters() + collect_treatment_data() + Index: tests/test_flush.py =================================================================== diff -u -r5a413e437f8a341c9e9b77342df6e634c1563add -r0a83db66e0df99be5dbac9cd9e9aceb25e7ce7ac --- tests/test_flush.py (.../test_flush.py) (revision 5a413e437f8a341c9e9b77342df6e634c1563add) +++ tests/test_flush.py (.../test_flush.py) (revision 0a83db66e0df99be5dbac9cd9e9aceb25e7ce7ac) @@ -103,7 +103,9 @@ complete_counter = 1 f = open("/home/fw/projects/dialin/tests/flush_mode.log", "w") - dg.hd_proxy.cmd_start_stop_dg_flush() + #dg.hd_proxy.cmd_start_stop_dg_flush() + dg.cmd_dg_software_reset_request() + #sleep(0.1) try: while True: flush = get_flush_mode_info() @@ -122,11 +124,11 @@ # If the mode came back to standby or standby solo if dg.dg_operation_mode == 3 or dg.dg_operation_mode == 4: - + dg.hd_proxy.cmd_start_stop_dg_flush() # Write a few more complete states to make sure the complete state items are recorded - if complete_counter == 3: - f.close() - break + #if complete_counter == 3: + # f.close() + # break complete_counter += 1