Index: tst_ui_logs/test.py =================================================================== diff -u -ra3bcd22e1ad0d29c293509911ce49a8b7cd65244 -rc3c300e47058098ad766b62430969dc9568a54b4 --- tst_ui_logs/test.py (.../test.py) (revision a3bcd22e1ad0d29c293509911ce49a8b7cd65244) +++ tst_ui_logs/test.py (.../test.py) (revision c3c300e47058098ad766b62430969dc9568a54b4) @@ -36,9 +36,12 @@ hd_simulator = HDSimulator() dg_simulator = DGSimulator() +hd_simulator = HDSimulator() logger= logging.getLogger("INFO") messenger= DenaliCanMessenger('can0') hd_alarm= HDAlarmsSimulator(can_interface=messenger, logger=logger) +dg_simulator = DGSimulator() + NUMBER_OF_OPMODE = 9 NUMBER_OF_TREATMENTMODES = 3 CONDITIONS = [0,1] @@ -307,17 +310,20 @@ payload = integer_to_bytearray(1) payload += unsigned_integer_to_bytearray(4) hd_simulator.cmd_send_hd_general_response(message_id=155, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) + hd_simulator.cmd_send_hd_disinfect_response(accepted = False, reason =1) # verify_log(msg_id=MsgIds.MSG_ID_HD_SET_STANDBY_DISINFECT_SUB_MODE_RESPONSE.value, msg="~HD_Set_Standby_Disinfect_State_Response") #RINSEBACK #0x5300 hd_simulator.cmd_send_treatment_adjust_rinseback_response(accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_RINSEBACK_CMD_RESPONSE.value, msg = "AdjustRinseback", param = [1,1]) + hd_simulator.cmd_send_treatment_adjust_rinseback_response(accepted = 0, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_RINSEBACK_CMD_RESPONSE.value, msg = "AdjustRinseback", param = [0,1]) + - - #0x5500 + hd_simulator.cmd_send_treatment_adjust_recirculate_response(accepted = 0, reason = 1) hd_simulator.cmd_send_treatment_adjust_recirculate_response(accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_RECIRC_CMD_RESPONSE.value, msg = "AdjustRecirculate", param = [1,1]) @@ -331,6 +337,7 @@ #Treatment End(sub-mode) #0x5800 + hd_simulator.cmd_send_treatment_adjust_end_response(accepted = 0, reason = 5) hd_simulator.cmd_send_treatment_adjust_end_response(accepted = 1, reason = 5) verify_log(msg_id = MsgIds.MSG_ID_HD_TX_END_CMD_RESPONSE.value, msg = "AdjustTxEnd", param = [1,5]) @@ -344,6 +351,7 @@ #0x4900 payload = unsigned_integer_to_bytearray(150) payload += unsigned_integer_to_bytearray(300) + hd_simulator.cmd_send_hd_general_response(message_id=73, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) hd_simulator.cmd_send_hd_general_response(message_id=73, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) verify_log(msg_id=MsgIds.MSG_ID_HD_TREATMENT_STOP_TIMER_DATA.value, msg="Stop") @@ -410,6 +418,7 @@ #0x9C00 #TODO: Payload values need to been changed after discussion + hd_simulator.cmd_send_hd_general_response(message_id=156, accepted=1, reason=2, is_pure_data=False, has_parameters=False, parameters_payload=None, channel_id=DenaliChannels.hd_to_dg_ch_id) hd_simulator.cmd_send_hd_general_response(message_id=156, accepted=0, reason=0, is_pure_data=False, has_parameters=False, parameters_payload=None, channel_id=DenaliChannels.hd_to_dg_ch_id) #verify_log(msg_id=MsgIds.MSG_ID_HD_DG_POST_RESULT_REQUEST.value) @@ -558,6 +567,10 @@ payload = integer_to_bytearray(0) dg_simulator.cmd_send_dg_general_response(message_id=107, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) verify_log(msg_id=MsgIds.MSG_ID_DG_FLUID_LEAK_STATE.value, msg="~DG_Fluid_Leak_Data") + payload = integer_to_bytearray(1) + dg_simulator.cmd_send_dg_general_response(message_id=107, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) + verify_log(msg_id=MsgIds.MSG_ID_DG_FLUID_LEAK_STATE.value, msg="~DG_Fluid_Leak_Data") + #0x7A00 payload = unsigned_integer_to_bytearray(11) @@ -610,7 +623,11 @@ payload = integer_to_bytearray(1) dg_simulator.cmd_send_dg_general_response(message_id=167, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload, channel_id=DenaliChannels.dg_sync_broadcast_ch_id) verify_log(msg_id=MsgIds.MSG_ID_DG_ALARM_INFO.value, msg=None) - + payload = integer_to_bytearray(0) + dg_simulator.cmd_send_dg_general_response(message_id=167, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload, channel_id=DenaliChannels.dg_sync_broadcast_ch_id) + verify_log(msg_id=MsgIds.MSG_ID_DG_ALARM_INFO.value, msg=None) + + #0xAA00 #TODO: Payload values need to been changed after discussion payload = float_to_bytearray(88.6) @@ -698,6 +715,9 @@ payload += unsigned_integer_to_bytearray(1) hd_simulator.cmd_send_hd_general_response(message_id=124, accepted=1, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_AUDIO_VOLUME_SET_RESPONSE.value, msg = "AdjustHDAlarmVolume") + hd_simulator.cmd_send_hd_general_response(message_id=124, accepted=0, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) + verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_AUDIO_VOLUME_SET_RESPONSE.value, msg = "AdjustHDAlarmVolume") + #0x3F00 #TODO: Payload values need to been changed after discussion @@ -716,6 +736,12 @@ hd_alarm.cmd_send_active_list_response(accept = True, reason = 1, a0 = 0, a1 = 1, a2 = 2, a3 = 3, a4 = 4, a5 = 5, a6 = 6, a7 = 7, a8 = 8, a9 = 9) + hd_alarm.cmd_send_active_list_response(accept = 0, reason = 2, + a0 = 0, a1 = 1, a2 = 2, a3 = 3, a4 = 4, + a5 = 5, a6 = 6, a7 = 7, a8 = 8, a9 = 9) + hd_alarm.cmd_send_active_list_response(accept = 0, reason = 1, + a0 = 0, a1 = 0, a2 = 0, a3 = 0, a4 = 0, + a5 = 0, a6 = 0, a7 = 0, a8 = 0, a9 = 0) #verify_log(msg_id = MsgIds.MSG_ID_HD_ACTIVE_ALARMS_LIST_REQUEST_RESPONSE.value, msg = "AlarmActiveList") @@ -724,6 +750,7 @@ #0x4100 #parameter mismatch : expected 1 int but 3 integers are logged hd_simulator.cmd_set_treatment_adjust_ultrafiltration_accepted(state = 1) + hd_simulator.cmd_set_treatment_adjust_ultrafiltration_accepted(state = 0) verify_log(msg_id = MsgIds.MSG_ID_USER_UF_PAUSE_RESUME_RESPONSE.value, msg = "AdjustUFState") #0x1300 @@ -752,29 +779,40 @@ #0x1400 hd_simulator.cmd_set_saline_bolus_response(accepted = 1, reason = 1, target = 2) verify_log(msg_id = MsgIds.MSG_ID_USER_SALINE_BOLUS_RESPONSE.value, msg = "AdjustSaline", param = [1,1,2]) - + hd_simulator.cmd_set_saline_bolus_response(accepted = 0, reason = 1, target = 2) + verify_log(msg_id = MsgIds.MSG_ID_USER_SALINE_BOLUS_RESPONSE.value, msg = "AdjustSaline", param = [0,1,2]) + #Heparin #0x4C00 hd_simulator.cmd_set_heparin_pause_resume_response(accepted = 1, reason = 1) verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_PAUSE_RESUME_RESPONSE.value, msg = "AdjustHeparin", param = [1,1]) - + hd_simulator.cmd_set_heparin_pause_resume_response(accepted = 0, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_PAUSE_RESUME_RESPONSE.value, msg = "AdjustHeparin", param = [0,1]) + #Duration #0x1B00 hd_simulator.cmd_send_treatment_adjust_duration_response(accepted = 1, reason = 1,duration = 22, ultrafiltration = 17.0) verify_log(msg_id = MsgIds.MSG_ID_USER_TREATMENT_TIME_CHANGE_RESPONSE.value, msg = "AdjustDuration", param = [1, 1, 22, 17.0]) - + hd_simulator.cmd_send_treatment_adjust_duration_response(accepted = 0, reason = 1,duration = 22, ultrafiltration = 17.0) + verify_log(msg_id = MsgIds.MSG_ID_USER_TREATMENT_TIME_CHANGE_RESPONSE.value, msg = "AdjustDuration", param = [0, 1, 22, 17.0]) + + #Blood / Dialysate #0x1800 hd_simulator.cmd_send_treatment_adjust_blood_dialysate_response(accepted = 1, reason = 1,blood_rate = 2, dialysate_flow_rate = 3) verify_log(msg_id = MsgIds.MSG_ID_USER_BLOOD_DIAL_RATE_CHANGE_RESPONSE.value, msg = "AdjustBloodDialysate", param = [1, 1, 2, 3]) - + hd_simulator.cmd_send_treatment_adjust_blood_dialysate_response(accepted = 0, reason = 1,blood_rate = 2, dialysate_flow_rate = 3) + verify_log(msg_id = MsgIds.MSG_ID_USER_BLOOD_DIAL_RATE_CHANGE_RESPONSE.value, msg = "AdjustBloodDialysate", param = [0, 1, 2, 3]) + #PRS-58: In-Line Blood Pressure Limits #0x4700 hd_simulator.cmd_send_treatment_adjust_pressures_limit_response(accepted = 1, reason = 1,arterial_low = 2, arterial_high = 3, venous_low = 4, venous_high = 5) verify_log(msg_id = MsgIds.MSG_ID_HD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, msg = "AdjustPressuresLimits", param = [1, 1, 2, 3, 4, 5]) - + hd_simulator.cmd_send_treatment_adjust_pressures_limit_response(accepted = 0, reason = 1,arterial_low = 2, arterial_high = 3, venous_low = 4, venous_high = 5) + verify_log(msg_id = MsgIds.MSG_ID_HD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, msg = "AdjustPressuresLimits", param = [0, 1, 2, 3, 4, 5]) + #Service Information #0x8A00 hd_simulator._handler_system_usage_response() @@ -855,6 +893,10 @@ payload = unsigned_integer_to_bytearray(1) hd_simulator.cmd_send_hd_general_response(message_id=91, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) verify_log(msg_id=MsgIds.MSG_ID_DG_CHANGE_VALVE_SETTING_CMD.value, msg="~DG_Chg_Valves_Cmd") + payload = unsigned_integer_to_bytearray(0) + hd_simulator.cmd_send_hd_general_response(message_id=91, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) + verify_log(msg_id=MsgIds.MSG_ID_DG_CHANGE_VALVE_SETTING_CMD.value, msg="~DG_Chg_Valves_Cmd") + #0x5100 payload = unsigned_integer_to_bytearray(1) @@ -892,7 +934,10 @@ #ID:0x3900 hd_simulator.cmd_initiate_treatment_response(response = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_INITIATE_TREATMENT_RESPONSE.value, msg= "InitTreatment", param = [1,0]) + hd_simulator.cmd_initiate_treatment_response(response = 0, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_INITIATE_TREATMENT_RESPONSE.value, msg= "InitTreatment", param = [0,1]) + #Treatment Parameters Validation #ID:0x3600 payload = unsigned_integer_to_bytearray(1) @@ -915,12 +960,16 @@ payload += unsigned_integer_to_bytearray(18) payload += unsigned_integer_to_bytearray(19) hd_simulator.cmd_send_hd_general_response(message_id=54, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) + hd_simulator.cmd_send_hd_general_response(message_id=54, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) verify_log(msg_id=MsgIds.MSG_ID_HD_NEW_TREATMENT_PARAMS_RESPONSE.value, msg="Validate New Create Treatment Response") #Pre-Treatment Water Sample (sub-mode) #ID:0x5E00 hd_simulator.cmd_send_pre_treatment_water_sample_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_SAMPLE_WATER_CMD_RESPONSE.value, msg = "AdjustWaterSample", param = [1,0]) + hd_simulator.cmd_send_pre_treatment_water_sample_response(accepted = 0, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_SAMPLE_WATER_CMD_RESPONSE.value, msg = "AdjustWaterSample", param = [0,1]) + #ID:0x6000 dg_simulator.cmd_send_dg_pre_treatment_filter_flush_progress_data(total = 120, countdown = 60) @@ -937,7 +986,10 @@ payload += unsigned_integer_to_bytearray(0) hd_simulator.cmd_send_hd_general_response(message_id=173, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) verify_log(msg_id = MsgIds.MSG_ID_UI_INSTALLATION_CONFIRM_RESPONSE.value, msg = "AdjustDisposablesConfirm") - + hd_simulator.cmd_send_hd_general_response(message_id=173, accepted=1, reason=0, is_pure_data=False, has_parameters=True, parameters_payload=payload) + verify_log(msg_id = MsgIds.MSG_ID_UI_INSTALLATION_CONFIRM_RESPONSE.value, msg = "AdjustDisposablesConfirm") + + #Pre-Treatment Dry Self-Test (sub-mode) #ID:0x6300 hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(total = 120, countdown = 60) @@ -947,6 +999,9 @@ #ID:0x3D00 hd_simulator.cmd_send_pre_treatment_prime_start_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_START_PRIME_RESPONSE.value, msg = "AdjustDisposablesPrime", param = [1,0]) + hd_simulator.cmd_send_pre_treatment_prime_start_response(accepted = 0, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_START_PRIME_RESPONSE.value, msg = "AdjustDisposablesPrime", param = [0,1]) + #ID:0x4300 hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(timeout = 120, countdown = 60) @@ -958,7 +1013,10 @@ payload += unsigned_integer_to_bytearray(0) hd_simulator.cmd_send_hd_general_response(message_id=101, accepted=1, reason=0, is_pure_data=False, has_parameters=True, parameters_payload=payload) verify_log(msg_id=MsgIds.MSG_ID_HD_PATIENT_CONNECTION_BEGIN_RESPONSE.value, msg="Patient Connection Begin Response") - + hd_simulator.cmd_send_hd_general_response(message_id=101, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) + verify_log(msg_id=MsgIds.MSG_ID_HD_PATIENT_CONNECTION_BEGIN_RESPONSE.value, msg="Patient Connection Begin Response") + + #Pre-Treatment Ultrafiltration (Init) Volume Adjustment #ID:0x5000 payload = unsigned_integer_to_bytearray(1) @@ -972,18 +1030,25 @@ #ID:0x6700 hd_simulator.cmd_send_pre_treatment_patient_connection_confirm_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_PATIENT_CONNECTION_CONFIRM_RESPONSE.value, msg = "AdjustPatientConnectionBegin", param = [1,0]) + - - #Start Treatment #ID:0x7200 hd_simulator.cmd_send_pre_treatment_continue_to_treament_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_START_TREATMENT_RESPONSE.value, msg = "AdjustStartTreatment", param = [1,0]) + + #ID:0x7200 + hd_simulator.cmd_send_pre_treatment_continue_to_treament_response(accepted = 0, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_START_TREATMENT_RESPONSE.value, msg = "AdjustStartTreatment", param = [0,1]) + #Post-Treatment #ID:0x7400 hd_simulator.cmd_send_post_treatment_disposable_removal_confirm_response(accepted = 1, reason = 0) verify_log(msg_id = MsgIds.MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE.value, msg = "AdjustDisposablesRemovalConfirm", param = [1,0]) + hd_simulator.cmd_send_post_treatment_disposable_removal_confirm_response(accepted = 0, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE.value, msg = "AdjustDisposablesRemovalConfirm", param = [0,1]) + #Treatment Log #ID:0x7600 @@ -1047,6 +1112,11 @@ hd_simulator.cmd_send_hd_disinfect_response(accepted = 1, reason = 0) #verify_log(msg_id = MsgIds.MSG_ID_HD_DISINFECT_RESPONSE.value, msg = "AdjustDisinfect", param =[1,0]) + #ID:0x6700 + hd_simulator.cmd_send_pre_treatment_patient_connection_confirm_response(accepted = 0, reason = 1) + #verify_log(msg_id = MsgIds.MSG_ID_HD_PATIENT_CONNECTION_CONFIRM_RESPONSE.value, msg = "AdjustPatientConnectionBegin", param = [0,1]) + + #ID:0x8200 payload = unsigned_integer_to_bytearray(0) payload += unsigned_integer_to_bytearray(7) @@ -1110,6 +1180,7 @@ #0x2700 payload = unsigned_integer_to_bytearray(1) payload += unsigned_integer_to_bytearray(1) + dg_simulator.cmd_send_dg_general_response(message_id=39, accepted=0, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) dg_simulator.cmd_send_dg_general_response(message_id=39, accepted=1, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) verify_log(msg_id = MsgIds.MSG_ID_DG_OP_MODE.value, msg = "OpMode") @@ -1136,6 +1207,7 @@ hd_simulator.cmd_send_hd_general_response(message_id=177, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) verify_log(msg_id = MsgIds.MSG_ID_HD_RESPONSE_SERVICE_MODE_REQUEST.value, msg = "ServiceMode", param = [1,1]) + #0x0600 dg_simulator.cmd_send_checkin_dg() dg_simulator.cmd_send_dg_general_response(message_id=6, accepted=0, reason=0, is_pure_data = False, has_parameters = False, parameters_payload = None) @@ -1167,6 +1239,12 @@ #0x5000 hd_simulator.cmd_send_uf_treatment_response(accepted= 1, reason= 1, volume= 0.1) + #0xB100 + payload = unsigned_integer_to_bytearray(1) + payload += unsigned_integer_to_bytearray(1) + hd_simulator.cmd_send_hd_general_response(message_id=177, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) + #verify_log(msg_id = MsgIds.MSG_ID_HD_RESPONSE_SERVICE_MODE_REQUEST.value, msg = "ServiceMode", param = [0,1]) + #0x4100 hd_simulator.cmd_set_treatment_adjust_ultrafiltration_state_response(accepted=1, reason= 10, state= 5) @@ -1336,6 +1414,7 @@ #0x7500 hd_simulator.cmd_send_hd_general_response(message_id=117, accepted=1, reason=1, is_pure_data=False, has_parameters=False, parameters_payload=None,channel_id= DenaliChannels.ui_to_hd_ch_id ) + #0x7F00 for s_mode in range(3): hd_simulator.cmd_send_hd_general_response(message_id=127, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload,channel_id= DenaliChannels.ui_to_hd_ch_id) @@ -1346,10 +1425,13 @@ #0x9200 payload = unsigned_integer_to_bytearray(0) hd_simulator.cmd_send_hd_general_response(message_id=146, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload,channel_id= DenaliChannels.ui_sync_broadcast_ch_id ) - + payload = unsigned_integer_to_bytearray(1) + hd_simulator.cmd_send_hd_general_response(message_id=146, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload,channel_id= DenaliChannels.ui_sync_broadcast_ch_id ) + #0x4E00 payload = unsigned_integer_to_bytearray(1) hd_simulator.cmd_send_hd_general_response(message_id=78, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload,channel_id= DenaliChannels.ui_to_hd_ch_id ) + hd_simulator.cmd_send_hd_general_response(message_id=78, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload,channel_id= DenaliChannels.ui_to_hd_ch_id ) utils.tstDone()