Loop through trees to set them up

This commit is contained in:
atse 2023-08-16 17:35:13 +08:00
parent 5ba189d3ba
commit 137004e6b5
1 changed files with 3 additions and 4 deletions

View File

@ -266,10 +266,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
await asyncio.gather(*[self.tec_client._command(x.format(value=data)) for x in param.opts["commands"]]) await asyncio.gather(*[self.tec_client._command(x.format(value=data)) for x in param.opts["commands"]])
def _set_param_tree(self): def _set_param_tree(self):
self.ch0_tree.setParameters(params[0], showTop=False) for i, tree in enumerate((self.ch0_tree, self.ch1_tree)):
self.ch1_tree.setParameters(params[1], showTop=False) tree.setParameters(params[i], showTop=False)
params[0].sigTreeStateChanged.connect(self.send_command) params[i].sigTreeStateChanged.connect(self.send_command)
params[1].sigTreeStateChanged.connect(self.send_command)
@pyqtSlot(list) @pyqtSlot(list)
def update_pid(self, pid_settings): def update_pid(self, pid_settings):