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

temperature sweep working from GUI

parent 55c36d76
No related branches found
No related tags found
No related merge requests found
from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QTextEdit from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QTextEdit
from PyQt5 import uic, QtCore, QtGui, QtWidgets from PyQt5 import uic, QtCore, QtGui, QtWidgets
import sys import sys
import prototype
import json
class TestStandMainWindow(QMainWindow): class TestStandMainWindow(QMainWindow):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
uic.loadUi('climate-lab-main.ui', self) uic.loadUi('climate-lab-main.ui', self)
self.startButton.clicked.connect(lambda: self.doMeasurement())
def doMeasurement(self):
self.setEnabled(False)
with open('test_stand_parameter.json', 'r') as f:
config_data = json.load(f)
output_basename = self.baseName.text()
meas = prototype.Measurements(config_data['chamber_ip'], config_data['vna_ip'], output_basename,
False, config_data)
try:
temperatures = meas.perform_temperature_sweep(self.startParameter.value(), self.stopParameter.value(),
self.stepParameter.value(),
self.fixedParameter.value(), self.soakingTime.value(),
self.stableReads.value())
temp_extensions = []
for t in temperatures:
temp_extensions.append(str(t)+'deg_'+str(self.fixedParameter.value())+'rh')
prototype.plot_output(output_basename, temp_extensions, True, output_basename +
': Temperature sweep ' + str(temperatures[0]) + ' degC to ' +
str(temperatures[-1]) + ' degC')
finally:
meas.chamber.close()
self.setEnabled(True)
app = QApplication(sys.argv) if __name__ == '__main__':
mainWindow = TestStandMainWindow() app = QApplication(sys.argv)
mainWindow.show() mainWindow = TestStandMainWindow()
app.exec_() mainWindow.show()
app.exec_()
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