import sys import qdarkstyle from datetime import datetime from pylablib.devices import Thorlabs from PyQt5 import QtCore from pymeasure.experiment import unique_filename from pymeasure.experiment import Results from pymeasure.display.Qt import QtWidgets from src.ui.mainui import UIWindown from src.ui.controltab import ControlTab from src.ui.livetab import LiveTab from src.procedures import B_Sweep, X_Sweep, Y_Sweep class MainWindow(UIWindown): def __init__(self): super().__init__( procedure_class=[B_Sweep, X_Sweep, Y_Sweep], inputs=[ ['acq_time', 'freq', 'b_min', 'b_max', 'b_step', 'x', 'y', 'loop'], ['acq_time', 'freq', 'x_min', 'x_max', 'x_step', 'y', 'field'], ['acq_time', 'freq', 'y_min', 'y_max', 'y_step', 'x', 'field'] ], displays=['acq_time', 'freq'], x_axis='Iteration', y_axis='Voltage', widget_list=(ControlTab("Manual control"), LiveTab("Live measurements")), directory_input=True ) self.setWindowTitle('Mini MOKE') self.directory = 'data' def queue(self, procedure=None): direc = self.directory + '/' + datetime.now().strftime('%Y-%m') if procedure is None: procedure = self.make_procedure() file = unique_filename(direc, procedure.name+"_") results = Results(procedure, file) experiment = self.new_experiment(results) self.manager.queue(experiment) if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) dark_stylesheet = qdarkstyle.load_stylesheet_pyqt5() app.setStyleSheet(dark_stylesheet) window = MainWindow() window.show() sys.exit(app.exec())