""" ########################################################################### # # Copyright (c) 2021-2025 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file loader.py # # @author (last) Behrouz NematiPour # @date (last) 11-Feb-2021 # @author (original) Behrouz NematiPour # @date (original) 09-Feb-2021 # ############################################################################ 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 dialin.ui.hd_simulator import HDSimulator # plugin specific # -- none -- 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)