# -*- coding: utf-8 -*- import names from leahi_dialin.ui import utils from configuration import utility,config,navigation from configuration import config 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 td =TD_Messaging() def change_treatmentstates(state): test.startSection("Change the treatment parameter") td.td_tx_state( state, 0 , 0 , 0 , 0 , TXStates.RINSEBACK_RUN_STATE , 0 , 0 , 0 , 0) test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) test.startSection("Verify the heparin state is off state") td.td_operation_mode(TDOpModes.MODE_STAN.value) change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value) td.td_pressure(H2_arterial_pressure = -151, H14_venous_pressure = -12, limit_state = 0, H2_arterial_min = -390, H2_arterial_max = 220 , H14_venous_min = -90 , H14_venous_max = 410 , H2_arterial_long = 0 , H14_venous_long = 0 , tmp_pressure = -100 , tmp_min = -500 , tmp_max = -50) value = waitForObject(names.o_EndTreatmentRinseback_arterialRangeBar_TreatmentPressureComponent,3000) arterial_rangeBar = utility.get_object_from_names(value, error_message="arterial rangeBar object is missing") arterial_low = arterial_rangeBar.lowerBound arterial_high = arterial_rangeBar.upperBound arterial_element = waitForObject(names.o_EndTreatmentRinseback_arterialRangeBar_TreatmentPressureComponent) arterial_value = utility.findObjectById(arterial_element, "_value") test.log(str(arterial_value)) venous_rangeBar = utility.get_object_from_names(names.o_EndTreatmentRinseback_venousRangeBar_TreatmentPressureComponent, error_message="venous rangeBar object is missing") venous_low = venous_rangeBar.lowerBound venous_high = venous_rangeBar.upperBound tmp_RangeBar = utility.get_object_from_names(names.o_EndTreatmentRinseback_tmpRangeBar_TreatmentPressureComponent, error_message="trancememberance rangeBar object is missing") trancememberance_low = tmp_RangeBar.lowerBound trancememberance_high = tmp_RangeBar.upperBound test.compare(arterial_low, -390, "Arterial low value should be '{}'".format(arterial_low)) test.compare(arterial_high, 220, "Arterial high value should be '{}'".format(arterial_high)) test.compare(venous_low, -90, "Venous low value should be '{}'".format(venous_low)) test.compare(venous_high, 410, "Venous high value should not be '{}'".format(venous_high)) test.compare(trancememberance_low, -500, "Trancememberance low value should be '{}'".format(trancememberance_low)) test.compare(trancememberance_high, -50, "Trancememberance high value should not be '{}'".format(trancememberance_high))