""" The Disposable Prime 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 """ sldTimeout: QtWidgets.QSlider sldCountdown: 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.sldTimeout = self.find_slider('sldTimeout') self.sldCountdown = self.find_slider('sldCountdown') def _init_widgets(self): """ initializes the widgets' properties :return: none """ pass def _init_connections(self): """ initializes the widgets connections :return: """ # saline data self.sldTimeout.valueChanged.connect(self.do_data) self.sldCountdown.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 """ timeout = self.sldTimeout.value() countdown = self.sldCountdown.value() self.interface.hd.cmd_send_pre_treatment_self_test_dry_progress_data(timeout, countdown)