Index: dialin/common/msg_ids.py =================================================================== diff -u -rbca51efc98d8cbb3759ed270193c74e6d4ce3fee -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- dialin/common/msg_ids.py (.../msg_ids.py) (revision bca51efc98d8cbb3759ed270193c74e6d4ce3fee) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -372,7 +372,7 @@ MSG_ID_DG_SWITCHES_PUBLISH_INTERVAL_OVERRIDE = 0xA01E MSG_ID_DG_OP_MODE_PUBLISH_INTERVAL_OVERRIDE = 0xA01F MSG_ID_DG_BLOCK_MESSAGE_TRANSMISSION = 0xA020 - MSG_ID_DIALYSATE_MEASURED_FLOW_OVERRIDE = 0xA021 + MSG_ID_MEASURED_FLOW_SENSORS_OVERRIDE = 0xA021 MSG_ID_DG_SOFTWARE_RESET_REQUEST = 0xA022 MSG_ID_DG_CONCENTRATE_PUMP_MEASURED_SPEED_OVERRIDE = 0xA023 MSG_ID_CONCENTRATE_PUMP_TARGET_SPEED_OVERRIDE = 0xA024 @@ -406,7 +406,7 @@ MSG_ID_DG_FLUSH_PUBLISH_INTERVAL_OVERRIDE = 0xA041 MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE = 0xA042 MSG_ID_DG_FANS_RPM_OVERRIDE = 0xA043 - MSG_ID_DIALYSATE_FLOW_SEND_INTERVAL_OVERRIDE = 0xA044 + MSG_ID_FLOW_DATA_PUBLISH_INTERVAL_OVERRIDE = 0xA044 MSG_ID_DG_STOP_RTC_CLOCK = 0xA045 MSG_ID_DG_DRAIN_PUMP_MEASURED_RPM_OVERRIDE = 0xA046 MSG_ID_DG_SUPER_CLEAR_ALARMS_CMD = 0xA047 Fisheye: Tag 1c5dbffa6b205c14f92e05badc563f2a84980bfa refers to a dead (removed) revision in file `dialin/dg/dialysate_flow_sensor.py'. Fisheye: No comparison available. Pass `N' to diff? Index: dialin/dg/dialysate_generator.py =================================================================== diff -u -r5eb006b08eb1d7b641b22fff20072ab7b685cfec -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision 5eb006b08eb1d7b641b22fff20072ab7b685cfec) +++ dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -26,7 +26,7 @@ from .drain_pump import DGDrainPump from .fans import Fans from .dialysate_fill import DialysateFill -from .dialysate_flow_sensor import DialysateFlowSensor +from .flow_sensors import FlowSensors from .fluid_leak import DGFluidLeak from .flush import FlushMode from .gen_idle import GenIdle @@ -165,9 +165,9 @@ self.concentrate_pumps = ConcentratePumps(self.can_interface, self.logger) self.conductivity_sensors = ConductivitySensors(self.can_interface, self.logger) self.dialysate_fill = DialysateFill(self.can_interface, self.logger) - self.dialysate_flow_sensor = DialysateFlowSensor(self.can_interface, self.logger) self.drain_pump = DGDrainPump(self.can_interface, self.logger) self.fans = Fans(self.can_interface, self.logger) + self.flow_sensors = FlowSensors(self.can_interface, self.logger) self.fluid_leak = DGFluidLeak(self.can_interface, self.logger) self.flush = FlushMode(self.can_interface, self.logger) self.gen_idle = GenIdle(self.can_interface, self.logger) Index: dialin/dg/voltages.py =================================================================== diff -u -rb1ffba07a82b4e99156a07b09762d33205300050 -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- dialin/dg/voltages.py (.../voltages.py) (revision b1ffba07a82b4e99156a07b09762d33205300050) +++ dialin/dg/voltages.py (.../voltages.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -29,24 +29,28 @@ # Monitored voltages @unique class DGMonitoredVoltages(DialinEnum): - MONITORED_LINE_24V_MAIN = 0 # Main voltage (24V) - MONITORED_LINE_1_8V_FPGA = 1 # FPGA logic voltage (1.8V) - MONITORED_LINE_1V_FPGA = 2 # FPGA reference voltage (1V) - MONITORED_LINE_3_3V_SENSORS = 3 # Sensors voltage (3.3V) - MONITORED_LINE_1_8V_PROC = 4 # Processor voltage (1.8V) - MONITORED_LINE_5V_SENSORS = 5 # Sensors voltage (5V) - MONITORED_LINE_5V_LOGIC = 6 # Logic voltage (5V) - MONITORED_LINE_3_3V = 7 # Logic voltage (3.3V) - MONITORED_LINE_1_2V_PROC = 8 # Processor voltage (1.2V) - MONITORED_LINE_V_REF = 9 # Reference voltage (3V) - MONITORED_LINE_EXT_ADC_1_REF_V = 10 # External ADC 1 reference voltage (3V) - MONITORED_LINE_EXT_ADC_2_REF_V = 11 # External ADC 2 reference voltage (3V) - MONITORED_LINE_PS_GATE_DRIVER_V = 12 # P/S gate driver (5V) - MONITORED_LINE_24V_PRIM_HTR_V = 13 # Primary heater (0..24V) - MONITORED_LINE_24V_PRIM_HTR_GND_V = 14 # Primary heater ground (0..24V) - MONITORED_LINE_24V_SEC_HTR_V = 15 # Secondary element voltage (0..24V) - MONITORED_LINE_24V_TRIM_HTR_V = 16 # Trimmer heater voltage (0..24V) - NUM_OF_MONITORED_LINES = 17 # Number of monitored voltages + MONITORED_LINE_24V_MAIN = 0 # Main voltage (24V) + MONITORED_LINE_1_8V_FPGA = 1 # FPGA logic voltage (1.8V) + MONITORED_LINE_1V_FPGA = 2 # FPGA reference voltage (1V) + MONITORED_LINE_3_3V_SENSORS = 3 # Sensors voltage (3.3V) + MONITORED_LINE_1_8V_PROC = 4 # Processor voltage (1.8V) + MONITORED_LINE_5V_SENSORS = 5 # Sensors voltage (5V) + MONITORED_LINE_5V_LOGIC = 6 # Logic voltage (5V) + MONITORED_LINE_3_3V = 7 # Logic voltage (3.3V) + MONITORED_LINE_1_2V_PROC = 8 # Processor voltage (1.2V) + MONITORED_LINE_V_REF = 9 # Reference voltage (3V) + MONITORED_LINE_EXT_ADC_1_REF_V = 10 # External ADC 1 reference voltage (3V) + MONITORED_LINE_EXT_ADC_2_REF_V = 11 # External ADC 2 reference voltage (3V) + MONITORED_LINE_PS_GATE_DRIVER_V = 12 # P/S gate driver (5V) + # NOTE: This enum has been commented out because two enums cannot have the same value but the firmware has + # MONITORED_LINE_PS_GATE_DRIVER_V and MONITORED_LINE_LAST_RANGE_CHECKED_LINE with the same number so for clarity it + # is kept here + # MONITORED_LINE_LAST_RANGE_CHECKED_LINE = MONITORED_LINE_PS_GATE_DRIVER_V # Monitored last range + MONITORED_LINE_24V_POWER_PRIM_HTR_V = 13 # Power primary heater voltage (24V) + MONITORED_LINE_24V_GND_MAIN_PRIM_HTR_V = 14 # Main primary heater ground voltage + MONITORED_LINE_24V_GND_SMALL_PRIM_HTR_V = 15 # Small primary heater voltage (24V) + MONITORED_LINE_24V_GND_TRIM_HTR_V = 16 # Trimmer heater voltage (24V) + NUM_OF_MONITORED_LINES = 17 # Number of monitored voltages class DGVoltages(AbstractSubSystem): @@ -114,13 +118,13 @@ message['message'][MsgFieldPositions.START_POS_FIELD_11:MsgFieldPositions.END_POS_FIELD_11])) v5g = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_12:MsgFieldPositions.END_POS_FIELD_12])) - v24 = struct.unpack('f', bytearray( - message['message'][MsgFieldPositions.START_POS_FIELD_13:MsgFieldPositions.END_POS_FIELD_13])) v24p = struct.unpack('f', bytearray( + message['message'][MsgFieldPositions.START_POS_FIELD_13:MsgFieldPositions.END_POS_FIELD_13])) + v24pp = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_14:MsgFieldPositions.END_POS_FIELD_14])) v24pg = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_15:MsgFieldPositions.END_POS_FIELD_15])) - v24s = struct.unpack('f', bytearray( + v24sg = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_16:MsgFieldPositions.END_POS_FIELD_16])) v24t = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_17:MsgFieldPositions.END_POS_FIELD_17])) @@ -137,11 +141,11 @@ self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_5V_LOGIC.value] = v5l[0] self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_5V_SENSORS.value] = v5s[0] self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_PS_GATE_DRIVER_V.value] = v5g[0] - self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_MAIN.value] = v24[0] - self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_PRIM_HTR_V.value] = v24p[0] - self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_PRIM_HTR_GND_V.value] = v24pg[0] - self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_SEC_HTR_V.value] = v24s[0] - self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_TRIM_HTR_V.value] = v24t[0] + self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_MAIN.value] = v24p[0] + self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_POWER_PRIM_HTR_V.value] = v24pp[0] + self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_GND_MAIN_PRIM_HTR_V.value] = v24pg[0] + self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_GND_SMALL_PRIM_HTR_V.value] = v24sg[0] + self.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_GND_TRIM_HTR_V.value] = v24t[0] def cmd_monitored_voltage_override(self, signal: int = 0, volts: float = 0.0, reset: int = NO_RESET) -> int: """ Index: dialin/hd/sw_configs.py =================================================================== diff -u -rfab0ce077e13918698b5310b685d5d736880f5e2 -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- dialin/hd/sw_configs.py (.../sw_configs.py) (revision fab0ce077e13918698b5310b685d5d736880f5e2) +++ dialin/hd/sw_configs.py (.../sw_configs.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -74,6 +74,8 @@ SW_CONFIG_ENABLE_DIALYSATE_INLET_PUMP_OPEN_LOOP = 39 SW_CONFIG_DISABLE_SWITCHES_MONITOR = 40 SW_CONFIG_ENABLE_VBA_SPECIAL_POSITION_C = 41 + SW_CONFIG_ENABLE_V3_SYSTEM = 42 + SW_CONFIG_DISABLE_SERVICE_AND_DISINFECT_CHECK = 43 class HDSoftwareConfigs(AbstractSubSystem): Index: tests/dg_nvm_scripts.py =================================================================== diff -u -rbca51efc98d8cbb3759ed270193c74e6d4ce3fee -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision bca51efc98d8cbb3759ed270193c74e6d4ce3fee) +++ tests/dg_nvm_scripts.py (.../dg_nvm_scripts.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -32,7 +32,7 @@ # Use cmd_set_dg_sw_config_record() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - dg.sw_configs.cmd_update_dg_sw_config_record('/home/fw/projects/DG_NV_Records/2022-08-02-DG-SW-CONFIGS-Record.xlsx') + dg.sw_configs.cmd_update_dg_sw_config_record('/home/fw/projects/DG_NV_Records/2022-09-16-DG-SW-CONFIGS-Record.xlsx') # Use this function to reset the configuration records to all be 0 #dg.sw_configs.cmd_reset_dg_sw_config_record() @@ -49,12 +49,12 @@ # It creates a folder called DG_NV_Records in the destination that is called # If no address is provided, the default location is one folder above the dialin folder wherever it is installed # in you computer. - #dg.calibration_record.cmd_get_dg_calibration_record_report() + dg.calibration_record.cmd_get_dg_calibration_record_report() # Use cmd_set_dg_calibration_excel_to_fw() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2022-08-17-DG-Record.xlsx') + #dg.calibration_record.cmd_set_dg_calibration_excel_to_fw('/home/fw/projects/DG_NV_Records/2022-08-17-DG-Record.xlsx') # For resetting the calibration record to benign values, use the function below #dg.calibration_record.cmd_reset_dg_calibration_record() @@ -69,9 +69,9 @@ # It creates a folder called DG_NV_Records in the destination that is called # If no address is provided, the default location is one folder above the dialin folder wherever it is installed # in you computer. - dg.system_record.cmd_get_dg_system_record_report() + #dg.system_record.cmd_get_dg_system_record_report() - #dg.system_record.cmd_set_dg_system_record_excel_to_fw('/home/fw/projects/DG_NV_Records/2022-08-09-DG-Record.xlsx') + dg.system_record.cmd_set_dg_system_record_excel_to_fw('/home/fw/projects/DG_NV_Records/2022-09-06-DG-Record.xlsx') # For resetting the system record to benign values, use the function below #dg.system_record.cmd_reset_dg_system_record() Index: tests/dg_tests.py =================================================================== diff -u -rbca51efc98d8cbb3759ed270193c74e6d4ce3fee -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- tests/dg_tests.py (.../dg_tests.py) (revision bca51efc98d8cbb3759ed270193c74e6d4ce3fee) +++ tests/dg_tests.py (.../dg_tests.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -44,6 +44,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 from time import sleep from datetime import datetime import sys @@ -77,6 +78,14 @@ 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, + dg.flush.flush_drain_line_volume_l, hd.alarms.alarm_top)) + + return info + + def get_hd_run_info(): info = ('HD_op_mode, {}, HD_sub_mode, {}, Top_alarm, {}, Target_UF_ml, {:5.3f}, Meas_UF_ml, {:5.3f}, ' 'Wet_test_state, {}, Post_tx_state, {}, Post_tx_drain_state, {}, Prime_state, {}, Pre_Tx_rsrvr_state, {}, ' @@ -175,19 +184,12 @@ 'Feedback_PWM, {:5.3f}, Flow_with_conc_pumps, {:5.3f}, Dialysate_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.target_flow_lpm, dg.dialysate_flow_sensor.flow_rate, + dg.ro_pump.measured_flow_rate_lpm, dg.ro_pump.target_flow_lpm, dg.flow_sensors.measured_dialysate_flow_LPM, dg.ro_pump.feedback_duty_cycle_pct, dg.ro_pump.measured_raw_flow_rate_with_conc_pumps_mlp, - dg.dialysate_flow_sensor.flow_rate)) + dg.flow_sensors.measured_dialysate_flow_LPM)) return info -def get_new_ro_info(): - info = ('New_flow, {:5.3f}, Tgt_flow, {:5.3f}, New_flow_with_conc_pumps, {:5.3f}, New_dialysate_flow, {:5.3f}, ' - .format(dg.dialysate_flow_sensor.new_ro_flow, dg.dialysate_flow_sensor.new_dialysate_flow, - dg.dialysate_flow_sensor.new_ro_flow_with_conc, dg.dialysate_flow_sensor.new_dialysate_flow)) - return info - - def get_heaters_with_no_temp_info(): info = ('Pri_main_DC, {:5.3f}, Pri_state, {}, Trimmer_DC, {:5.3f}, Trim_state, {}, ' 'Primary_target_temp, {:5.3f}, Trimmer_target_temp, {:5.3f}, '. @@ -200,16 +202,18 @@ def get_heaters_info(): info = ('Pri_main_DC, {:5.3f}, Pri_state, {}, Trimmer_DC, {:5.3f}, Trimmer_state, {}, ' 'Primary_target_temp, {:5.3f}, Trimmer_target_temp, {:5.3f}, Primary_eff, {:5.3f}, ' - 'Primary_calc_temp, {:5.3f}, Trimmer_calc_temp, {:5.3f}, Primary_volt, {:5.3f}, Primary_sec_volt, {:5.3f},' + 'Primary_calc_temp, {:5.3f}, Trimmer_calc_temp, {:5.3f}, Primary_power, {:5.3f}, ' + 'Primary_volt, {:5.3f}, Primary_sec_volt, {:5.3f},' ' Trimmer_volt, {:5.3f}, ' .format(dg.heaters.main_primary_heater_duty_cycle, dg.heaters.primary_heater_state, dg.heaters.trimmer_heater_duty_cycle, dg.heaters.trimmer_heater_state, dg.heaters.primary_heaters_target_temperature, dg.heaters.trimmer_heater_target_temperature, dg.heaters.primary_efficiency, dg.heaters.primary_calc_target_temperature, dg.heaters.trimmer_calc_target_temperature, - dg.voltages.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_PRIM_HTR_V.value], - dg.voltages.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_PRIM_HTR_GND_V.value], - dg.voltages.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_TRIM_HTR_V.value])) + dg.voltages.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_POWER_PRIM_HTR_V.value], + dg.voltages.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_GND_MAIN_PRIM_HTR_V.value], + dg.voltages.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_GND_SMALL_PRIM_HTR_V.value], + dg.voltages.monitored_voltages[DGMonitoredVoltages.MONITORED_LINE_24V_GND_TRIM_HTR_V.value])) return info @@ -324,6 +328,7 @@ hd.voltages.monitored_voltages[HDMonitoredVoltages.MONITORED_LINE_24V_REGEN.value])) return info + def run_dg(): counter = 1 timer = 0.1 @@ -397,14 +402,19 @@ counter = 1 start = False - sleep_time = 0.05 + sleep_time = 1 - dg.heaters.cmd_heaters_broadcast_interval_override(50) - sleep(1) - dg.voltages.cmd_monitored_voltages_broadcast_interval_override(50) + #dg.heaters.cmd_heaters_broadcast_interval_override(50) + #sleep(1) + #dg.voltages.cmd_monitored_voltages_broadcast_interval_override(50) #dg.concentrate_pumps.cmd_concentrate_pump_broadcast_interval_override(50) - #sleep(0.5) + #sleep(1) + #dg.hd_proxy.cmd_start_stop_dg() + #sleep(1) + + #dg.hd_proxy.cmd_fill() + try: while True: hd_run = get_hd_run_info() @@ -414,8 +424,7 @@ drain = get_drain_states_info() load_cell = get_load_cells_info() valves = get_dg_valves_states() - ro = str(0)#get_ro_info() - new_ro = str(0)#get_new_ro_info() + ro = get_ro_info() temp = get_temperature_sensors_info() heaters = get_heaters_info() dg_fans = get_dg_fans_info() @@ -424,9 +433,10 @@ hd_pumps = get_hd_pumps_info() fill_info = get_dg_fill_info() idle_bad_fill = get_dg_idle_bad_fill_info() + uv = get_uv_reactors_info() var = str(datetime.now()) + ', ' + hd_run + dg_run + hd_rsrvrs + dg_rsrvrs + load_cell + drain + ro + \ - new_ro + temp + heaters + conc_pumps + dg_fans + valves + blood_leak + hd_pumps + fill_info + '\r' + temp + heaters + conc_pumps + dg_fans + valves + blood_leak + hd_pumps + fill_info + uv + '\r' if hd.alarms.get_alarm_state(97) and start is False: dg.conductivity_sensors.cmd_conductivity_sensor_override(ConductivitySensorsEnum.CD2.value, 13700.00) @@ -484,7 +494,7 @@ def run_heat_disinfect(): complete_counter = 1 f = open("/home/fw/projects/dialin/tests/Heat_disinfect.log", "w") - #dg.hd_proxy.cmd_start_stop_dg_heat_disinfect() + dg.hd_proxy.cmd_start_stop_dg_heat_disinfect() try: while True: @@ -496,11 +506,12 @@ ro = get_ro_info() temp = get_temperature_sensors_info() heaters = get_heaters_info() + uv = get_uv_reactors_info() dg_fans = get_dg_fans_info() hd_fans = get_hd_fans_info() conc = get_concentrate_pumps_info() - var = disinfect + load_cell + drain + ro + temp + heaters + dg_fans + hd_fans + valves + conc + '\r' + var = disinfect + load_cell + drain + ro + temp + heaters + uv + dg_fans + hd_fans + valves + conc + '\r' print(var) f.write(var) @@ -575,51 +586,52 @@ sleep(1) -def test_dg_fans_alarms(): - f = open("/home/fw/projects/dialin/tests/dg_fans_issues.log", "w") +def run_flush_mode(): + complete_counter = 1 + f = open("/home/fw/projects/dialin/tests/flush_mode.log", "w") + dg.hd_proxy.cmd_start_stop_dg_flush() + #dg.cmd_dg_software_reset_request() - for fan in DGFansNames.__members__: + try: + while True: + flush = get_flush_mode_info() + load_cell = get_load_cells_info() + drain = get_drain_states_info() + ro = get_ro_info() + conc = get_concentrate_pumps_info() + uv_reactors = get_uv_reactors_info() + valves = get_dg_valves_states() - dg.cmd_dg_software_reset_request() - sleep(1) - dg.alarms.clear_dialin_alarms() - i = 0 - ack = False - counter = 0 + var = flush + uv_reactors + load_cell + drain + ro + conc + valves + '\r' - while True: - if dg.dg_operation_mode == DGOperationModes.DG_OP_MODE_STANDBY.value: - dg.cmd_log_in_to_dg() - sleep(1) - dg.fans.cmd_fans_data_broadcast_interval_override(50, reset=0) - sleep(1) - dg.fans.cmd_fans_rpm_override(DGFansNames[fan].value, 1000.0, reset=0) - start_time = datetime.now() - while True: - alarm_state = dg.alarms.get_alarm_state(AlarmList.ALARM_ID_DG_FAN_RPM_OUT_OF_RANGE.value) - info = str(fan) + ', ' + str(alarm_state) + ', ' + str(datetime.now() - start_time) + ', ' + \ - get_dg_fans_info() + '\r' - print(info) - f.write(info) + print(var) + f.write(var) + sleep(1) - if alarm_state: - if ack is False and counter == 0: - hd.ui.cmd_ui_user_alarm_response(3) - ack = True - if ack: - if i == 0 and counter == 50: - dg.fans.cmd_fans_rpm_alarm_start_time_offset(86390) - i += 1 - elif alarm_state and i > 0: - break - counter += 1 + # If the mode came back to standby or standby solo + if dg.dg_operation_mode == 3 or dg.dg_operation_mode == 4: - sleep(0.05) - break + if complete_counter == 1: + 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() + #events = dg.events.get_dg_events(2, 60) + #for event in events: + # print(event) + break + complete_counter += 1 -def test_dvt_drain_pump(): + except KeyboardInterrupt: + dg.hd_proxy.cmd_start_stop_dg_flush(start=False) + f.close() + #events = dg.events.get_dg_events(2, 50) + #for event in events: + # print(event) + +def test_dvt_drain_pump(): dg.drain_pump.cmd_drain_pump_set_rpm(2000) try: while True: @@ -630,7 +642,6 @@ def test_conc_pumps(): - dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(0, True) sleep(1) #dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(1, True) @@ -675,6 +686,8 @@ #run_heat_disinfect() + #run_flush_mode() + #run_chemical_disinfect() #run_dg() @@ -690,10 +703,6 @@ # sleep(1) #while True: - # print(get_new_ro_info(), get_ro_info()) - # sleep(1) - - #while True: # print(dg.rtc.get_rtc_epoch(), hd.rtc.get_rtc_epoch()) # sleep(1) @@ -714,3 +723,10 @@ #dg.ro_pump.cmd_set_ro_flow_rate(0.6) + #dg.flow_sensors.cmd_measured_flow_sensor_value_lpm_override(1, 0.8, reset=1) + + #while True: + + # print(get_ro_info()) + # sleep(1) + Index: tests/hd_nvm_scripts.py =================================================================== diff -u -rbca51efc98d8cbb3759ed270193c74e6d4ce3fee -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision bca51efc98d8cbb3759ed270193c74e6d4ce3fee) +++ tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -33,7 +33,7 @@ # Use cmd_update_hd_sw_config_record() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - hd.sw_configs.cmd_update_hd_sw_config_record('/home/fw/projects/HD_NV_Records/2022-06-07-HD-SW-CONFIGS-Record.xlsx') + hd.sw_configs.cmd_update_hd_sw_config_record('/home/fw/projects/HD_NV_Records/2022-09-19-HD-SW-CONFIGS-Record.xlsx') # Use this function to reset the configuration records to all be 0 #hd.sw_configs.cmd_reset_hd_sw_config_record() @@ -50,12 +50,12 @@ # It creates a folder called HD_NV_Records in the destination that is called # If no address is provided, the default location is one folder above the dialin folder wherever it is installed # in your computer. - #hd.calibration_record.cmd_get_hd_calibration_record_report() + hd.calibration_record.cmd_get_hd_calibration_record_report() # Use cmd_set_hd_calibration_excel_to_fw() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - hd.calibration_record.cmd_set_hd_calibration_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-08-13-HD-Record.xlsx') + #hd.calibration_record.cmd_set_hd_calibration_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-08-13-HD-Record.xlsx') # For resetting the calibration record to benign values, use the function below #hd.calibration_record.cmd_reset_hd_calibration_record() Index: tests/test_flush.py =================================================================== diff -u -r5eb006b08eb1d7b641b22fff20072ab7b685cfec -r1c5dbffa6b205c14f92e05badc563f2a84980bfa --- tests/test_flush.py (.../test_flush.py) (revision 5eb006b08eb1d7b641b22fff20072ab7b685cfec) +++ tests/test_flush.py (.../test_flush.py) (revision 1c5dbffa6b205c14f92e05badc563f2a84980bfa) @@ -147,9 +147,9 @@ except KeyboardInterrupt: dg.hd_proxy.cmd_start_stop_dg_flush(start=False) f.close() - events = dg.events.get_dg_events(2, 50) - for event in events: - print(event) + #events = dg.events.get_dg_events(2, 50) + #for event in events: + # print(event) if __name__ == "__main__":