Index: config.xml =================================================================== diff -u -r9002496389b9df6383fc0fcc47fa6754ca7e14a6 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- config.xml (.../config.xml) (revision 9002496389b9df6383fc0fcc47fa6754ca7e14a6) +++ config.xml (.../config.xml) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -3,5 +3,7 @@ - + +200 + Index: shared/scripts/denaliMessages.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- shared/scripts/denaliMessages.py (.../denaliMessages.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ shared/scripts/denaliMessages.py (.../denaliMessages.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -35,10 +35,13 @@ PressureOcclusion = 9 - AdjustBloodDialysateReq = 23 # 23 - AdjustBloodDialysateRsp = 24 # 24 + AdjustBloodDialysateReq = 23 + AdjustBloodDialysateRsp = 24 + + AdjustDurationReq = 22 + AdjustDurationRsp = 27 - TreatmentRanges = 26 # 26 + TreatmentRanges = 26 String = 65279 @@ -151,6 +154,24 @@ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +def buildTreatmentAdjustDurationResponse(vAccepted, vReason, vDuration, vUltrafiltration): + msg = messageBuilder.buildMessage( GuiActionType.AdjustDurationRsp, 4 * 4, True, + utils.toI32(vAccepted), + utils.toI32(vReason), + utils.toI32(vDuration), + utils.toF32(vUltrafiltration) + ) + return messageBuilder.toFrames(msg) +## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +def sendTreatmentAdjustDurationResponse (vAccepted, vReason, vDuration, vUltrafiltration): + frames = buildTreatmentAdjustDurationResponse(vAccepted, vReason, vDuration, vUltrafiltration) + frames = messageBuilder.toCandumpFormat(frames) + for frame in frames: + subprocess.call(['cansend', 'can0', '020#{}'.format(frame)]) + waitForMessageToBeSent() + +## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def buildTreatmentTime(vSecsTotal, vSecsElap, vSecsRem): msg = messageBuilder.buildMessage( GuiActionType.TreatmentTime, 3 * 4, False, utils.toI32(vSecsTotal ), @@ -159,7 +180,9 @@ ) return messageBuilder.toFrames(msg) ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -def setTreatmentTime (vSecsTotal, vSecsElap, vSecsRem): +def setTreatmentTime (vSecsTotal, vSecsElap, vSecsRem = None): + if vSecsRem == None: + vSecsRem = vSecsTotal - vSecsElap frames = buildTreatmentTime(vSecsTotal, vSecsElap, vSecsRem) frames = messageBuilder.toCandumpFormat(frames) for frame in frames: Index: shared/scripts/utils.py =================================================================== diff -u -r29c5291e48510492127655aa753ba496c94e9ae2 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- shared/scripts/utils.py (.../utils.py) (revision 29c5291e48510492127655aa753ba496c94e9ae2) +++ shared/scripts/utils.py (.../utils.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -14,6 +14,8 @@ import time import struct +import inspect +from pathlib import PurePath ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def waitForGUI(vDelay = 2): @@ -50,4 +52,9 @@ lPad = int(lStr / vLen) * vLen + ( vLen * (1 if lStr % vLen else 0) ) return vString.ljust(lPad, "0") +## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +def tstStart(): + print(time.strftime("%H:%M:%S Start", time.localtime()), PurePath(inspect.stack()[1][1]).parts[-2]) +def tstDone(): + print(time.strftime("%H:%M:%S Done ", time.localtime()), PurePath(inspect.stack()[1][1]).parts[-2]) Index: suite.conf =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- suite.conf (.../suite.conf) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ suite.conf (.../suite.conf) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -1,10 +1,10 @@ -AUT=denaliSquish +AUT=denaliSquish -0 -u CWD= ENVVARS=envvars HOOK_SUB_PROCESSES=false IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_Internals tst_HomeScreen tst_ServiceShutdown tst_TreatmentScreen tst_Treatment_Section_BloodDialysate tst_Treatment_BloodFlowRate tst_Treatment_DialysateFlowRate tst_Treatment_Time tst_Treatment_Ultrafiltration tst_Treatment_PressureOcclusion tst_Treatment_ParametersRange tst_Treatment_Adjustment_BloodDialysate tst_Alarm +TEST_CASES=tst_Internals tst_HomeScreen tst_ServiceShutdown tst_TreatmentScreen tst_Treatment_Section_BloodDialysate tst_Treatment_BloodFlowRate tst_Treatment_DialysateFlowRate tst_Treatment_Time tst_Treatment_Ultrafiltration tst_Treatment_PressureOcclusion tst_Treatment_ParametersRange tst_Treatment_Adjustment_BloodDialysate tst_Treatment_Adjustment_Duration tst_Alarm VERSION=3 WRAPPERS=Qt Index: tst_Alarm/test.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Alarm/test.py (.../test.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ tst_Alarm/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -17,6 +17,8 @@ import denaliMessages def main(): + utils.tstStart() + startApplication("denaliSquish") denaliMessages.sendAlarm(3, 26, 2, 0, 0) @@ -65,4 +67,4 @@ denaliMessages.sendUnknown_HD() denaliMessages.sendUnknown_DG() - + utils.tstDone() Index: tst_HomeScreen/test.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_HomeScreen/test.py (.../test.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ tst_HomeScreen/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -16,6 +16,8 @@ import utils def main(): + utils.tstStart() + startApplication("denaliSquish") test.compare( waitForObjectExists(names.o_treatmentHome).visible, True) @@ -40,3 +42,5 @@ utils.waitForGUI() test.compare(waitForObjectExists(names.o_treatmentHome).visible, True , "SRSUI 535") + utils.tstDone() + Index: tst_Internals/test.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Internals/test.py (.../test.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ tst_Internals/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -13,7 +13,12 @@ # import unittests +import utils def main(): + utils.tstStart() + unittests.testPythonVersion() unittests.testcrc8() + + utils.tstDone() \ No newline at end of file Index: tst_ServiceShutdown/test.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_ServiceShutdown/test.py (.../test.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ tst_ServiceShutdown/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -79,6 +79,9 @@ utils.waitForGUI (1) # Wait for the animation def main(): + utils.tstStart() + + # Start the Application startApplication("denaliSquish") @@ -117,3 +120,4 @@ # 534 : The "Treatment" button shall be selected by default on the Home Screen. gotoScreenNtest_Contains_TreatmentHome(534) + utils.tstDone() \ No newline at end of file Index: tst_TreatmentScreen/test.py =================================================================== diff -u -rd95e4751c8ebf874c55869608a25492e8e5aa444 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_TreatmentScreen/test.py (.../test.py) (revision d95e4751c8ebf874c55869608a25492e8e5aa444) +++ tst_TreatmentScreen/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -13,8 +13,11 @@ # import names +import utils def main(): + utils.tstStart() + startApplication("denaliSquish") mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) @@ -29,3 +32,6 @@ test.compare(waitForObjectExists(names.o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).visible, True) test.compare(waitForObjectExists(names.o_treatmentStart_SalineTouchArea_TreatmentFluid).visible, True) test.compare(waitForObjectExists(names.o_treatmentStart_heparinTouchArea_TreatmentFluid).visible, True) + + utils.tstDone() + \ No newline at end of file Index: tst_Treatment_Adjustment_BloodDialysate/test.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Treatment_Adjustment_BloodDialysate/test.py (.../test.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ tst_Treatment_Adjustment_BloodDialysate/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -20,20 +20,22 @@ mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) test.compare(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).visible, True) -def gotoScreenNTest_Contains_Ranges(): +def gotoScreenNTest_Adjustment(): mouseClick(waitForObject(names.o_treatmentStart_flowsTouchArea_TreatmentFlows)) test.compare(waitForObjectExists(names.o_modalDialog).visible, True) def main(): - startApplication("denaliSquish") + utils.tstStart() + startApplication("denaliSquish") # + gotoScreenNtest_Contains_FlowsSection() utils.waitForGUI(1) denaliMessages.setTreatmentBloodFlowRate(175, 0, 0, 0, 0, 0, 0) denaliMessages.setTreatmentDialysateFlowRate(250, 1, 1, 1, 1, 1, 1) - gotoScreenNTest_Contains_Ranges() + gotoScreenNTest_Adjustment() utils.waitForGUI(1) denaliMessages.setTreatmentParamRanges(0, 0, 0, 0, 150, 550) @@ -75,3 +77,6 @@ test.compare(str(waitForObjectExists(names.o_treatmentStart_225_Text).text), "225") test.compare(str(waitForObjectExists(names.o_treatmentStart_200_Text).text), "200") + + utils.tstDone() + \ No newline at end of file Index: tst_Treatment_BloodFlowRate/test.py =================================================================== diff -u -r929c42f19c662c57ae264d200658fb1690353008 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Treatment_BloodFlowRate/test.py (.../test.py) (revision 929c42f19c662c57ae264d200658fb1690353008) +++ tst_Treatment_BloodFlowRate/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -21,6 +21,8 @@ test.compare(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).visible, True) def main(): + utils.tstStart() + startApplication("denaliSquish") gotoScreenNtest_Contains_FlowsSection() @@ -36,3 +38,4 @@ denaliMessages.setTreatmentBloodFlowRate(175, 1, 1, 1, 1, 1, 1) test.compare(str(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).bloodFlowSetPoint), "175") + utils.tstDone() \ No newline at end of file Index: tst_Treatment_DialysateFlowRate/test.py =================================================================== diff -u -rc1b9d926e38745dcd9fb3e0503176b1c85182294 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Treatment_DialysateFlowRate/test.py (.../test.py) (revision c1b9d926e38745dcd9fb3e0503176b1c85182294) +++ tst_Treatment_DialysateFlowRate/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -21,6 +21,8 @@ test.compare(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).visible, True) def main(): + utils.tstStart() + startApplication("denaliSquish") gotoScreenNtest_Contains_FlowsSection() @@ -46,3 +48,4 @@ denaliMessages.setTreatmentDialysateFlowRate(155, 1.55, 1.55, 1.55, 1.55, 1.55, 1.55) test.compare(str(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).dialysateFlowSetPoint), "155") + utils.tstDone() \ No newline at end of file Index: tst_Treatment_ParametersRange/test.py =================================================================== diff -u -r99810cece725cd3b1070c61756563b90b6d36650 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Treatment_ParametersRange/test.py (.../test.py) (revision 99810cece725cd3b1070c61756563b90b6d36650) +++ tst_Treatment_ParametersRange/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -31,6 +31,8 @@ test.compare(str(waitForObjectExists(names.o_dialysateFlowSlider_Slider).maxText.text), "{}mL/min".format(vMax)) def main(): + utils.tstStart() + startApplication("denaliSquish") gotoScreenNtest_Contains_FlowsSection() @@ -55,3 +57,4 @@ denaliMessages.send_acknowledge_UI() test_Dialysate_Ranges(minDF, maxDF) + utils.tstDone() \ No newline at end of file Index: tst_Treatment_PressureOcclusion/test.py =================================================================== diff -u -r99810cece725cd3b1070c61756563b90b6d36650 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Treatment_PressureOcclusion/test.py (.../test.py) (revision 99810cece725cd3b1070c61756563b90b6d36650) +++ tst_Treatment_PressureOcclusion/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -21,6 +21,8 @@ test.compare(waitForObjectExists(names.o_treatmentStart_pressureTouchArea_TreatmentPressure).visible, True) def main(): + utils.tstStart() + startApplication("denaliSquish") gotoScreenNtest_Contains_PressureOcclusion() @@ -44,3 +46,5 @@ test.compare(waitForObjectExists(names.o_treatmentStart_pressureTouchArea_TreatmentPressure).arterilPressure, 0) test.compare(waitForObjectExists(names.o_treatmentStart_pressureTouchArea_TreatmentPressure).venusPressure, 0) + utils.tstDone() + \ No newline at end of file Index: tst_Treatment_Section_BloodDialysate/test.py =================================================================== diff -u -rf268c732b393b4a4db05e8b8d4b1e17f7252ea27 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Treatment_Section_BloodDialysate/test.py (.../test.py) (revision f268c732b393b4a4db05e8b8d4b1e17f7252ea27) +++ tst_Treatment_Section_BloodDialysate/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -13,8 +13,11 @@ # import names +import utils def main(): + utils.tstStart() + startApplication("denaliSquish") # Goto Treatment Screen @@ -40,3 +43,5 @@ test.compare(waitForObjectExists(names.o_treatmentStart_mL_min_Text_2).visible, True) test.compare(str(waitForObjectExists(names.o_treatmentStart_mL_min_Text_2).text), "mL/min") + utils.tstDone() + \ No newline at end of file Index: tst_Treatment_Ultrafiltration/test.py =================================================================== diff -u -r99810cece725cd3b1070c61756563b90b6d36650 -ra1bf6e9dc0dacf5aee003365d3472e43075d00a7 --- tst_Treatment_Ultrafiltration/test.py (.../test.py) (revision 99810cece725cd3b1070c61756563b90b6d36650) +++ tst_Treatment_Ultrafiltration/test.py (.../test.py) (revision a1bf6e9dc0dacf5aee003365d3472e43075d00a7) @@ -30,6 +30,8 @@ test.compare(waitForObjectExists(names.o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value, 0) def main(): + utils.tstStart() + startApplication("denaliSquish") gotoScreenNtest_Contains_Ultrafiltration() @@ -57,3 +59,4 @@ startNTestTreatmentUltrafiltration(minUF, maxUF) resetNTestTreatmentUltrafiltration() + utils.tstDone() \ No newline at end of file