Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r5242b0f3bde261dff5670b39bdb263f084d237b6 -rfd006d367dc5690c1cf4452d748f761c454e4293 --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 5242b0f3bde261dff5670b39bdb263f084d237b6) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision fd006d367dc5690c1cf4452d748f761c454e4293) @@ -221,5 +221,9 @@ RINSEBACK_PAUSED = "Rinseback Paused" BLOOD_RETURN_COUNTDOWN_DESCRIPTION_TEXT = "Blood return will NOT be allowed in:" BLOOD_RETURN_COMPLETE = "Blood Return Complete!" +PRESSURE_TREATMENT_PARAMETERS = ["Arterial Pressure", "Venous High Pressure", "Venous Low Pressure","TMP Pressure"] +COLOR_CODES = "#ffa500" +PRESCRIPTION_SETTINGS_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate" ,"Dialysate Temperature"] +RED_COLOR = "#c53b33" +WHITE_COLOR = "#fefefe" - Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -r8bfb02b2b8e50dccd822549c11d340df033744c7 -rfd006d367dc5690c1cf4452d748f761c454e4293 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 8bfb02b2b8e50dccd822549c11d340df033744c7) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision fd006d367dc5690c1cf4452d748f761c454e4293) @@ -170,7 +170,7 @@ test.log(f"Updated value: {current_value}") - test.log(f"✅ Target value reached: {current_value}") + test.log(f" Target value reached: {current_value}") def select_different_dropdown(object,type,whichTypeIndex): @@ -306,48 +306,75 @@ def verify_create_treatment_parameters(): test.startSection("Pre treatment parameters") navigation.navigation_pageIndicator_step(config.CREATERX) - squish.mouseClick(squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry)) - squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="abcd" - set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 60) - set_value_based_on_target(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster, 75) - set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 75) - heparinValue =navigation.get_ini_value("/home/denali/Public/luis/config/configurations/Settings/System.conf", section ="Feature Configurations", key ="HeparinSyringePump") - if heparinValue == "1": - set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, 0.4) - set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.5) - set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 60) + patient_id = squish.waitForObject(names.o_PreTreatmentCreate_patientID_LabelUnitContainer) + patient_id_edit = findObjectById(patient_id, "_editButton") + squish.mouseClick(patient_id_edit) + squish.mouseClick(squish.waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry)) + squish.waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry).text ="abcd" + squish.mouseClick(squish.waitForObject(names.o_secondaryPatientID_LabelUnitContainer)) + squish.waitForObject(names.o_secondaryPatientID_LabelUnitContainer).text ="Test1" + squish.type(names.o_pretreatmentPatientIDEntry_TextEntry, "") + squish.mouseClick(squish.waitForObject(names.o_confirmButton_ConfirmButton)) + parent_obj = squish.waitForObject(names.o_PreTreatmentCreate_leftColumn_Column) + blood_flow_rate = findObjectById(parent_obj, "_bloodFlowRate") + set_value_based_on_target(blood_flow_rate, 50) + dialysate_flow_rate = findObjectById(parent_obj, "_dialysateFlowRate") + set_value_based_on_target(dialysate_flow_rate, 60) + duration = findObjectById(parent_obj,"_duration") + set_value_based_on_target(duration, 75) + right_obj = squish.waitForObject(names.o_PreTreatmentCreate_rightColumn_Column) + ultrafiltration_volume = findObjectById(right_obj,"_ufVolume") + set_value_based_on_target(ultrafiltration_volume,0.30) + heparin_rx = findObjectById(right_obj,"_heparinRx") + heparin_right_arrow = findObjectById(heparin_rx, "_rightArrow") + squish.mouseClick(heparin_right_arrow) + heparin_obj = squish.waitForObject(names.o_LabelUnitValueAdjuster_LabelUnitValueAdjuster) + heparin_bolus = findObjectById(heparin_obj,"_heparinBolusVolume") + set_value_based_on_target(heparin_bolus, 0.2) + set_value_based_on_target(names.o_heparinDispensingRate_LabelUnitValueAdjuster,0.3) + set_value_based_on_target(names.o_heparinDeliveryDuration_LabelUnitValueAdjuster, 60) + squish.mouseClick(squish.waitForObject(names.o_confirmButton_ConfirmButton)) select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,config.ACID_CONCENTRATE,2) select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,config.DIALYZER_TYPE,2) - set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, 200) - set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom,5.0) select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,config.BICARBONATE,0) - Validatebutton = setObjectText(obj = names.o_preTreatmentStack_Text, text =config.VALIDATE) - squish.mouseClick(squish.waitForObject(Validatebutton)) - td.td_Treatment_Parameters_Validation( vAccepted = 1, - vBloodFlowRateRejectReason = 0, - vDialysateFlowRateRejectReason = 0, - vTreatmentDurationRejectReason = 0, - vSalineBolusVolumeRejectReason = 0, - vHeparinStopTimeRejectReason = 0, - vHeparinTypeRejectReason = 0, - vAcidConcentrateRejectReason = 0, - vBicarbonateConcentrateRejectReason = 0, - vDialyzerTypeRejectReason = 0, - vBloodPressureMeasureIntervalRejectReason = 0, - vRinsebackFlowRateRejectReason = 0, - vRinsebackVolumeRejectReason = 0, - vArterialPressureLimitWindowRejectReason = 0, - vVenousPressureLimitWindowRejectReason = 0, - vVenousPressureLimitAsymtrcRejectReason = 0, - vTransmembranePressureLimitWindowRejectReason = 0, - vDialysateTempRejectReason = 0, - vHeparinDispensingRateRejectReason = 0, - vHeparinBolusVolumeRejectReason = 0 - ) - confirm = squish.waitForObjectExists(names.o_preTreatmentStack_confirmButton_ConfirmButton, 3000) - squish.mouseClick(confirm) + Nextbutton = setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(squish.waitForObject(Nextbutton)) + set_value_based_on_target(names.o_PreTreatmentCreate_sodium_LabelUnitValueAdjuster, 139) + set_value_based_on_target(names.o_PreTreatmentCreate_bicarbonate_LabelUnitValueAdjuster, 35) + set_value_based_on_target(names.o_PreTreatmentCreate_fluidBolusVolume_LabelUnitValueAdjuster,300) + set_value_based_on_target(names.o_PreTreatmentCreate_primeRinsebackVolume_LabelUnitValueAdjuster,310) + set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom,0) + confirm_button = squish.waitForObjectExists(names.o_preTreatmentStack_confirmButton_ConfirmButton) + squish.mouseClick(confirm_button) + td.td_Treatment_Parameters_Validation( vAccepted = 1, + vTreatmentModalityRejectReason = 1, + vHDFTreatmentModeRejectReason = 0, + vBloodFlowRateRejectReason = 0, + vDialysateFlowRateRejectReason = 0, + vTreatmentDurationRejectReason = 0, + vHeparinDeliveryDurationRejectReason = 0, + vHeparinTypeRejectReason = 0, + vDryBicarbCartSizeRejectReason = 0, + vSodiumRejectReason = 0, + vBicarbonateRejectReason = 0, + vDialyzerTypeRejectReason = 0, + vFluidBolusVolumeRejectReason = 0, + vBloodPressureMeasureIntervalRejecteason = 0, + vRinsebackVolumeRejectReason = 0, + vHepatitusBStatusRejectReason = 0, + vAcidConcentrateIndextRejectReason = 0, + vSubstitutionFluidVolumeRejecteason = 0, + vHeparinBolusVolumeRejectReason = 0, + vHeparinDispensingRateRejecteason = 0, + vDialysateTempRejectReason = 0, + vAcidConcentrateConversionFactorRejectReason = 0, + vUFPreWeightRejectReason = 0, + vUFEstimatedTargetWeightRejectReason = 0, + vUFVolumeRejectReason = 0 + ) test.endSection() + def findAllObjectsById(parent, target_id): """ Recursively finds all child objects by their id property. Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r5242b0f3bde261dff5670b39bdb263f084d237b6 -rfd006d367dc5690c1cf4452d748f761c454e4293 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 5242b0f3bde261dff5670b39bdb263f084d237b6) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision fd006d367dc5690c1cf4452d748f761c454e4293) @@ -407,7 +407,8 @@ #patient vitals o_treatmentVitals = {"container": mainTreatmentScreen, "objectName": "treatmentVitals", "type": "TreatmentVitals" } -o_treatmentHome_editButton_IconButton = {"container": o_treatmentVitals, "id": "_editButton", "type": "IconButton", "unnamed": 1 } +# o_treatmentHome_editButton_IconButton = {"container": o_treatmentVitals, "id": "_editButton", "type": "IconButton", "unnamed": 1 } +o_treatmentHome_editButton_IconButton = {"container": mainTreatmentScreen, "id": "_editButton", "type": "IconButton", "unnamed": 1 } o_vitalsButton_VitalsButton = {"container": o_Gui_MainView, "id": "_vitalsButton", "type": "VitalsButton", "unnamed": 1 } o_bloodPressureSystolic_TextEntry = {"container": o_Overlay, "id": "_bloodPressureSystolic", "type": "TextEntry", "unnamed": 1 } o_bloodPressureDiastolic_TextEntry = {"container": o_Overlay, "id": "_bloodPressureDiastolic", "type": "TextEntry", "unnamed": 1 } @@ -462,6 +463,9 @@ o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox= {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bicarbonateConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1 } o_PreTreatmentCreate_treatmentModalityComboBox_BaseComboBox = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_treatmentModalityComboBox", "type": "BaseComboBox", "unnamed": 1 } o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementIntervalControl", "type": "ValueAdjusterCustom", "unnamed": 1} +o_secondaryPatientID_LabelUnitContainer = {"container": o_Overlay, "id": "_secondaryPatientID", "type": "LabelUnitContainer", "unnamed": 1 } +o_patientID_LabelUnitContainer = {"container": o_Overlay, "id": "_patientID", "type": "LabelUnitContainer", "unnamed": 1 } +o_PreTreatmentCreate_patientID_LabelUnitContainer = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_patientID", "type": "LabelUnitContainer", "unnamed": 1 } # Edit Treatment Parameters o_treatmentHome_treatmentPressures_TreatmentPressures = {"container": mainTreatmentScreen, "objectName": "treatmentPressures", "type": "TreatmentPressures" } @@ -477,7 +481,10 @@ o_newTreatmentDuration_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_newTreatmentDuration", "type": "LabelUnitValueAdjuster" } o_ufRate_LabelUnitText = {"container": o_Overlay, "objectName": "_ufRate", "type": "LabelUnitText" } o_newTreatmentDuration_LabelUnitText = {"container": o_Overlay, "objectName": "_newTreatmentDuration", "type": "LabelUnitText" } - +o_arterialWindow_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_arterialWindow", "type": "LabelUnitValueAdjuster" } +o_venousWindow_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_venousWindow", "type": "LabelUnitValueAdjuster" } +o_venousAsymmetricWindow_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_venousAsymmetricWindow", "type": "LabelUnitValueAdjuster" } +o_tmpWindow_LabelUnitValueAdjuster = {"container": o_Overlay, "objectName": "_tmpWindow", "type": "LabelUnitValueAdjuster" } #Rinseback o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentRinsebackStack", "type": "EndTreatmentRinsebackStack", } o_EndTreatmentRinsebackStack_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinseback", "type": "EndTreatmentRinseback", } Index: suite_leahi/tst_edit_parameters/test.py =================================================================== diff -u -re79975dc325f90441f70e114390d1adf4e7d58f9 -rfd006d367dc5690c1cf4452d748f761c454e4293 --- suite_leahi/tst_edit_parameters/test.py (.../test.py) (revision e79975dc325f90441f70e114390d1adf4e7d58f9) +++ suite_leahi/tst_edit_parameters/test.py (.../test.py) (revision fd006d367dc5690c1cf4452d748f761c454e4293) @@ -43,15 +43,16 @@ import squish import can from leahi_dialin.ui import utils -from configuration import utility,config,navigation -from configuration import config +from configuration import utility,config,navigation,application_init from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.ui_defs import TXStates from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.utils import conversions from leahi_dialin.protocols import CAN +from configuration.getrejectiontext import ScopedRejectionRepository + td = TD_Messaging() can_interface = td.can_interface ArterialWindow = None @@ -68,17 +69,20 @@ durationvalue = 0 durationconfirm = None -PRESSURE_TREATEMENT_OBJ = [names.o_arterialWindow_LabelUnitValueAdjuster, +PRESSURE_TREATEMENT_OBJ = [names.o_arterialWindow_LabelUnitValueAdjuster, names.o_venousWindow_LabelUnitValueAdjuster, names.o_venousAsymmetricWindow_LabelUnitValueAdjuster, names.o_tmpWindow_LabelUnitValueAdjuster] -PRESCRIPTION_SETTINGS_OBJ =[names.o_bloodFlowRate_LabelUnitValueAdjuster, +PRESCRIPTION_SETTINGS_OBJ =[names.o_bloodFlowRate_LabelUnitValueAdjuster, names.o_dialysateFlowRate_LabelUnitValueAdjuster, names.o_dialysateTemperature_LabelUnitValueAdjuster] +conf_path = application_init.configuration_folder_path() + "Alarms/Rejections.conf" +repo = ScopedRejectionRepository(path=conf_path) + def handle_saline_request( message, timestamp = 0.0): """ Called when the user requests to firmware from UI @@ -219,15 +223,15 @@ tmpwindow_value = waitForObject(names.o_tmpWindow_LabelUnitValueAdjuster) tmp_value =tmpwindow_value.value test.log(str(tmp_value)) - utility.set_value_based_on_target(names.o_arterialWindow_LabelUnitValueAdjuster,200) + utility.set_value_based_on_target(names.o_arterialWindow_LabelUnitValueAdjuster,70) arterialwindow_value = waitForObject(names.o_arterialWindow_LabelUnitValueAdjuster) change_arterialwindow_value =arterialwindow_value.value test.log(str(change_arterialwindow_value)) - utility.set_value_based_on_target(names.o_venousWindow_LabelUnitValueAdjuster,140) + utility.set_value_based_on_target(names.o_venousWindow_LabelUnitValueAdjuster,80) venouswindow_value = waitForObject(names.o_venousWindow_LabelUnitValueAdjuster) change_venouswindow_value =venouswindow_value.value test.log(str(change_venouswindow_value)) - utility.set_value_based_on_target(names.o_tmpWindow_LabelUnitValueAdjuster,100) + utility.set_value_based_on_target(names.o_tmpWindow_LabelUnitValueAdjuster,50) tmpwindow_value = waitForObject(names.o_tmpWindow_LabelUnitValueAdjuster) change_tmpwindow_value =tmpwindow_value.value test.log(str(change_tmpwindow_value)) @@ -266,11 +270,10 @@ def check_saline_edit_maintreatment(): test.startSection("Saline data") td.td_saline( - 100 , # target_volume - 150 , # cumulative_volume - 75 , # bolus_volume - 0 - ) + 100, # target_volume + 150, # cumulative_volume + 75 , # bolus_volume + 0 ) mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) fluidbolusvolume_value = waitForObject(names.o_valueAdjuster_ValueAdjuster) @@ -281,15 +284,16 @@ #saline rejection reason is 1 payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) - td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE.value, - reason=0, - accepted=1, + td.cmd_send_general_response(message_id = MsgIds.MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE.value, + reason = 1, + accepted = 0, is_pure_data = False, has_parameters = True, parameters_payload= payload) rejectionReason = waitForObject(names.o_notificationBar_NotificationBarSmall).text - test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + test.compare(rejectionReason, "[1] "+REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason)) #rejection reason 0 mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1) @@ -441,7 +445,7 @@ message_id, handle_dialflow_request) - test.verify(waitFor( lambda: dialflow == changeddialflow+5, 3000), "Testing FW received dial flow Value in main treatment screen") + test.verify(waitFor( lambda: dialflow == changeddialflow+10, 3000), "Testing FW received dial flow Value in main treatment screen") dialysateflowdownarrowbutton = utility.findObjectById(dialysateflowuparrow,"_downArrowIcon") mouseClick(dialysateflowdownarrowbutton) @@ -454,7 +458,7 @@ message_id, handle_dialflow_request) - test.verify(waitFor( lambda: dialflow == changeddialflow-20, 3000), "Testing FW received dial flow Value in main treatment screen") + test.verify(waitFor( lambda: dialflow == changeddialflow-10, 3000), "Testing FW received dial flow Value in main treatment screen") dialysatetmpuparrow = waitForObject(names.o_dial_tmp_value) @@ -484,7 +488,6 @@ test.verify(waitFor( lambda: dialtemperature == changeddialtmp-0.5, 3000), "Testing FW received dial tmp Value in main treatment screen") - #rejection reason is 1 payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) @@ -495,9 +498,10 @@ has_parameters = True, parameters_payload= payload) - rejectionReason = utility.get_object_from_names(names.o_treatmentHome_notification_NotificationBarSmall) - test.compare(rejectionReason.text, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + rejectionReason = waitForObjectExists(names.o_treatmentHome_notification_NotificationBarSmall) + test.compare(rejectionReason.text,"[1] "+ REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason.text)) #rejection reason is 0 payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) @@ -589,7 +593,8 @@ vUFRate= 0.0) rejectionReason = waitForObject(names.o_notificationBar_NotificationBarSmall).text - test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + test.compare(rejectionReason,"[1] "+REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason)) td.td_duration_validate_response(vRejectionReason =0, vDuration= 78, vHeparinDuration = 0, @@ -611,7 +616,8 @@ parameters_payload= payload) rejectionReason = waitForObject(names.o_notificationBar_NotificationBarSmall).text - test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) + REJECT_TEXT = repo.get("1", "Title") + test.compare(rejectionReason,"[1] "+REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason)) #rejection reason is 0 mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1) @@ -647,11 +653,4 @@ check_saline_edit_maintreatment() check_treatement_edit_maintreatment() check_duration_edit_maintreatment() - utils.tstDone() - - - - - - - \ No newline at end of file + utils.tstDone() \ No newline at end of file