diff options
-rw-r--r-- | eitControl.py | 23 |
1 files changed, 15 insertions, 8 deletions
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 |