Index: simulator/plugins/accelerometer/loader.py =================================================================== diff -u -rc9c30b825fc1bcc6d3fa3cdd8b825275b9dbb262 -rb84c3a9b1d50790944ee40a68d2013ace7302f82 --- simulator/plugins/accelerometer/loader.py (.../loader.py) (revision c9c30b825fc1bcc6d3fa3cdd8b825275b9dbb262) +++ simulator/plugins/accelerometer/loader.py (.../loader.py) (revision b84c3a9b1d50790944ee40a68d2013ace7302f82) @@ -17,7 +17,7 @@ class Loader(DynamicLoader): """ - The Saline Bolus ui loader class + The accelerometer ui loader class """ sldHDX: QtWidgets.QSlider @@ -103,7 +103,7 @@ def do_hd_data(self): """ the slot which is called to send the data - by calling the denaliMessage API cmd_send_treatment_blood_prime_data + by calling the denaliMessage API cmd_send_accelerometer_hd_data :return: none """ sld_hd_x = self.sldHDX.value() @@ -131,7 +131,7 @@ def do_dg_data(self): """ the slot which is called to send the data - by calling the denaliMessage API cmd_send_treatment_blood_prime_data + by calling the denaliMessage API cmd_send_accelerometer_dg_data :return: none """ sld_dg_x = self.sldDGX.value() Index: simulator/plugins/version/interface.ui =================================================================== diff -u --- simulator/plugins/version/interface.ui (revision 0) +++ simulator/plugins/version/interface.ui (revision b84c3a9b1d50790944ee40a68d2013ace7302f82) @@ -0,0 +1,403 @@ + + + ui_interface + + + + 0 + 0 + 548 + 320 + + + + Versions + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(32, 74, 135); + + + Versions + + + Qt::AlignCenter + + + + + + + + + + 0 + 0 + + + + FPGA id + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Micro + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + FPGA Lab + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + FPGA Minor + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Major + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Minor + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + FPGA Major + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(239, 41, 41); + + + HD Vession + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + Build + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + FPGA Lab + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 0 + 0 + + + + FPGA id + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Build + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + + + + + + 0 + 0 + + + + FPGA Major + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 0 + 0 + + + + Micro + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Major + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + FPGA Minor + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Minor + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(41, 41, 239); + + + DG Version + + + Qt::AlignCenter + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Index: simulator/plugins/version/loader.py =================================================================== diff -u --- simulator/plugins/version/loader.py (revision 0) +++ simulator/plugins/version/loader.py (revision b84c3a9b1d50790944ee40a68d2013ace7302f82) @@ -0,0 +1,148 @@ +""" +The versions 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 Versions ui loader class + """ + sbHDMajor: QtWidgets.QSpinBox + sbHDMinor: QtWidgets.QSpinBox + sbHDMicro: QtWidgets.QSpinBox + sbHDBuild: QtWidgets.QSpinBox + sbHDFPGAid: QtWidgets.QSpinBox + sbHDFPGAMajor: QtWidgets.QSpinBox + sbHDFPGAMinor: QtWidgets.QSpinBox + sbHDFPGALab: QtWidgets.QSpinBox + + sbDGMajor: QtWidgets.QSpinBox + sbDGMinor: QtWidgets.QSpinBox + sbDGMicro: QtWidgets.QSpinBox + sbDGBuild: QtWidgets.QSpinBox + sbDGFPGAid: QtWidgets.QSpinBox + sbDGFPGAMajor: QtWidgets.QSpinBox + sbDGFPGAMinor: QtWidgets.QSpinBox + sbDGFPGALab: QtWidgets.QSpinBox + + 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 + """ + self.sbHDMajor = self.find_spinbox('sbHDMajor') + self.sbHDMinor = self.find_spinbox('sbHDMinor') + self.sbHDMicro = self.find_spinbox('sbHDMicro') + self.sbHDBuild = self.find_spinbox('sbHDBuild') + self.sbHDFPGAid = self.find_spinbox('sbHDFPGAid') + self.sbHDFPGAMajor = self.find_spinbox('sbHDFPGAMajor') + self.sbHDFPGAMinor = self.find_spinbox('sbHDFPGAMinor') + self.sbHDFPGALab = self.find_spinbox('sbHDFPGALab') + + self.sbDGMajor = self.find_spinbox('sbDGMajor') + self.sbDGMinor = self.find_spinbox('sbDGMinor') + self.sbDGMicro = self.find_spinbox('sbDGMicro') + self.sbDGBuild = self.find_spinbox('sbDGBuild') + self.sbDGFPGAid = self.find_spinbox('sbDGFPGAid') + self.sbDGFPGAMajor = self.find_spinbox('sbDGFPGAMajor') + self.sbDGFPGAMinor = self.find_spinbox('sbDGFPGAMinor') + self.sbDGFPGALab = self.find_spinbox('sbDGFPGALab') + + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + pass + + def _init_connections(self): + """ + initializes the widgets connections + :return: + """ + self.sbHDMajor.valueChanged.connect(self.do_hd_data) + self.sbHDMinor.valueChanged.connect(self.do_hd_data) + self.sbHDMicro.valueChanged.connect(self.do_hd_data) + self.sbHDBuild.valueChanged.connect(self.do_hd_data) + self.sbHDFPGAid.valueChanged.connect(self.do_hd_data) + self.sbHDFPGAMajor.valueChanged.connect(self.do_hd_data) + self.sbHDFPGAMinor.valueChanged.connect(self.do_hd_data) + self.sbHDFPGALab.valueChanged.connect(self.do_hd_data) + + self.sbDGMajor.valueChanged.connect(self.do_dg_data) + self.sbDGMinor.valueChanged.connect(self.do_dg_data) + self.sbDGMicro.valueChanged.connect(self.do_dg_data) + self.sbDGBuild.valueChanged.connect(self.do_dg_data) + self.sbDGFPGAid.valueChanged.connect(self.do_dg_data) + self.sbDGFPGAMajor.valueChanged.connect(self.do_dg_data) + self.sbDGFPGAMinor.valueChanged.connect(self.do_dg_data) + self.sbDGFPGALab.valueChanged.connect(self.do_dg_data) + + @Slot() + def do_hd_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_version_hd_data + :return: none + """ + sb_hd_major = self.sbHDMajor.value() + sb_hd_minor = self.sbHDMinor.value() + sb_hd_micro = self.sbHDMicro.value() + sb_hd_build = self.sbHDBuild.value() + sb_hd_fpga_id = self.sbHDFPGAid.value() + sb_hd_fpga_major = self.sbHDFPGAMajor.value() + sb_hd_fpga_minor = self.sbHDFPGAMinor.value() + sb_hd_fpga_lab = self.sbHDFPGALab.value() + self.hd_simulator.cmd_send_version_hd_data( + sb_hd_major, + sb_hd_minor, + sb_hd_micro, + sb_hd_build, + sb_hd_fpga_id, + sb_hd_fpga_major, + sb_hd_fpga_minor, + sb_hd_fpga_lab, + ) + + @Slot() + def do_dg_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_version_dg_data + :return: none + """ + print("DG version") + sb_dg_major = self.sbDGMajor.value() + sb_dg_minor = self.sbDGMinor.value() + sb_dg_micro = self.sbDGMicro.value() + sb_dg_build = self.sbDGBuild.value() + sb_dg_fpga_id = self.sbDGFPGAid.value() + sb_dg_fpga_major = self.sbDGFPGAMajor.value() + sb_dg_fpga_minor = self.sbDGFPGAMinor.value() + sb_dg_fpga_lab = self.sbDGFPGALab.value() + self.hd_simulator.cmd_send_version_dg_data( + sb_dg_major, + sb_dg_minor, + sb_dg_micro, + sb_dg_build, + sb_dg_fpga_id, + sb_dg_fpga_major, + sb_dg_fpga_minor, + sb_dg_fpga_lab, + )