Index: simulator/plugins/recirculate/loader.py =================================================================== diff -u -r370f52c41992e2fbdc428376efb02b6f61e3b245 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/recirculate/loader.py (.../loader.py) (revision 370f52c41992e2fbdc428376efb02b6f61e3b245) +++ simulator/plugins/recirculate/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,16 +1,19 @@ """ The Heparin ui loader class """ +# Python import os -from simulator.dynamicloader import DynamicLoader - +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from dialin.ui.hd_simulator import HDSimulator, TXStates +# plugin specific +# -- none -- -from dialin.ui.hd_simulator import HDSimulator -from dialin.ui.hd_simulator import TXStates - class Loader(DynamicLoader): """ The Saline Bolus ui loader class @@ -35,7 +38,13 @@ finds and creates widgets :return: none """ - # rinseback data + # recirculate adjustment + self.btnAccept = self.find_button('btnAccept') + self.btnReject = self.find_button('btnReject') + self.lblAction = self.find_label('lblAction') + self.spnRejectReason = self.find_spinbox('spnRejectReason') + + # recirculate data self.sldTimeoutTotal = self.find_slider('sldTimeoutTotal') self.sldTimeoutCountDown = self.find_slider('sldTimeoutCountDown') @@ -51,10 +60,33 @@ initializes the widgets connections :return: """ + + self.btnAccept.clicked.connect(self.do_accept) + self.btnReject.clicked.connect(self.do_reject) + self.sldTimeoutTotal.valueChanged.connect(self.do_data) self.sldTimeoutCountDown.valueChanged.connect(self.do_data) @Slot() + def do_accept(self): + """ + the slot for accept button + :return: none + """ + self.hd_simulator.cmd_send_treatment_adjust_recirculate_response(True, 0) + self.lblAction.setText('Accepted ') + + @Slot() + def do_reject(self): + """ + the slot for accept saline bolus button + :return: none + """ + reason = self.spnRejectReason.value() + self.hd_simulator.cmd_send_treatment_adjust_recirculate_response(False, reason) + self.lblAction.setText('Rejected ' + "{}".format(reason)) + + @Slot() def do_data(self): """ the slot which is called to send the data @@ -63,5 +95,4 @@ """ timeout_total = self.sldTimeoutTotal.value() timeout_countdown = self.sldTimeoutCountDown.value() - self.hd_simulator.cmd_send_treatment_recirculate_data(timeout_total, timeout_countdown)