Index: simulator/plugins/treatmentranges/loader.py =================================================================== diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r93458545b38aa7d16a71625348f5210ebc27172c --- simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc) +++ simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision 93458545b38aa7d16a71625348f5210ebc27172c) @@ -1,12 +1,48 @@ """ +########################################################################### +# +# Copyright (c) 2020-2026 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) 16-Feb-2021 +# @author (original) Behrouz NematiPour +# @date (original) 23-Nov-2020 +# +############################################################################ +########################################################################### +# +# Copyright (c) 2020-2026 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) 16-Feb-2021 +# @author (original) Behrouz NematiPour +# @date (original) 23-Nov-2020 +# +############################################################################ The Treatment Ranges ui loader """ +# Python import os -from simulator.dynamicloader import DynamicLoader +# Qt from PySide2 import QtWidgets from PySide2.QtCore import QTimer from PySide2.QtCore import Slot -from dialin.squish import denaliMessages +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from dialin.ui.hd_simulator import HDSimulator +# plugin specific +# -- none -- class Loader(DynamicLoader): @@ -24,8 +60,9 @@ spnUFVolumeMax: QtWidgets.QSpinBox sldDurationValue: QtWidgets.QSlider - def __init__(self): - super().__init__(os.path.dirname(__file__)) + def __init__(self, hd_simulator: HDSimulator): + super().__init__(os.path.dirname(__file__), hd_simulator) + print(" ---------- ", self.hd_simulator) def _init_loader(self): """ @@ -47,6 +84,7 @@ :return: none """ self.timer.timeout.connect(self.do_ranges_data) + self.timer.timeout.connect(self.do_duration_data) self.sldDurationValue.valueChanged.connect(self.do_duration_data) def _init_widgets(self): @@ -58,12 +96,15 @@ self.timer.start(1000) @Slot() - def do_duration_data(self, value): + def do_duration_data(self): """ sends the duration message :return: none """ - denaliMessages.setTreatmentTime(self.spnDurationMax.value() * 60, value) + value = self.sldDurationValue.value() + self.hd_simulator.cmd_set_treatment_time( + self.spnDurationMax.value() * 60, value + ) @Slot() def do_ranges_data(self): @@ -77,7 +118,7 @@ self.sldDurationValue.setMinimum(duration_min * 60) self.sldDurationValue.setMaximum(duration_max * 60) - denaliMessages.setTreatmentParamRanges( + self.hd_simulator.cmd_set_treatment_parameter_ranges( duration_min, duration_max, self.spnUFVolumeMin.value(),