Skip to content
Snippets Groups Projects
Commit b444bd9e authored by Martin Killenberg's avatar Martin Killenberg
Browse files

feat: introduce stop button

Not working yet because thread in GUI is missing
parent d0f6a5c7
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ import prototype ...@@ -8,6 +8,8 @@ import prototype
import json import json
import time import time
import analysis import analysis
import process_sync
import multiprocessing as mp
class TestStandMainWindow(QMainWindow): class TestStandMainWindow(QMainWindow):
...@@ -17,6 +19,7 @@ class TestStandMainWindow(QMainWindow): ...@@ -17,6 +19,7 @@ class TestStandMainWindow(QMainWindow):
self.qt_app = qt_app self.qt_app = qt_app
self.startButton.clicked.connect(lambda: self.do_measurement()) self.startButton.clicked.connect(lambda: self.do_measurement())
self.stopButton.clicked.connect(lambda: self.stop_measurement())
self.tempSweepButton.clicked.connect(lambda: self.set_temp_sweep_labels()) self.tempSweepButton.clicked.connect(lambda: self.set_temp_sweep_labels())
self.humSweepButton.clicked.connect(lambda: self.set_hum_sweep_labels()) self.humSweepButton.clicked.connect(lambda: self.set_hum_sweep_labels())
...@@ -70,8 +73,13 @@ class TestStandMainWindow(QMainWindow): ...@@ -70,8 +73,13 @@ class TestStandMainWindow(QMainWindow):
return analysis_config return analysis_config
def stop_measurement(self):
process_sync.stop_measurement.set()
def do_measurement(self): def do_measurement(self):
self.setEnabled(False) self.runSettingsLayout.setEnabled(False)
self.startButton.setEnabled(False)
self.stopButton.setEnabled(True)
self.qt_app.processEvents(); self.qt_app.processEvents();
os.chdir(self.start_dir) os.chdir(self.start_dir)
...@@ -94,6 +102,7 @@ class TestStandMainWindow(QMainWindow): ...@@ -94,6 +102,7 @@ class TestStandMainWindow(QMainWindow):
meas = None meas = None
try: try:
meas = prototype.Measurements(config_data, output_basename,False, ext_sensor_channels) meas = prototype.Measurements(config_data, output_basename,False, ext_sensor_channels)
q = mp.Queue()
if self.tempSweepButton.isChecked(): if self.tempSweepButton.isChecked():
temperatures = meas.perform_sweep(self.startParameter.value(), self.stopParameter.value(), temperatures = meas.perform_sweep(self.startParameter.value(), self.stopParameter.value(),
self.stepParameter.value(), self.fixedParameter.value(), self.stepParameter.value(), self.fixedParameter.value(),
...@@ -148,7 +157,9 @@ class TestStandMainWindow(QMainWindow): ...@@ -148,7 +157,9 @@ class TestStandMainWindow(QMainWindow):
meas.chamber.close() meas.chamber.close()
meas.ext_sensors.close() meas.ext_sensors.close()
self.setEnabled(True) self.runSettingsLayout.setEnabled(True)
self.startButton.setEnabled(True)
self.stopButton.setEnabled(False)
if __name__ == '__main__': if __name__ == '__main__':
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment