From 3ad01c9a43096b3887f4a1a1b1d2c4cb001a8fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstr=C3=B6m?= Date: Mon, 14 Aug 2023 16:20:46 +0200 Subject: [PATCH] Replot when checkbox toggle --- tools/ecmcMotionMainPyQtGraph.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/ecmcMotionMainPyQtGraph.py b/tools/ecmcMotionMainPyQtGraph.py index 2e6280e..26e6da6 100644 --- a/tools/ecmcMotionMainPyQtGraph.py +++ b/tools/ecmcMotionMainPyQtGraph.py @@ -252,6 +252,7 @@ class ecmcMtnMainGui(QtWidgets.QDialog): self.checkBoxListAnalog[pv].setChecked(True) self.checkBoxListAnalog[pv].setStyleSheet("color: " + self.checkboxColor[pv]) layoutVertPlotsSelectionUpper.addWidget(self.checkBoxListAnalog[pv]) + self.checkBoxListAnalog[pv].toggled.connect(self.stateChangedAnalog) layoutVertPlotsSelectionUpper.addSpacing(200) @@ -269,6 +270,8 @@ class ecmcMtnMainGui(QtWidgets.QDialog): self.checkBoxListBinary[pv].setChecked(True) self.checkBoxListBinary[pv].setStyleSheet("color: " + self.checkboxColor[pv]) layoutVertPlotsSelectionLower.addWidget(self.checkBoxListBinary[pv]) + self.checkBoxListBinary[pv].toggled.connect(self.stateChangedBinary) + framePlotsSelectionLower.setLayout(layoutVertPlotsSelectionLower) layoutVertPlotsSelectionLower.addSpacing(200) @@ -692,6 +695,15 @@ class ecmcMtnMainGui(QtWidgets.QDialog): return + def stateChangedAnalog(self, int): + # refresh plots + self.plotAnalog() + + + def stateChangedBinary(self, int): + # refresh plots + self.plotBinary() + def plotAll(self): if self.MtnYDataValid and self.MtnXDataValid: self.plotAnalog()