From a6c1993a64c29cdb1fbb4a3166cafc529855578f Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Mon, 21 Jun 2021 23:35:08 -0400 Subject: removed stop button, make toggle stop/pause/continue button instead --- eitControl.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'eitControl.py') diff --git a/eitControl.py b/eitControl.py index e85b174..df8572d 100644 --- a/eitControl.py +++ b/eitControl.py @@ -109,20 +109,18 @@ class Experiment: bAutoZoom.clicked.connect(self.autoZoom) bRestart = QtGui.QPushButton('Restart') bRestart.clicked.connect(self.restart) - bStart = QtGui.QPushButton('Start') - bStart.clicked.connect(self.start) - bStop = QtGui.QPushButton('Stop') - bStop.clicked.connect(self.stop) + bStartStopToggle = QtGui.QPushButton('&Start') + bStartStopToggle.clicked.connect(self.start) + self.buttons["StartStopToggle"] = bStartStopToggle bSave = QtGui.QPushButton('Save data') bSave.clicked.connect(self.saveCmd) bExit = QtGui.QPushButton('Exit') bExit.clicked.connect(exit) w1.addWidget(bAutoZoom, row=0, col=0) w1.addWidget(bRestart, row=0, col=1) - w1.addWidget(bStart, row=0, col=2) - w1.addWidget(bStop, row=0, col=3) - w1.addWidget(bSave, row=0, col=4) - w1.addWidget(bExit, row=0, col=5) + w1.addWidget(bStartStopToggle, row=0, col=2) + w1.addWidget(bSave, row=0, col=3) + w1.addWidget(bExit, row=0, col=4) d1.addWidget(w1) # RF gen gui @@ -151,13 +149,22 @@ class Experiment: def stop(self): self.sweeper.cmdStop() + self.buttons["StartStopToggle"].setText("&Continue") + self.buttons["StartStopToggle"].clicked.disconnect() + self.buttons["StartStopToggle"].clicked.connect(self.start) def start(self): self.sweeper.cmdStart() + self.buttons["StartStopToggle"].setText("&Pause") + self.buttons["StartStopToggle"].clicked.disconnect() + self.buttons["StartStopToggle"].clicked.connect(self.stop) def restart(self): self.clearData() self.sweeper.cmdRestart() + self.buttons["StartStopToggle"].setText("&Pause") + self.buttons["StartStopToggle"].clicked.disconnect() + self.buttons["StartStopToggle"].clicked.connect(self.stop) def getNewDataFileName(self, ext="csv"): data_dir = self.data_dir -- cgit v1.2.3