""" The FP Conductivity ui loader """ # Python import os # Qt from PySide2 import QtCore, QtWidgets from PySide2.QtCore import Slot # parent from engine.dynamicloader import DynamicLoader # fp Simulator from leahi_dialin.ui.fp_messaging import FP_Messaging class Loader(DynamicLoader): """ The FP Conductivity """ def __init__(self): self.fp_interface = FP_Messaging() super().__init__(os.path.dirname(__file__)) def _init_loader(self): """ finds and creates widgets :return: none """ self.tbReset = self.find_widget(QtWidgets.QToolButton , 'tbReset' ) self.tbSend = self.find_widget(QtWidgets.QToolButton , 'tbSend' ) self.dsbrawRORejectionRatio = self.find_widget(QtWidgets.QDoubleSpinBox , 'dsbrawRORejectionRatio' ) self.dsbrawRORejectionRatioTankFill = self.find_widget(QtWidgets.QDoubleSpinBox , 'dsbrawRORejectionRatioTankFill' ) self.dsbavgRORejectionRatio = self.find_widget(QtWidgets.QDoubleSpinBox , 'dsbavgRORejectionRatio' ) self.dsbavgRORejectionRatioTankFill = self.find_widget(QtWidgets.QDoubleSpinBox , 'dsbavgRORejectionRatioTankFill' ) self.dsbgenPermeateState = self.find_widget(QtWidgets.QDoubleSpinBox , 'dsbgenPermeateState' ) def _init_connections(self): """ initializes the widgets connections :return: none """ self.tbReset.clicked.connect(self._init_widgets) self.tbSend.clicked.connect(self.do_RoRejectionPercentage) @Slot() def _init_widgets(self): """ initializes the widgets' properties :return: none """ self.dsbrawRORejectionRatio .setValue(0) self.dsbrawRORejectionRatioTankFill.setValue(0) self.dsbavgRORejectionRatio .setValue(0) self.dsbavgRORejectionRatioTankFill.setValue(0) self.dsbgenPermeateState .setValue(0) @Slot() def do_RoRejectionPercentage(self): """ the slot for FP conductivity change :return: none """ self.fp_interface.fp_roRejectionPercentage ( self.dsbrawRORejectionRatio .value() , self.dsbrawRORejectionRatioTankFill .value() , self.dsbavgRORejectionRatio .value() , self.dsbavgRORejectionRatioTankFill .value() , self.dsbgenPermeateState .value() )