Index: TD_Post_Treatment/interface.ui
===================================================================
diff -u -re7b0bdd0190ebfcee1681e7c8320e923b8ac9f0d -rb0db89757f584c9392c903594523ce550b7e144a
--- TD_Post_Treatment/interface.ui (.../interface.ui) (revision e7b0bdd0190ebfcee1681e7c8320e923b8ac9f0d)
+++ TD_Post_Treatment/interface.ui (.../interface.ui) (revision b0db89757f584c9392c903594523ce550b7e144a)
@@ -6,8 +6,8 @@
0
0
- 545
- 90
+ 508
+ 268
@@ -22,21 +22,137 @@
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 352
+ 0
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(191, 98, 163);
+
+
+
+ 149 : [0x9500] : Auto Eject
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 100
+ 16777215
+
+
+
+ Send
+
+
+
+ -
+
+
+ Accepted
+
+
+ true
+
+
+
+ -
+
+
+
+ 100
+ 16777215
+
+
+
+ Send
+
+
+
-
-
-
- Qt::Horizontal
+
+
+
+ 0
+ 0
+
-
+
+ Req [0xA8]
+
+
+
+ -
+
+
- 40
- 20
+ 0
+ 0
-
+
+ Reason
+
+
+ -
+
+
+ 900
+
+
+
+ -
+
+
+
+ 15
+
+
+
+ false
+
+
+ color: rgb(238, 238, 236);
+background-color:rgb(191, 98, 114)
+
+
+ Post-Treatment
+
+
+ Qt::AlignCenter
+
+
+
-
-
+
0
@@ -66,73 +182,133 @@
- -
-
-
- Qt::Horizontal
+
-
+
+
+ 900
-
+
+
+ -
+
+
+ Accepted
+
+
+ true
+
+
+
+ -
+
+
- 40
- 20
+ 100
+ 16777215
-
+
+ Send
+
+
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
- 0
+ 100
0
+
+ false
+
+
+ QFrame::WinPanel
+
+
+ QFrame::Sunken
+
- Reason
+ -
-
-
- -
-
-
- 900
+
+ Qt::AlignCenter
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 352
+ 0
+
+
- 100
+ 16777215
16777215
-
- Send
-
-
-
- -
-
10
color: rgb(238, 238, 236);
-background-color:rgb(173, 127, 168)
+background-color: rgb(191, 98, 163);
+
- Post-Treatment
+ 169 : [0xA900] : Patient Disconnect Confirm
Qt::AlignCenter
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Reason
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Req [0xA6]
+
+
+
+ -
+
0
@@ -158,17 +334,91 @@
color: rgb(238, 238, 236);
-background-color: rgb(92, 53, 102);
+background-color: rgb(191, 98, 163);
- 148 : [0x9400] : Auto Eject
+ 167 : [0xA700] : Treatment Review Logs
Qt::AlignCenter
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Req[0x94]
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 0
+
+
+
+ false
+
+
+ QFrame::WinPanel
+
+
+ QFrame::Sunken
+
+
+ -
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Reason
+
+
+
+ -
+
+
+ Accepted
+
+
+ true
+
+
+
+ -
+
+
+ 900
+
+
+
Index: TD_Post_Treatment/loader.py
===================================================================
diff -u -re7b0bdd0190ebfcee1681e7c8320e923b8ac9f0d -rb0db89757f584c9392c903594523ce550b7e144a
--- TD_Post_Treatment/loader.py (.../loader.py) (revision e7b0bdd0190ebfcee1681e7c8320e923b8ac9f0d)
+++ TD_Post_Treatment/loader.py (.../loader.py) (revision b0db89757f584c9392c903594523ce550b7e144a)
@@ -38,23 +38,46 @@
eject_request_message_id,
self.handle_eject_request)
+ if self.can_interface is not None:
+ self.can_interface.register_receiving_publication_function(channel_id,
+ MsgIds.MSG_ID_UI_ADJUST_PATIENT_DISCONNECT_CONFIRM_REQUEST.value,
+ self.handle_patient_disconnect_request)
+
+ if self.can_interface is not None:
+ self.can_interface.register_receiving_publication_function(channel_id,
+ MsgIds.MSG_ID_UI_ADJUST_TREATMENT_LOGS_REQUEST.value,
+ self.handle_tx_logs_request)
def _init_loader(self):
"""
finds and creates widgets
:return: none
"""
self.btnAutoEject = self.find_widget(QtWidgets.QPushButton, 'btnAutoEjectSend' )
self.spnAutoEjectRejectReason = self.find_widget(QtWidgets.QSpinBox , 'spnEjectReasonSpinBox' )
+ self.cbEjectAccepted = self.find_widget(QtWidgets.QCheckBox , 'cbEjectAccepted' )
self.lbAutoEject = self.find_widget(QtWidgets.QLabel , 'lbAutoEject' )
+ self.btnPatientDisconnectSend = self.find_widget(QtWidgets.QPushButton, 'btnPatientDisconnectSend' )
+ self.spnPatientDisconnectReasonSpinBox = self.find_widget(QtWidgets.QSpinBox , 'spnPatientDisconnectReasonSpinBox' )
+ self.cbPatientDisconnectAccepted = self.find_widget(QtWidgets.QCheckBox , 'cbPatientDisconnectAccepted' )
+ self.lbPatientDisconnect = self.find_widget(QtWidgets.QLabel , 'lbPatientDisconnect' )
+
+ self.lbTxLogs = self.find_widget(QtWidgets.QLabel , 'lbTxLogs' )
+ self.btnTxLogsSend = self.find_widget(QtWidgets.QPushButton, 'btnTxLogsSend' )
+ self.spnTxLogsReasonSpinBox = self.find_widget(QtWidgets.QSpinBox , 'spnTxLogsReasonSpinBox' )
+ self.cbTxLogsAccepted = self.find_widget(QtWidgets.QCheckBox , 'cbTxLogsAccepted' )
+
def _init_connections(self):
"""
initializes the widgets connections
:return: none
"""
- self.btnAutoEject .clicked.connect(self.do_auto_eject)
+ self.btnAutoEject .clicked.connect(self.do_auto_eject )
+ self.btnPatientDisconnectSend .clicked.connect(self.do_patient_disconnect )
+ self.btnTxLogsSend .clicked.connect(self.do_treatment_logs )
+
def _init_widgets(self):
"""
initializes the widgets' properties
@@ -65,8 +88,9 @@
@Slot()
def do_auto_eject(self):
- reason = self.spnAutoEjectRejectReason.value()
- self.td_interface.td_blood_set_auto_eject_response(reason)
+ accepted = self.cbEjectAccepted .isChecked()
+ reason = self.spnAutoEjectRejectReason .value()
+ self.td_interface.td_blood_set_auto_eject_response(accepted, reason)
self.lbAutoEject.setText("-")
@Slot()
@@ -77,3 +101,36 @@
"""
self.lbAutoEject.setText("Requested")
+
+ @Slot()
+ def do_patient_disconnect(self):
+ accepted = self.cbPatientDisconnectAccepted .isChecked()
+ reason = self.spnPatientDisconnectReasonSpinBox .value()
+ self.td_interface.td_patient_disconnect_confirm_response(accepted, reason)
+ self.lbPatientDisconnect.setText("-")
+
+
+ @Slot()
+ def handle_patient_disconnect_request(self, message, timestamp = 0.0):
+ """
+ Called when the user requests to firmware from UI
+ @return: None
+ """
+ self.lbPatientDisconnect.setText("Requested")
+
+
+ @Slot()
+ def do_treatment_logs(self):
+ accepted = self.cbTxLogsAccepted .isChecked()
+ reason = self.spnTxLogsReasonSpinBox .value()
+ self.td_interface.td_patient_disconnect_confirm_response(accepted, reason)
+ self.lbTxLogs.setText("-")
+
+
+ @Slot()
+ def handle_tx_logs_request(self, message, timestamp = 0.0):
+ """
+ Called when the user requests to firmware from UI
+ @return: None
+ """
+ self.lbTxLogs.setText("Requested")
\ No newline at end of file