Index: dialin/hd/alarms.py =================================================================== diff -u -r00355394c6248f1d228e97bf140aa651bf991175 -ra71114f4e0e47702f4c98b9eabc25182b137be00 --- dialin/hd/alarms.py (.../alarms.py) (revision 00355394c6248f1d228e97bf140aa651bf991175) +++ dialin/hd/alarms.py (.../alarms.py) (revision a71114f4e0e47702f4c98b9eabc25182b137be00) @@ -512,6 +512,29 @@ return 1 == received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] return False + def cmd_resend_all_alarms(self) -> int: + """ + Constructs and sends the re-send all active alarms command. + This will allow Dialin to get caught up with HD alarms that were triggered prior to connection. + Constraints: + Must be logged into HD. + + @return: 1 if successful, zero otherwise + """ + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, + message_id=MsgIds.MSG_ID_HD_SEND_ALARMS_COMMAND.value) + + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + self.logger.debug("Command to re-send all active HD alarms acknowledged.") + # response payload is OK or not OK + return 1 == received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + return False + def cmd_alarm_state_override(self, alarm: int, state: int, reset: int = NO_RESET) -> int: """ Constructs and sends the alarm state override command Index: tests/dg_tests.py =================================================================== diff -u -r561e833a27bde8d147f7966cb472671c1760d28d -ra71114f4e0e47702f4c98b9eabc25182b137be00 --- tests/dg_tests.py (.../dg_tests.py) (revision 561e833a27bde8d147f7966cb472671c1760d28d) +++ tests/dg_tests.py (.../dg_tests.py) (revision a71114f4e0e47702f4c98b9eabc25182b137be00) @@ -113,7 +113,7 @@ def get_dg_reservoirs_info(): info = ('Time_rsrvr_cycle, {}, Time_rsrvr_fill_2_switch, {}, Time_uf_decay, {:5.3f}, Temp_uf_fill, {:5.3f}, ' 'Temp_rsrvr_use_actual, {:5.3f}, Temp_rsrvr_end_fill, {:5.3}, Temp_avg_fill, {:5.3f}, ' - 'Temp_last_fill, {:5.3f}, Time_rsrvr_fill, ' + 'Temp_last_fill, {:5.3f}, Time_rsrvr_fill, {:5.3f}, ' .format(dg.reservoirs.time_reservoir_cycle, dg.reservoirs.time_reservoir_fill_2_switch, dg.reservoirs.time_uf_decay, dg.reservoirs.temp_uf_fill, dg.reservoirs.temp_reservoir_use_actual, dg.reservoirs.temp_reservoir_end_fill, dg.reservoirs.temp_avg_fill, dg.reservoirs.temp_last_fill, @@ -203,7 +203,7 @@ .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_heaters_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_TRIM_HTR_V.value])) @@ -609,11 +609,11 @@ dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(0, True) sleep(1) - dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(1, True) - sleep(1) - dg.concentrate_pumps.cmd_concentrate_pump_target_speed_override(0, 20) - sleep(1) - dg.concentrate_pumps.cmd_concentrate_pump_target_speed_override(1, 20) + #dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(1, True) + # sleep(1) + dg.concentrate_pumps.cmd_concentrate_pump_target_speed_override(0, 35) + #sleep(1) + #dg.concentrate_pumps.cmd_concentrate_pump_target_speed_override(1, 20) try: while True: @@ -625,6 +625,22 @@ dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(1, False) +def test_hd_valves(): + while True: + + #VALVE_POSITION_A_INSERT_EJECT = 1 + #VALVE_POSITION_B_OPEN = 2 + #VALVE_POSITION_C_CLOSE = 3 + # + + hd.valves.cmd_set_hd_valve_position(3,3) + sleep(2) + hd.valves.cmd_set_hd_valve_position(3,2) + sleep(2) + hd.valves.cmd_set_hd_valve_position(3,1) + sleep(2) + + if __name__ == "__main__": dg = DG(log_level='DEBUG') dg.cmd_log_in_to_dg() @@ -641,7 +657,7 @@ # cmd_set_disinfect_ui_screen() - collect_treatment_data() + #collect_treatment_data() #collect_hd_treatment() @@ -657,7 +673,7 @@ #test_dvt_drain_pump() - #test_conc_pumps() + test_conc_pumps() #while True: # print(get_concentrate_pumps_info()) @@ -666,4 +682,7 @@ #ui = HDSimulator() #ui.cmd_send_hd_operation_mode(3, 1) + #test_hd_valves() + + Index: tests/hd_nvm_scripts.py =================================================================== diff -u -r561e833a27bde8d147f7966cb472671c1760d28d -ra71114f4e0e47702f4c98b9eabc25182b137be00 --- tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision 561e833a27bde8d147f7966cb472671c1760d28d) +++ tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision a71114f4e0e47702f4c98b9eabc25182b137be00) @@ -55,7 +55,7 @@ # 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-07-20-HD-Record.xlsx') + hd.calibration_record.cmd_set_hd_calibration_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-07-26-HD-Record.xlsx') # For resetting the calibration record to benign values, use the function below hd.calibration_record.cmd_reset_hd_calibration_record() @@ -68,8 +68,8 @@ if hd.cmd_log_in_to_hd(): # Comment this function if not needed - run_sw_configs_commands() + #run_sw_configs_commands() # Comment this function if not needed - #run_calibration_commands() + run_calibration_commands() Index: tests/test_flush.py =================================================================== diff -u -rc1ce5d861b5d1a9ba0e6c949401468e4139d828e -ra71114f4e0e47702f4c98b9eabc25182b137be00 --- tests/test_flush.py (.../test_flush.py) (revision c1ce5d861b5d1a9ba0e6c949401468e4139d828e) +++ tests/test_flush.py (.../test_flush.py) (revision a71114f4e0e47702f4c98b9eabc25182b137be00) @@ -109,7 +109,7 @@ 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() try: