Index: simulator/plugins/version/loader.py =================================================================== diff -u -rb84c3a9b1d50790944ee40a68d2013ace7302f82 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/version/loader.py (.../loader.py) (revision b84c3a9b1d50790944ee40a68d2013ace7302f82) +++ simulator/plugins/version/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -37,10 +37,15 @@ sbDGFPGAMinor: QtWidgets.QSpinBox sbDGFPGALab: QtWidgets.QSpinBox - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) - print(" ---------- ", self.hd_simulator) + leHDSerial: QtWidgets.QLineEdit + leDGSerial: QtWidgets.QLineEdit + pbHDSend: QtWidgets.QPushButton + pbDGSend: QtWidgets.QPushButton + + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) + def _init_loader(self): """ finds and creates widgets @@ -64,6 +69,12 @@ self.sbDGFPGAMinor = self.find_spinbox('sbDGFPGAMinor') self.sbDGFPGALab = self.find_spinbox('sbDGFPGALab') + self.leHDSerial = self.find_line_edit('leHDSerial') + self.leDGSerial = self.find_line_edit('leDGSerial') + + self.pbHDSend = self.find_button('pbHDSend') + self.pbDGSend = self.find_button('pbDGSend') + def _init_widgets(self): """ initializes the widgets' properties @@ -76,26 +87,13 @@ 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.pbHDSend.clicked.connect(self.do_hd_version_data) + self.pbDGSend.clicked.connect(self.do_dg_version_data) + self.pbHDSend.clicked.connect(self.do_hd_serial_data) + self.pbDGSend.clicked.connect(self.do_dg_serial_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): + def do_hd_version_data(self): """ the slot which is called to send the data by calling the denaliMessage API cmd_send_version_hd_data @@ -109,7 +107,7 @@ 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( + self.interface.hd.cmd_send_version_hd_data( sb_hd_major, sb_hd_minor, sb_hd_micro, @@ -121,7 +119,7 @@ ) @Slot() - def do_dg_data(self): + def do_dg_version_data(self): """ the slot which is called to send the data by calling the denaliMessage API cmd_send_version_dg_data @@ -136,7 +134,7 @@ 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( + self.interface.dg.cmd_send_version_dg_data( sb_dg_major, sb_dg_minor, sb_dg_micro, @@ -146,3 +144,25 @@ sb_dg_fpga_minor, sb_dg_fpga_lab, ) + + @Slot() + def do_hd_serial_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_serial_hd_data + :return: none + """ + self.interface.hd.cmd_send_serial_hd_data( + self.leHDSerial.text() + ) + + @Slot() + def do_dg_serial_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_serial_dg_data + :return: none + """ + self.interface.dg.cmd_send_serial_dg_data( + self.leDGSerial.text() + )