Index: MainTreatmentData/interface.ui =================================================================== diff -u -r99e021f300fcbdbd20a79762f9b94d234244b70f -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- MainTreatmentData/interface.ui (.../interface.ui) (revision 99e021f300fcbdbd20a79762f9b94d234244b70f) +++ MainTreatmentData/interface.ui (.../interface.ui) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -6,8 +6,8 @@ 0 0 - 434 - 364 + 482 + 492 @@ -562,6 +562,302 @@ + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + + 0 + 0 + + + + + 352 + 0 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + 62 : [0x3E00] : Ultrafiltration Data + + + Qt::AlignCenter + + + + + + + Send + + + + + + + Reset + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + Set Volume (L) + + + + + + + + + + 0 + 0 + + + + + 250 + 0 + + + + 1000 + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 40 + 0 + + + + + 10 + + + + 0.00 + + + Qt::AlignCenter + + + + + + + + + Target Rate (L/Hr) + + + + + + + + + + 0 + 0 + + + + + 250 + 0 + + + + 1000 + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 40 + 0 + + + + + 10 + + + + 0.00 + + + Qt::AlignCenter + + + + + + + + + Volume Delivered (L) + + + + + + + + + + 0 + 0 + + + + + 250 + 0 + + + + 800 + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 40 + 0 + + + + + 10 + + + + 0.00 + + + Qt::AlignCenter + + + + + + + + + State + + + + + + + + 0 + 0 + + + + Qt::AlignCenter + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + QFrame::StyledPanel Index: MainTreatmentData/loader.py =================================================================== diff -u -rc43959d92d8ae0439b01b9acd6fa5bb3922afd17 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- MainTreatmentData/loader.py (.../loader.py) (revision c43959d92d8ae0439b01b9acd6fa5bb3922afd17) +++ MainTreatmentData/loader.py (.../loader.py) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -48,13 +48,25 @@ finds and creates widgets :return: none """ + self.uf_scaling = 100.00 # UF Scaling factor to be 2 decimal places + self.tbReset = self.find_widget(QtWidgets.QToolButton , 'tbReset' ) self.tbSend = self.find_widget(QtWidgets.QToolButton , 'tbSend' ) self.saline_tgt_vol = self.find_widget(QtWidgets.QSlider , 'TargetVolumeSlider' ) self.saline_cum_vol = self.find_widget(QtWidgets.QSlider , 'CumulativeVolumeSlider' ) self.saline_bol_del = self.find_widget(QtWidgets.QSlider , 'SalineCurrDeliveredVolumeSlider' ) + self.ufDataSend = self.find_widget(QtWidgets.QToolButton , 'ufDataSendButton' ) + self.ufDataReset = self.find_widget(QtWidgets.QToolButton , 'ufDataResetButton' ) + self.ufSetVolume = self.find_widget(QtWidgets.QSlider , 'ufSetVolumeSlider' ) + self.ufTargetRate = self.find_widget(QtWidgets.QSlider , 'ufTargetRateSlider' ) + self.ufVolumeDelivered = self.find_widget(QtWidgets.QSlider , 'ufVolumeDeliveredSlider' ) + self.ufState = self.find_widget(QtWidgets.QSpinBox , 'ufStateSpinBox' ) + self.ufSetVolumeLabel = self.find_widget(QtWidgets.QLabel , 'ufSetVolumeLabel' ) + self.ufTargetRateLabel = self.find_widget(QtWidgets.QLabel , 'ufTargetRateLabel' ) + self.ufVolumeDeliveredLabel = self.find_widget(QtWidgets.QLabel , 'ufVolumeDeliveredLabel' ) + self.tx_duration = self.find_widget(QtWidgets.QSlider , 'DurationSlider' ) self.tx_elapsed = self.find_widget(QtWidgets.QSlider , 'ElapsedSlider' ) @@ -79,6 +91,13 @@ self.saline_cum_vol .valueChanged.connect(self.do_saline_data) self.saline_bol_del .valueChanged.connect(self.do_saline_data) + self.ufDataSend .clicked.connect(self.do_uf_data) + self.ufDataReset .clicked.connect(self.init_uf_data) + self.ufSetVolume .valueChanged.connect(self.do_uf_data) + self.ufTargetRate .valueChanged.connect(self.do_uf_data) + self.ufVolumeDelivered .valueChanged.connect(self.do_uf_data) + self.ufState .valueChanged.connect(self.do_uf_data) + self.tx_duration .valueChanged.connect(self.do_tx_time_data) self.tx_elapsed .valueChanged.connect(self.do_tx_time_data) @@ -106,6 +125,8 @@ self.saline_cum_vol .setValue(0) self.saline_bol_del .setValue(0) + self.init_uf_data() + self.tx_duration .setValue(0) self.tx_elapsed .setValue(0) @@ -130,7 +151,43 @@ 0 ) + @Slot() + def init_uf_data(self): + """ + slot for initializing UF settings change + :return: none + """ + self.ufSetVolume .setValue(0) + self.ufTargetRate .setValue(0) + self.ufVolumeDelivered .setValue(0) + self.ufState .setValue(0) + + + @Slot() + def do_uf_data(self): + """ + the slot for UF Data + :return: none + """ + set_volume = self.ufSetVolume .value() / self.uf_scaling + target_rate = self.ufTargetRate .value() / self.uf_scaling + volume_delivered = self.ufVolumeDelivered.value() / self.uf_scaling + state = self.ufState .value() + + self.ufSetVolumeLabel .setText(f"{set_volume:.2f}" ) + self.ufTargetRateLabel .setText(f"{target_rate:.2f}" ) + self.ufVolumeDeliveredLabel .setText(f"{volume_delivered:.2f}" ) + + self.td_interface.td_ultrafiltration( + set_volume , + target_rate , + volume_delivered , + state + ) + + + @Slot() def do_tx_time_data(self): """ the slot for treatment time Data Index: TD_TreatmentAdjustmentsBolusVolume/interface.ui =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsBolusVolume/interface.ui (.../interface.ui) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsBolusVolume/interface.ui (.../interface.ui) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -6,8 +6,8 @@ 0 0 - 459 - 159 + 398 + 106 @@ -40,150 +40,7 @@ 5 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - - 0 - 0 - - - - - 352 - 0 - - - - - 16777215 - 16777215 - - - - - 10 - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 116 : [0x7400] : Bolus Volume Adjustments Req - - - Qt::AlignCenter - - - - - - - - 10 - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 180 - 0 - - - - - 10 - - - - Bolus Volume (mL) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 10 - - - - QFrame::Box - - - QFrame::Raised - - - -- - - - Qt::AlignCenter - - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - + Qt::Vertical @@ -196,7 +53,7 @@ - + QFrame::StyledPanel @@ -255,18 +112,6 @@ - - - - 10 - - - - Copy - - - - @@ -291,7 +136,7 @@ 2 - + @@ -303,7 +148,7 @@ - + @@ -318,40 +163,47 @@ - - + + 10 + + QFrame::Box + + + QFrame::Raised + - Bolus Volume (mL) + -- + + Qt::AlignCenter + - - + + + + + 180 + 0 + + 10 + + Req [0x7400] +Bolus Volume (mL) + - Qt::AlignCenter + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - 0 - - - 400 - - - 1 - - - 0 - Index: TD_TreatmentAdjustmentsBolusVolume/loader.py =================================================================== diff -u -rf130aeba8b9749645bf7c1f8b00c68268ad3bbc0 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsBolusVolume/loader.py (.../loader.py) (revision f130aeba8b9749645bf7c1f8b00c68268ad3bbc0) +++ TD_TreatmentAdjustmentsBolusVolume/loader.py (.../loader.py) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -43,24 +43,18 @@ finds and creates widgets :return: none """ - self.tbReqReset = self.find_widget(QtWidgets.QToolButton , 'tbReqReset' ) - self.lbBolusVolumeValue = self.find_widget(QtWidgets.QLabel , 'lbBolusVolumeValue' ) - self.tbRspSend = self.find_widget(QtWidgets.QToolButton , 'tbRspSend' ) - self.tbRspCopy = self.find_widget(QtWidgets.QToolButton , 'tbRspCopy' ) self.tbRspReset = self.find_widget(QtWidgets.QToolButton , 'tbRspReset' ) + self.lbReqBolusVolume = self.find_widget(QtWidgets.QLabel , 'lbReqBolusVolume' ) self.sbRejectionReason = self.find_widget(QtWidgets.QSpinBox , 'sbRejectionReason' ) - self.sbBolusVolume = self.find_widget(QtWidgets.QSpinBox , 'sbBolusVolume' ) def _init_connections(self): """ initializes the widgets connections :return: none """ - self.tbReqReset .clicked .connect(self.init_bolus_adjustments_request ) self.tbRspSend .clicked .connect(self.do_bolus_adjustments_response ) - self.tbRspCopy .clicked .connect(self.do_copy_bolus_adjustments_request ) self.tbRspReset .clicked .connect(self.init_bolus_adjustments_response ) @@ -75,7 +69,7 @@ @Slot() def init_bolus_adjustments_request(self): - self.lbBolusVolumeValue.setText("--") + self.lbReqBolusVolume.setText("--") @Slot() @@ -88,29 +82,24 @@ index = MsgFieldPositions.START_POS_FIELD_1 value,index = conversions.bytearray_to_integer(message, index) - self.lbBolusVolumeValue.setText("{0}".format(value)) + self.lbReqBolusVolume.setText("{0}".format(value)) @Slot() def init_bolus_adjustments_response(self): - self.sbRejectionReason .setValue(0) - self.sbBolusVolume .setValue(0) + self.sbRejectionReason.setValue(0) @Slot() - def do_copy_bolus_adjustments_request(self): - convert_to_int = lambda value : int(value) if value.isdigit() else 0 - - self.sbBolusVolume.setValue(convert_to_int(self.lbBolusVolumeValue.text())) - - - @Slot() def do_bolus_adjustments_response(self): """ the slot for sending pressure adjustments response :return: none """ - self.td_interface.td_bolus_volume_adjustment_response( - self.sbRejectionReason .value(), - self.sbBolusVolume .value() + self.td_interface.cmd_send_general_response( + message_id = MsgIds.MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE.value, + accepted = 1 if self.sbRejectionReason.value() == 0 else 0, + reason = self.sbRejectionReason.value(), + is_pure_data = False, + has_parameters = False, ) Index: TD_TreatmentAdjustmentsDuration/interface.ui =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsDuration/interface.ui (.../interface.ui) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsDuration/interface.ui (.../interface.ui) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -6,8 +6,8 @@ 0 0 - 428 - 411 + 404 + 292 @@ -40,442 +40,33 @@ 5 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - - 0 - 0 - - - - - 352 - 0 - - - - - 16777215 - 16777215 - - - - - 10 - - - - color: rgb(238, 238, 236); + + + + + + color: rgb(238, 238, 236); background-color: rgb(92, 53, 102); - - - 118 : [0x7600] : Duration Edit Request - - - Qt::AlignCenter - - - - - - - - 10 - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 0 - 0 - - - - - 10 - - - - QFrame::Box - - - QFrame::Raised - - - -- - - - Qt::AlignCenter - - - - - - - Duration (min) - - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - + + + Duration Adjustment + + + Qt::AlignCenter + + + + + + + Reset + + + + - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 120 : [0x7800] : Duration Confirm Request - - - Qt::AlignCenter - - - - - - - Reset - - - - - - - - - - - Duration (min) - - - - - - - - 0 - 0 - - - - QFrame::Box - - - QFrame::Sunken - - - -- - - - Qt::AlignCenter - - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 121 : [0x7900] : Duration Confirm Response - - - Qt::AlignCenter - - - - - - - Send - - - - - - - Copy - - - - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Rejection Reason - - - - - - - Qt::AlignCenter - - - 100 - - - - - - - Duration (min) - - - - - - - - - 540 - - - Qt::Horizontal - - - - - - - - 40 - 0 - - - - -- - - - Qt::AlignCenter - - - - - - - - - UF Volume Goal (mL) - - - - - - - - - 8000 - - - 10 - - - 100 - - - Qt::Horizontal - - - - - - - - 40 - 0 - - - - -- - - - Qt::AlignCenter - - - - - - - - - UF Rate (L/hr) - - - - - - - - - 2000 - - - 10 - - - 100 - - - Qt::Horizontal - - - - - - - - 40 - 0 - - - - -- - - - Qt::AlignCenter - - - - - - - - - - - + QFrame::StyledPanel @@ -570,7 +161,7 @@ 2 - + @@ -582,7 +173,7 @@ - + @@ -597,7 +188,7 @@ - + @@ -609,14 +200,14 @@ - + UF Volume Goal (mL) - + @@ -658,7 +249,7 @@ - + @@ -688,14 +279,14 @@ - + UF Rate (L/hr) - + @@ -737,6 +328,44 @@ + + + + + 0 + 0 + + + + + 10 + + + + QFrame::Box + + + QFrame::Raised + + + -- + + + Qt::AlignCenter + + + + + + + Req [0x7600] +Duration (min) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + @@ -755,7 +384,124 @@ - + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + + 121 : [0x7900] : Duration Confirm Response + + + Qt::AlignCenter + + + + + + + Send + + + + + + + Reset + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + Req [0x7800] +Duration (min) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + QFrame::Box + + + QFrame::Sunken + + + -- + + + Qt::AlignCenter + + + + + + + Rejection Reason + + + + + + + Qt::AlignCenter + + + 100 + + + + + + + + + Qt::Vertical @@ -768,32 +514,6 @@ - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - Duration Adjustment - - - Qt::AlignCenter - - - - - - - Reset - - - - - Index: TD_TreatmentAdjustmentsDuration/loader.py =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsDuration/loader.py (.../loader.py) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsDuration/loader.py (.../loader.py) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -49,7 +49,6 @@ """ self.tbReset = self.find_widget(QtWidgets.QToolButton , 'tbReset' ) - self.tbEditReqReset = self.find_widget(QtWidgets.QToolButton , 'tbEditReqReset' ) self.lbEditReqDuration = self.find_widget(QtWidgets.QLabel , 'lbEditReqDuration' ) self.tbEditRspSend = self.find_widget(QtWidgets.QToolButton , 'tbEditRspSend' ) self.tbEditRspCopy = self.find_widget(QtWidgets.QToolButton , 'tbEditRspCopy' ) @@ -62,18 +61,10 @@ self.slEditRspUfRate = self.find_widget(QtWidgets.QSlider , 'slEditRspUfRate' ) self.lbEditRspUfRate = self.find_widget(QtWidgets.QLabel , 'lbEditRspUfRate' ) - self.tbConfirmReqReset = self.find_widget(QtWidgets.QToolButton , 'tbConfirmReqReset' ) - self.lbConfirmReqDuration = self.find_widget(QtWidgets.QLabel , 'lbConfirmReqDuration' ) self.tbConfirmRspSend = self.find_widget(QtWidgets.QToolButton , 'tbConfirmRspSend' ) - self.tbConfirmRspCopy = self.find_widget(QtWidgets.QToolButton , 'tbConfirmRspCopy' ) self.tbConfirmRspReset = self.find_widget(QtWidgets.QToolButton , 'tbConfirmRspReset' ) + self.lbConfirmReqDuration = self.find_widget(QtWidgets.QLabel , 'lbConfirmReqDuration' ) self.sbConfirmRspRejectionReason = self.find_widget(QtWidgets.QSpinBox , 'sbConfirmRspRejectionReason' ) - self.slConfirmRspDuration = self.find_widget(QtWidgets.QSlider , 'slConfirmRspDuration' ) - self.lbConfirmRspDuration = self.find_widget(QtWidgets.QLabel , 'lbConfirmRspDuration' ) - self.slConfirmRspUfVolumeGoal = self.find_widget(QtWidgets.QSlider , 'slConfirmRspUfVolumeGoal' ) - self.lbConfirmRspUfVolumeGoal = self.find_widget(QtWidgets.QLabel , 'lbConfirmRspUfVolumeGoal' ) - self.slConfirmRspUfRate = self.find_widget(QtWidgets.QSlider , 'slConfirmRspUfRate' ) - self.lbConfirmRspUfRate = self.find_widget(QtWidgets.QLabel , 'lbConfirmRspUfRate' ) def _init_connections(self): @@ -83,40 +74,27 @@ """ self.tbReset .clicked .connect(self._init_widgets ) - self.tbEditReqReset .clicked .connect(self.init_edit_request ) self.tbEditRspSend .clicked .connect(self.do_send_edit_response ) self.tbEditRspCopy .clicked .connect(self.do_copy_edit_response ) self.tbEditRspReset .clicked .connect(self.init_edit_response ) self.slEditRspDuration .valueChanged .connect(lambda value: self.lbEditRspDuration.setText(f"{value}") ) self.slEditRspUfVolumeGoal .valueChanged .connect(lambda value: self.lbEditRspUfVolumeGoal.setText(f"{value/1000:.2f}") ) self.slEditRspUfRate .valueChanged .connect(lambda value: self.lbEditRspUfRate.setText(f"{value/1000:.2f}") ) - self.tbConfirmReqReset .clicked .connect(self.init_confirm_request ) self.tbConfirmRspSend .clicked .connect(self.do_send_confirm_response ) - self.tbConfirmRspCopy .clicked .connect(self.do_copy_confirm_response ) self.tbConfirmRspReset .clicked .connect(self.init_confirm_response ) - self.slConfirmRspDuration .valueChanged .connect(lambda value: self.lbConfirmRspDuration.setText(f"{value}") ) - self.slConfirmRspUfVolumeGoal .valueChanged .connect(lambda value: self.lbConfirmRspUfVolumeGoal.setText(f"{value/1000:.2f}") ) - self.slConfirmRspUfRate .valueChanged .connect(lambda value: self.lbConfirmRspUfRate.setText(f"{value/1000:.2f}") ) def _init_widgets(self): """ initializes the widgets' properties :return: none """ - self.init_edit_request() self.init_edit_response() - self.init_confirm_request() self.init_confirm_response() @Slot() - def init_edit_request(self): - self.lbEditReqDuration.setText("--") - - - @Slot() def handle_duration_edit_request(self, message, timestamp = 0.0): """ Called when the user requests duration edit from UI @@ -130,8 +108,8 @@ @Slot() def init_edit_response(self): + self.lbEditReqDuration.setText("--") self.sbEditRspRejectionReason .setValue(0) - self.slEditRspDuration .setValue(0) self.lbEditRspDuration .setText("{0}".format(self.slEditRspDuration.value())) self.slEditRspUfVolumeGoal .setValue(0) @@ -165,11 +143,6 @@ @Slot() - def init_confirm_request(self): - self.lbConfirmReqDuration.setText("--") - - - @Slot() def handle_duration_confirm_request(self, message, timestamp = 0.0): """ Called when the user requests duration confirm from UI @@ -183,35 +156,20 @@ @Slot() def init_confirm_response(self): + self.lbConfirmReqDuration .setText("--") self.sbConfirmRspRejectionReason .setValue(0) - self.slConfirmRspDuration .setValue(0) - self.lbConfirmRspDuration .setText("{0}".format(self.slConfirmRspDuration.value())) - self.slConfirmRspUfVolumeGoal .setValue(0) - self.lbConfirmRspUfVolumeGoal .setText("{0:.2f}".format(self.slConfirmRspUfVolumeGoal.value() / 1000)) - self.slConfirmRspUfRate .setValue(0) - self.lbConfirmRspUfRate .setText("{0:.2f}".format(self.slConfirmRspUfRate.value() / 1000)) - @Slot() def do_send_confirm_response(self): """ the slot for sending duration confirm response :return: none """ - self.td_interface.td_duration_confirm_response( - self.sbConfirmRspRejectionReason .value(), - self.slConfirmRspDuration .value(), - self.slConfirmRspUfVolumeGoal .value(), - self.slConfirmRspUfRate .value() / 1000 + self.td_interface.cmd_send_general_response( + message_id = MsgIds.MSG_ID_TD_DURATION_CONFIRM_RESPONSE.value, + accepted = 1 if self.sbConfirmRspRejectionReason.value() == 0 else 0, + reason = self.sbConfirmRspRejectionReason.value(), + is_pure_data = False, + has_parameters = False, ) - - - @Slot() - def do_copy_confirm_response(self): - """ - the slot for copying duration confirm request data to confirm response - :return: none - """ - convert_to_int = lambda value : int(value) if value.isdigit() else 0 - self.slConfirmRspDuration.setValue(convert_to_int(self.lbConfirmReqDuration.text())) Index: TD_TreatmentAdjustmentsPressures/interface.ui =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsPressures/interface.ui (.../interface.ui) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsPressures/interface.ui (.../interface.ui) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -7,7 +7,7 @@ 0 0 432 - 319 + 219 @@ -366,18 +366,6 @@ - - - - 10 - - - - Copy - - - - @@ -429,144 +417,6 @@ - - - - - 10 - - - - Arterial Window (mmHg) - - - - - - - - 10 - - - - Qt::AlignCenter - - - -600 - - - 300 - - - 1 - - - 0 - - - - - - - - 10 - - - - Venous Window (mmHg) - - - - - - - - 10 - - - - Qt::AlignCenter - - - -600 - - - 300 - - - 1 - - - 0 - - - - - - - - 10 - - - - Venous Asymmetric Window - - - - - - - - 10 - - - - Qt::AlignCenter - - - -600 - - - 300 - - - 5 - - - 0 - - - - - - - - 10 - - - - TMP Window (mmHg) - - - - - - - - 10 - - - - Qt::AlignCenter - - - -600 - - - 300 - - - Index: TD_TreatmentAdjustmentsPressures/loader.py =================================================================== diff -u -r8f738af4e021a2ccd0f3f360489c3263a4c96631 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsPressures/loader.py (.../loader.py) (revision 8f738af4e021a2ccd0f3f360489c3263a4c96631) +++ TD_TreatmentAdjustmentsPressures/loader.py (.../loader.py) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -50,13 +50,8 @@ self.lbTmpWindowValue = self.find_widget(QtWidgets.QLabel , 'lbTmpWindowValue' ) self.tbRspSend = self.find_widget(QtWidgets.QToolButton , 'tbRspSend' ) - self.tbRspCopy = self.find_widget(QtWidgets.QToolButton , 'tbRspCopy' ) self.tbRspReset = self.find_widget(QtWidgets.QToolButton , 'tbRspReset' ) self.sbRejectionReason = self.find_widget(QtWidgets.QSpinBox , 'sbRejectionReason' ) - self.sbArterialWindow = self.find_widget(QtWidgets.QSpinBox , 'sbArterialWindow' ) - self.sbVenousWindow = self.find_widget(QtWidgets.QSpinBox , 'sbVenousWindow' ) - self.sbVenousAsymmetricWindow = self.find_widget(QtWidgets.QSpinBox , 'sbVenousAsymmetricWindow') - self.sbTmpWindow = self.find_widget(QtWidgets.QSpinBox , 'sbTmpWindow' ) def _init_connections(self): @@ -66,7 +61,6 @@ """ self.tbReqReset .clicked .connect(self.init_pressure_adjustments_request ) self.tbRspSend .clicked .connect(self.do_pressure_adjustments_response ) - self.tbRspCopy .clicked .connect(self.do_copy_pressure_adjustments_request ) self.tbRspReset .clicked .connect(self.init_pressure_adjustments_response ) @@ -109,32 +103,18 @@ @Slot() def init_pressure_adjustments_response(self): self.sbRejectionReason .setValue(0) - self.sbArterialWindow .setValue(0) - self.sbVenousWindow .setValue(0) - self.sbVenousAsymmetricWindow .setValue(0) - self.sbTmpWindow .setValue(0) @Slot() - def do_copy_pressure_adjustments_request(self): - convert_to_int = lambda value : int(value) if value.isdigit() else 0 - - self.sbArterialWindow .setValue(convert_to_int(self.lbArterialWindowValue.text()) ) - self.sbVenousWindow .setValue(convert_to_int(self.lbVenousWindowValue.text()) ) - self.sbVenousAsymmetricWindow .setValue(convert_to_int(self.lbVenousAsymmetricValue.text()) ) - self.sbTmpWindow .setValue(convert_to_int(self.lbTmpWindowValue.text()) ) - - - @Slot() def do_pressure_adjustments_response(self): """ the slot for sending pressure adjustments response :return: none """ - self.td_interface.td_pressure_limits_adjustment_response( - self.sbRejectionReason .value(), - self.sbArterialWindow .value(), - self.sbVenousWindow .value(), - self.sbVenousAsymmetricWindow .value(), - self.sbTmpWindow .value() + self.td_interface.cmd_send_general_response( + message_id = MsgIds.MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, + accepted = 1 if self.sbRejectionReason.value() == 0 else 0, + reason = self.sbRejectionReason.value(), + is_pure_data = False, + has_parameters = False, ) Index: TD_TreatmentAdjustmentsSetPoints/interface.ui =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsSetPoints/interface.ui (.../interface.ui) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsSetPoints/interface.ui (.../interface.ui) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -6,8 +6,8 @@ 0 0 - 822 - 461 + 743 + 297 @@ -46,249 +46,6 @@ 2 - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - - 11 - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - Set Points - - - Qt::AlignCenter - - - - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Blood Flow Rate - - - - - - - - - - 0 - 0 - - - - - 200 - 0 - - - - 600 - - - Qt::Horizontal - - - - - - - - 40 - 0 - - - - -- - - - Qt::AlignCenter - - - - - - - - - Dialysate Flow Rate - - - - - - - - - - 0 - 0 - - - - - 200 - 0 - - - - 700 - - - Qt::Horizontal - - - - - - - - 40 - 0 - - - - -- - - - Qt::AlignCenter - - - - - - - - - Dialysate Temperature - - - - - - - Acid Concentrate - - - - - - - Bicarb Concentrate - - - - - - - Qt::AlignCenter - - - - - - - Qt::AlignCenter - - - - - - - - - - 0 - 0 - - - - - 200 - 0 - - - - 400 - - - 1 - - - Qt::Horizontal - - - - - - - - 40 - 0 - - - - -- - - - Qt::AlignCenter - - - - - - - - - - - QFrame::StyledPanel @@ -330,13 +87,6 @@ - - - Copy - - - - Reset @@ -575,20 +325,14 @@ 2 - - - - 0 - 0 - - + QFrame::StyledPanel QFrame::Raised - + 2 @@ -605,279 +349,118 @@ 2 - + - - - - 0 - 25 - - - - - 11 - - + color: rgb(238, 238, 236); background-color: rgb(92, 53, 102); - Blood Flow Rate + 125 : [0x7D00] : Blood Flow Rate Response Qt::AlignCenter - + + Send + + + + + + Reset - - - QFrame::StyledPanel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - 10 - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 124 : [0x7C00] : Blood Flow Rate Request - - - Qt::AlignCenter - - - - - - - Copy - - - - - - - - 10 - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 0 - 0 - - - - - 10 - - - - QFrame::Box - - - QFrame::Raised - - - -- - - - Qt::AlignCenter - - - - - - - Blood Flow Rate (mL/min) - - - - - - - - - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 125 : [0x7D00] : Blood Flow Rate Response - - - Qt::AlignCenter - - - - - - - Send - - - - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Rejection Reason - - - - - - - - 0 - 0 - - - - Qt::AlignCenter - - - 100 - - - - - - - + + + + Rejection Reason + + + + + + + + 0 + 0 + + + + Qt::AlignCenter + + + 100 + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::Box + + + QFrame::Raised + + + -- + + + Qt::AlignCenter + + + + + + + Req [0x7C00] +Flow Rate (mL/min) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + - - - - 0 - 0 - - + QFrame::StyledPanel QFrame::Raised - + 2 @@ -894,249 +477,110 @@ 2 - + - - - - 0 - 25 - - - - - 11 - - + color: rgb(238, 238, 236); background-color: rgb(92, 53, 102); - Dialysate Flow Rate + 127 : [0x7F00] : Dialysate Flow Rate Response Qt::AlignCenter - + + Send + + + + + + Reset - - - QFrame::StyledPanel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 126 : [0x7E00] : Dialysate Flow Rate Request - - - Qt::AlignCenter - - - - - - - Copy - - - - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Dialysate Flow Rate (mL/min) - - - - - - - - 0 - 0 - - - - QFrame::Box - - - QFrame::Sunken - - - -- - - - Qt::AlignCenter - - - - - - - + + + + Rejection Reason + + + + + + + + 0 + 0 + + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + QFrame::Box + + + QFrame::Sunken + + + -- + + + Qt::AlignCenter + + + + + + + Req [0x7E00] +Flow Rate (mL/min) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 127 : [0x7F00] : Dialysate Flow Rate Response - - - Qt::AlignCenter - - - - - - - Send - - - - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Rejection Reason - - - - - - - - 0 - 0 - - - - Qt::AlignCenter - - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - + QFrame::StyledPanel QFrame::Raised - + 2 @@ -1153,241 +597,98 @@ 2 - + - - - - 0 - 25 - - - - - 11 - - + color: rgb(238, 238, 236); background-color: rgb(92, 53, 102); - Dialysate Temperature + 129 : [0x8100] : Dialysate Temperature Response Qt::AlignCenter - + + Send + + + + + + Reset - - - QFrame::StyledPanel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 128 : [0x8000] : Dialysate Temperature Request - - - Qt::AlignCenter - - - - - - - Copy - - - - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Dialysate Temperature (°C) - - - - - - - - 0 - 0 - - - - QFrame::Box - - - QFrame::Sunken - - - -- - - - Qt::AlignCenter - - - - - - - + + + + Rejection Reason + + + + + + + + 0 + 0 + + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + QFrame::Box + + + QFrame::Sunken + + + -- + + + Qt::AlignCenter + + + + + + + Req [0x8000] +Temperature (°C) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - - - 129 : [0x8100] : Dialysate Temperature Response - - - Qt::AlignCenter - - - - - - - Send - - - - - - - Reset - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - Rejection Reason - - - - - - - - 0 - 0 - - - - Qt::AlignCenter - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - - Index: TD_TreatmentAdjustmentsSetPoints/loader.py =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsSetPoints/loader.py (.../loader.py) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsSetPoints/loader.py (.../loader.py) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -55,17 +55,6 @@ finds and creates widgets :return: none """ - self.tbSetPointsReset = self.find_widget(QtWidgets.QToolButton , 'tbSetPointsReset' ) - self.slSetPointsBloodFlowRate = self.find_widget(QtWidgets.QSlider , 'slSetPointsBloodFlowRate' ) - self.lbSetPointsBloodFlowRate = self.find_widget(QtWidgets.QLabel , 'lbSetPointsBloodFlowRate' ) - self.slSetPointsDialysateFlowRate = self.find_widget(QtWidgets.QSlider , 'slSetPointsDialysateFlowRate' ) - self.lbSetPointsDialysateFlowRate = self.find_widget(QtWidgets.QLabel , 'lbSetPointsDialysateFlowRate' ) - self.slSetPointsDialysateTemperature = self.find_widget(QtWidgets.QSlider , 'slSetPointsDialysateTemperature' ) - self.lbSetPointsDialysateTemperature = self.find_widget(QtWidgets.QLabel , 'lbSetPointsDialysateTemperature' ) - self.sbSetPointsAcidConcentrate = self.find_widget(QtWidgets.QSpinBox , 'sbSetPointsAcidConcentrate' ) - self.sbSetPointsBicarbConcentrate = self.find_widget(QtWidgets.QSpinBox , 'sbSetPointsBicarbConcentrate' ) - - self.tbSetPointsReqCopy = self.find_widget(QtWidgets.QToolButton , 'tbSetPointsReqCopy' ) self.tbSetPointsReqReset = self.find_widget(QtWidgets.QToolButton , 'tbSetPointsReqReset' ) self.lbSetPointsReqBloodFlowRate = self.find_widget(QtWidgets.QLabel , 'lbSetPointsReqBloodFlowRate' ) self.lbSetPointsReqDialysateFlowRate = self.find_widget(QtWidgets.QLabel , 'lbSetPointsReqDialysateFlowRate' ) @@ -77,34 +66,19 @@ self.tbSetPointsRspReset = self.find_widget(QtWidgets.QToolButton , 'tbSetPointsRspReset' ) self.sbSetPointsRspRejectionReason = self.find_widget(QtWidgets.QSpinBox , 'sbSetPointsRspRejectionReason' ) - self.tbBloodFlowRateReset = self.find_widget(QtWidgets.QToolButton , 'tbBloodFlowRateReset' ) - - self.tbBloodFlowRateReqCopy = self.find_widget(QtWidgets.QToolButton , 'tbBloodFlowRateReqCopy' ) - self.tbBloodFlowRateReqReset = self.find_widget(QtWidgets.QToolButton , 'tbBloodFlowRateReqReset' ) - self.lbBloodFlowRateReq = self.find_widget(QtWidgets.QLabel , 'lbBloodFlowRateReq' ) - self.tbBloodFlowRateRspSend = self.find_widget(QtWidgets.QToolButton , 'tbBloodFlowRateRspSend' ) self.tbBloodFlowRateRspReset = self.find_widget(QtWidgets.QToolButton , 'tbBloodFlowRateRspReset' ) + self.lbBloodFlowRateReq = self.find_widget(QtWidgets.QLabel , 'lbBloodFlowRateReq' ) self.sbBloodFlowRateRspRejectionReason = self.find_widget(QtWidgets.QSpinBox , 'sbBloodFlowRateRspRejectionReason' ) - self.tbDialysateFlowRateReset = self.find_widget(QtWidgets.QToolButton , 'tbDialysateFlowRateReset' ) - - self.tbDialysateFlowRateReqCopy = self.find_widget(QtWidgets.QToolButton , 'tbDialysateFlowRateReqCopy' ) - self.tbDialysateFlowRateReqReset = self.find_widget(QtWidgets.QToolButton , 'tbDialysateFlowRateReqReset' ) - self.lbDialysateFlowRateReq = self.find_widget(QtWidgets.QLabel , 'lbDialysateFlowRateReq' ) - self.tbDialysateFlowRateRspSend = self.find_widget(QtWidgets.QToolButton , 'tbDialysateFlowRateRspSend' ) self.tbDialysateFlowRateRspReset = self.find_widget(QtWidgets.QToolButton , 'tbDialysateFlowRateRspReset' ) + self.lbDialysateFlowRateReq = self.find_widget(QtWidgets.QLabel , 'lbDialysateFlowRateReq' ) self.sbDialysateFlowRateRspRejectionReason = self.find_widget(QtWidgets.QSpinBox , 'sbDialysateFlowRateRspRejectionReason' ) - self.tbDialysateTemperatureReset = self.find_widget(QtWidgets.QToolButton , 'tbDialysateTemperatureReset' ) - - self.tbDialysateTemperatureReqCopy = self.find_widget(QtWidgets.QToolButton , 'tbDialysateTemperatureReqCopy' ) - self.tbDialysateTemperatureReqReset = self.find_widget(QtWidgets.QToolButton , 'tbDialysateTemperatureReqReset' ) - self.lbDialysateTemperatureReq = self.find_widget(QtWidgets.QLabel , 'lbDialysateTemperatureReq' ) - self.tbDialysateTemperatureRspSend = self.find_widget(QtWidgets.QToolButton , 'tbDialysateTemperatureRspSend' ) self.tbDialysateTemperatureRspReset = self.find_widget(QtWidgets.QToolButton , 'tbDialysateTemperatureRspReset' ) + self.lbDialysateTemperatureReq = self.find_widget(QtWidgets.QLabel , 'lbDialysateTemperatureReq' ) self.sbDialysateTemperatureRspRejectionReason = self.find_widget(QtWidgets.QSpinBox , 'sbDialysateTemperatureRspRejectionReason') @@ -113,38 +87,17 @@ initializes the widgets connections :return: none """ - self.tbSetPointsReset .clicked .connect(self.do_set_points_reset ) - self.slSetPointsBloodFlowRate .valueChanged .connect(lambda value: self.lbSetPointsBloodFlowRate.setText(f"{value}") ) - self.slSetPointsDialysateFlowRate .valueChanged .connect(lambda value: self.lbSetPointsDialysateFlowRate.setText(f"{value}") ) - self.slSetPointsDialysateTemperature .valueChanged .connect(lambda value: self.lbSetPointsDialysateTemperature.setText(f"{value/10:.1f}") ) - - self.tbSetPointsReqCopy .clicked .connect(self.do_set_points_request_copy ) self.tbSetPointsReqReset .clicked .connect(self.do_set_points_request_reset ) self.tbSetPointsRspSend .clicked .connect(self.do_set_points_response_send ) self.tbSetPointsRspReset .clicked .connect(self.do_set_points_response_reset ) - self.tbBloodFlowRateReset .clicked .connect(self.do_blood_flow_rate_reset ) - - self.tbBloodFlowRateReqCopy .clicked .connect(self.do_blood_flow_rate_request_copy ) - self.tbBloodFlowRateReqReset .clicked .connect(self.do_blood_flow_rate_request_reset ) - self.tbBloodFlowRateRspSend .clicked .connect(self.do_blood_flow_rate_response_send ) self.tbBloodFlowRateRspReset .clicked .connect(self.do_blood_flow_rate_response_reset ) - self.tbDialysateFlowRateReset .clicked .connect(self.do_dialysate_flow_rate_reset ) - - self.tbDialysateFlowRateReqCopy .clicked .connect(self.do_dialysate_flow_rate_request_copy ) - self.tbDialysateFlowRateReqReset .clicked .connect(self.do_dialysate_flow_rate_request_reset ) - self.tbDialysateFlowRateRspSend .clicked .connect(self.do_dialysate_flow_rate_response_send ) self.tbDialysateFlowRateRspReset .clicked .connect(self.do_dialysate_flow_rate_response_reset ) - self.tbDialysateTemperatureReset .clicked .connect(self.do_dialysate_temperature_reset ) - - self.tbDialysateTemperatureReqCopy .clicked .connect(self.do_dialysate_temperature_request_copy ) - self.tbDialysateTemperatureReqReset .clicked .connect(self.do_dialysate_temperature_request_reset ) - self.tbDialysateTemperatureRspSend .clicked .connect(self.do_dialysate_temperature_response_send ) self.tbDialysateTemperatureRspReset .clicked .connect(self.do_dialysate_temperature_response_reset ) @@ -159,27 +112,10 @@ @Slot() def do_set_points_reset(self): - self.slSetPointsBloodFlowRate .setValue ( 0 ) - self.lbSetPointsBloodFlowRate .setText ( "--" ) - self.slSetPointsDialysateFlowRate .setValue ( 0 ) - self.lbSetPointsDialysateFlowRate .setText ( "--" ) - self.slSetPointsDialysateTemperature .setValue ( 0 ) - self.lbSetPointsDialysateTemperature .setText ( "--" ) - self.sbSetPointsAcidConcentrate .setValue ( 0 ) - self.sbSetPointsBicarbConcentrate .setValue ( 0 ) - self.do_set_points_request_reset() self.do_set_points_response_reset() @Slot() - def do_set_points_request_copy(self): - self.slSetPointsBloodFlowRate .setValue ( self.convert_to_int ( self.lbSetPointsReqBloodFlowRate.text() ) ) - self.slSetPointsDialysateFlowRate .setValue ( self.convert_to_int ( self.lbSetPointsReqDialysateFlowRate.text() ) ) - self.slSetPointsDialysateTemperature .setValue ( self.convert_to_float ( self.lbSetPointsReqDialysateTemperature.text() ) * 10 ) - self.sbSetPointsAcidConcentrate .setValue ( self.convert_to_int ( self.lbSetPointsReqAcidConcentrate.text() ) ) - self.sbSetPointsBicarbConcentrate .setValue ( self.convert_to_int ( self.lbSetPointsReqBicarbConcentrate.text() ) ) - - @Slot() def do_set_points_request_reset(self): self.lbSetPointsReqBloodFlowRate .setText("--") self.lbSetPointsReqDialysateFlowRate .setText("--") @@ -211,38 +147,21 @@ @Slot() def do_set_points_response_send(self): - self.td_interface.td_treatment_set_points_change_response( - self.sbSetPointsRspRejectionReason .value() , - self.slSetPointsBloodFlowRate .value() , - self.slSetPointsDialysateFlowRate .value() , - self.slSetPointsDialysateTemperature .value() / 10 , - self.sbSetPointsAcidConcentrate .value() , - self.sbSetPointsBicarbConcentrate .value() + self.td_interface.cmd_send_general_response( + message_id = MsgIds.MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE.value, + accepted = 1 if self.sbSetPointsRspRejectionReason.value() == 0 else 0, + reason = self.sbSetPointsRspRejectionReason.value(), + is_pure_data = False, + has_parameters = False, ) @Slot() def do_set_points_response_reset(self): - self.sbSetPointsRspRejectionReason .setValue(0) + self.sbSetPointsRspRejectionReason.setValue(0) @Slot() - def do_blood_flow_rate_reset(self): - self.do_blood_flow_rate_request_reset() - self.do_blood_flow_rate_response_reset() - - - @Slot() - def do_blood_flow_rate_request_copy(self): - self.slSetPointsBloodFlowRate.setValue(self.convert_to_int(self.lbBloodFlowRateReq.text())) - - - @Slot() - def do_blood_flow_rate_request_reset(self): - self.lbBloodFlowRateReq.setText("--") - - - @Slot() def handle_blood_flow_change_request(self, message, timestamp = 0.0): """ Called when the user requests blood flow rate change from UI @@ -251,39 +170,33 @@ message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 value,index = conversions.bytearray_to_integer(message, index) + print(f"*** I'm here {value}") # SQ self.lbBloodFlowRateReq.setText(f"{value}") @Slot() def do_blood_flow_rate_response_send(self): - self.td_interface.td_treatment_set_point_blood_flow_rate_change_response( - self.sbBloodFlowRateRspRejectionReason .value(), - self.slSetPointsBloodFlowRate .value() + self.td_interface.cmd_send_general_response( + message_id = MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_RESPONSE.value, + accepted = 1 if self.sbBloodFlowRateRspRejectionReason.value() == 0 else 0, + reason = self.sbBloodFlowRateRspRejectionReason.value(), + is_pure_data = False, + has_parameters = False, ) @Slot() def do_blood_flow_rate_response_reset(self): - self.sbBloodFlowRateRspRejectionReason.setValue(0) + self.lbBloodFlowRateReq .setText("--") + self.sbBloodFlowRateRspRejectionReason .setValue(0) @Slot() def do_dialysate_flow_rate_reset(self): - self.do_dialysate_flow_rate_request_reset() self.do_dialysate_flow_rate_response_reset() @Slot() - def do_dialysate_flow_rate_request_copy(self): - self.slSetPointsDialysateFlowRate.setValue(self.convert_to_int(self.lbDialysateFlowRateReq.text())) - - - @Slot() - def do_dialysate_flow_rate_request_reset(self): - self.lbDialysateFlowRateReq.setText("--") - - - @Slot() def handle_dialysate_flow_change_request(self, message, timestamp = 0.0): """ Called when the user requests dialysate flow rate change from UI @@ -297,34 +210,22 @@ @Slot() def do_dialysate_flow_rate_response_send(self): - self.td_interface.td_treatment_set_point_dialysate_flow_rate_change_response( - self.sbDialysateFlowRateRspRejectionReason .value(), - self.slSetPointsDialysateFlowRate .value() + self.td_interface.cmd_send_general_response( + message_id = MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_RESPONSE.value, + accepted = 1 if self.sbDialysateFlowRateRspRejectionReason.value() == 0 else 0, + reason = self.sbDialysateFlowRateRspRejectionReason.value(), + is_pure_data = False, + has_parameters = False, ) @Slot() def do_dialysate_flow_rate_response_reset(self): - self.sbDialysateFlowRateRspRejectionReason.setValue(0) + self.lbDialysateFlowRateReq .setText("--") + self.sbDialysateFlowRateRspRejectionReason .setValue(0) @Slot() - def do_dialysate_temperature_reset(self): - self.do_dialysate_temperature_request_reset() - self.do_dialysate_temperature_response_reset() - - - @Slot() - def do_dialysate_temperature_request_copy(self): - self.slSetPointsDialysateTemperature.setValue(self.convert_to_int(self.lbDialysateTemperatureReq.text()) * 10) - - - @Slot() - def do_dialysate_temperature_request_reset(self): - self.lbDialysateTemperatureReq.setText("--") - - - @Slot() def handle_dialysate_temperature_change_request(self, message, timestamp = 0.0): """ Called when the user requests dialysate temperature change from UI @@ -338,25 +239,16 @@ @Slot() def do_dialysate_temperature_response_send(self): - self.td_interface.td_treatment_set_point_dialysate_temperature_change_response( - self.sbDialysateTemperatureRspRejectionReason .value(), - self.slSetPointsDialysateTemperature .value() / 10 + self.td_interface.cmd_send_general_response( + message_id = MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_RESPONSE.value, + accepted = 1 if self.sbDialysateTemperatureRspRejectionReason.value() == 0 else 0, + reason = self.sbDialysateTemperatureRspRejectionReason.value(), + is_pure_data = False, + has_parameters = False, ) @Slot() def do_dialysate_temperature_response_reset(self): - self.sbDialysateTemperatureRspRejectionReason.setValue(0) - - - def convert_to_float(self, value): - try: - return float(value) - except ValueError: - return 0.0 - - def convert_to_int(self, value): - try: - return int(value) - except ValueError: - return 0 + self.lbDialysateTemperatureReq .setText("--") + self.sbDialysateTemperatureRspRejectionReason .setValue(0) Index: TD_TreatmentAdjustmentsUltrafiltration/interface.ui =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsUltrafiltration/interface.ui (.../interface.ui) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsUltrafiltration/interface.ui (.../interface.ui) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -6,8 +6,8 @@ 0 0 - 920 - 467 + 431 + 463 @@ -16,87 +16,201 @@ 100000 + + + 10 + + &3 Treatment/Adjustments/&4 Ultrafiltration - - - - - - 10 - - - - color: rgb(238, 238, 236); + + + + 0 + 20 + + + + + 10 + + + + color: rgb(238, 238, 236); background-color: rgb(92, 53, 102); - - - Ultrafiltration - - - Qt::AlignCenter - - - - - - - Send - - - - - - - Reset - - - - + + + Ultrafiltration + + + Qt::AlignCenter + + - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - + + + + 0 + 0 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + - + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + 66: [0x4200]: Settings Edit Response + + + Qt::AlignCenter + + + + + + + Send + + + + + + + Reset + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + Req [0x4100] +Volume (mL) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 10 + + + + QFrame::Box + + + QFrame::Raised + + + -- + + + Qt::AlignCenter + + + + + + + Reject Reason + + + + + + + Qt::AlignCenter + + + + + + + Volume (mL) + + + + + - + + + + 250 + 0 + + + + 8000 + + + Qt::Horizontal + + + + + - + 0 0 - 352 + 50 0 @@ -105,894 +219,250 @@ 10 - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - 62 : [0x3E00] : Ultrafiltration Data + 0.00 Qt::AlignCenter - - - - Send - - - - - - - Reset - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + Duration (min) - - - - Set Volume (L) + + + + + + + + + 250 + 0 + - - - - - - - - - 0 - 0 - - - - - 250 - 0 - - - - 1000 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 40 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Target Rate (L/Hr) + + 4800 - - - - - - - - - 0 - 0 - - - - - 250 - 0 - - - - 1000 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 40 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Volume Delivered (L) + + Qt::Horizontal - - - - - - - 0 - 0 - - - - - 250 - 0 - - - - 800 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 40 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - State - - - - - + + - + 0 0 - - Qt::AlignCenter + + + 50 + 0 + - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - 10 - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - 66: [0x4200]: Settings Change Response + 0.00 Qt::AlignCenter - - - - Send - - - - - - - Reset - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + Time Diff - - - - Req [0x4100] -Volume (mL) + + + + + + + + + 250 + 0 + - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + 4800 + + Qt::Horizontal + - - + + + + + 0 + 0 + + + + + 50 + 0 + + 10 - - QFrame::Box - - - QFrame::Raised - - -- + 0.00 Qt::AlignCenter - - - - Response - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 10 - - - 5 - - - 2 - - - 5 - - - 2 - - - - - - 10 - - - - Accept - - - true - - - - - - - - 10 - - - - Reject - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Reject Reason - - - - - - - Qt::AlignCenter - - - - - - - Volume (mL) - - - - - - - - - - 250 - 0 - - - - 8000 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Duration (min) - - - - - - - - - - 250 - 0 - - - - 4800 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Time Diff - - - - - - - - - - 250 - 0 - - - - 4800 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Rate (L/Hr) - - - - - - - - - 2000 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Rate Diff (L/Hr) - - - - - - - - - 2000 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Old Rate (L/Hr) - - - - - - - - - 2000 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Qt::Vertical + + + + Rate (L/Hr) - - - 0 - 0 - - - + - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - 2 - - - + + - + + + 2000 + + + Qt::Horizontal + + + + + - + 0 0 + + + 50 + 0 + + 10 - - color: rgb(238, 238, 236); -background-color: rgb(92, 53, 102); - - 72: [0x4800]: Pause/Resume Response + 0.00 Qt::AlignCenter - - - - Send - - - - - - - Reset - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + Rate Diff (L/Hr) - - - - Req [0x4700] + + + + + + + + 2000 - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + Qt::Horizontal - - + + + + + 0 + 0 + + + + + 50 + 0 + + 10 - - QFrame::Box - - - QFrame::Raised - - -- + 0.00 Qt::AlignCenter - - - - Response + + + + + + Old Rate (L/Hr) + + + + + + + + + 2000 + + Qt::Horizontal + - - + + + + + 0 + 0 + + - 0 + 50 0 @@ -1001,450 +471,301 @@ 10 - - QFrame::StyledPanel - - - QFrame::Raised - - - - 10 - - - 5 - - - 2 - - - 5 - - - 2 - - - - - - 10 - - - - Accept - - - true - - - - - - - - 10 - - - - Reject - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Reject Reason + 0.00 - - - - Qt::AlignCenter + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + - - - Qt::Vertical + + + + 0 + 0 + - - - 0 - 0 - + + + 10 + - + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + 72: [0x4800]: Pause/Resume Response + + + Qt::AlignCenter + + + + + + Send + + + + + + + Reset + + + - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - 2 + + + + Req [0x4700] + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 10 + + + + QFrame::Box + + + QFrame::Raised + + + -- + + + Qt::AlignCenter + + + + + + + Reject Reason + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Vertical - - 2 + + + 0 + 0 + - - 2 - - - 2 - + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + - - - - - - 10 - - - - color: rgb(238, 238, 236); + + + + 10 + + + + color: rgb(238, 238, 236); background-color: rgb(92, 53, 102); - - - 103: [0x6700]: Confirm Response - - - Qt::AlignCenter - - - - - - - Send - - - - - - - Reset - - - - + + + 103: [0x6700]: Confirm Response + + + Qt::AlignCenter + + - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + Send - - - - Req [0x6600] -Volume (mL) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 10 - - - - QFrame::Box - - - QFrame::Raised - - - -- - - - Qt::AlignCenter - - - - - - - Response - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 10 - - - 5 - - - 2 - - - 5 - - - 2 - - - - - - 10 - - - - Accept - - - true - - - - - - - - 10 - - - - Reject - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Reject Reason - - - - - - - Qt::AlignCenter - - - - - - - Volume (mL) - - - - - - - - - - 250 - 0 - - - - Qt::Horizontal - - - - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Duration (min) - - - - - - - - - - 250 - 0 - - - - Qt::Horizontal - - - - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - - - - Rate (L/Hr) - - - - - - - - - - 250 - 0 - - - - Qt::Horizontal - - - - - - - - 50 - 0 - - - - - 10 - - - - 0.00 - - - Qt::AlignCenter - - - - - - + - - - Qt::Vertical + + + Reset - - - 0 - 0 - + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + Req [0x6600] +Volume (mL) - + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 10 + + + + QFrame::Box + + + QFrame::Raised + + + -- + + + Qt::AlignCenter + + + + + + + Reject Reason + + + + + + + Qt::AlignCenter + + + - - - + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + - - allSendButton - allResetButton - Index: TD_TreatmentAdjustmentsUltrafiltration/loader.py =================================================================== diff -u -r3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1 -r5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd --- TD_TreatmentAdjustmentsUltrafiltration/loader.py (.../loader.py) (revision 3a57fe707c4cba4a4f3e3b2d4d22e43e38b562d1) +++ TD_TreatmentAdjustmentsUltrafiltration/loader.py (.../loader.py) (revision 5bcfcac949d3a6c28ea9555ec5dcf7de978a06fd) @@ -55,29 +55,14 @@ """ self.uf_scaling = 100.00 # UF Scaling factor to be 2 decimal places - self.allSend = self.find_widget(QtWidgets.QToolButton , 'allSendButton' ) - self.allReset = self.find_widget(QtWidgets.QToolButton , 'allResetButton' ) - - self.ufDataSend = self.find_widget(QtWidgets.QToolButton, 'ufDataSendButton' ) - self.ufDataReset = self.find_widget(QtWidgets.QToolButton, 'ufDataResetButton' ) - self.ufSetVolume = self.find_widget(QtWidgets.QSlider , 'ufSetVolumeSlider' ) - self.ufTargetRate = self.find_widget(QtWidgets.QSlider , 'ufTargetRateSlider' ) - self.ufVolumeDelivered = self.find_widget(QtWidgets.QSlider , 'ufVolumeDeliveredSlider' ) - self.ufState = self.find_widget(QtWidgets.QSpinBox , 'ufStateSpinBox' ) - self.ufSetVolumeLabel = self.find_widget(QtWidgets.QLabel , 'ufSetVolumeLabel' ) - self.ufTargetRateLabel = self.find_widget(QtWidgets.QLabel , 'ufTargetRateLabel' ) - self.ufVolumeDeliveredLabel = self.find_widget(QtWidgets.QLabel , 'ufVolumeDeliveredLabel' ) - self.prSend = self.find_widget(QtWidgets.QToolButton , 'prSendButton' ) self.prReset = self.find_widget(QtWidgets.QToolButton , 'prResetButton' ) self.prRequestLabel = self.find_widget(QtWidgets.QLabel , 'prRequestLabel' ) - self.prAccepted = self.find_widget(QtWidgets.QRadioButton , 'prAcceptRadioButton' ) self.prRejectReason = self.find_widget(QtWidgets.QSpinBox , 'prRejectReasonSpinBox' ) self.changeSend = self.find_widget(QtWidgets.QToolButton , 'changeSendButton' ) self.changeReset = self.find_widget(QtWidgets.QToolButton , 'changeResetButton' ) self.changeRequestLabel = self.find_widget(QtWidgets.QLabel , 'changeRequestLabel' ) - self.changeAccepted = self.find_widget(QtWidgets.QRadioButton , 'changeAcceptRadioButton' ) self.changeRejectReason = self.find_widget(QtWidgets.QSpinBox , 'changeRejectReasonSpinBox' ) self.changeVolume = self.find_widget(QtWidgets.QSlider , 'changeVolumeSlider' ) self.changeVolumeLabel = self.find_widget(QtWidgets.QLabel , 'changeVolumeLabel' ) @@ -95,30 +80,13 @@ self.confirmSend = self.find_widget(QtWidgets.QToolButton , 'confirmSendButton' ) self.confirmReset = self.find_widget(QtWidgets.QToolButton , 'confirmResetButton' ) self.confirmRequestLabel = self.find_widget(QtWidgets.QLabel , 'confirmRequestLabel' ) - self.confirmAccepted = self.find_widget(QtWidgets.QRadioButton , 'confirmAcceptRadioButton' ) self.confirmRejectReason = self.find_widget(QtWidgets.QSpinBox , 'confirmRejectReasonSpinBox' ) - self.confirmVolume = self.find_widget(QtWidgets.QSlider , 'confirmVolumeSlider' ) - self.confirmVolumeLabel = self.find_widget(QtWidgets.QLabel , 'confirmVolumeLabel' ) - self.confirmDuration = self.find_widget(QtWidgets.QSlider , 'confirmDurationSlider' ) - self.confirmDurationLabel = self.find_widget(QtWidgets.QLabel , 'confirmDurationLabel' ) - self.confirmRate = self.find_widget(QtWidgets.QSlider , 'confirmRateSlider' ) - self.confirmRateLabel = self.find_widget(QtWidgets.QLabel , 'confirmRateLabel' ) def _init_connections(self): """ initializes the widgets connections :return: none """ - self.allReset .clicked.connect(self._init_widgets) - self.allSend .clicked.connect(self.do_all_tx_data) - - self.ufDataSend .clicked.connect(self.do_uf_data) - self.ufDataReset .clicked.connect(self.init_uf_data) - self.ufSetVolume .valueChanged.connect(self.do_uf_data) - self.ufTargetRate .valueChanged.connect(self.do_uf_data) - self.ufVolumeDelivered .valueChanged.connect(self.do_uf_data) - self.ufState .valueChanged.connect(self.do_uf_data) - self.prSend.clicked.connect(self.do_pause_resume) self.prReset.clicked.connect(self.init_pause_resume) @@ -133,62 +101,24 @@ self.confirmSend.clicked.connect(self.do_confirm) self.confirmReset.clicked.connect(self.init_confirm) - self.confirmVolume.valueChanged.connect(lambda value: self.confirmVolumeLabel.setText(f"{value/1000:.2f}")) - self.confirmDuration.valueChanged.connect(lambda value: self.confirmDurationLabel.setText(f"{value}")) - self.confirmRate.valueChanged.connect(lambda value: self.confirmRateLabel.setText(f"{value/1000:.2f}")) @Slot() def _init_widgets(self): """ initializes the widgets' properties :return: none """ - self.init_uf_data() self.init_settings_change() self.init_pause_resume() self.init_confirm() @Slot() - def init_uf_data(self): - """ - slot for initializing UF settings change - :return: none - """ - self.ufSetVolume .setValue(0) - self.ufTargetRate .setValue(0) - self.ufVolumeDelivered .setValue(0) - self.ufState .setValue(0) - - @Slot() - def do_uf_data(self): - """ - the slot for UF Data - :return: none - """ - set_volume = self.ufSetVolume .value() / self.uf_scaling - target_rate = self.ufTargetRate .value() / self.uf_scaling - volume_delivered = self.ufVolumeDelivered.value() / self.uf_scaling - state = self.ufState .value() - - self.ufSetVolumeLabel .setText(f"{set_volume:.2f}" ) - self.ufTargetRateLabel .setText(f"{target_rate:.2f}" ) - self.ufVolumeDeliveredLabel .setText(f"{volume_delivered:.2f}" ) - - self.td_interface.td_ultrafiltration( - set_volume , - target_rate , - volume_delivered , - state - ) - - @Slot() def init_settings_change(self): """ slot for initializing UF settings change :return: none """ self.changeRequestLabel .setText("--") - self.changeAccepted .setChecked(True) self.changeRejectReason .setValue(0) self.changeVolume .setValue(0) self.changeDuration .setValue(0) @@ -214,7 +144,7 @@ slot for UF settings change :return: none """ - payload = conversions.integer_to_bytearray(int(1 if self.changeAccepted.isChecked() else 0)) + payload = conversions.integer_to_bytearray(1 if self.changeRejectReason.value() == 0 else 0) payload += conversions.integer_to_bytearray(self.changeRejectReason.value()) payload += conversions.float_to_bytearray(self.changeVolume.value()) payload += conversions.integer_to_bytearray(self.changeDuration.value()) @@ -225,7 +155,7 @@ self.td_interface.cmd_send_general_response( message_id = MsgIds.MSG_ID_TD_RESP_ULTRAFILTRATION_VOLUME_TO_VALIDATE.value, - accepted = 1 if self.changeAccepted.isChecked() else 0, + accepted = 1 if self.changeRejectReason.value() == 0 else 0, reason = self.changeRejectReason.value(), is_pure_data = False, has_parameters = True, @@ -239,7 +169,6 @@ :return: none """ self.prRequestLabel .setText("--") - self.prAccepted .setChecked(True) self.prRejectReason .setValue(0) @Slot() @@ -261,7 +190,7 @@ """ self.td_interface.cmd_send_general_response( message_id = MsgIds.MSG_ID_TD_UF_PAUSE_RESUME_RESPONSE.value, - accepted = 1 if self.prAccepted.isChecked() else 0, + accepted = 1 if self.prRejectReason.value() == 0 else 0, reason = self.prRejectReason.value() ) @@ -272,11 +201,7 @@ :return: none """ self.confirmRequestLabel .setText("--") - self.confirmAccepted .setChecked(True) self.confirmRejectReason .setValue(0) - self.confirmVolume .setValue(0) - self.confirmDuration .setValue(0) - self.confirmRate .setValue(0) @Slot() def handle_confirm_request(self, message, timestamp = 0.0): @@ -295,28 +220,14 @@ slot for UF confirm :return: none """ - payload = conversions.integer_to_bytearray(int(1 if self.confirmAccepted.isChecked() else 0)) + payload = conversions.integer_to_bytearray(1 if self.confirmRejectReason.value() == 0 else 0) payload += conversions.integer_to_bytearray(self.confirmRejectReason.value()) - payload += conversions.float_to_bytearray(self.confirmVolume.value()) - payload += conversions.integer_to_bytearray(self.confirmDuration.value()) - payload += conversions.float_to_bytearray(self.confirmRate.value()/1000) self.td_interface.cmd_send_general_response( message_id = MsgIds.MSG_ID_USER_UF_SETTINGS_CHANGE_CONFIRMATION_RESPONSE.value, - accepted = 1 if self.confirmAccepted.isChecked() else 0, + accepted = 1 if self.confirmRejectReason.value() == 0 else 0, reason = self.confirmRejectReason.value(), is_pure_data = False, has_parameters = True, parameters_payload = payload ) - - @Slot() - def do_all_tx_data(self): - """ - slot for treatment set point Data - :return: none - """ - self.do_uf_data() - self.do_settings_change() - self.do_pause_resume() - self.do_confirm()