# -*- coding: utf-8 -*- ## # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # copyright # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, # IN PART OR IN WHOLE, # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # file tst_UI_log_verification # date 2022/04/09 # author Bhavana Savanth # author Amol Pandharinath Shinde # author Amrita Debnath # author Sai Chaitanya Ela # author Akshay Rajaram # # NOTE: # This test verifies the logs for the messages provided from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator import logging from dialin.protocols.CAN import DenaliCanMessenger from dialin.ui import HDSimulator from dialin.ui import DGSimulator from dialin.ui import utils from configuration import utility from configuration import config import builtins from dialin.common.msg_ids import MsgIds logger= logging.getLogger("INFO") messenger= DenaliCanMessenger('can0') hd_alarm= HDAlarmsSimulator(can_interface=messenger, logger=logger) hd_simulator = HDSimulator() dg_simulator = DGSimulator() YES = 'Y' def verify_log(msg_id, ack = None, msg = None): utils.waitForGUI(0.1) message_extracted = utility.get_current_log_details(message_ack = ack, message_text = msg) if ack == YES: test.verify(config.ACK_REQ_STATUS in message_extracted, "ack request is verified") test.verify(config.ACK_BAK_STATUS in message_extracted, "ack back is verified") # if msg != None: # test.verify(msg in message_extracted, "message is verified") message_id_hex = builtins.hex(builtins.int(msg_id)) message_id_str = builtins.str(message_id_hex) test.log(message_id_str) test.log(str(message_extracted)) test.verify(message_id_str in message_extracted, "message ID is verified") def main(): startApplication("denaliSquish") #HD Broadcast #0x0D00 hd_simulator.cmd_set_treatment_time(200,60) verify_log(msg_id = MsgIds.MSG_ID_TREATMENT_TIME.value, ack = YES, msg = "TreatmentTime") #0x0500 hd_simulator.cmd_set_treatment_blood_flow_rate(flow_set_pt=20, measured_flow=10.5, rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, mc_current = 12.5, pwm = 32.3, rotor_count = 30) verify_log(msg_id = MsgIds.MSG_ID_BLOOD_FLOW_DATA.value, ack = YES, msg = "BloodFlow") #0x0800 hd_simulator.cmd_set_treatment_dialysate_flow_rate(flow_set_pt=20, measured_flow=10.5, rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, mc_current = 12.5, pwm = 32.3) verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_FLOW_DATA.value, ack = YES, msg = "DialysateFlow") #0x0900 hd_simulator.cmd_set_pressure_occlusion_data(arterial_prs = 54.5, venous_prs = 20.1, blood_pump_occlusion = 3, dialysate_inlet_pump_occlusion = 2, dialysate_outlet_pump_occlusion = 5) verify_log(msg_id = MsgIds.MSG_ID_PRESSURE_OCCLUSION_DATA.value, ack = YES, msg = "Pressure/Occlusion") #0x0B00 hd_simulator.cmd_set_treatment_ultrafiltration_outlet_flow_data(ref_uf_vol = 77.5, measured_uf_vol = 22.6, rot_speed = 54.0, mot_speed = 66.2, mc_speed = 33.3, mc_current = 21.2, pwm = 322.2) verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_OUT_FLOW_DATA.value, ack = YES, msg = "OutletFlow") #0x1A00 hd_simulator.cmd_set_treatment_parameter_ranges(min_treatment_duration = 300, max_treatment_duration = 500, min_uf_volume = 22.6, max_uf_volume = 34.2, min_dialysate_flow_rate = 3, max_dialysate_flow_rate = 5) verify_log(msg_id = str(MsgIds.MSG_ID_TREATMENT_PARAM_CHANGE_RANGES.value), ack = YES, msg = "TreatmentRanges") #0x2F00 hd_simulator.cmd_set_treatment_saline_bolus_data(target = 2, cumulative = 90.0, delivered = 67.2) verify_log(msg_id = MsgIds.MSG_ID_SALINE_BOLUS_DATA.value, ack = YES, msg = "Saline") #0x4D00 hd_simulator.cmd_set_treatment_heparin_data(cumulative = 4) verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_DATA_BROADCAST.value, ack = YES, msg = "Heparin") #0x3300 hd_simulator.cmd_send_accelerometer_hd_data(x = 12.3, y = 22.2, z = 4.0, x_max = 14.0, y_max = 30.2, z_max = 10.5, x_tilt = 11.0, y_tilt = 22.1, z_tilt = 5.5) verify_log(msg_id = MsgIds.MSG_ID_HD_ACCELEROMETER_DATA.value, ack = YES, msg = "Accel") #0x3A00 hd_simulator.cmd_send_hd_general_response(message_id = 58, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_VALVES_DATA.value, ack = YES, msg = "~HD_Valves_Data") #0x3E00 #hd_simulator.cmd_send_hd_general_response(message_id = 62, accepted = 1, reason = 1) hd_simulator.cmd_send_hd_air_trap_data(lower_level = 1, upper_level = 10) verify_log(msg_id = MsgIds.MSG_ID_HD_AIR_TRAP_DATA.value, ack = YES, msg = "AirTrap") #0x6900 hd_simulator.cmd_send_hd_general_response(message_id = 105, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_SYRINGE_PUMP_DATA.value, ack = YES) #0x6A00 hd_simulator.cmd_send_hd_general_response(message_id = 106, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_FLUID_LEAK_STATE.value, ack = YES, msg = "~HD_Fluid_Leak_Data") #0x6C00 hd_simulator.cmd_send_hd_blood_leak_data(blood_leak_status = 0, blood_leak_state = 1, blood_leak_zero_status_counter = 2, blood_leak_counter = 3, blood_leak_zeroed_status = 2, blood_leak_detect_set_point = 1, blood_leak_detect_level = 1, blood_leak_st_count = 1, blood_leak_led_intensity = 2, blood_leak_register_counter = 3) verify_log(msg_id = MsgIds.MSG_ID_HD_BLOOD_LEAK_DATA.value, ack = YES, msg = "BloodLeak") #0x9300 hd_simulator.cmd_send_hd_air_bubble_data(venous_air_bubble_status = 2, venous_air_bubble_state = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_BUBBLES_DATA.value, ack = YES, msg = "AirBubble") #0x7B00 hd_simulator.cmd_send_hd_general_response(message_id = 123, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_VOLTAGES_DATA.value, ack = YES, msg = "~HD_Voltages_Data") #0x7D00 hd_simulator.cmd_send_hd_general_response(message_id = 125, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_INFORMATION.value, ack = YES, msg = "~HD_Alarm_Information") #0xA200 hd_simulator.cmd_send_hd_general_response(message_id = 162, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_SWITCHES_DATA.value, ack = YES, msg = "~HD_Switches_Data") #0x9D00 hd_simulator.cmd_send_hd_general_response(message_id = 157, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_TEMPERATURES_DATA.value, ack = YES, msg = "~HD_Temperature_Data") #0xA300 hd_simulator.cmd_send_hd_general_response(message_id = 163, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_FANS_DATA.value, ack = YES, msg = "~HD_Fans_Data") #0xA800 hd_simulator.cmd_send_hd_general_response(message_id = 168, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_RESERVOIRS_DATA.value, ack = YES, msg = "~HD_Reservoirs_Data") #HD Operation Mode #0x2500 for mode in range(9): hd_simulator.cmd_send_hd_operation_mode(op_mode = mode) verify_log(msg_id = MsgIds.MSG_ID_HD_OP_MODE.value, ack = YES, msg = "OpMode") #0x5C00 for s_mode in range(9): hd_simulator.cmd_send_pre_treatment_state_data(sub_mode = s_mode, water_sample_state = 0, consumables_self_test_state = 0, no_cartridge_self_test_state = 0, installation_state = 0, dry_self_test_state = 0, prime_state = 0, recirculate_state = 0, patient_connection_state = 0) verify_log(msg_id = MsgIds.MSG_ID_PRE_TREATMENT_STATE.value, ack = YES, msg = "PreTreatmentStates") #0x0F00 for s_mode in range(3): hd_simulator.cmd_set_treatment_states_data(sub_mode = s_mode, uf_state = 0, saline_state = 0, heparin_state = 0, rinseback_state = 0, recirculate_state = 0, blood_prime_state = 0, treatment_end_state = 0, treatment_stop_state = 0, dialysis_state = 0) verify_log(msg_id = MsgIds.MSG_ID_TREATMENT_STATE.value, ack = YES, msg = "TreatmentStates") #0x7700 #for s_mode in range(3): hd_simulator.cmd_send_hd_general_response(message_id = 119, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_POST_TREATMENT_STATE.value, ack = YES, msg = "PostTreatmentStates") #0x7E00 for s_mode in range(3): hd_simulator.cmd_send_hd_disinfection_state(sub_mode = s_mode, flush_mode = 0, heat_mode = 0, chemical_mode = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_DISINFECT_STANDBY_DATA.value, ack = YES, msg = "DisinfectStates") #0x9A00 UI-HD #0x9B00 # hd_simulator.cmd_send_hd_disinfect_response(accepted = True, reason =1) hd_simulator.cmd_send_hd_general_response(message_id = 155, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_SET_STANDBY_DISINFECT_SUB_MODE_RESPONSE.value, ack = YES, msg = "~HD_Set_Standby_Disinfect_State_Response") #RINSEBACK #0x5200 UI-HD #0x5300 hd_simulator.cmd_send_treatment_adjust_rinseback_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_RINSEBACK_CMD_RESPONSE.value, ack = YES, msg = "AdjustRinseback") #0x5400 #0x5500 hd_simulator.cmd_send_treatment_adjust_recirculate_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_RECIRC_CMD_RESPONSE.value, ack = YES, msg = "AdjustRecirculate") #0x5600 hd_simulator.cmd_send_treatment_rinseback_data(target_vol = 2.4, current_vol = 1.9, flow_rate = 1, timeout = 4, timeout_countdown = 8, is_completed = False) verify_log(msg_id = MsgIds.MSG_ID_HD_RINSEBACK_PROGRESS.value, ack = YES, msg = "Rinseback") #0x5A00 hd_simulator.cmd_send_treatment_recirculate_data(timeout_total = 200, timeout_count_down = 100) verify_log(msg_id = MsgIds.MSG_ID_HD_RECIRC_PROGRESS.value, ack = YES, msg = "Recirculate") #0x5800 hd_simulator.cmd_send_treatment_adjust_end_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_TX_END_CMD_RESPONSE.value, ack = YES, msg = "AdjustTxEnd") #0x5900 hd_simulator.cmd_send_treatment_blood_prime_data(target = 22.2, current = 33.3) verify_log(msg_id = MsgIds.MSG_ID_HD_BLOOD_PRIME_PROGRESS.value, ack = YES, msg = "BloodPrime") #0x4900 hd_simulator.cmd_send_hd_general_response(message_id = 73, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_STOP_TIMER_DATA.value, ack = YES, msg = "Stop") #RTC #0x0A00 hd_simulator.cmd_send_hd_general_response(message_id = 10, accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_RTC_EPOCH.value, ack = YES, msg = "~HD_RTC_Epoch_Data") #0x6E00 hd_simulator.cmd_send_set_rtc_response(response = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_UI_SET_RTC_RESPONSE.value, ack = YES, msg = "AdjustHDDateTime") #0x7000 dg_simulator.cmd_send_set_rtc_response(response = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_DG_UI_SET_RTC_RESPONSE.value, ack = YES, msg = "AdjustDGDateTime") #Service Information #0x8A00 hd_simulator._handler_system_usage_response() verify_log(msg_id = MsgIds.MSG_ID_HD_SERVICE_SCHEDULE_DATA.value, ack = YES, msg = "ServiceDate") #0x8C00 dg_simulator._handler_system_usage_response() verify_log(msg_id = MsgIds.MSG_ID_DG_SERVICE_SCHEDULE_DATA.value, ack = YES, msg = "ServiceDate") #System Usage Information #0x8B00 hd_simulator.cmd_send_hd_general_response(message_id=139, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_HD_USAGE_DATA.value, ack = YES, msg = "~HD_Usage_Data") #0x8D00 dg_simulator.cmd_send_dg_general_response(message_id=141, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_USAGE_DATA.value, ack = YES, msg = "~DG_Usage_Data") #DG Command #0x2100 hd_simulator.cmd_send_hd_general_response(message_id=33, accepted=0, reason=1) verify_log(msg_id = MsgIds. MSG_ID_DG_SWITCH_RESERVOIR_CMD.value, ack = YES, msg = "~DG_Switch_Res_Cmd") #0x2200 hd_simulator.cmd_send_hd_general_response(message_id=34, accepted=0, reason=1) verify_log(msg_id = MsgIds. MSG_ID_DG_FILL_CMD.value, ack = YES, msg = "~DG_Fill_Cmd") #0x2300 hd_simulator.cmd_send_hd_general_response(message_id=35, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_DRAIN_CMD.value, ack = YES, msg = "~DG_Drain_Cmd") #0x1900 hd_simulator.cmd_send_hd_general_response(message_id=25, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_SET_DG_DIALYSATE_TEMP_TARGETS.value, ack = YES, msg = "~DG_Dialysate_Tgt_Temps") #0x2600 hd_simulator.cmd_send_hd_general_response(message_id=38, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_STARTING_STOPPING_TREATMENT_CMD.value, ack = YES, msg = "~DG_Cmd") #0x2900 hd_simulator.cmd_send_hd_general_response(message_id=41, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_SAMPLE_WATER_CMD.value, ack = YES, msg = "~DG_Sample_Water_Cmd") #0x2B00 hd_simulator.cmd_send_hd_general_response(message_id=43, accepted=0, reason=1) verify_log(msg_id = MsgIds. MSG_ID_DG_START_STOP_TRIMMER_HEATER_CMD.value, ack = YES, msg = "~DG_Trimmer_Htr_Cmd") #0x3000 hd_simulator.cmd_send_hd_general_response(message_id=48, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_START_STOP_HEAT_DISINFECT.value, ack = YES, msg = "~DG_Heat_Disinfect_Cmd") #0x5B00 hd_simulator.cmd_send_hd_general_response(message_id=91, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_CHANGE_VALVE_SETTING_CMD.value, ack = YES, msg = "~DG_Chg_Valves_Cmd") #0x5100 hd_simulator.cmd_send_hd_general_response(message_id=81, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_COMMAND_RESPONSE.value, ack = YES, msg = "~DG_Cmd_Rsp") #0x7800 hd_simulator.cmd_send_hd_general_response(message_id=120, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_START_STOP_CHEM_DISINFECT.value, ack = YES, msg = "~DG_Chem_Disinfect_Cmd") #0x7900 hd_simulator.cmd_send_hd_general_response(message_id=121, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_START_STOP_FLUSH.value, ack = YES, msg = "~DG_Flush_Cmd") #0xA900 hd_simulator.cmd_send_hd_general_response(message_id=169, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_HD_REQUEST_DG_CONCENTRATE_MIXING_RATIOS.value, ack = YES, msg = "~DG_Mixing_Ratio_Fill_Prep_Request") #reading of 4 digit messages has to be dealt with in utility # #0xFFF1 # hd_simulator.cmd_send_hd_general_response(message_id=65521, accepted=0, reason=1) # verify_log(msg_id = MsgIds.MSG_ID_HD_DEBUG_EVENT.value, ack = YES, msg = "None") # # # #0xFFF2 # dg_simulator.cmd_send_dg_general_response(message_id=65522, accepted=0, reason=1) # verify_log(msg_id = MsgIds.MSG_ID_DG_DEBUG_EVENT.value, ack = YES, msg = "None") #Power #0x0100 hd_simulator.cmd_send_poweroff_button_pressed() verify_log(msg_id = MsgIds.MSG_ID_OFF_BUTTON_PRESS.value, ack = YES, msg = "PowerOff") #0x0E00 hd_simulator.cmd_send_broadcast_poweroff_imminent() verify_log(msg_id = MsgIds.MSG_ID_POWER_OFF_WARNING.value, ack = YES, msg = "ShuttingDown") #Events #0xA400 hd_simulator.cmd_send_hd_general_response(message_id=164, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_HD_EVENT.value, ack = YES) #0xA500 dg_simulator.cmd_send_dg_general_response(message_id=165, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_EVENT.value, ack = YES) #Power-On Self-Test [POST] #0x8E00 hd_simulator.cmd_send_hd_post(1, True, False) verify_log(msg_id = MsgIds.MSG_ID_HD_POST_SINGLE_TEST_RESULT.value, ack = YES, msg = "POSTItem") #0x8F00 hd_simulator.cmd_send_hd_post(2, False, True) verify_log(msg_id = MsgIds.MSG_ID_HD_POST_FINAL_TEST_RESULT.value, ack = YES, msg = "POSTDone") #0x9000 dg_simulator.cmd_send_dg_post(1, True, False) verify_log(msg_id = MsgIds.MSG_ID_DG_POST_SINGLE_TEST_RESULT.value, ack = YES, msg = "POSTItem") #0x9100 dg_simulator.cmd_send_dg_post(2, False, True) verify_log(msg_id = MsgIds.MSG_ID_DG_POST_FINAL_TEST_RESULT.value, ack = YES, msg = "POSTDone") #0x9C00 hd_simulator.cmd_send_hd_general_response(message_id=156, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_HD_DG_POST_RESULT_REQUEST.value, ack = YES) #Versions #0x1D00 hd_simulator.cmd_send_version_hd_data(1, 1, 0, 4, 5,1, 2, 3, 6) verify_log(msg_id = MsgIds.MSG_ID_HD_VERSION.value, ack = YES, msg = "VersionRsp") #0x1E00 dg_simulator.cmd_send_version_dg_data(1, 1, 0, 4, 5,1, 2, 3, 6) verify_log(msg_id = MsgIds.MSG_ID_DG_VERSION.value, ack = YES, msg = "Version") #0x9900 hd_simulator.cmd_send_serial_hd_data('AGHHG1234GHJ') verify_log(msg_id = MsgIds.MSG_ID_HD_SERIAL_NUMBER.value, ack = YES) #0x8800 dg_simulator.cmd_send_serial_dg_data('AGHHG1234GHJ') verify_log(msg_id = MsgIds.MSG_ID_DG_SERIAL_NUMBER.value, ack = YES) #0x9E00 # failing due to quick acknowledgement from ui resulting in 0x9f in the last ID. # will be uncommented once acknowledgements are finalized from Diality # hd_simulator.cmd_send_hd_request_ui_version() # verify_log(msg_id = MsgIds.MSG_ID_HD_UI_VERSION_INFO_REQUEST.value, ack = YES, msg = "VersionReq") #Initiate (Create/Select) a Treatment ( and later validate the parameters ) #ID:0x3900 hd_simulator.cmd_initiate_treatment_response(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_INITIATE_TREATMENT_RESPONSE.value, ack = YES, msg= "Initiate treatment response") #Treatment Parameters Validation #ID:0x3600 (API is not reflecting with rejection messages) #hd_simulator.cmd_send_treatment_parameter_validation_response([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]) hd_simulator.cmd_send_hd_general_response(message_id=54, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_HD_NEW_TREATMENT_PARAMS_RESPONSE.value, ack = YES, msg= "Validate New Create Treatment Response") #Pre-Treatment Water Sample (sub-mode) #ID:0x5E00 hd_simulator.cmd_send_pre_treatment_water_sample_response(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_SAMPLE_WATER_CMD_RESPONSE.value, ack = YES, msg = "Water Sample Response") #ID:0x6000 dg_simulator.cmd_send_dg_pre_treatment_filter_flush_progress_data(120,60) verify_log(msg_id = MsgIds.MSG_ID_DG_FILTER_FLUSH_PROGRESS.value, ack = YES, msg = "Filter Flush Progress") #Pre-Treatment No Cartridge Self-Test (sub-mode) #ID:0x6100 hd_simulator.cmd_send_pre_treatment_self_test_no_cartridge_progress_data(120,60) verify_log(msg_id = MsgIds.MSG_ID_HD_NO_CART_SELF_TEST_PROGRESS.value, ack = YES, msg = "No Cartridge Self-Tests Progress") #Pre-Treatment Disposable Installation (sub-mode) #ID:0xAD00(API is missing, also message id is not present in msgs.py file hd_simulator.cmd_send_hd_general_response(message_id=173, accepted=0, reason=1) #verify_log(msg_id = MsgIds. .value, ack = YES, msg = "Disposable Installation Response") #Pre-Treatment Dry Self-Test (sub-mode) #ID:0x6300 hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(120,60) verify_log(msg_id = MsgIds.MSG_ID_HD_DRY_SELF_TEST_PROGRESS.value, ack = YES, msg = "Dry Self-Tests Progress") #Pre-Treatment Prime (sub-mode) #ID:0x3D00 hd_simulator.cmd_send_pre_treatment_prime_start_response(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_START_PRIME_RESPONSE.value, ack = YES, msg = "Prime Start Response") #ID:0x4300 hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(120,60) verify_log(msg_id = MsgIds.MSG_ID_HD_PRIMING_STATUS_DATA.value, ack = YES, msg = "Priming Progress") #Pre-Treatment Patient Connection Begin #ID:0x6500 hd_simulator.cmd_send_hd_general_response(message_id=101, accepted=1, reason=0) verify_log(msg_id = MsgIds.MSG_ID_HD_PATIENT_CONNECTION_BEGIN_RESPONSE.value, ack = YES, msg = "Patient Connection Begin Response") #Pre-Treatment Ultrafiltration (Init) Volume Adjustment #ID:0x5000 hd_simulator.cmd_send_hd_general_response(message_id=80, accepted=1, reason=0) verify_log(msg_id = MsgIds.MSG_ID_HD_SET_UF_VOLUME_PARAMETER_RESPONSE.value, ack = YES, msg = "Pre UF Volume Adjustment Response") #Pre-Treatment Patient Connection Confirm #ID:0x6700 hd_simulator.cmd_send_pre_treatment_patient_connection_confirm_response(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_PATIENT_CONNECTION_CONFIRM_RESPONSE.value, ack = YES, msg = "Patient Connection Confirm Response") #Start Treatment #ID:0x7200 hd_simulator.cmd_send_pre_treatment_continue_to_treament_response(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_START_TREATMENT_RESPONSE.value, ack = YES, msg = "Start treatment response") #Post-Treatment #ID:0x7400 hd_simulator.cmd_send_post_treatment_disposable_removal_confirm_response(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE.value, ack = YES, msg = "Disposable Removal Confirm Response") #Treatment Log #ID:0x7600 hd_simulator.cmd_send_post_treatment_log_response(1,1,1,1,1,1,1,1,1,1,1,1.0,1,1,1,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0, 1.0,1.0,1,1.0,1.0,1,1.0,1,1.0,1.0,1,0,1) verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_DATA_RESPONSE.value, ack = YES, msg = "Treatment Log Data Response") #ID:0x9400 hd_simulator.cmd_send_treatment_log_data(1,1,1.0,0.0,1.0) verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_PERIODIC_DATA.value, ack = YES, msg = "Treatment Log Data 30 min Periodic") #ID:0x9500 hd_simulator.cmd_send_treatment_log_alarm(1,0.0,1.0) verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_ALARM_EVENT.value, ack = YES, msg = "Treatment Log Alarms Data") #ID:0x9600 hd_simulator.cmd_send_treatment_log_event(1,1.0,0.0) verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_EVENT.value, ack = YES, msg = "Treatment Log Events Data") #Post-Treatment - Disinfect #ID:0x8000 hd_simulator.cmd_send_hd_disinfect_response(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_DISINFECT_RESPONSE.value, ack = YES, msg = "Disinfect Request Response") #ID:0x8200 hd_simulator.cmd_send_hd_disinfect_chemical_confirm(1,0) verify_log(msg_id = MsgIds.MSG_ID_HD_CHEM_DISINFECT_CONFIRM_RESPONSE.value, ack = YES, msg = "Chemical Disinfect User Confirm Response") #ID:0x8300 dg_simulator.cmd_send_dg_disinfect_progress_time_flush(120,60) verify_log(msg_id = MsgIds.MSG_ID_DG_FLUSH_TIME_DATA.value, ack = YES, msg = "DG Flush Time [each sub state]") #ID:0x8400 dg_simulator.cmd_send_dg_disinfect_progress_time_heat(120,60) verify_log(msg_id = MsgIds.MSG_ID_DG_HEAT_DISINFECT_TIME_DATA.value, ack = YES, msg = "DG Heat Disinfect Time [each sub state]") #ID:0x8500 dg_simulator.cmd_send_dg_disinfect_progress_time_checmical(120,60) verify_log(msg_id = MsgIds.MSG_ID_DG_CHEM_DISINFECT_TIME_DATA.value, ack = YES, msg = "DG Chem Disinfect Time [each sub state]") # #0x3F00 # the ID isn't getting logged for 63 # hd_simulator.cmd_send_hd_general_response(63, 1, 2) # verify_log(msg_id = MsgIds.MSG_ID_ALARM_CONDITION_CLEARED.value, ack = YES) #DG Broadcast Data #0x1F00 dg_simulator.cmd_set_dg_ro_pump_data(1, 2,5) verify_log(msg_id = MsgIds.MSG_ID_RO_PUMP_DATA.value, ack = YES , msg = "DG RO Pump Data") #0x2000 dg_simulator.cmd_set_dg_pressures_data(1, 1, 2, 2) verify_log(msg_id = MsgIds.MSG_ID_DG_PRESSURES_DATA.value, ack = YES , msg = "DG Pressures Data") #0x2400 dg_simulator.cmd_set_dg_drain_pump_data(10, 5) verify_log(msg_id = MsgIds.MSG_ID_DRAIN_PUMP_DATA.value, ack = YES , msg = "DG Drain Pump Data") #0x2700 dg_simulator.cmd_set_dg_operation_mode(1) verify_log(msg_id = MsgIds.MSG_ID_DG_OP_MODE.value, ack = YES , msg = "DG Operation Mode Data") #0x2800 dg_simulator.cmd_set_dg_reservoir_data( 1, 2, 3) verify_log(msg_id = MsgIds.MSG_ID_DG_RESERVOIRS_DATA.value, ack = YES , msg = "DG Reservoir Data") #0x2A00 dg_simulator.cmd_set_dg_valves_states(3) verify_log(msg_id = MsgIds.MSG_ID_DG_VALVES_STATES.value, ack = YES , msg = "DG Valves States Data") #0x2C00 dg_simulator.cmd_set_dg_heaters_data(1, 2, 3) verify_log(msg_id = MsgIds.MSG_ID_DG_HEATERS_DATA.value, ack = YES , msg = "Heaters Data") #0x0C00 dg_simulator.cmd_set_dg_load_cell_readings_data(1, 2, 4, 3) verify_log(msg_id = MsgIds.MSG_ID_LOAD_CELL_READINGS.value, ack = YES , msg = "Load Cell Readings Data") #0x2D00 dg_simulator.cmd_set_dg_temperatures_data(1,2, 3, 4, 5, 6,7, 8,9, 10, 11, 12) verify_log(msg_id = MsgIds.MSG_ID_DG_TEMPERATURE_DATA.value, ack = YES , msg = "DG Temperatures Data") #0x3100 dg_simulator.cmd_send_dg_conductivity_data(1,2,3,4,5) verify_log(msg_id = MsgIds.MSG_ID_DG_CONDUCTIVITY_DATA.value, ack = YES , msg = "DG Conductivity Data") #0x3700 dg_simulator.cmd_send_dg_general_response(message_id=55, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_HEAT_DISINFECT_DATA.value, ack = YES , msg = "DG Heat Disinfect Data") #0x4200 dg_simulator.cmd_send_dg_general_response(message_id=66, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_CONCENTRATE_PUMP_DATA.value, ack = YES , msg = "DG Concentrate Pumps Data") #0x4400 dg_simulator.cmd_send_dg_general_response(message_id=68, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_UV_REACTORS_DATA.value, ack = YES , msg = "DG UV reactors Data") #0x4500 dg_simulator.cmd_send_dg_general_response(message_id=69, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_THERMISTORS_DATA.value, ack = YES , msg = "DG Thermistors Data") #0x4800 dg_simulator.cmd_send_dg_general_response(message_id=72, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_FANS_DATA.value, ack = YES , msg = "DG Fans Data") #0x3400 dg_simulator.cmd_send_accelerometer_dg_data(x=1, y=2, z=3, x_max=2, y_max=2, z_max=3, x_tilt=2, y_tilt=3, z_tilt=4) verify_log(msg_id = MsgIds.MSG_ID_DG_ACCELEROMETER_DATA.value, ack = YES , msg = "DG Accelerometer Data") #0x6B00 dg_simulator.cmd_send_dg_general_response(message_id=107, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_FLUID_LEAK_STATE.value, ack = YES , msg = "DG fluid leak data") #0x7A00 dg_simulator.cmd_send_dg_general_response(message_id=122, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_FLUSH_DATA.value, ack = YES , msg = "DG flush data") #0x8600 dg_simulator.cmd_send_dg_general_response(message_id=134, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_VOLTAGES_DATA.value, ack = YES , msg = "Monitored DG voltages") #0x8700 dg_simulator.cmd_send_dg_general_response(message_id=135, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_CHEM_DISINFECT_DATA.value, ack = YES , msg = "DG Chemical Disinfect Data") #0xA100 dg_simulator.cmd_send_dg_general_response(message_id=161, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_SWITCHES_DATA.value, ack = YES , msg = "DG switches data") #0xA700 dg_simulator.cmd_send_dg_general_response(message_id=167, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_ALARM_INFO.value, ack = YES , msg = "DG alarm info") #0xAA00 dg_simulator.cmd_send_dg_general_response(message_id=170, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_CONCENTRATE_MIXING_RATIOS_DATA.value, ack = YES , msg = "DG concentrate mixing ratios") #0xA600 dg_simulator.cmd_send_dg_general_response(message_id=166, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_DIALYSATE_FLOW_METER_DATA.value, ack = YES , msg = "Dialysate Flow Rate") #0xAB00 dg_simulator.cmd_send_dg_general_response(message_id=171, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_SCHEDULED_RUNS_DATA.value, ack = YES , msg = "DG scheduled runs data") #0xAC00 dg_simulator.cmd_send_dg_general_response(message_id=172, accepted=0, reason=1) verify_log(msg_id = MsgIds.MSG_ID_DG_SCHEDULED_RUNS_INFO.value, ack = YES , msg = "DG scheduled runs info") # #0xAE00 # no msg_id in msg_ids.py # dg_simulator.cmd_send_dg_general_response(message_id=174, accepted=0, reason=1) # verify_log(msg_id = '174', ack = YES , msg = "DG Fill Mode Data") # # #0xAF00 # no msg_id in msg_ids.py # dg_simulator.cmd_send_dg_general_response(message_id=175, accepted=0, reason=1) # verify_log(msg_id = '175', ack = YES , msg = "DG Idle Mode Bad Fill Sub-states") # #Alarm #0x0200 hd_alarm.cmd_send_clear_alarms() verify_log(msg_id = MsgIds.MSG_ID_ALARM_STATUS.value, ack = YES , msg = "Alarm Status (Composite)") #0x0300 hd_alarm.cmd_set_alarm_triggered(3,4, 2, 3, 5, 1, 1, 3) verify_log(msg_id = MsgIds.MSG_ID_ALARM_TRIGGERED.value, ack = YES , msg = "Alarm Triggered") #0x0400 hd_alarm.cmd_set_alarm_cleared(4) verify_log(msg_id = MsgIds.MSG_ID_ALARM_CLEARED.value, ack = YES , msg = "Alarm Cleared") #0x7C00 hd_simulator.cmd_send_hd_general_response(124, 1, 2) verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_AUDIO_VOLUME_SET_RESPONSE.value, ack = YES , msg = "Set Alarm Audio Volume Level Response") #0x3200 hd_simulator.cmd_send_hd_general_response(50, 1, 2) verify_log(msg_id = MsgIds.MSG_ID_USER_REQUEST_ALARM_SILENCE.value, ack = YES , msg = "Alarm Silence Request") #0x9800 hd_alarm.cmd_send_active_list_response(1, 2, 3, 3, 3, 3, 2,3,4, 4,4 ,9) verify_log(msg_id = MsgIds.MSG_ID_HD_ACTIVE_ALARMS_LIST_REQUEST_RESPONSE.value, ack = YES , msg = "Active Alarms List Response") #UF Vol. #0x4100 hd_simulator.cmd_set_treatment_adjust_ultrafiltration_accepted(1) verify_log(msg_id = MsgIds.MSG_ID_USER_UF_PAUSE_RESUME_RESPONSE.value, ack = YES , msg = "UF Pause/Resume Response") #0x1300 hd_simulator.cmd_send_hd_general_response(19, 1, 2) verify_log(msg_id = MsgIds.MSG_ID_USER_UF_SETTINGS_CHANGE_RESPONSE.value, ack = YES , msg = "UF Vol. Change Response") #0x2E00 hd_simulator.cmd_set_treatment_adjust_ultrafiltration_confirm_rejected(1) verify_log(msg_id = MsgIds.MSG_ID_USER_UF_SETTINGS_CHANGE_CONFIRMATION_RESPONSE.value, ack = YES , msg = "UF Vol. Change Confirmation Response") #Saline #0x1400 hd_simulator.cmd_set_saline_bolus_response( 0,1, 10) verify_log(msg_id = MsgIds.MSG_ID_USER_SALINE_BOLUS_RESPONSE.value, ack = YES , msg = "Saline Bolus Response") #Heparin #0x4C00 hd_simulator.cmd_set_heparin_pause_resume_response(1,2) verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_PAUSE_RESUME_RESPONSE.value, ack = YES , msg = "Heparin Pause/Resume Response") #Duration #0x1B00 hd_simulator.cmd_send_treatment_adjust_duration_response(0,1,5,1) verify_log(msg_id = MsgIds.MSG_ID_USER_TREATMENT_TIME_CHANGE_RESPONSE.value, ack = YES , msg = "Treatment Duration change Response") #Blood / Dialysate #0x1800 hd_simulator.cmd_send_treatment_adjust_blood_dialysate_response(1, 1, 12, 10) verify_log(msg_id = MsgIds.MSG_ID_USER_BLOOD_DIAL_RATE_CHANGE_RESPONSE.value, ack = YES , msg = "Blood/dialysate rate change Response") #PRS-58: In-Line Blood Pressure Limits #0x4700 hd_simulator.cmd_send_treatment_adjust_pressures_limit_response(1,1,1, 2, 3, 4) verify_log(msg_id = MsgIds.MSG_ID_HD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, ack = YES , msg = "A/V BP Limit Change Response")