Index: simulator/plugins/bloodPrime/interface.ui =================================================================== diff -u --- simulator/plugins/bloodPrime/interface.ui (revision 0) +++ simulator/plugins/bloodPrime/interface.ui (revision 946ef354fad2014bd50283cbb817c17e392760b3) @@ -0,0 +1,274 @@ + + + ui_interface + + + + 0 + 0 + 375 + 115 + + + + + 375 + 115 + + + + + 16777215 + 115 + + + + Blood Prime + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + + + 10 + + + + Qt::Horizontal + + + + + + + + + + 10 + + + + 0 + + + 300 + + + 0 + + + Qt::Horizontal + + + + + + + + 10 + + + + 0 + + + 300 + + + 300 + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + Target + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 10 + + + + background-color: rgb(239, 41, 41); +color: rgb(238, 238, 236); + + + Blood Prime Data + + + Qt::AlignCenter + + + + + + + + 30 + 0 + + + + + 10 + + + + 300 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 30 + 0 + + + + + 10 + + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Volume + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + sldCurrent + + + + + + + + + + + + 10 + + + + background-color: rgb(239, 41, 41); +color: rgb(238, 238, 236); + + + Blood Prime + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + sldTarget + valueChanged(int) + lblTarget + setNum(int) + + + 244 + 182 + + + 469 + 184 + + + + + sldCurrent + valueChanged(int) + lblCurrent + setNum(int) + + + 413 + 202 + + + 468 + 207 + + + + + Index: simulator/plugins/bloodPrime/loader.py =================================================================== diff -u --- simulator/plugins/bloodPrime/loader.py (revision 0) +++ simulator/plugins/bloodPrime/loader.py (revision 946ef354fad2014bd50283cbb817c17e392760b3) @@ -0,0 +1,60 @@ +""" +The Heparin ui loader class +""" +import os +from simulator.dynamicloader import DynamicLoader + +from PySide2 import QtWidgets +from PySide2.QtCore import Slot + +from dialin.ui.hd_simulator import HDSimulator +from dialin.ui.hd_simulator import TXStates + + +class Loader(DynamicLoader): + """ + The Saline Bolus ui loader class + """ + + sldTarget: QtWidgets.QSlider + sldCurrent: QtWidgets.QSlider + + 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 + """ + # blood prime data + self.sldTarget = self.find_slider('sldTarget') + self.sldCurrent = self.find_slider('sldCurrent') + + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + pass + + def _init_connections(self): + """ + initializes the widgets connections + :return: + """ + # saline data + self.sldTarget.valueChanged.connect(self.do_data) + self.sldCurrent.valueChanged.connect(self.do_data) + + @Slot() + def do_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_treatment_blood_prime_data + :return: none + """ + target = self.sldTarget.value() + current = self.sldCurrent.value() + self.hd_simulator.cmd_send_treatment_blood_prime_data(target, current)