Index: MainTreatmentData/interface.ui =================================================================== diff -u -r2d936e054bf8364ff42d19d616b555637749ca22 -r94d0118ed4a3f20089a70ae8e43e3e46e39d9286 --- MainTreatmentData/interface.ui (.../interface.ui) (revision 2d936e054bf8364ff42d19d616b555637749ca22) +++ MainTreatmentData/interface.ui (.../interface.ui) (revision 94d0118ed4a3f20089a70ae8e43e3e46e39d9286) @@ -7,7 +7,7 @@ 0 0 732 - 387 + 407 @@ -20,163 +20,10 @@ &3 Treatment/&1 Main treatment - - + + - - - - 180 - 0 - - - - - 180 - 16777215 - - - - Cumulative Volume - - - - - - - 10000 - - - Qt::Horizontal - - - - - - - - 50 - 0 - - - - 0 - - - - - - - - - - - - 180 - 0 - - - - Target Volume - - - - - - - 10000 - - - Qt::Horizontal - - - - - - - - 50 - 0 - - - - 0 - - - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - - 0 - 0 - - - - - 352 - 0 - - - - - 10 - - - - false - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - 61 : [0x3D00] : Saline Bolus - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Saline Bolus Req[0x5F00] - - - - - - - + 0 @@ -189,60 +36,50 @@ 0 - - - 16777215 - 16777215 - - 10 color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - +background-color: rgb(92, 53, 102); - 59 : [0x3B00] : Treament Time + 62 : [0x3E00] : Ultrafiltration Qt::AlignCenter - + - + 180 0 - TX Duration + Set Volume L - + - 480 + 1000 - - 15 - Qt::Horizontal - + 50 @@ -257,32 +94,32 @@ - + - + 180 0 - Elapsed Time + Target Rate L/Hr - + - 480 + 1000 Qt::Horizontal - + 50 @@ -297,112 +134,137 @@ - - - Qt::Vertical - - - - 20 - 60 - - - - - - - - - - + - - - - 10 - + + + + 180 + 0 + - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - Main Treatment Data + Volume Delivered L - - Qt::AlignCenter + + + + + + 200 + + Qt::Horizontal + - + + + + 50 + 0 + + - send + 0 + + + + - + + + + 180 + 0 + + - reset + State + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - - - - - - 180 - 0 - - - - - 180 - 16777215 - - - - Current Delivered Volume - - + + + + + + 180 + 0 + + + + Max Delivery + + + + + + + 20.000000000000000 + + + 2.000000000000000 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - 10000 - + - Qt::Horizontal + Qt::Vertical - - - - - + - 50 - 0 + 20 + 40 - - 0 - - + - - + + - + 0 @@ -432,104 +294,102 @@ - 79 : [0x4F00] : Set Point Data + 59 : [0x3B00] : Treament Time Qt::AlignCenter - + - + 180 0 - Blood Flow + TX Duration - + - 900 + 480 + + 15 + + + Qt::Horizontal + - - - - - + - 180 + 50 0 - Dial Flow + 0 - - - - 900 - - - - + - + 180 0 - Dial Temp + Elapsed Time - + - 100.000000000000000 + 480 + + Qt::Horizontal + + + + + + 50 + 0 + + + + 0 + + + - - - - Qt::Vertical - - - - 20 - 10 - - - - - - + + - + 0 @@ -547,45 +407,48 @@ 10 + + false + color: rgb(238, 238, 236); background-color: rgb(92, 53, 102); - 62 : [0x3E00] : Ultrafiltration + 61 : [0x3D00] : Saline Bolus Qt::AlignCenter - + - + 180 0 - Set Volume L + Target Volume - + - 1000 + 10000 Qt::Horizontal - + 50 @@ -600,32 +463,38 @@ - + - + 180 0 + + + 180 + 16777215 + + - Target Rate L/Hr + Cumulative Volume - + - 1000 + 10000 Qt::Horizontal - + 50 @@ -640,32 +509,38 @@ - + - + 180 0 + + + 180 + 16777215 + + - Volume Delivered L + Current Delivered Volume - + - 200 + 10000 Qt::Horizontal - + 50 @@ -680,111 +555,357 @@ - + - + + + Saline Bolus Req[0x5F00] + + + + + + + false + + + QFrame::WinPanel + + + QFrame::Sunken + + + - + + + Qt::AlignCenter + + + + + + + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + + Main Treatment Data + + + Qt::AlignCenter + + + + + + + send + + + + + + + reset + + + + + + + + + + + + 0 + 0 + + + + + 352 + 0 + + + + + 16777215 + 16777215 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + + xx : [0xXX00] : Treament Vitals + + + Qt::AlignCenter + + + + + + + 180 0 - State + Systolic - + + + 60 + + + 250 + + + 120 + + + + + + - - - Qt::Horizontal - - + + - 40 - 20 + 180 + 0 - + + Diastolic + + + + + + 40 + + + 200 + + + 80 + + + - + - + 180 0 - Max Delivery + Heart Rate - + + + 40 + - 20.000000000000000 + 180 - 2.000000000000000 + 100 + + + + - - - Qt::Horizontal - - + + - 40 - 20 + 180 + 0 - + + Reason + + + + + + 900 + + + + + + + - - - Qt::Vertical + + + + 0 + 0 + - + - 20 - 40 + 352 + 0 - + + + 16777215 + 16777215 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + + 79 : [0x4F00] : Set Point Data + + + Qt::AlignCenter + + + + + + + + + 180 + 0 + + + + Blood Flow + + + + + + + 900 + + + + + + + + + + + + 180 + 0 + + + + Dial Flow + + + + + + + 900 + + + + + + + + + + + + 180 + 0 + + + + Dial Temp + + + + + + + 100.000000000000000 + + + + + - - - - false + + + + Qt::Vertical - - QFrame::WinPanel + + + 20 + 40 + - - QFrame::Sunken - - - - - - - Qt::AlignCenter - - + @@ -797,49 +918,12 @@ UFVolDelSlider UFStatespinBox UFMaxDoubleSpinBox - DurationSlider - ElapsedSlider - BloodFlowSpinBox - DialFlowDpinBox - DialTempDoubleSpinBox tbSend tbReset - DurationSlider - valueChanged(int) - label_14 - setNum(int) - - - 666 - 82 - - - 721 - 83 - - - - - ElapsedSlider - valueChanged(int) - label_15 - setNum(int) - - - 666 - 107 - - - 721 - 108 - - - - TargetVolumeSlider valueChanged(int) label_8 Index: MainTreatmentData/loader.py =================================================================== diff -u -r2d936e054bf8364ff42d19d616b555637749ca22 -r94d0118ed4a3f20089a70ae8e43e3e46e39d9286 --- MainTreatmentData/loader.py (.../loader.py) (revision 2d936e054bf8364ff42d19d616b555637749ca22) +++ MainTreatmentData/loader.py (.../loader.py) (revision 94d0118ed4a3f20089a70ae8e43e3e46e39d9286) @@ -36,13 +36,18 @@ if self.can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id - message_id = MsgIds.MSG_ID_UI_SOLUTION_INFUSION_REQUEST.value + # soluton infusion + solution_infusion_message_id = MsgIds.MSG_ID_UI_SOLUTION_INFUSION_REQUEST.value self.can_interface.register_receiving_publication_function(channel_id, - message_id, + solution_infusion_message_id, self.handle_solution_infusion_request) - self.saline_bolus_req.setText("Saline Bolus Req[{0}00]".format(f"0x{message_id:02X}")) + self.saline_bolus_req.setText("Saline Bolus Req[{0}00]".format(f"0x{solution_infusion_message_id:02X}")) + # vitals request + vitals_request_message_id = MsgIds.MSG_ID_UI_VITALS_REQUEST.value + self.can_interface.register_receiving_publication_function(channel_id, + vitals_request_message_id, + self.handle_vitals_request) - def _init_loader(self): """ finds and creates widgets @@ -77,6 +82,10 @@ self.lbBolusStart = self.find_widget(QtWidgets.QLabel , 'lbBolusStart' ) + self.sbSystolic = self.find_widget(QtWidgets.QSpinBox , 'SystolicSpinBox' ) + self.sbDiastolic = self.find_widget(QtWidgets.QSpinBox , 'DiastolicSpinBox' ) + self.sbHeartRate = self.find_widget(QtWidgets.QSpinBox , 'HeartRateSpinBox' ) + self.sbVitalsReason = self.find_widget(QtWidgets.QSpinBox , 'VitalsReasonSpinBox' ) def _init_connections(self): """ @@ -104,6 +113,9 @@ self.dial_flow_st_pt .valueChanged.connect(self.do_tx_set_point_data) self.dial_temp_st_pt .valueChanged.connect(self.do_tx_set_point_data) + self.sbSystolic .valueChanged.connect(self.do_vitals_data) + self.sbDiastolic .valueChanged.connect(self.do_vitals_data) + self.sbHeartRate .valueChanged.connect(self.do_vitals_data) def handle_solution_infusion_request(self, message, timestamp = 0.0): """ @@ -115,6 +127,14 @@ state,index = conversions.bytearray_to_integer( message, index) self.lbBolusStart .setText( str(state) ) + def handle_vitals_request(self, message, timestamp = 0.0): + """ + Called when the user requests to firmware from UI + @return: None + """ + reason = self.sbVitalsReason.value() + self.td_interface.td_vitals_adjustment_response(reason) + @Slot() def _init_widgets(self): """ @@ -220,7 +240,24 @@ dialysate_temp ) + @Slot() + def do_vitals_data(self): + """ + the slot for Vitals Data + :return: none + """ + systolic = self.sbSystolic .value() + diastolic = self.sbDiastolic .value() + heartRate = self.sbHeartRate .value() + + self.td_interface.td_vitals( + systolic , + diastolic , + heartRate + ) + + @Slot() def do_all_tx_data(self): """ the slot for treatment set point Data @@ -230,3 +267,4 @@ self.do_uf_data() self.do_tx_time_data() self.do_tx_set_point_data() + self.do_vitals_data()