Index: shared/scripts/configuration/config.py =================================================================== diff -u -rf8943fd4831755c59de02301e92eed5e2dc6eee5 -racea999b214b759fa0749e8b026a5c4a5ebc931d --- shared/scripts/configuration/config.py (.../config.py) (revision f8943fd4831755c59de02301e92eed5e2dc6eee5) +++ shared/scripts/configuration/config.py (.../config.py) (revision acea999b214b759fa0749e8b026a5c4a5ebc931d) @@ -8,7 +8,7 @@ # # @file utils.py # -# @author (last) Joseph varghese +# @author (last) LTTS # @date (last) 18-Jan-2022 # ############################################################################ @@ -24,6 +24,7 @@ "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} + ALARM_ID_AND_MESSAGES = { 1: "Stuck button POST failure.\nStop or Off button detected to be pressed for at least 1 second during test shortly after power up.", 2: "HD FPGA POST failure.", @@ -322,50 +323,6 @@ ACCEPTED = True REJECTED = False ALARM_LIST_TITLE = "Alarm list" - -REJECTION_REASON = { - 0: "No Active Alarm List", - 1: "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE", - 2: "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM", - 3: "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE", - 4: "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE", - 5: "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED", - 6: "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE", - 7: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT", - 8: "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE", - 9: "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE", - 10: "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE", - 11: "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE", - 12: "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE", - 13: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM", - 14: "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS", - 15: "REQUEST_REJECT_REASON_UF_NOT_PAUSED", - 16: "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS", - 17: "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE", - 18: "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION", - 19: "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH", - 20: "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH", - 21: "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED", - 22: "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS", - 23: "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE", - 24: "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE", - 25: "REQUEST_REJECT_REASON_INVALID_COMMAND", - 26: "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED", - 27: "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED", - 28: "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET", - 29: "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM", - 30: "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE", - 31: "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED", - 32: "REQUEST_REJECT_REASON_DG_COMM_LOST", - 33: "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE", - 34: "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE", - 35: "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT", - 36: "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME", - 37: "REQUEST_REJECT_REASON_NO_NEW_TREATMENT_ALARM_TRIGGERED", - 38: "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED", - 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", - } - UNDEFINED_ALARM_ID_MSG = "ALARM_ID_UNDEFINED" ALARM_TITLE = "Alarm" @@ -422,6 +379,162 @@ GOODEVENING_START_TIME_SEC = 43200 BLOOD_PRIMING_TEXT = "Blood Priming" -SALINE_UNIT = "mL" +LIQUID_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" +SALINE_BOLUS_CUMULATIVE = 300 + +UF_MINIMUM_VALUE = 0 +UF_MAXIMUM_VALUE = 600 +PAUSED_TEXT = "Ultrafiltration Paused" +RESUME_TEXT = "RESUME ULTRAFILTRATION" +EDIT_TEXT = "EDIT ULTRAFILTRATION VOLUME" +TITLE_TEXT = "ULTRAFILTRATION VOLUME (L)" + + +# dictionary of rejection reason from application source code. +# message location -> denali-> Headers-> common-> MsgDefs.h +REJECTION_REASON = { + 0 : "No Active Alarm List" , # Used when there is no rejection + 1 : "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE" , # "REQuest is not allowed in the current operating mode + 2 : "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM" , # Validated "REQuest was not confirmed by user in reasonable time + 3 : "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE" , # "REQuest is not allowed if not in treatment mode + 4 : "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE" , # "REQuest is not allowed in current treatment state + 5 : "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED" , # "REQuest is not allowed so near end of treatment + 6 : "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE" , # Treatment duration is out of range + 7 : "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT" , # Treatment time change is less than currently elapsed treatment time + 8 : "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE" , # Blood flow is out of range + 9 : "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE" , # Dialysate flow is out of range + 10 : "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE" , # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit + 11 : "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE" , # Ultrafiltration volume is out of range + 12 : "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE" , # Ultrafiltration rate is out of range + 13 : "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM" , # Treatment time change is less than minimum treatment time + 14 : "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS" , # Ultrafiltration is not currently in progress + 15 : "REQUEST_REJECT_REASON_UF_NOT_PAUSED" , # Ultrafiltration is not currently paused + 16 : "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS" , # A saline bolus is in progress + 17 : "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE" , # A treatment parameter is out of range + 18 : "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION" , # The Heparin pre-stop setting is greater than the treatment duration + 19 : "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH" , # Arterial pressure low and high alarm limits are not inconsistent + 20 : "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH" , # Venous pressure low and high alarm limits are inconsistent + 21 : "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED" , # Saline bolus volume maximum has been reached - no more saline allowed + 22 : "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS" , # A saline bolus is not in progress + 23 : "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE" , # "REQuested user action is disabled in current state + 24 : "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE" , # "REQuested user action not allowed while alarm is active + 25 : "REQUEST_REJECT_REASON_INVALID_COMMAND" , # "REQuested user action invalid + 26 : "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED" , # The treatment has been completed + 27 : "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED" , # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed + 28 : "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET" , # Ultrafiltration volume is not set yet + 29 : "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM" , # The user has not confirmed patient connection + 30 : "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE" , # Heparin cannot be paused if not currently deliverying Heparin + 31 : "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED" , # Heparin cannot be resumed if not paused + 32 : "REQUEST_REJECT_REASON_DG_COMM_LOST" , # Treatment cannot initiate if DG comm is lost + 33 : "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE" , # Post-treatment reservoirs drain not complete + 34 : "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE" , # Treatment cannot initiate if DG is not in standby idle state + 35 : "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT" , # "REQuest message not formatted properly + 36 : "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME" , # Given date/time is invalid + 37 : "REQUEST_REJECT_REASON_NO_NEW_TREATMENT_ALARM_TRIGGERED" , # Treatment cannot initiate if an alarm with no new treatment property has triggered before + 38 : "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED" , # Battery does not have enough charge to start treatment + 39 : "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED" , # Cannot move on to recirculate without completing full rinseback +} + +NUM_OF_REQUEST_REJECT_REASONS = 39 + +#main treatment pressure +PRESSURE_TITLE = "PRESSURES" +ARTERIAL_TITLE = "Arterial" +VENOUS_TITLE = "Venous" +VENOUS_UOM = "mmHg" +ARTERIAL_UOM = "mmHg" +LOW_TEXT = "LOW" +HIGH_TEXT = "HIGH" +ACCEPTED = True +REJECTED = False + +#pressure +PRESSURE_STEPS = 10 +ARTERIAL_PRESSURE_MINIMUM = -400 +ARTERIAL_PRESSURE_MAXIMUM = +600 +ARTERIAL_PRESSURE_LOW_MIN = -300 +ARTERIAL_PRESSURE_LOW_DEF = -300 +ARTERIAL_PRESSURE_LOW_MAX = +200 +ARTERIAL_PRESSURE_HIGH_MIN = -300 +ARTERIAL_PRESSURE_HIGH_DEF = +100 +ARTERIAL_PRESSURE_HIGH_MAX = +200 + +VENOUS_PRESSURE_MINIMUM = -100 +VENOUS_PRESSURE_MAXIMUM = +700 +VENOUS_PRESSURE_LOW_MIN = -100 +VENOUS_PRESSURE_LOW_DEF = -100 +VENOUS_PRESSURE_LOW_MAX = +600 +VENOUS_PRESSURE_HIGH_MIN = +100 +VENOUS_PRESSURE_HIGH_DEF = +400 +VENOUS_PRESSURE_HIGH_MAX = +600 + +#main_treatment_flows +BLOOD_FLOW_MINIMUM_VALUE = 100 +BLOOD_FLOW_BUFFER = 25 +FLOW_SLIDER_WIDTH_BUFFER = 37 +BLOOD_FLOW_MAXIMUM_VALUE = 500 +DIALYSATE_FLOW_MINIMUM_VALUE = 0 +DIALYSATE_FLOW_MAXIMUM_VALUE = 0 # Seems to be bug. need change +FLOW_UNIT = "mL/min" +BLOOD_FLOW_TEXT = "blood" +DIALYSATE_FLOW_TEXT = "dialysate" + +#main treatment screen +VITALS_TITLE = "VITALS" +OUT_OF_RANGE_COLOR = "#c53b33" +IN_RANGE_COLOR = "#fcfcfc" +SYSTOLIC_LOWER_LIMIT = 60 +SYSTOLIC_UPPER_LIMIT = 250 +DIASTOLIC_LOWER_LIMIT = 40 +DIASTOLIC_UPPER_LIMIT = 200 +HEART_RATE_LOWER_LIMIT = 40 +HEART_RATE_UPPER_LIMIT = 180 +HEART_RATE_TITLE = "Heart Rate" +BLOOD_PRESSURE_TITLE = "Blood Pressure" +BLOOD_PRESSURE_UNIT = "mmHg" +HEART_RATE_UNIT = "BPM" +BLOOD_PRIMING_RANGE = 300 +BLOOD_PRIMING_TARGET_MAXIMUM = 300 + + +#tst_treatment_monitoring +FLOWS_TEXT = "FLOWS" +BLOOD_UNIT = "mL/min" +DIALYSATE_TEXT = "Dialysate" +BLOOD_TEXT = "Blood" +VITALS_TEXT = "VITALS" +BLOOD_PRESSURE_TEXT = "mmHg" +HEARTRATE_UNIT = "BPM" +PRESSURE_TEXT = "PRESSURE (mmHg)" +ARTEREAL_TEXT = "Arterial" +VENOUS_TEXT = "Venous" +TIME_DURATION_TEXT = "Time Remaining" +ULTRAFILTERATION_TEXT = "ULTRAFILTRATION VOLUME (L)" +SALINE_BOLUS = "SALINE BOLUS" +VOLUME_DELIVERED = "Volume Delivered" +CUMULATIVE_DELIVERED = "Cumulative Delivered" +HEPARIN_TEXT = "HEPARIN" +VOLUME_DELIVERED = "Volume Delivered" + +#patient id +CHARACTER_PATIENT_ID = ["qwerty","sampleid","abcdefghijklmnop","patientid", "username"] +ALPHANUMERIC_PATIENT_ID = ["sA@MpLE#123", "A@BH&321","5432@qwerty"] +KEYBOARD_SWITCH = ["ABC", "&123"] + + +#main-treatment heparin +HEPARIN_UNIT = "mL" +HEPARIN_DELIVERY_TEXT = "HEPARIN DELIVERY" +HEPARIN_DELIVERY_OFF_TEXT = "Heparin Delivery Off" +HEPARIN_STOP_TEXT = "Heparin Delivery Stopped" +HEPARIN_RESUME_DELIVERY_TEXT = "RESUME DELIVERY" +HEPARIN_BOLUS_ACTIVE_TEXT = "Heparin Bolus Active" +HEPARIN_PAUSE_DELIVERY_TEXT = "PAUSE DELIVERY" +HEPARIN_MAXIMUM_VOLUME_DELIVERED_TEXT = "Maximum Cumulative Heparin Volume Delivered" +HEPARIN_SYRINGE_EMPTY_TEXT = "Heparin Syringe Empty" + +#Time_Duration +PAUSED_TEXT = "Treatment Paused" + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r124b6d7ceaa73600e99e51c59ee1098564736db0 -racea999b214b759fa0749e8b026a5c4a5ebc931d --- shared/scripts/configuration/utility.py (.../utility.py) (revision 124b6d7ceaa73600e99e51c59ee1098564736db0) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision acea999b214b759fa0749e8b026a5c4a5ebc931d) @@ -16,7 +16,6 @@ import names -import sys import squish import test @@ -29,44 +28,6 @@ from builtins import str as pyStr from builtins import float as pyFloat - -def start_application(app_name): - """ - Function to start application and verify application status [running] - If application does not start or running status is false, test stops - Argument: - @param app_name : (str) - Name of the application - @param app_executable : (str) - Actual application - @return: handle for the application if the application is in running state, - or error (exist the application) - """ - counter = 0 - while True: - try: - counter += 1 - test.log("Starting {}".format(app_name)) - squish.startApplication(app_name) - if counter == 1: - test.log("Application launched at the "+str(counter)+" st try.") - elif counter == 2: - test.log("Application launched at the "+str(counter)+" nd try.") - elif counter == 3: - test.log("Application launched at the "+str(counter)+" rd try.") - else: - test.log("Application launched at the "+str(counter)+" th try.") - break - except RuntimeError: - if counter == 1: - test.log("Application failed to launch after "+str(counter)+" try - Please refer logs") - elif counter == 20: - test.log("Exiting after "+str(counter)+ " tries..") - sys.exit(1) - else: - test.log("Application failed to launch after "+str(counter)+ " tries - Please refer logs") - except: - logErrorDetails("Failed to start the application") - sys.exit(1) - def check_if_object_is_within_the_container(obj=None, container=None): """ @@ -76,12 +37,12 @@ @return boolean true and false """ container = squish.findObject(container) - containerPos = container.mapToGlobal(QPoint(0, 0)) + containerPos = container.mapToGlobal(squish.QPoint(0, 0)) container_x, container_y = pyInt(containerPos.x), pyInt(containerPos.y) container_width, container_height = pyInt(container.width), pyInt(container.height) obj = squish.findObject(obj) - objPos = obj.mapToGlobal(QPoint(0, 0)) + objPos = obj.mapToGlobal(squish.QPoint(0, 0)) obj_x, obj_y = pyInt(objPos.x), pyInt(objPos.y) obj_width, obj_height = pyInt(obj.width), pyInt(obj.height) @@ -115,8 +76,7 @@ squish.mouseWheel(ScreenObj, screenWidth-1000, screenHeight-10, 0, -50, Qt.NoModifier) - raise LookupError("zone object is not in view to the user after " + \ - "trying 100 times") + raise LookupError("zone object is not in view to the user after trying 100 times") def pressure_pop_up_text_obj(text): Index: tst_ui_alarms_list/test.py =================================================================== diff -u -rb3070943b619120d7b14fb33b98ce03e831621ca -racea999b214b759fa0749e8b026a5c4a5ebc931d --- tst_ui_alarms_list/test.py (.../test.py) (revision b3070943b619120d7b14fb33b98ce03e831621ca) +++ tst_ui_alarms_list/test.py (.../test.py) (revision acea999b214b759fa0749e8b026a5c4a5ebc931d) @@ -175,8 +175,7 @@ expected_message = REJECTION_REASON[0] + "\n" + REJECTION_REASON[reason_id] rejected_alarm_list_msg = waitForObject(names.o_rejected_alarm_list_msg) rejected_alarm_list_msg = rejected_alarm_list_msg.text - test.compare(rejected_alarm_list_msg, expected_message, - "When 'Alarm list' is not accepted then '{}' should be displayed on 'Alarm List' pop up".format(expected_message)) + test.compare(rejected_alarm_list_msg, expected_message, "When 'Alarm list' is not accepted then '{}' should be displayed on 'Alarm List' pop up".format(expected_message)) test.endSection()