""" The Heparin 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 simulator.interface import SimulationInterface # plugin specific # -- none -- class Loader(DynamicLoader): """ The Saline Bolus ui loader class """ sldTarget: QtWidgets.QSlider sldCurrent: QtWidgets.QSlider def __init__(self, interface: SimulationInterface): super().__init__(os.path.dirname(__file__), interface) 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.interface.hd.cmd_send_treatment_blood_prime_data(target, current)