Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r57644f8662735736c07ea303b6f5c17cfc929ce7 -rc5452bef60ff6c8703bec2675bf726132a79e5dd --- shared/scripts/configuration/utility.py (.../utility.py) (revision 57644f8662735736c07ea303b6f5c17cfc929ce7) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision c5452bef60ff6c8703bec2675bf726132a79e5dd) @@ -241,11 +241,11 @@ string_format_id = str(formatted_message_id) first_two_char = string_format_id[2:4] last_two_char = string_format_id[4:6] - if last_two_char != '00': + if last_two_char != '00' and len(string_format_id) != 5: test.log(str(('0x'+last_two_char+first_two_char))) return row[3], row[4], ('0x'+last_two_char+first_two_char) else: - return row[3], row[4], formatted_message_id.replace("00", "") + return row[3], row[4], string_format_id.replace("00", "") else: pass except: @@ -312,8 +312,3 @@ content_record.append(ack_bak_status) return content_record - - - - - Index: shared/scripts/names.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -rc5452bef60ff6c8703bec2675bf726132a79e5dd --- shared/scripts/names.py (.../names.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/names.py (.../names.py) (revision c5452bef60ff6c8703bec2675bf726132a79e5dd) @@ -3,6 +3,24 @@ from objectmaphelper import * + +# Top Parents +o_QQuickView = { "type": "QQuickView"} +o_Overlay = {"container": o_QQuickView, "type": "Overlay"} +o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True} +o_treatmentHome_backgroung = {"container": o_treatmentHome, "id": "_backgroundRect" , "type": "Rectangle" , "unnamed": 1, "visible": True} +o_treatmentHome_startTreatment = {"container": o_treatmentHome, "id": "_startTreatmentRect" , "type": "TouchRect" , "unnamed": 1, "visible": True} +o_treatmentHome_createTreatment = {"container": o_treatmentHome, "id": "_createTreatmentRect", "type": "TouchRect" , "unnamed": 1, "visible": True} + + +# Main Menu +o_mainMenu = {"container": o_QQuickView, "id": "_mainMenu" , "type": "MainMenu" , "unnamed": 1 , "visible": True} +o_mainMenu_treatment = {"container": o_mainMenu , "id": "_touchRect", "type": "TouchRect", "objectName": "_touchRect0", "visible": True} +o_mainMenu_manager = {"container": o_mainMenu , "id": "_touchRect", "type": "TouchRect", "objectName": "_touchRect1", "visible": True} +o_mainMenu_settings = {"container": o_mainMenu , "id": "_touchRect", "type": "TouchRect", "objectName": "_touchRect2", "visible": True} + + + o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} o_Overlay = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True} o_borderRect_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_borderRect", "type": "Rectangle", "unnamed": 1, "visible": True} @@ -46,8 +64,6 @@ o_uf_close_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_NotificationBar_NotificationBarSmall = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "objectName": "NotificationBar", "type": "NotificationBarSmall", "visible": True} - - - Index: tst_unhandled_message_log/test.py =================================================================== diff -u -r57644f8662735736c07ea303b6f5c17cfc929ce7 -rc5452bef60ff6c8703bec2675bf726132a79e5dd --- tst_unhandled_message_log/test.py (.../test.py) (revision 57644f8662735736c07ea303b6f5c17cfc929ce7) +++ tst_unhandled_message_log/test.py (.../test.py) (revision c5452bef60ff6c8703bec2675bf726132a79e5dd) @@ -1,29 +1,21 @@ # -*- 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 +# file tst_inhandled_message_log # date 2022/04/09 # author # # NOTE: # This test verifies the unhandled logs for the messages provided +import os from dialin.ui.hd_simulator import HDSimulator -from dialin.hd.reservoirs import HDReservoirs -from dialin.hd.valves import HDValves -from dialin.dg.reservoirs import DGReservoirs - -from dialin.hd.rtc import HDRTC -from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator -import logging -from dialin.protocols.CAN import DenaliCanMessenger #from dialin.dg import DGSimulator from dialin.ui import utils from configuration import utility @@ -35,16 +27,9 @@ hd_simulator = HDSimulator() -logging.basicConfig(filename='log_file.log',level=logging.INFO, datefmt='%d-%b-%y %H:%M:%S') -logger= logging.getLogger("INFO") -messenger= DenaliCanMessenger('can0') -reservoirs = HDReservoirs(can_interface=messenger, logger=logger) -alarm = HDAlarmsSimulator(can_interface=messenger, logger=logger) -rtc = HDRTC(can_interface=messenger, logger=logger) -valves = HDValves(can_interface=messenger, logger=logger) -reservoirs = DGReservoirs(can_interface=messenger, logger=logger) + def verify_log(msg_id,msg = None, param = None): utils.waitForGUI(0.2) ack = False @@ -56,31 +41,74 @@ 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") message_id_hex = builtins.hex(builtins.int(msg_id)) - message_id_str = builtins.str(message_id_hex) + message_id_str = builtins.str(message_id_hex) test.verify(message_id_str in message_extracted, "message ID is verified") if param != None: test.verify(param in message_extracted, "parameters are verified") +UNHANDLED_MESSAGE_1 = "\n[0x7234]\nHDDDDDDDDD\nU32=Audio Volume\nF32=Audio Current HG\n" + #['F32=Audio Current LG'], ['F32=Backup Audio Current'], ['U32=Safety Shutdown']] +#UNHANDLED_MESSAGE_2 = + + +def navigate_unhandled_message(): + + location = '/home/denali/Projects/application/resources/settings/Messages/Unhandled.conf' + with open(location, "a") as filereader: + filereader.write(UNHANDLED_MESSAGE_1) + snooze(5) + + + def main(): startApplication("denaliSquish") + navigate_unhandled_message() + + ''' + cd "$HOME"/opt/spacelabs/Monitor/MCISIM/LaunchScrptFiles + + snooze(5) + + shell_script (compling application) + log v/s dic + + #0x7D00 alarm._send_alarm_volume_broadcast() - snooze(5) verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_INFORMATION.value, msg = '~HD_Alarm_Information', param = [5,1,1,1,'?']) + ''' + #0x0A00 + hd_simulator.cmd_send_hd_general_response(message_id = 29236, accepted = 1, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_RTC_EPOCH.value, msg = '~HD_RTC_Epoch_Data', param = [1]) + ''' + #0x2100 hd_simulator.cmd_send_hd_general_response(message_id = 33, accepted = 1, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_DG_SWITCH_RESERVOIR_CMD.value, msg = '~DG_Switch_Res_Cmd', param = [1]) + + #0x0080 + hd_simulator.cmd_send_hd_general_response(message_id = 640, accepted = 1, reason = 1) + #verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_INFORMATION.value, msg = '~HD_Alarm_Information', param = [5,1,1,1,'?']) + + """ + hd_simulator.cmd_send_hd_general_response(message_id = 10, accepted = 1, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_INFORMATION.value, msg = '~HD_Alarm_Information', param = [5,1,1,1,'?']) + + hd_simulator.cmd_send_hd_general_response(message_id = 33, accepted = 1, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_INFORMATION.value, msg = '~HD_Alarm_Information', param = [5,1,1,1,'?']) + + hd_simulator.cmd_send_hd_general_response(message_id = 33, accepted = 1, reason = 1) + verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_INFORMATION.value, msg = '~HD_Alarm_Information', param = [5,1,1,1,'?']) + #reservoirs.cmd_switch_reservoirs(reservoir = 1) snooze(5) #valves = HDValves(can_interface=messenger, logger=logger) #rtc.cmd_set_rtc_time_and_date(second = 25, minute = 30, hour = 2, day = 5, month = 5, year = 2015) + ''' - - - - snooze(5)