Index: simulator/plugins/__PostTreatment/interface.ui =================================================================== diff -u --- simulator/plugins/__PostTreatment/interface.ui (revision 0) +++ simulator/plugins/__PostTreatment/interface.ui (revision ac067cb6ba007a8d5db80208498dd45497b6b9ab) @@ -0,0 +1,2312 @@ + + + ui_interface + + + + 0 + 0 + 1118 + 776 + + + + &5 Post-Treatment/&0 Responses + + + + + + + + + 10 + + + + Accept + + + + + + + + 0 + 0 + + + + + 10 + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + reason + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + + + + 10 + + + + Reject + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Disposables Removal Confirm Response + + + Qt::AlignCenter + + + + + + + + + + + + 10 + + + + Accept + + + + + + + + 0 + 0 + + + + + 10 + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + reason + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Treatment Log Data Response + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + + + + 10 + + + + Reject + + + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 27 - (F32) Heparin Bolus Volume + + + leHeparinBolusVolume + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 26 - (U32) Heparin Concentration + + + leHeparinConcentration + + + + + + + + Courier + + + + 99999 + + + 0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (IU/mL) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 33 - (U32) End Treatment Early Alarm + + + leEndTreatmentEarlyAlarm + + + + + + + + Courier + + + + 99999 + + + 0 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 15 - (U32) Treatment Date and Time + + + leTreatmentDateTime + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 5 - (U32) Treatment Duration + + + leTreatmentDuration + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 6 - (U32) Actual Treatment Duration + + + leActualTreatmentDuration + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 10 - (U32) Calcium Concentration + + + leCalciumConcentration + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 18 - (F32) Dialysate Volume Used + + + leDialysateVolumeUsed + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (L) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 4 - (U32) Dialysate Flow Rate + + + leDialysateFlowRate + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 28 - (F32) Heparin Dispense Rate + + + leHeparinDispenseRate + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/hr) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 29 - (U32) Heparin Pre-Stop + + + leHeparinPreStop + + + + + + + + Courier + + + + 99999 + + + 0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 3 - (U32) Blood Flow Rate + + + leBloodFlowRate + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 21 - (F32) Actual UF Volume + + + leActualUFVolume + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (L) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 9 - (U32) Potassium Concentration + + + lePotassiumConcentration + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 7 - (U32) Acid Concentrate Type + + + leAcidConcentrateType + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 13 - (F32) Dialysate Temperature + + + leDialysateTemperature + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (Celsius) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 31 - (F32) Average Arterial Pressure + + + leAverageArterialPressure + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mmHg) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 14 - (U32) Dialyzer Type + + + leDialyzerType + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 35 - (U32) Water Sample Test Result + + + leWaterSampleTestResult + + + + + + + + Courier + + + + 99999 + + + 0 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 25 - (U32) Heparin Type + + + leHeparinType + + + + + + + + Courier + + + + 99999 + + + 0 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 34 - (U32) Device ID + + + leDeviceID + + + + + + + + Courier + + + + 99999 + + + 0 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 17 - (F32) Average Dialysate Flow + + + leAverageDialysateFlow + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 24 - (U32) Saline Bolus Volume + + + leSalineBolusVolume + + + + + + + + Courier + + + + 99999 + + + 0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 22 - (F32) Target UF Rate + + + leTargetUFRate + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 23 - (F32) Actual UF Rate + + + leActualUFRate + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 30 - (F32) Heparin Delivered Volume + + + leHeparinDeliveredVolume + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 8 - (U32) Bicarbonate Concentrate Type + + + leBicarbonateConcentrateType + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 11 - (U32) Bicarbonate Concentration + + + leBicarbonateConcentration + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 20 - (F32) Target UF Volume + + + leTargetUFVolume + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (L) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 16 - (F32) Average Blood Flow + + + leAverageBloodFlow + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 32 - (F32) Average Venous Pressure + + + leAverageVenousPressure + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mmHg) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 19 - (F32) Average Dialysate Temp + + + leAverageDialysateTemp + + + + + + + + Courier + + + + 99999.999 + + + 0.0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (Celsius) + + + + + + + + + + + + 350 + 0 + + + + + Courier + + + + 12 - (U32) SodiumConcentration + + + leSodiumConcentration + + + + + + + + Courier + + + + 99999 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + Qt::Vertical + + + + + + + + + Qt::Horizontal + + + + 636 + 69 + + + + + + + + Qt::Horizontal + + + + 636 + 69 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Post Treatment + + + Qt::AlignCenter + + + + + + + btnAccept + btnReject + spnReason + btnAccept_2 + btnReject_2 + spnReason_2 + leBloodFlowRate + leDialysateFlowRate + leTreatmentDuration + leActualTreatmentDuration + leAcidConcentrateType + leBicarbonateConcentrateType + lePotassiumConcentration + leCalciumConcentration + leBicarbonateConcentration + leSodiumConcentration + leDialysateTemperature + leDialyzerType + leTreatmentDateTime + leAverageBloodFlow + leAverageDialysateFlow + leDialysateVolumeUsed + leAverageDialysateTemp + leTargetUFVolume + leActualUFVolume + leTargetUFRate + leActualUFRate + leSalineBolusVolume + leHeparinType + leHeparinConcentration + leHeparinBolusVolume + leHeparinDispenseRate + leHeparinPreStop + leHeparinDeliveredVolume + leAverageArterialPressure + leAverageVenousPressure + leEndTreatmentEarlyAlarm + leDeviceID + leWaterSampleTestResult + + + + Index: simulator/plugins/__PostTreatment/loader.py =================================================================== diff -u --- simulator/plugins/__PostTreatment/loader.py (revision 0) +++ simulator/plugins/__PostTreatment/loader.py (revision ac067cb6ba007a8d5db80208498dd45497b6b9ab) @@ -0,0 +1,79 @@ +""" +The ui loader class +""" +# Python +import os +# Qt +from email import message + +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 RequestRejectReasons +# plugin specific +# -- None -- + + +class Loader(DynamicLoader): + """ + The ui loader class + """ + + leMessageID: QtWidgets.QLineEdit + btnAccept: QtWidgets.QPushButton + btnReject: QtWidgets.QPushButton + lblAction: QtWidgets.QLabel + spnReason: QtWidgets.QSpinBox + + def __init__(self, hd_simulator: HDSimulator): + super().__init__(os.path.dirname(__file__), hd_simulator) + + def _init_loader(self): + """ + finds and creates widgets + :return: none + """ + self.leMessageID = self.find_line_edit('leMessageID') + self.btnAccept = self.find_button('btnAccept') + self.btnReject = self.find_button('btnReject') + self.lblAction = self.find_label('lblAction') + self.spnReason = self.find_spinbox('spnReason') + + 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 button + :return: none + """ + message_id = self.leMessageID.text() + self.hd_simulator.cmd_send_general_response(int(message_id), True, 0) + self.lblAction.setText('Accepted ') + + @Slot() + def do_reject(self): + """ + the slot for reject button + :return: none + """ + message_id = self.leMessageID.text() + reason = self.spnReason.value() + self.hd_simulator.cmd_send_general_response(int(message_id), False, reason) + self.lblAction.setText('Rejected ' + "{}".format(reason))