Index: simulator/plugins/alarms/loader.py =================================================================== diff -u -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/alarms/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18) +++ simulator/plugins/alarms/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,14 +1,22 @@ """ The Alarms ui loader class container file """ + +# shall be removed later +from dialin.squish import denaliMessages + +# Python import os -from simulator.dynamicloader import DynamicLoader +from datetime import datetime +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot, QObject, Qt -from dialin.squish import denaliMessages -from datetime import datetime -from dialin.common.prs_defs import AlarmPriority +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator from dialin.ui.hd_simulator import HDSimulator +# plugin specific +from dialin.common.prs_defs import AlarmPriority class Loader(DynamicLoader): Index: simulator/plugins/bloodPrime/loader.py =================================================================== diff -u -r946ef354fad2014bd50283cbb817c17e392760b3 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/bloodPrime/loader.py (.../loader.py) (revision 946ef354fad2014bd50283cbb817c17e392760b3) +++ simulator/plugins/bloodPrime/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,14 +1,18 @@ """ The Heparin ui loader class """ -import os -from simulator.dynamicloader import DynamicLoader +# Python +import os +# 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 -from dialin.ui.hd_simulator import TXStates +# plugin specific +# -- none -- class Loader(DynamicLoader): Index: simulator/plugins/createtreatment/loader.py =================================================================== diff -u -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/createtreatment/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18) +++ simulator/plugins/createtreatment/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,12 +1,17 @@ """ The Heparin ui loader class """ +# Python import os -from simulator.dynamicloader import DynamicLoader +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot -from dialin.squish import denaliMessages +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator from dialin.ui.hd_simulator import HDSimulator +# plugin specific +# -- None -- class Loader(DynamicLoader): @@ -27,6 +32,7 @@ def __init__(self, hd_simulator: HDSimulator): super().__init__(os.path.dirname(__file__), hd_simulator) + print(" ---------- ", self.hd_simulator) def _init_loader(self): """ @@ -101,14 +107,3 @@ volume = self.sldUFVolume.value() self.hd_simulator.cmd_send_uf_treatment_response(False, reason, volume) self.lblCreateAction.setText('Rejected ' + "{}".format(reason)) - - @Slot() - def do_data(self, value): - """ - the slot which is called to send the data - by calling the denaliMessage API setTreatmentHeparinData - :return: none - """ - volume = value * 0.1 - denaliMessages.setTreatmentHeparinData(volume) - self.lblCumulative.setNum(volume) Index: simulator/plugins/heparin/loader.py =================================================================== diff -u -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/heparin/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18) +++ simulator/plugins/heparin/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,13 +1,17 @@ """ The Heparin ui loader class """ +# Python import os -from simulator.dynamicloader import DynamicLoader +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot -from dialin.squish import denaliMessages -from dialin.squish.denaliMessages import txStates -from dialin.ui.hd_simulator import HDSimulator +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from dialin.ui.hd_simulator import HDSimulator, TXStates +# plugin specific +# -- None -- class Loader(DynamicLoader): @@ -22,12 +26,12 @@ spnRejectReason: QtWidgets.QSpinBox sldCumulative: QtWidgets.QSlider - requested_state: txStates + requested_state: TXStates def __init__(self, hd_simulator: HDSimulator): super().__init__(os.path.dirname(__file__), hd_simulator) print(" ---------- ", self.hd_simulator) - self.requested_state = txStates.HEPARIN_STATE_PAUSED + self.requested_state = TXStates.HEPARIN_STATE_PAUSED def _init_loader(self): """ @@ -68,12 +72,12 @@ :return: none """ # toggle the requested state - if self.requested_state == txStates.HEPARIN_STATE_DISPENSING: - self.requested_state = txStates.HEPARIN_STATE_PAUSED + if self.requested_state == TXStates.HEPARIN_STATE_DISPENSING: + self.requested_state = TXStates.HEPARIN_STATE_PAUSED else: - self.requested_state = txStates.HEPARIN_STATE_DISPENSING + self.requested_state = TXStates.HEPARIN_STATE_DISPENSING - denaliMessages.setHeparinResponse(True, 0, self.requested_state) + self.hd_simulator.cmd_set_heparin_pause_resume_response(True, 0, self.requested_state) self.lblAction.setText('Accepted ') @Slot() @@ -83,7 +87,7 @@ :return: none """ reason = self.spnRejectReason.value() - denaliMessages.setHeparinResponse(False, reason, self.requested_state) + self.hd_simulator.cmd_set_heparin_pause_resume_response(False, reason, self.requested_state) self.lblAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -94,5 +98,5 @@ :return: none """ volume = value * 0.1 - denaliMessages.setTreatmentHeparinData(volume) + self.hd_simulator.cmd_set_treatment_heparin_data(volume) self.lblCumulative.setNum(volume) Index: simulator/plugins/inlinebloodpressures/loader.py =================================================================== diff -u -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/inlinebloodpressures/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18) +++ simulator/plugins/inlinebloodpressures/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,14 +1,17 @@ """ The In-Line Blood Pressure ui class """ +# Python import os -from simulator.dynamicloader import DynamicLoader +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot -from dialin.squish import denaliMessages -from dialin.squish.denaliMessages import txStates, EResponse +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from dialin.ui.hd_simulator import HDSimulator, TXStates +# plugin specific from dialin.common import Ranges -from dialin.ui.hd_simulator import HDSimulator class Loader(DynamicLoader): @@ -38,7 +41,7 @@ def __init__(self, hd_simulator: HDSimulator): super().__init__(os.path.dirname(__file__), hd_simulator) print(" ---------- ", self.hd_simulator) - self.saline_requested_state = txStates.SALINE_BOLUS_STATE_IDLE + self.saline_requested_state = TXStates.SALINE_BOLUS_STATE_IDLE def _init_loader(self): """ @@ -124,7 +127,7 @@ sends the pressures values message with given value on the screen :return: none """ - denaliMessages.setPressureOcclusionData( + self.hd_simulator.cmd_set_pressure_occlusion_data( self.sldArterialValue.value(), self.sldVenousValue.value(), 0, 0, 0 @@ -137,8 +140,8 @@ :return: none """ # vAccepted, vReason, vArterialLow, vArterialHigh, vVenousLow, vVenousHigh - denaliMessages.sendTreatmentAdjustPressuresLimitsResponse( - EResponse.Accepted, 0, + self.hd_simulator.cmd_send_treatment_adjust_pressures_limit_response( + True, 0, self.spnArterialLimitLow.value(), self.spnArterialLimitHigh.value(), self.spnVenousLimitLow.value(), @@ -153,8 +156,8 @@ :return: none """ reason = self.spnAVPressuresRejectReason.value() - denaliMessages.sendTreatmentAdjustPressuresLimitsResponse( - EResponse.Rejected, reason, + self.hd_simulator.cmd_send_treatment_adjust_pressures_limit_response( + False, reason, self.spnArterialLimitLow.value(), self.spnArterialLimitHigh.value(), self.spnVenousLimitLow.value(), Index: simulator/plugins/recirculate/interface.ui =================================================================== diff -u -r370f52c41992e2fbdc428376efb02b6f61e3b245 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/recirculate/interface.ui (.../interface.ui) (revision 370f52c41992e2fbdc428376efb02b6f61e3b245) +++ simulator/plugins/recirculate/interface.ui (.../interface.ui) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -6,8 +6,8 @@ 0 0 - 427 - 112 + 356 + 188 @@ -33,22 +33,124 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + + + + + 10 + + + + Reject + + + + + + + + 10 + + + + Accept + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + + + + 0 + 0 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(173, 127, 168); + + + Recirculate Adjustment + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 10 + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 10 + + + + reason + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + @@ -195,6 +297,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + 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) Index: simulator/plugins/rinseback/loader.py =================================================================== diff -u -r370f52c41992e2fbdc428376efb02b6f61e3b245 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/rinseback/loader.py (.../loader.py) (revision 370f52c41992e2fbdc428376efb02b6f61e3b245) +++ simulator/plugins/rinseback/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 @@ -38,7 +41,7 @@ finds and creates widgets :return: none """ - # saline adjustment + # rinseback adjustment self.btnAccept = self.find_button('btnAccept') self.btnReject = self.find_button('btnReject') self.lblAction = self.find_label('lblAction') @@ -62,10 +65,10 @@ initializes the widgets connections :return: """ - # saline adjustment + # rinseback adjustment self.btnAccept.clicked.connect(self.do_accept) self.btnReject.clicked.connect(self.do_reject) - # saline data + # rinseback data self.sldTarget.valueChanged.connect(self.do_data) self.sldCurrent.valueChanged.connect(self.do_data) self.sldRate.valueChanged.connect(self.do_data) @@ -78,14 +81,8 @@ the slot for accept button :return: none """ - # toggle the requested state - # if self.requested_state == TXStates.Rinseba: - # self.requested_state = TXStates.HEPARIN_STATE_PAUSED - # else: - # self.requested_state = TXStates.HEPARIN_STATE_DISPENSING - # - # self.hd_simulator.setHeparinResponse(True, 0, self.requested_state) - # self.lblAction.setText('Accepted ') + self.hd_simulator.cmd_send_treatment_adjust_rinseback_response(True, 0) + self.lblAction.setText('Accepted ') @Slot() def do_reject(self): Index: simulator/plugins/salinebolus/loader.py =================================================================== diff -u -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/salinebolus/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18) +++ simulator/plugins/salinebolus/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,13 +1,17 @@ """ The Saline Bolus ui loader class """ +# Python import os -from simulator.dynamicloader import DynamicLoader +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot -from dialin.squish import denaliMessages -from dialin.squish.denaliMessages import txStates -from dialin.ui.hd_simulator import HDSimulator +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from dialin.ui.hd_simulator import HDSimulator, TXStates +# plugin specific +# -- none -- class Loader(DynamicLoader): @@ -24,12 +28,12 @@ sldSalineCumulative: QtWidgets.QSlider sldSalineVolume: QtWidgets.QSlider - saline_requested_state: txStates + saline_requested_state: TXStates def __init__(self, hd_simulator: HDSimulator): super().__init__(os.path.dirname(__file__), hd_simulator) print(" ---------- ", self.hd_simulator) - self.saline_requested_state = txStates.SALINE_BOLUS_STATE_IDLE + self.saline_requested_state = TXStates.SALINE_BOLUS_STATE_IDLE def _init_loader(self): """ @@ -74,13 +78,15 @@ :return: none """ # toggle the saline requested state - if self.saline_requested_state == txStates.SALINE_BOLUS_STATE_IN_PROGRESS: - self.saline_requested_state = txStates.SALINE_BOLUS_STATE_IDLE + if self.saline_requested_state == TXStates.SALINE_BOLUS_STATE_IN_PROGRESS: + self.saline_requested_state = TXStates.SALINE_BOLUS_STATE_IDLE else: - self.saline_requested_state = txStates.SALINE_BOLUS_STATE_IN_PROGRESS + self.saline_requested_state = TXStates.SALINE_BOLUS_STATE_IN_PROGRESS target = self.cmbSalineAcceptTarget.currentText() - denaliMessages.setSalineBolusResponse(True, 0, target, self.saline_requested_state) + self.hd_simulator.cmd_set_saline_bolus_response( + True, 0, int(target), self.saline_requested_state + ) self.lblSalineAction.setText('Accepted ' + target) @Slot() @@ -90,17 +96,20 @@ :return: none """ reason = self.spnSalineRejectReason.value() - denaliMessages.setSalineBolusResponse(False, reason, 0, self.saline_requested_state) + self.hd_simulator.cmd_set_saline_bolus_response( + False, reason, 0, self.saline_requested_state + ) self.lblSalineAction.setText('Rejected ' + "{}".format(reason)) - @Slot() def do_saline_data(self): """ the slot which is called to send the saline bolus data by calling the denaliMessage API setTreatmentSalineBolusData :return: none """ - denaliMessages.setTreatmentSalineBolusData(self.sldSalineTarget.value(), - self.sldSalineCumulative.value(), - self.sldSalineVolume.value()) + self.hd_simulator.cmd_set_treatment_saline_bolus_data( + self.sldSalineTarget.value(), + self.sldSalineCumulative.value(), + self.sldSalineVolume.value() + ) Index: simulator/plugins/treatmentend/interface.ui =================================================================== diff -u --- simulator/plugins/treatmentend/interface.ui (revision 0) +++ simulator/plugins/treatmentend/interface.ui (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -0,0 +1,152 @@ + + + ui_interface + + + + 0 + 0 + 374 + 96 + + + + Treatment End + + + + + + + + + 10 + + + + Reject + + + + + + + + 10 + + + + Accept + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 10 + + + + reason + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + + + + 0 + 0 + + + + + 10 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(136, 138, 133); + + + Treatment End + + + Qt::AlignCenter + + + + + + + btnAccept + btnReject + spnRejectReason + + + + Index: simulator/plugins/treatmentend/loader.py =================================================================== diff -u --- simulator/plugins/treatmentend/loader.py (revision 0) +++ simulator/plugins/treatmentend/loader.py (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -0,0 +1,73 @@ +""" +The Treatment End ui loader class +""" +# Python +import os +# 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 +# plugin specific +# -- none -- + + +class Loader(DynamicLoader): + """ + The Treatment End ui loader class + """ + + btnAccept: QtWidgets.QPushButton + btnReject: QtWidgets.QPushButton + lblAction: QtWidgets.QLabel + spnRejectReason: QtWidgets.QSpinBox + + def __init__(self, hd_simulator: HDSimulator): + super().__init__(os.path.dirname(__file__), hd_simulator) + print(" ---------- ", self.hd_simulator) + + def _init_loader(self): + """ + finds and creates widgets + :return: none + """ + self.btnAccept = self.find_button('btnAccept') + self.btnReject = self.find_button('btnReject') + self.lblAction = self.find_label('lblAction') + self.spnRejectReason = self.find_spinbox('spnRejectReason') + + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + pass + + def _init_connections(self): + """ + initializes the widgets connections + :return: + """ + self.btnAccept.clicked.connect(self.do_accept) + self.btnReject.clicked.connect(self.do_reject) + + @Slot() + def do_accept(self): + """ + the slot for accept treatment end button + :return: none + """ + self.hd_simulator.cmd_send_treatment_adjust_end_response(True, 0) + self.lblAction.setText('Accepted ') + + @Slot() + def do_reject(self): + """ + the slot for accept treatment end button + :return: none + """ + reason = self.spnRejectReason.value() + self.hd_simulator.cmd_send_treatment_adjust_end_response(False, reason) + self.lblAction.setText('Rejected ' + "{}".format(reason)) Index: simulator/plugins/treatmentranges/loader.py =================================================================== diff -u -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18) +++ simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,14 +1,20 @@ """ The Treatment Ranges ui loader """ +# Python import os -from simulator.dynamicloader import DynamicLoader +# Qt from PySide2 import QtWidgets from PySide2.QtCore import QTimer from PySide2.QtCore import Slot -from dialin.squish import denaliMessages +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator from dialin.ui.hd_simulator import HDSimulator +# plugin specific +# -- none -- + class Loader(DynamicLoader): """ The Treatment Ranges ui loader @@ -28,7 +34,6 @@ super().__init__(os.path.dirname(__file__), hd_simulator) print(" ---------- ", self.hd_simulator) - def _init_loader(self): """ finds and creates widgets @@ -65,7 +70,9 @@ sends the duration message :return: none """ - denaliMessages.setTreatmentTime(self.spnDurationMax.value() * 60, value) + self.hd_simulator.cmd_set_treatment_time( + self.spnDurationMax.value() * 60, value + ) @Slot() def do_ranges_data(self): @@ -79,7 +86,7 @@ self.sldDurationValue.setMinimum(duration_min * 60) self.sldDurationValue.setMaximum(duration_max * 60) - denaliMessages.setTreatmentParamRanges( + self.hd_simulator.cmd_set_treatment_parameter_ranges( duration_min, duration_max, self.spnUFVolumeMin.value(), Index: simulator/plugins/treatmentstates/loader.py =================================================================== diff -u -r370f52c41992e2fbdc428376efb02b6f61e3b245 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/treatmentstates/loader.py (.../loader.py) (revision 370f52c41992e2fbdc428376efb02b6f61e3b245) +++ simulator/plugins/treatmentstates/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,14 +1,17 @@ """ The Ultrafiltration ui loader """ +# Python import os - +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot - +# parent from simulator.dynamicloader import DynamicLoader -from dialin.ui.hd_simulator import TXStates -from dialin.ui.hd_simulator import HDSimulator +# hd Simulator +from dialin.ui.hd_simulator import HDSimulator, TXStates +# plugin specific +# -- none -- class Loader(DynamicLoader): Index: simulator/plugins/ultrafiltration/loader.py =================================================================== diff -u -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18 -rf4523ffcaff0d27f7392c943f0a487fcb01a7d34 --- simulator/plugins/ultrafiltration/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18) +++ simulator/plugins/ultrafiltration/loader.py (.../loader.py) (revision f4523ffcaff0d27f7392c943f0a487fcb01a7d34) @@ -1,13 +1,17 @@ """ The Ultrafiltration ui loader """ +# Python import os -from simulator.dynamicloader import DynamicLoader +# Qt from PySide2 import QtWidgets from PySide2.QtCore import Slot -from dialin.squish import denaliMessages -from dialin.squish.denaliMessages import txStates, EResponse -from dialin.ui.hd_simulator import HDSimulator +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from dialin.ui.hd_simulator import HDSimulator, TXStates +# plugin specific +# -- none -- class Loader(DynamicLoader): @@ -81,8 +85,9 @@ the slot for accept ultrafiltration pause button :return: none """ - denaliMessages.setTreatmentAdjustUltrafiltrationStateResponse( - EResponse.Accepted, 0, txStates.UF_PAUSED_STATE) + self.hd_simulator.cmd_set_treatment_adjust_ultrafiltration_state_response( + True, 0, TXStates.UF_PAUSED_STATE + ) self.lblUfPauseAction.setText('Accepted ') @Slot() @@ -92,8 +97,8 @@ :return: none """ reason = self.spnUfPauseRejectReason.value() - denaliMessages.setTreatmentAdjustUltrafiltrationStateResponse( - EResponse.Rejected, reason, txStates.UF_RUNNING_STATE) + self.hd_simulator.cmd_set_treatment_adjust_ultrafiltration_state_response( + False, reason, TXStates.UF_RUNNING_STATE) self.lblUfPauseAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -102,8 +107,8 @@ the slot for accept ultrafiltration resume accept :return: none """ - denaliMessages.setTreatmentAdjustUltrafiltrationStateResponse( - EResponse.Accepted, 0, txStates.UF_RUNNING_STATE) + self.hd_simulator.cmd_set_treatment_adjust_ultrafiltration_state_response( + True, 0, TXStates.UF_RUNNING_STATE) self.lblUfResumeAction.setText('Accepted ') @Slot() @@ -113,8 +118,8 @@ :return: none """ reason = self.spnUfResumeRejectReason.value() - denaliMessages.setTreatmentAdjustUltrafiltrationStateResponse( - EResponse.Rejected, reason, txStates.UF_PAUSED_STATE) + self.hd_simulator.cmd_set_treatment_adjust_ultrafiltration_state_response( + False, reason, TXStates.UF_PAUSED_STATE) self.lblUfResumeAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -123,8 +128,8 @@ the slot for accept ultrafiltration next button :return: none """ - denaliMessages.setTreatmentAdjustUltrafiltrationEditResponse( - EResponse.Accepted, 0, 2500, 60, 0, 10, 0, 10) + self.hd_simulator.cmd_set_treatment_adjust_ultrafiltration_edit_response( + True, 0, 2325, 60, 0, 10, 0, 10) self.lblUfEditAction.setText('Accepted ') @Slot() @@ -134,8 +139,8 @@ :return: none """ reason = self.spnUfEditRejectReason.value() - denaliMessages.setTreatmentAdjustUltrafiltrationEditResponse( - EResponse.Rejected, reason, 2500, 60, 0, 10, 0, 10) + self.hd_simulator.cmd_set_treatment_adjust_ultrafiltration_edit_response( + False, reason, 2500, 60, 0, 10, 0, 10) self.lblUfEditAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -144,5 +149,6 @@ sends the ultrafiltration delivered volume message :return: none """ - denaliMessages.setTreatmentUltrafiltration(self.sldUfVolume.value(), 0, 0, 0, 0, 0, 0) - + self.hd_simulator.cmd_set_treatment_ultrafiltration_outlet_flow_data( + self.sldUfVolume.value(), 0, 0, 0, 0, 0, 0 + )