# -*- coding: utf-8 -*- ########################################################################### # # Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. # # 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 test.py # # @author (last) Peter Lucia # @date (last) 22-Feb-2021 # @author (original) Behrouz NematiPour # @date (original) 09-Apr-2020 # ############################################################################ import names from dialin.ui import utils from dialin import HDSimulator hd_sim = HDSimulator() def gotoScreenNtest_Contains_FlowsSection(): mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) test.compare(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).visible, True) def gotoScreenNTest_Adjustment(): mouseClick(waitForObject(names.o_treatmentStart_flowsTouchArea_TreatmentFlows)) test.compare(waitForObjectExists(names.o_modalDialog).visible, True) def main(): utils.tstStart(__file__) startApplication(names.AUT_NAME + " -q") utils.waitForGUI(1) gotoScreenNtest_Contains_FlowsSection() utils.waitForGUI(1) hd_sim.cmd_set_treatment_blood_flow_rate(175, 0, 0, 0, 0, 0, 0) hd_sim.cmd_set_treatment_dialysate_flow_rate(250, 1, 1, 1, 1, 1, 1) gotoScreenNTest_Adjustment() utils.waitForGUI(1) hd_sim.cmd_set_treatment_parameter_ranges(0, 0, 0, 0, 150, 550) hd_sim.cmd_send_acknowledge_ui() mouseClick(waitForObject(names.o_bloodFlowSlider_Slider), 190, 4, Qt.LeftButton) mouseClick(waitForObject(names.o_dialysateFlowSlider_Slider), 79, 5, Qt.LeftButton) test.compare(waitForObjectExists(names.o_bloodFlowSlider_Slider).value, 225) test.compare(waitForObjectExists(names.o_dialysateFlowSlider_Slider).value, 200) # sendTreatmentAdjustBloodDialysateRequest mouseClick(waitForObject(names.o_confirmButton)) hd_sim.wait_for_message_to_be_sent() utils.waitForGUI(7) # wait for ack timeout 5 is the timeout added +2 Sec for safe range. # sendTreatmentAdjustBloodDialysateRequest again mouseClick(waitForObject(names.o_confirmButton)) hd_sim.wait_for_message_to_be_sent() hd_sim.cmd_send_acknowledge_hd() hd_sim.cmd_send_treatment_adjust_blood_dialysate_response(0, 3, 125, 150) # coverage hd_sim.cmd_send_treatment_adjust_blood_dialysate_response(0, 3, 125, 150) # coverage hd_sim.cmd_send_treatment_adjust_blood_dialysate_response(0, 3, 175, 250) utils.waitForGUI(2) mouseClick(waitForObject(names.o_bloodFlowSlider_Slider), 190, 4, Qt.LeftButton) mouseClick(waitForObject(names.o_dialysateFlowSlider_Slider), 79, 5, Qt.LeftButton) test.compare(waitForObjectExists(names.o_bloodFlowSlider_Slider).value, 225) test.compare(waitForObjectExists(names.o_dialysateFlowSlider_Slider).value, 200) hd_sim.cmd_send_treatment_adjust_blood_dialysate_response(1, 0, waitForObjectExists(names.o_bloodFlowSlider_Slider).value, waitForObjectExists(names.o_dialysateFlowSlider_Slider).value ) hd_sim.cmd_set_treatment_blood_flow_rate(225, 1, 1, 1, 1, 1, 1) hd_sim.cmd_set_treatment_dialysate_flow_rate(200, 0, 0, 0, 0, 0, 0) test.compare(str(waitForObjectExists(names.o_treatmentStart_225_Text).text), "225") test.compare(str(waitForObjectExists(names.o_treatmentStart_200_Text).text), "200") utils.tstDone()