Index: tst_ui_logs/test.py =================================================================== diff -u -rdf44af5c27380e476c35908e36d2b0281dd68556 -r2cc74bf5bb8f5b28494e1502b2d931f9f79895e4 --- tst_ui_logs/test.py (.../test.py) (revision df44af5c27380e476c35908e36d2b0281dd68556) +++ tst_ui_logs/test.py (.../test.py) (revision 2cc74bf5bb8f5b28494e1502b2d931f9f79895e4) @@ -66,53 +66,53 @@ #HD Broadcast #0x0D00 -# hd_simulator.cmd_set_treatment_time(200,60,0) -# verify_log(msg_id = MsgIds.MSG_ID_TREATMENT_TIME.value, msg = "TreatmentTime", param = [200,60,0]) -# -# #0x0500 -# hd_simulator.cmd_set_treatment_blood_flow_rate(flow_set_pt=20, measured_flow=10.5, -# rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, -# mc_current = 12.5, pwm = 32.3, rotor_count = 30) -# verify_log(msg_id = MsgIds.MSG_ID_BLOOD_FLOW_DATA.value, msg = "BloodFlow", param = [20,10.5,112.2,120.3,100.0,12.5,32.3,30]) -# -# #0x0800 -# hd_simulator.cmd_set_treatment_dialysate_flow_rate(flow_set_pt=20, measured_flow=10.5, -# rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, -# mc_current = 12.5, pwm = 32.3) -# verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_FLOW_DATA.value, msg = "DialysateFlow", param = [20,10.5,112.2,120.3,100.0,12.5,32.3]) -# -# #0x0900 -# hd_simulator.cmd_set_pressure_occlusion_data(arterial_prs = 54.5, venous_prs = 20.1, blood_pump_occlusion = 3, -# dialysate_inlet_pump_occlusion = 2, dialysate_outlet_pump_occlusion = 5) -# verify_log(msg_id = MsgIds.MSG_ID_PRESSURE_OCCLUSION_DATA.value, msg = "Pressure/Occlusion", param = [54.5,20.1,3,2,5]) -# -# #0x0B00 -# hd_simulator.cmd_set_treatment_ultrafiltration_outlet_flow_data(ref_uf_vol = 77.5, measured_uf_vol = 22.6, -# rot_speed = 54.0, mot_speed = 66.2, mc_speed = 33.3, -# mc_current = 21.2, pwm = 322.2) -# verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_OUT_FLOW_DATA.value, msg = "OutletFlow",param = [77.5,22.6,54.0,66.2,33.3,21.2,322.2]) -# -# #0x1A00 -# hd_simulator.cmd_set_treatment_parameter_ranges(min_treatment_duration = 300, max_treatment_duration = 500, -# min_uf_volume = 22.6, max_uf_volume = 34.2, -# min_dialysate_flow_rate = 3, max_dialysate_flow_rate = 5) -# -# verify_log(msg_id = str(MsgIds.MSG_ID_TREATMENT_PARAM_CHANGE_RANGES.value), msg = "TreatmentRanges", param = [300,500,22.6,34.2,3,5]) -# -# #0x2F00 -# hd_simulator.cmd_set_treatment_saline_bolus_data(target = 2, cumulative = 90.0, delivered = 67.2) -# verify_log(msg_id = MsgIds.MSG_ID_SALINE_BOLUS_DATA.value, msg = "Saline", param = [2,90.0,67.2]) -# -# #0x4D00 -# hd_simulator.cmd_set_treatment_heparin_data(cumulative = 4) -# verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_DATA_BROADCAST.value, msg = "Heparin", param = [4]) -# -# #0x3300 -# hd_simulator.cmd_send_accelerometer_hd_data(x = 12.3, y = 22.2, z = 4.0, -# x_max = 14.0, y_max = 30.2, z_max = 10.5, -# x_tilt = 11.0, y_tilt = 22.1, z_tilt = 5.5) -# verify_log(msg_id = MsgIds.MSG_ID_HD_ACCELEROMETER_DATA.value, msg = "Accel", param = [12.3,22.2,4.0,14.0,30.2,10.5,11.0,22.1,5.5]) -# + hd_simulator.cmd_set_treatment_time(200,60,0) + verify_log(msg_id = MsgIds.MSG_ID_TREATMENT_TIME.value, msg = "TreatmentTime", param = [200,60,0]) + + #0x0500 + hd_simulator.cmd_set_treatment_blood_flow_rate(flow_set_pt=20, measured_flow=10.5, + rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, + mc_current = 12.5, pwm = 32.3, rotor_count = 30) + verify_log(msg_id = MsgIds.MSG_ID_BLOOD_FLOW_DATA.value, msg = "BloodFlow", param = [20,10.5,112.2,120.3,100.0,12.5,32.3,30]) + + #0x0800 + hd_simulator.cmd_set_treatment_dialysate_flow_rate(flow_set_pt=20, measured_flow=10.5, + rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, + mc_current = 12.5, pwm = 32.3) + verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_FLOW_DATA.value, msg = "DialysateFlow", param = [20,10.5,112.2,120.3,100.0,12.5,32.3]) + + #0x0900 + hd_simulator.cmd_set_pressure_occlusion_data(arterial_prs = 54.5, venous_prs = 20.1, blood_pump_occlusion = 3, + dialysate_inlet_pump_occlusion = 2, dialysate_outlet_pump_occlusion = 5) + verify_log(msg_id = MsgIds.MSG_ID_PRESSURE_OCCLUSION_DATA.value, msg = "Pressure/Occlusion", param = [54.5,20.1,3,2,5]) + + #0x0B00 + hd_simulator.cmd_set_treatment_ultrafiltration_outlet_flow_data(ref_uf_vol = 77.5, measured_uf_vol = 22.6, + rot_speed = 54.0, mot_speed = 66.2, mc_speed = 33.3, + mc_current = 21.2, pwm = 322.2) + verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_OUT_FLOW_DATA.value, msg = "OutletFlow",param = [77.5,22.6,54.0,66.2,33.3,21.2,322.2]) + + #0x1A00 + hd_simulator.cmd_set_treatment_parameter_ranges(min_treatment_duration = 300, max_treatment_duration = 500, + min_uf_volume = 22.6, max_uf_volume = 34.2, + min_dialysate_flow_rate = 3, max_dialysate_flow_rate = 5) + + verify_log(msg_id = str(MsgIds.MSG_ID_TREATMENT_PARAM_CHANGE_RANGES.value), msg = "TreatmentRanges", param = [300,500,22.6,34.2,3,5]) + + #0x2F00 + hd_simulator.cmd_set_treatment_saline_bolus_data(target = 2, cumulative = 90.0, delivered = 67.2) + verify_log(msg_id = MsgIds.MSG_ID_SALINE_BOLUS_DATA.value, msg = "Saline", param = [2,90.0,67.2]) + + #0x4D00 + hd_simulator.cmd_set_treatment_heparin_data(cumulative = 4) + verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_DATA_BROADCAST.value, msg = "Heparin", param = [4]) + + #0x3300 + hd_simulator.cmd_send_accelerometer_hd_data(x = 12.3, y = 22.2, z = 4.0, + x_max = 14.0, y_max = 30.2, z_max = 10.5, + x_tilt = 11.0, y_tilt = 22.1, z_tilt = 5.5) + verify_log(msg_id = MsgIds.MSG_ID_HD_ACCELEROMETER_DATA.value, msg = "Accel", param = [12.3,22.2,4.0,14.0,30.2,10.5,11.0,22.1,5.5]) + #0x3A00 payload = unsigned_integer_to_bytearray(2) payload += unsigned_integer_to_bytearray(1)