All the legacy

This commit is contained in:
Moritz Grimm 2025-07-04 15:52:40 +02:00
commit 743f93cb4c
115 changed files with 120982 additions and 0 deletions

View File

@ -0,0 +1,434 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
import collections
import itertools
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import BK_9132B
from design_files.BK_9131B_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_BK_9131B')
self.sync_BK_9131B = manager.sync_BK_9131B()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_BK_9131B')
self.sync_BK_9131B = manager.sync_BK_9131B()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_BK_9131B.update({'setU':[0,0,0], 'setI':[0,0,0], 'OutputOn':[False, False, False], 'U':[0,0,0], 'I':[0,0,0], 'P':[0,0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Voltage, Current, Power")
self.graphWidget.setLabel('left', 'Voltage [V], Current [A], Power [W]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
pen7 = pg.mkPen(color=(255, 127, 127), width=2)
pen8 = pg.mkPen(color=(127, 255, 70), width=2)
pen9 = pg.mkPen(color=(255, 127, 70), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'V Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'I Ch: 1')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'P Ch: 1')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'V Ch: 2')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'I Ch: 2')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'P Ch: 2')
self.plot_7 = self.graphWidget.plot(temp,[1,0],pen = pen7, name = 'V Ch: 3')
self.plot_8 = self.graphWidget.plot(temp,[1,0],pen = pen8, name = 'I Ch: 3')
self.plot_9 = self.graphWidget.plot(temp,[1,0],pen = pen9, name = 'P Ch: 3')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.SB_Nplot.editingFinished.connect(self.set_Npoints)
self.dSB_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.checkBox_V_1.stateChanged.connect(self.plot_hide)
self.checkBox_I_1.stateChanged.connect(self.plot_hide)
self.checkBox_P_1.stateChanged.connect(self.plot_hide)
self.checkBox_V_2.stateChanged.connect(self.plot_hide)
self.checkBox_I_2.stateChanged.connect(self.plot_hide)
self.checkBox_P_2.stateChanged.connect(self.plot_hide)
self.checkBox_V_3.stateChanged.connect(self.plot_hide)
self.checkBox_I_3.stateChanged.connect(self.plot_hide)
self.checkBox_P_3.stateChanged.connect(self.plot_hide)
self.V_set_1.editingFinished.connect(self.set_V)
self.I_set_1.editingFinished.connect(self.set_I)
self.Output_1.stateChanged.connect(self.set_Output)
self.V_set_2.editingFinished.connect(self.set_V)
self.I_set_2.editingFinished.connect(self.set_I)
self.Output_2.stateChanged.connect(self.set_Output)
self.V_set_3.editingFinished.connect(self.set_V)
self.I_set_3.editingFinished.connect(self.set_I)
self.Output_3.stateChanged.connect(self.set_Output)
#define constants
self.Voltage = np.zeros((1,3)) #store voltage data
self.Current = np.zeros((1,3)) #store current data
self.Power = np.zeros((1,3)) #store power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.buffer_size = 36000 #size of ringbuffers for plotting. 36000 is roughly 1 hour, if timng_main is 0.1 s
self.buffer = collections.deque(maxlen=self.buffer_size) #ringbuffer for plot data
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.Spinboxes_config = [self.V_set_1,self.I_set_1,self.V_set_2,self.I_set_2,
self.V_set_3,self.I_set_3,self.SB_Nplot, self.SB_Buffer_size,
self.dSB_saveInterval]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath]#is used for config file
self.checkboxes_config = [self.Output_1, self.Output_2, self.Output_3,self.checkBox_disableplots,self.checkBox_save,
self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1, self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3,]#is used for config file
#read default values from config and set them in gui
self.read_default()
# #write values from gui to global variables.
self.set_V()
self.set_I()
self.set_Output()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.BK = BK_9132B.BK_9132B(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setU', 'setI', 'OutputOn']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_BK_9131B.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if setU is changed new setU parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Voltage(CH, self.set_new[0][CH-1]) #CH is element of 1-3 but setU parameters have indices of 0-2
if self.set_new[1] != self.set_old[1]: #if setI is changed new setI parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Current(CH, self.set_new[1][CH-1]) #CH is element of 1-3 but setI parameters have indices of 0-2
if self.set_new[2] != self.set_old[2]: #if OutputOn is changed new OutputOn parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Output(CH, self.set_new[2][CH-1]) #CH is element of 1-3 but OutputOn parameters have indices of 0-2
self.update_setValues(self.set_new) #Change GUI
U = self.BK.read_Voltage() #read Voltage of all three channels
I = self.BK.read_Current() #read Current of all three channels
P = self.BK.read_Power() #read Power of all three channels
#store values for save thread
self.Voltage = U
self.Current = I
self.Power = P
#Write measurement values into global variables
self.sync_BK_9131B.update({'U':U})
self.sync_BK_9131B.update({'I':I})
self.sync_BK_9131B.update({'P':P})
#Append Ringbuffer
self.buffer.append([time.time()]+U+I+P)
#emit signal to trigger self.update_gui
progress_callback.emit([U,I,P]) #Emits list of all three lists U,I,P
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.BK) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
U = List[0]
I = List[1]
P = List[2]
#set numbers
self.V_1.setText(str(U[0]))
self.I_1.setText(str(I[0]))
self.P_1.setText(str(P[0]))
self.V_2.setText(str(U[1]))
self.I_2.setText(str(I[1]))
self.P_2.setText(str(P[1]))
self.V_3.setText(str(U[2]))
self.I_3.setText(str(I[2]))
self.P_3.setText(str(P[2]))
#plot
#calculate index in buffer where plots start. (Needed for itertools.islice)
I_s = len(self.buffer) - self.Npoints
if I_s < 0:
I_s = 0
if self.disable_plot == False:
t = np.array(list(itertools.islice(self.buffer,I_s,None)))[:,0]
self.plot_1.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,1])#V1
self.plot_2.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,4])#I1
self.plot_3.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,7])#P1
self.plot_4.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,2])#V2
self.plot_5.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,5])#I2
self.plot_6.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,8])#P2
self.plot_7.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,3])#V3
self.plot_8.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,6])#I3
self.plot_9.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,9])#P3
def update_setValues(self,setV):
#sets setvalues obtained from update_all in gui ['setU', 'setI', 'OutputOn']
self.V_set_1.setValue(setV[0][0])
self.I_set_1.setValue(setV[1][0])
self.Output_1.setChecked(setV[2][0])
self.V_set_2.setValue(setV[0][1])
self.I_set_2.setValue(setV[1][1])
self.Output_2.setChecked(setV[2][1])
self.V_set_3.setValue(setV[0][2])
self.I_set_3.setValue(setV[1][2])
self.Output_3.setChecked(setV[2][2])
def set_V(self):
#updates the set voltage in global variables. The change will be detected by update_all and it will be passed to the device
setU = [self.V_set_1.value(), self.V_set_2.value(), self.V_set_3.value()]
print(setU)
self.sync_BK_9131B.update({'setU':setU})
def set_I(self):
#updates the set current in global variables. The change will be detected by update_all and it will be passed to the device
setI = [self.I_set_1.value(), self.I_set_2.value(), self.I_set_3.value()]
self.sync_BK_9131B.update({'setI':setI})
def set_Output(self):
#updates the set Output in global variables. The change will be detected by update_all and it will be passed to the device
setOutput = [self.Output_1.isChecked(), self.Output_2.isChecked(), self.Output_3.isChecked()]
self.sync_BK_9131B.update({'OutputOn':setOutput})
def change_buffer_size(self):
new_len = self.SB_Buffer_size.value()
data = list(self.buffer)
self.buffer = collections.deque(data[-new_len:], maxlen = new_len)
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = self.SB_Nplot.value()
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1,
self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3]
plots = plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6, self.plot_7, self.plot_8, self.plot_9]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = self.dSB_saveInterval.value()
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\tV Ch:3[V]\tI Ch:3[A]\tP Ch:3[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(t))+'\t')
for i in [0,1,2]: #Loop for all three channels
file.write(f"{self.Voltage[i]}\t")
file.write(f"{self.Current[i]}\t")
file.write(f"{self.Power[i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9131B_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for s in self.Spinboxes_config:
file.write(f"{s.value()}\t")
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9131B_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
for s,v in zip(self.Spinboxes_config,vals[0]):
try: #give float or int, depending on dSB of SB
s.setValue(float(v))
except TypeError:
s.setValue(int(v))
for l,v in zip(self.lines_config_strings,vals[0][len(self.Spinboxes_config):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.Spinboxes_config)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1 @@
moritz@Moritz-MacBook-Pro.local.707:1751220963

BIN
Legacy/Instrument_Drivers/.DS_Store vendored Normal file

Binary file not shown.

13
Legacy/Instrument_Drivers/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
## list of files and file extensions that should be ignored by git
#pycache files
*pyc
#config files
*_config.txt
*_config_*.txt
#virtual environment
env
#the usual messy files (ignore anything with "test" in it)
test*.*

View File

@ -0,0 +1,347 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback
import sys
import os
from timeit import default_timer as timer
import collections
import itertools
import numpy as np
import pyqtgraph as pg
import import_txt
from random import random
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Agilent_304_FS_AG
from design_files.Agilent_304_FS_AG_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0):
'''gets value from QLineEdit and converts it to float. If text is empty or
cannot be converted, it returns "default" which is 0, if not specified'''
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_AG_304')
self.sync_AG_304 = manager.sync_AG_304()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_AG_304')
self.sync_AG_304 = manager.sync_AG_304()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_AG_304.update({'P':0, 'T':0, 'f':0, 'Status': 'Stop'})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Pressure")
self.graphWidget.setLabel('left', 'Pressure [mnbar]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
self.graphWidget.setLogMode(False,True)
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1)
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.SB_N_points.valueChanged.connect(self.set_Npoints)
self.dSB_save_intervall.valueChanged.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.button_buffer_size.clicked.connect(self.change_buffer_size)
self.Button_start.clicked.connect(self.start_pump)
self.Button_stop.clicked.connect(self.stop_pump)
#define constants
self.P = 0 #store Pressure data
self.start = False #start Pump? Is set to true be self.start_pump
self.stop = False #Stop Pump? Is set to true be self.stop_pump
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.buffer_size = 36000 #size of ringbuffers for plotting. 36000 is roughly 1 hour, if timng_main is 0.1 s
self.buffer = collections.deque(maxlen=self.buffer_size) #ringbuffer for plot data
self.lines_config_strings = [self.line_devAdr,self.line_filePath]#is used for config file
self.Spinboxes_config = [self.SB_N_points, self.dSB_save_intervall, self.dSB_timing,
self.SB_Buffer_size]#is used for config file
self.checkboxes_config = [self.checkBox_disableplots,self.checkBox_save]#is used for config file
#read default values from config and set them in gui
self.read_default()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.ag = Agilent_304_FS_AG.AG_304_FS(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_all(self, progress_callback):
'''get values from device and write them to global variables.'''
while self.running == True:
start = timer()
P = self.ag.read_pressure()
T = self.ag.read_temp()
f = self.ag.read_freq()
status = self.ag.read_status()
self.P = P #store pressure as global variable for save thread
#Write measurement values into global variables
self.sync_AG_304.update({'P':P})
self.sync_AG_304.update({'T':T})
self.sync_AG_304.update({'f':f})
self.sync_AG_304.update({'Status':status})
#Append Ringbuffer
self.buffer.append([time.time(),P])
#emit signal to trigger self.update_gui
progress_callback.emit([P,T,f,status])
end = timer()
if self.start == True: #check if pump should start or stop
self.ag.start_pump()
time.sleep(2)
self.start = False
elif self.stop == True:
self.ag.stop_pump()
time.sleep(2)
self.stop = False
try:
time.sleep(self.dSB_timing.value()-(end-start))
except:
print(f"Iteration took {end-start} seconds.")
del(self.ag) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
P = List[0]
T = List[1]
f = List[2]
status = List[3]
#set numbers
self.line_P.setText(f"{P:.2e}")
self.line_T.setText(f"{T:.2f}")
self.line_f.setText(f"{f}")
self.line_status.setText(status)
#plot
#calculate index in buffer where plots start. (Needed for itertools.islice)
I_s = len(self.buffer) - self.Npoints
if I_s < 0:
I_s = 0
if self.disable_plot == False:
self.plot_1.setData(np.array(list(itertools.islice(self.buffer,I_s,None)))[:,0],
np.array(list(itertools.islice(self.buffer,I_s,None)))[:,1])
def start_pump(self):
'''generates prompt to make shure pump should start and, depending on
the input, it sets self.start to True. It is done this way so the controller does not
get multiple inputs at once from different threads.'''
button = QMessageBox.question(self, 'Start Pump','Start Pump?')
if button == QMessageBox.StandardButton.Yes:
print('start')
self.start = True
else:
print('no start')
def stop_pump(self):
'''generates prompt to make shure pump should stop and, depending on
the input, it sets self.stop to True. It is done this way so the controller does not
get multiple inputs at once from different threads.'''
button = QMessageBox.question(self, 'Stop Pump','Stop Pump?')
if button == QMessageBox.StandardButton.Yes:
print('stop')
self.stop = True
else:
print('no stop')
def change_buffer_size(self):
new_len = self.SB_Buffer_size.value()
data = list(self.buffer)
self.buffer = collections.deque(data[-new_len:], maxlen = new_len)
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = self.SB_N_points.value()
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = self.dSB_save_intervall.value()
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tP[mbar]\n')
file = open(path,'a')
t = self.buffer[len(self.buffer)-1][0]
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(t))+'\t')
file.write(f'{self.P}\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\AG_304_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for s in self.Spinboxes_config:
file.write(f"{s.value()}\t")
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\AG_304_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
for l,v in zip(self.lines_config_strings,vals[0][:]):
l.setText(v)
for s,v in zip(self.Spinboxes_config,vals[0][len(self.lines_config_strings):]):
try: #give float or int, depending on dSB of SB
s.setValue(float(v))
except TypeError:
s.setValue(int(v))
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,434 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
import collections
import itertools
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import BK_9132B
from design_files.BK_9131B_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_BK_9131B')
self.sync_BK_9131B = manager.sync_BK_9131B()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_BK_9131B')
self.sync_BK_9131B = manager.sync_BK_9131B()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_BK_9131B.update({'setU':[0,0,0], 'setI':[0,0,0], 'OutputOn':[False, False, False], 'U':[0,0,0], 'I':[0,0,0], 'P':[0,0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Voltage, Current, Power")
self.graphWidget.setLabel('left', 'Voltage [V], Current [A], Power [W]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
pen7 = pg.mkPen(color=(255, 127, 127), width=2)
pen8 = pg.mkPen(color=(127, 255, 70), width=2)
pen9 = pg.mkPen(color=(255, 127, 70), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'V Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'I Ch: 1')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'P Ch: 1')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'V Ch: 2')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'I Ch: 2')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'P Ch: 2')
self.plot_7 = self.graphWidget.plot(temp,[1,0],pen = pen7, name = 'V Ch: 3')
self.plot_8 = self.graphWidget.plot(temp,[1,0],pen = pen8, name = 'I Ch: 3')
self.plot_9 = self.graphWidget.plot(temp,[1,0],pen = pen9, name = 'P Ch: 3')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.SB_Nplot.editingFinished.connect(self.set_Npoints)
self.dSB_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.checkBox_V_1.stateChanged.connect(self.plot_hide)
self.checkBox_I_1.stateChanged.connect(self.plot_hide)
self.checkBox_P_1.stateChanged.connect(self.plot_hide)
self.checkBox_V_2.stateChanged.connect(self.plot_hide)
self.checkBox_I_2.stateChanged.connect(self.plot_hide)
self.checkBox_P_2.stateChanged.connect(self.plot_hide)
self.checkBox_V_3.stateChanged.connect(self.plot_hide)
self.checkBox_I_3.stateChanged.connect(self.plot_hide)
self.checkBox_P_3.stateChanged.connect(self.plot_hide)
self.V_set_1.editingFinished.connect(self.set_V)
self.I_set_1.editingFinished.connect(self.set_I)
self.Output_1.stateChanged.connect(self.set_Output)
self.V_set_2.editingFinished.connect(self.set_V)
self.I_set_2.editingFinished.connect(self.set_I)
self.Output_2.stateChanged.connect(self.set_Output)
self.V_set_3.editingFinished.connect(self.set_V)
self.I_set_3.editingFinished.connect(self.set_I)
self.Output_3.stateChanged.connect(self.set_Output)
#define constants
self.Voltage = np.zeros((1,3)) #store voltage data
self.Current = np.zeros((1,3)) #store current data
self.Power = np.zeros((1,3)) #store power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.buffer_size = 36000 #size of ringbuffers for plotting. 36000 is roughly 1 hour, if timng_main is 0.1 s
self.buffer = collections.deque(maxlen=self.buffer_size) #ringbuffer for plot data
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.Spinboxes_config = [self.V_set_1,self.I_set_1,self.V_set_2,self.I_set_2,
self.V_set_3,self.I_set_3,self.SB_Nplot, self.SB_Buffer_size,
self.dSB_saveInterval]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath]#is used for config file
self.checkboxes_config = [self.Output_1, self.Output_2, self.Output_3,self.checkBox_disableplots,self.checkBox_save,
self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1, self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3,]#is used for config file
#read default values from config and set them in gui
self.read_default()
# #write values from gui to global variables.
self.set_V()
self.set_I()
self.set_Output()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.BK = BK_9132B.BK_9132B(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setU', 'setI', 'OutputOn']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_BK_9131B.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if setU is changed new setU parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Voltage(CH, self.set_new[0][CH-1]) #CH is element of 1-3 but setU parameters have indices of 0-2
if self.set_new[1] != self.set_old[1]: #if setI is changed new setI parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Current(CH, self.set_new[1][CH-1]) #CH is element of 1-3 but setI parameters have indices of 0-2
if self.set_new[2] != self.set_old[2]: #if OutputOn is changed new OutputOn parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Output(CH, self.set_new[2][CH-1]) #CH is element of 1-3 but OutputOn parameters have indices of 0-2
self.update_setValues(self.set_new) #Change GUI
U = self.BK.read_Voltage() #read Voltage of all three channels
I = self.BK.read_Current() #read Current of all three channels
P = self.BK.read_Power() #read Power of all three channels
#store values for save thread
self.Voltage = U
self.Current = I
self.Power = P
#Write measurement values into global variables
self.sync_BK_9131B.update({'U':U})
self.sync_BK_9131B.update({'I':I})
self.sync_BK_9131B.update({'P':P})
#Append Ringbuffer
self.buffer.append([time.time()]+U+I+P)
#emit signal to trigger self.update_gui
progress_callback.emit([U,I,P]) #Emits list of all three lists U,I,P
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.BK) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
U = List[0]
I = List[1]
P = List[2]
#set numbers
self.V_1.setText(str(U[0]))
self.I_1.setText(str(I[0]))
self.P_1.setText(str(P[0]))
self.V_2.setText(str(U[1]))
self.I_2.setText(str(I[1]))
self.P_2.setText(str(P[1]))
self.V_3.setText(str(U[2]))
self.I_3.setText(str(I[2]))
self.P_3.setText(str(P[2]))
#plot
#calculate index in buffer where plots start. (Needed for itertools.islice)
I_s = len(self.buffer) - self.Npoints
if I_s < 0:
I_s = 0
if self.disable_plot == False:
t = np.array(list(itertools.islice(self.buffer,I_s,None)))[:,0]
self.plot_1.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,1])#V1
self.plot_2.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,4])#I1
self.plot_3.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,7])#P1
self.plot_4.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,2])#V2
self.plot_5.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,5])#I2
self.plot_6.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,8])#P2
self.plot_7.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,3])#V3
self.plot_8.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,6])#I3
self.plot_9.setData(t, np.array(list(itertools.islice(self.buffer,I_s,None)))[:,9])#P3
def update_setValues(self,setV):
#sets setvalues obtained from update_all in gui ['setU', 'setI', 'OutputOn']
self.V_set_1.setValue(setV[0][0])
self.I_set_1.setValue(setV[1][0])
self.Output_1.setChecked(setV[2][0])
self.V_set_2.setValue(setV[0][1])
self.I_set_2.setValue(setV[1][1])
self.Output_2.setChecked(setV[2][1])
self.V_set_3.setValue(setV[0][2])
self.I_set_3.setValue(setV[1][2])
self.Output_3.setChecked(setV[2][2])
def set_V(self):
#updates the set voltage in global variables. The change will be detected by update_all and it will be passed to the device
setU = [self.V_set_1.value(), self.V_set_2.value(), self.V_set_3.value()]
print(setU)
self.sync_BK_9131B.update({'setU':setU})
def set_I(self):
#updates the set current in global variables. The change will be detected by update_all and it will be passed to the device
setI = [self.I_set_1.value(), self.I_set_2.value(), self.I_set_3.value()]
self.sync_BK_9131B.update({'setI':setI})
def set_Output(self):
#updates the set Output in global variables. The change will be detected by update_all and it will be passed to the device
setOutput = [self.Output_1.isChecked(), self.Output_2.isChecked(), self.Output_3.isChecked()]
self.sync_BK_9131B.update({'OutputOn':setOutput})
def change_buffer_size(self):
new_len = self.SB_Buffer_size.value()
data = list(self.buffer)
self.buffer = collections.deque(data[-new_len:], maxlen = new_len)
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = self.SB_Nplot.value()
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1,
self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3]
plots = plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6, self.plot_7, self.plot_8, self.plot_9]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = self.dSB_saveInterval.value()
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\tV Ch:3[V]\tI Ch:3[A]\tP Ch:3[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(t))+'\t')
for i in [0,1,2]: #Loop for all three channels
file.write(f"{self.Voltage[i]}\t")
file.write(f"{self.Current[i]}\t")
file.write(f"{self.Power[i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9131B_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for s in self.Spinboxes_config:
file.write(f"{s.value()}\t")
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9131B_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
for s,v in zip(self.Spinboxes_config,vals[0]):
try: #give float or int, depending on dSB of SB
s.setValue(float(v))
except TypeError:
s.setValue(int(v))
for l,v in zip(self.lines_config_strings,vals[0][len(self.Spinboxes_config):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.Spinboxes_config)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,413 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import BK_9132B
from design_files.BK_9132B_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_BK_9132B')
self.sync_BK_9132B = manager.sync_BK_9132B()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_BK_9132B')
self.sync_BK_9132B = manager.sync_BK_9132B()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_BK_9132B.update({'setU':[0,0,0], 'setI':[0,0,0], 'OutputOn':[False, False, False], 'U':[0,0,0], 'I':[0,0,0], 'P':[0,0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Voltage, Current, Power")
self.graphWidget.setLabel('left', 'Voltage [V], Current [A], Power [W]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
pen7 = pg.mkPen(color=(255, 127, 127), width=2)
pen8 = pg.mkPen(color=(127, 255, 70), width=2)
pen9 = pg.mkPen(color=(255, 127, 70), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'V Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'I Ch: 1')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'P Ch: 1')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'V Ch: 2')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'I Ch: 2')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'P Ch: 2')
self.plot_7 = self.graphWidget.plot(temp,[1,0],pen = pen7, name = 'V Ch: 3')
self.plot_8 = self.graphWidget.plot(temp,[1,0],pen = pen8, name = 'I Ch: 3')
self.plot_9 = self.graphWidget.plot(temp,[1,0],pen = pen9, name = 'P Ch: 3')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.checkBox_V_1.stateChanged.connect(self.plot_hide)
self.checkBox_I_1.stateChanged.connect(self.plot_hide)
self.checkBox_P_1.stateChanged.connect(self.plot_hide)
self.checkBox_V_2.stateChanged.connect(self.plot_hide)
self.checkBox_I_2.stateChanged.connect(self.plot_hide)
self.checkBox_P_2.stateChanged.connect(self.plot_hide)
self.checkBox_V_3.stateChanged.connect(self.plot_hide)
self.checkBox_I_3.stateChanged.connect(self.plot_hide)
self.checkBox_P_3.stateChanged.connect(self.plot_hide)
self.V_set_1.editingFinished.connect(self.set_V)
self.I_set_1.editingFinished.connect(self.set_I)
self.Output_1.stateChanged.connect(self.set_Output)
self.V_set_2.editingFinished.connect(self.set_V)
self.I_set_2.editingFinished.connect(self.set_I)
self.Output_2.stateChanged.connect(self.set_Output)
self.V_set_3.editingFinished.connect(self.set_V)
self.I_set_3.editingFinished.connect(self.set_I)
self.Output_3.stateChanged.connect(self.set_Output)
#define constants
self.Voltage = np.zeros((1,3)) #store voltage data
self.Current = np.zeros((1,3)) #store current data
self.Power = np.zeros((1,3)) #store power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.V_set_1,self.I_set_1,self.V_set_2,self.I_set_2,self.V_set_3,self.I_set_3,self.line_Nplot]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath,self.line_saveInterval]#is used for config file
self.checkboxes_config = [self.Output_1, self.Output_2, self.Output_3,self.checkBox_disableplots,self.checkBox_save,
self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1, self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3,]#is used for config file
#read default values from config and set them in gui
self.read_default()
# #write values from gui to global variables.
self.set_V()
self.set_I()
self.set_Output()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.BK = BK_9132B.BK_9132B(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setU', 'setI', 'OutputOn']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_BK_9132B.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if setU is changed new setU parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Voltage(CH, self.set_new[0][CH-1]) #CH is element of 1-3 but setU parameters have indices of 0-2
if self.set_new[1] != self.set_old[1]: #if setI is changed new setI parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Current(CH, self.set_new[1][CH-1]) #CH is element of 1-3 but setI parameters have indices of 0-2
if self.set_new[2] != self.set_old[2]: #if OutputOn is changed new OutputOn parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Output(CH, self.set_new[2][CH-1]) #CH is element of 1-3 but OutputOn parameters have indices of 0-2
self.update_setValues(self.set_new) #Change GUI
U = self.BK.read_Voltage() #read Voltage of all three channels
I = self.BK.read_Current() #read Current of all three channels
P = self.BK.read_Power() #read Power of all three channels
#Write measurement values into global variables
self.sync_BK_9132B.update({'U':U})
self.sync_BK_9132B.update({'I':I})
self.sync_BK_9132B.update({'P':P})
progress_callback.emit([U,I,P]) #Emits list of all three lists U,I,P
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.BK) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
U = List[0]
I = List[1]
P = List[2]
#set numbers
self.V_1.setText(str(U[0]))
self.I_1.setText(str(I[0]))
self.P_1.setText(str(P[0]))
self.V_2.setText(str(U[1]))
self.I_2.setText(str(I[1]))
self.P_2.setText(str(P[1]))
self.V_3.setText(str(U[2]))
self.I_3.setText(str(I[2]))
self.P_3.setText(str(P[2]))
#Create database for plotting
self.Voltage = np.vstack([self.Voltage, np.array(U)])
self.Current = np.vstack([self.Current, np.array(I)])
self.Power = np.vstack([self.Power, np.array(P)])
# x = range(len(self.Temperature))
self.t.append(time.time())
#plot
if self.disable_plot == False:
self.plot_1.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,0])
self.plot_2.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,0])
self.plot_3.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,0])
self.plot_4.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,1])
self.plot_5.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,1])
self.plot_6.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,1])
self.plot_7.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,2])
self.plot_8.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,2])
self.plot_9.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,2])
def update_setValues(self,setV):
#sets setvalues obtained from update_all in gui ['setU', 'setI', 'OutputOn']
self.V_set_1.setText(f"{setV[0][0]}")
self.I_set_1.setText(f"{setV[1][0]}")
self.Output_1.setChecked(setV[2][0])
self.V_set_2.setText(f"{setV[0][1]}")
self.I_set_2.setText(f"{setV[1][1]}")
self.Output_2.setChecked(setV[2][1])
self.V_set_3.setText(f"{setV[0][2]}")
self.I_set_3.setText(f"{setV[1][2]}")
self.Output_3.setChecked(setV[2][2])
def set_V(self):
#updates the set voltage in global variables. The change will be detected by update_all and it will be passed to the device
setU = [get_float(self.V_set_1), get_float(self.V_set_2), get_float(self.V_set_3)]
self.sync_BK_9132B.update({'setU':setU})
def set_I(self):
#updates the set current in global variables. The change will be detected by update_all and it will be passed to the device
setI = [get_float(self.I_set_1), get_float(self.I_set_2), get_float(self.I_set_3)]
self.sync_BK_9132B.update({'setI':setI})
def set_Output(self):
#updates the set Output in global variables. The change will be detected by update_all and it will be passed to the device
setOutput = [self.Output_1.isChecked(), self.Output_2.isChecked(), self.Output_3.isChecked()]
self.sync_BK_9132B.update({'OutputOn':setOutput})
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1,
self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3]
plots = plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6, self.plot_7, self.plot_8, self.plot_9]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\tV Ch:3[V]\tI Ch:3[A]\tP Ch:3[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
for i in [0,1,2]: #Loop for all three channels
file.write(f"{self.Voltage[-1,i]}\t")
file.write(f"{self.Current[-1,i]}\t")
file.write(f"{self.Power[-1,i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9132B_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9132B_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,414 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import BK_9132B
from design_files.BK_9132B_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_BK_9132B_2')
self.sync_BK_9132B = manager.sync_BK_9132B_2()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_BK_9132B_2')
self.sync_BK_9132B = manager.sync_BK_9132B_2()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_BK_9132B.update({'setU':[0,0,0], 'setI':[0,0,0], 'OutputOn':[False, False, False], 'U':[0,0,0], 'I':[0,0,0], 'P':[0,0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
self.label_device.setText('Device 2') #change label to "device 2" to indicate which device is controlled
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Voltage, Current, Power")
self.graphWidget.setLabel('left', 'Voltage [V], Current [A], Power [W]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
pen7 = pg.mkPen(color=(255, 127, 127), width=2)
pen8 = pg.mkPen(color=(127, 255, 70), width=2)
pen9 = pg.mkPen(color=(255, 127, 70), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'V Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'I Ch: 1')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'P Ch: 1')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'V Ch: 2')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'I Ch: 2')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'P Ch: 2')
self.plot_7 = self.graphWidget.plot(temp,[1,0],pen = pen7, name = 'V Ch: 3')
self.plot_8 = self.graphWidget.plot(temp,[1,0],pen = pen8, name = 'I Ch: 3')
self.plot_9 = self.graphWidget.plot(temp,[1,0],pen = pen9, name = 'P Ch: 3')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.checkBox_V_1.stateChanged.connect(self.plot_hide)
self.checkBox_I_1.stateChanged.connect(self.plot_hide)
self.checkBox_P_1.stateChanged.connect(self.plot_hide)
self.checkBox_V_2.stateChanged.connect(self.plot_hide)
self.checkBox_I_2.stateChanged.connect(self.plot_hide)
self.checkBox_P_2.stateChanged.connect(self.plot_hide)
self.checkBox_V_3.stateChanged.connect(self.plot_hide)
self.checkBox_I_3.stateChanged.connect(self.plot_hide)
self.checkBox_P_3.stateChanged.connect(self.plot_hide)
self.V_set_1.editingFinished.connect(self.set_V)
self.I_set_1.editingFinished.connect(self.set_I)
self.Output_1.stateChanged.connect(self.set_Output)
self.V_set_2.editingFinished.connect(self.set_V)
self.I_set_2.editingFinished.connect(self.set_I)
self.Output_2.stateChanged.connect(self.set_Output)
self.V_set_3.editingFinished.connect(self.set_V)
self.I_set_3.editingFinished.connect(self.set_I)
self.Output_3.stateChanged.connect(self.set_Output)
#define constants
self.Voltage = np.zeros((1,3)) #store voltage data
self.Current = np.zeros((1,3)) #store current data
self.Power = np.zeros((1,3)) #store power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.V_set_1,self.I_set_1,self.V_set_2,self.I_set_2,self.V_set_3,self.I_set_3,self.line_Nplot]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath,self.line_saveInterval]#is used for config file
self.checkboxes_config = [self.Output_1, self.Output_2, self.Output_3,self.checkBox_disableplots,self.checkBox_save,
self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1, self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3,]#is used for config file
#read default values from config and set them in gui
self.read_default()
# #write values from gui to global variables.
self.set_V()
self.set_I()
self.set_Output()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.BK = BK_9132B.BK_9132B(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setU', 'setI', 'OutputOn']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_BK_9132B.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if setU is changed new setU parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Voltage(CH, self.set_new[0][CH-1]) #CH is element of 1-3 but setU parameters have indices of 0-2
if self.set_new[1] != self.set_old[1]: #if setI is changed new setI parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Current(CH, self.set_new[1][CH-1]) #CH is element of 1-3 but setI parameters have indices of 0-2
if self.set_new[2] != self.set_old[2]: #if OutputOn is changed new OutputOn parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.BK.set_Output(CH, self.set_new[2][CH-1]) #CH is element of 1-3 but OutputOn parameters have indices of 0-2
self.update_setValues(self.set_new) #Change GUI
U = self.BK.read_Voltage() #read Voltage of all three channels
I = self.BK.read_Current() #read Current of all three channels
P = self.BK.read_Power() #read Power of all three channels
#Write measurement values into global variables
self.sync_BK_9132B.update({'U':U})
self.sync_BK_9132B.update({'I':I})
self.sync_BK_9132B.update({'P':P})
progress_callback.emit([U,I,P]) #Emits list of all three lists U,I,P
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.BK) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
U = List[0]
I = List[1]
P = List[2]
#set numbers
self.V_1.setText(str(U[0]))
self.I_1.setText(str(I[0]))
self.P_1.setText(str(P[0]))
self.V_2.setText(str(U[1]))
self.I_2.setText(str(I[1]))
self.P_2.setText(str(P[1]))
self.V_3.setText(str(U[2]))
self.I_3.setText(str(I[2]))
self.P_3.setText(str(P[2]))
#Create database for plotting
self.Voltage = np.vstack([self.Voltage, np.array(U)])
self.Current = np.vstack([self.Current, np.array(I)])
self.Power = np.vstack([self.Power, np.array(P)])
# x = range(len(self.Temperature))
self.t.append(time.time())
#plot
if self.disable_plot == False:
self.plot_1.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,0])
self.plot_2.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,0])
self.plot_3.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,0])
self.plot_4.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,1])
self.plot_5.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,1])
self.plot_6.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,1])
self.plot_7.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,2])
self.plot_8.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,2])
self.plot_9.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,2])
def update_setValues(self,setV):
#sets setvalues obtained from update_all in gui ['setU', 'setI', 'OutputOn']
self.V_set_1.setText(f"{setV[0][0]}")
self.I_set_1.setText(f"{setV[1][0]}")
self.Output_1.setChecked(setV[2][0])
self.V_set_2.setText(f"{setV[0][1]}")
self.I_set_2.setText(f"{setV[1][1]}")
self.Output_2.setChecked(setV[2][1])
self.V_set_3.setText(f"{setV[0][2]}")
self.I_set_3.setText(f"{setV[1][2]}")
self.Output_3.setChecked(setV[2][2])
def set_V(self):
#updates the set voltage in global variables. The change will be detected by update_all and it will be passed to the device
setU = [get_float(self.V_set_1), get_float(self.V_set_2), get_float(self.V_set_3)]
self.sync_BK_9132B.update({'setU':setU})
def set_I(self):
#updates the set current in global variables. The change will be detected by update_all and it will be passed to the device
setI = [get_float(self.I_set_1), get_float(self.I_set_2), get_float(self.I_set_3)]
self.sync_BK_9132B.update({'setI':setI})
def set_Output(self):
#updates the set Output in global variables. The change will be detected by update_all and it will be passed to the device
setOutput = [self.Output_1.isChecked(), self.Output_2.isChecked(), self.Output_3.isChecked()]
self.sync_BK_9132B.update({'OutputOn':setOutput})
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1,
self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3]
plots = plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6, self.plot_7, self.plot_8, self.plot_9]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\tV Ch:3[V]\tI Ch:3[A]\tP Ch:3[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
for i in [0,1,2]: #Loop for all three channels
file.write(f"{self.Voltage[-1,i]}\t")
file.write(f"{self.Current[-1,i]}\t")
file.write(f"{self.Power[-1,i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9132B_2_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9132B_2_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,396 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import BK_9174B
from design_files.BK_9174B_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_BK_9174B_2')
self.sync_BK_9174B = manager.sync_BK_9174B_2()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_BK_9174B_2')
self.sync_BK_9174B = manager.sync_BK_9174B_2()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_BK_9174B.update({'setU':[0,0], 'setI':[0,0], 'OutputOn':[False, False], 'U':[0,0], 'I':[0,0], 'P':[0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
self.label_device.setText('Device 2') #change label to "device 2" to indicate which device is controlled
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Voltage, Current, Power")
self.graphWidget.setLabel('left', 'Voltage [V], Current [A], Power [W]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'V Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'I Ch: 1')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'P Ch: 1')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'V Ch: 2')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'I Ch: 2')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'P Ch: 2')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.checkBox_V_1.stateChanged.connect(self.plot_hide)
self.checkBox_I_1.stateChanged.connect(self.plot_hide)
self.checkBox_P_1.stateChanged.connect(self.plot_hide)
self.checkBox_V_2.stateChanged.connect(self.plot_hide)
self.checkBox_I_2.stateChanged.connect(self.plot_hide)
self.checkBox_P_2.stateChanged.connect(self.plot_hide)
self.V_set_1.editingFinished.connect(self.set_V)
self.I_set_1.editingFinished.connect(self.set_I)
self.Output_1.stateChanged.connect(self.set_Output)
self.V_set_2.editingFinished.connect(self.set_V)
self.I_set_2.editingFinished.connect(self.set_I)
self.Output_2.stateChanged.connect(self.set_Output)
#define constants
self.Voltage = np.zeros((1,2)) #store voltage data
self.Current = np.zeros((1,2)) #store current data
self.Power = np.zeros((1,2)) #store power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.V_set_1,self.I_set_1,self.V_set_2,self.I_set_2,self.line_Nplot]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath,self.line_saveInterval]#is used for config file
self.checkboxes_config = [self.Output_1, self.Output_2,self.checkBox_disableplots,self.checkBox_save,
self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1, self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2]#is used for config file
#read default values from config and set them in gui
self.read_default()
# #write values from gui to global variables.
self.set_V()
self.set_I()
self.set_Output()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.BK = BK_9174B.BK_9174B(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
#set voltage slew rate values. At the moment 0.5 V/ms is an arbitrary value
self.BK.set_Voltage_slewrate(1, 0.5)
self.BK.set_Voltage_slewrate(2, 0.5)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setU', 'setI', 'OutputOn']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_BK_9174B.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if setU is changed new setU parameters are sent to device
for CH in [1,2]: #for loop for both channels
self.BK.set_Voltage(CH, self.set_new[0][CH-1]) #CH is element of [1,2] but setU parameters have indices of [0,1]
if self.set_new[1] != self.set_old[1]: #if setI is changed new setI parameters are sent to device
for CH in [1,2]: #for loop for both channels
self.BK.set_Current(CH, self.set_new[1][CH-1]) #CH is element of [1,2] but setI parameters have indices of [0,1]
if self.set_new[2] != self.set_old[2]: #if OutputOn is changed new OutputOn parameters are sent to device
for CH in [1,2]: #for loop for both channels
self.BK.set_Output(CH, self.set_new[2][CH-1]) #CH is element of [1,2] but OutputOn parameters have indices of [0,1]
self.update_setValues(self.set_new) #Change GUI
U = self.BK.read_Voltage() #read Voltage of both channels
I = self.BK.read_Current() #read Current of both channels
P = [np.round(U[0]*I[0],4),np.round(U[1]*I[1],4)] #calculates power by P=U*I and rounds to 4 digits
#Write measurement values into global variables
self.sync_BK_9174B.update({'U':U})
self.sync_BK_9174B.update({'I':I})
self.sync_BK_9174B.update({'P':P})
progress_callback.emit([U,I,P]) #Emits list of all three lists U,I,P
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.BK) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
U = List[0]
I = List[1]
P = List[2]
#set numbers
self.V_1.setText(str(U[0]))
self.I_1.setText(str(I[0]))
self.P_1.setText(str(P[0]))
self.V_2.setText(str(U[1]))
self.I_2.setText(str(I[1]))
self.P_2.setText(str(P[1]))
#Create database for plotting
self.Voltage = np.vstack([self.Voltage, np.array(U)])
self.Current = np.vstack([self.Current, np.array(I)])
self.Power = np.vstack([self.Power, np.array(P)])
# x = range(len(self.Temperature))
self.t.append(time.time())
#plot
if self.disable_plot == False:
self.plot_1.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,0])
self.plot_2.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,0])
self.plot_3.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,0])
self.plot_4.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,1])
self.plot_5.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,1])
self.plot_6.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,1])
def update_setValues(self,setV):
#sets setvalues obtained from update_all in gui ['setU', 'setI', 'OutputOn']
self.V_set_1.setText(f"{setV[0][0]}")
self.I_set_1.setText(f"{setV[1][0]}")
self.Output_1.setChecked(setV[2][0])
self.V_set_2.setText(f"{setV[0][1]}")
self.I_set_2.setText(f"{setV[1][1]}")
self.Output_2.setChecked(setV[2][1])
def set_V(self):
#updates the set voltage in global variables. The change will be detected by update_all and it will be passed to the device
setU = [get_float(self.V_set_1), get_float(self.V_set_2)]
self.sync_BK_9174B.update({'setU':setU})
def set_I(self):
#updates the set current in global variables. The change will be detected by update_all and it will be passed to the device
setI = [get_float(self.I_set_1), get_float(self.I_set_2)]
self.sync_BK_9174B.update({'setI':setI})
def set_Output(self):
#updates the set Output in global variables. The change will be detected by update_all and it will be passed to the device
setOutput = [self.Output_1.isChecked(), self.Output_2.isChecked()]
self.sync_BK_9174B.update({'OutputOn':setOutput})
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1,
self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2]
plots = plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
for i in [0,1]: #Loop for both channels
file.write(f"{self.Voltage[-1,i]}\t")
file.write(f"{self.Current[-1,i]}\t")
file.write(f"{self.Power[-1,i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9174B_2_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9174B_2_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,394 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import BK_9174B
from design_files.BK_9174B_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_BK_9174B')
self.sync_BK_9174B = manager.sync_BK_9174B()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_BK_9174B')
self.sync_BK_9174B = manager.sync_BK_9174B()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_BK_9174B.update({'setU':[0,0], 'setI':[0,0], 'OutputOn':[False, False], 'U':[0,0], 'I':[0,0], 'P':[0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Voltage, Current, Power")
self.graphWidget.setLabel('left', 'Voltage [V], Current [A], Power [W]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'V Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'I Ch: 1')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'P Ch: 1')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'V Ch: 2')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'I Ch: 2')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'P Ch: 2')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.checkBox_V_1.stateChanged.connect(self.plot_hide)
self.checkBox_I_1.stateChanged.connect(self.plot_hide)
self.checkBox_P_1.stateChanged.connect(self.plot_hide)
self.checkBox_V_2.stateChanged.connect(self.plot_hide)
self.checkBox_I_2.stateChanged.connect(self.plot_hide)
self.checkBox_P_2.stateChanged.connect(self.plot_hide)
self.V_set_1.editingFinished.connect(self.set_V)
self.I_set_1.editingFinished.connect(self.set_I)
self.Output_1.stateChanged.connect(self.set_Output)
self.V_set_2.editingFinished.connect(self.set_V)
self.I_set_2.editingFinished.connect(self.set_I)
self.Output_2.stateChanged.connect(self.set_Output)
#define constants
self.Voltage = np.zeros((1,2)) #store voltage data
self.Current = np.zeros((1,2)) #store current data
self.Power = np.zeros((1,2)) #store power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.V_set_1,self.I_set_1,self.V_set_2,self.I_set_2,self.line_Nplot]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath,self.line_saveInterval]#is used for config file
self.checkboxes_config = [self.Output_1, self.Output_2,self.checkBox_disableplots,self.checkBox_save,
self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1, self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2]#is used for config file
#read default values from config and set them in gui
self.read_default()
# #write values from gui to global variables.
self.set_V()
self.set_I()
self.set_Output()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.BK = BK_9174B.BK_9174B(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
#set voltage slew rate values. At the moment 0.5 V/ms is an arbitrary value
self.BK.set_Voltage_slewrate(1, 0.5)
self.BK.set_Voltage_slewrate(2, 0.5)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setU', 'setI', 'OutputOn']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_BK_9174B.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if setU is changed new setU parameters are sent to device
for CH in [1,2]: #for loop for both channels
self.BK.set_Voltage(CH, self.set_new[0][CH-1]) #CH is element of [1,2] but setU parameters have indices of [0,1]
if self.set_new[1] != self.set_old[1]: #if setI is changed new setI parameters are sent to device
for CH in [1,2]: #for loop for both channels
self.BK.set_Current(CH, self.set_new[1][CH-1]) #CH is element of [1,2] but setI parameters have indices of [0,1]
if self.set_new[2] != self.set_old[2]: #if OutputOn is changed new OutputOn parameters are sent to device
for CH in [1,2]: #for loop for both channels
self.BK.set_Output(CH, self.set_new[2][CH-1]) #CH is element of [1,2] but OutputOn parameters have indices of [0,1]
self.update_setValues(self.set_new) #Change GUI
U = self.BK.read_Voltage() #read Voltage of both channels
I = self.BK.read_Current() #read Current of both channels
P = [np.round(U[0]*I[0],4),np.round(U[1]*I[1],4)] #calculates power by P=U*I and rounds to 4 digits
#Write measurement values into global variables
self.sync_BK_9174B.update({'U':U})
self.sync_BK_9174B.update({'I':I})
self.sync_BK_9174B.update({'P':P})
progress_callback.emit([U,I,P]) #Emits list of all three lists U,I,P
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.BK) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
U = List[0]
I = List[1]
P = List[2]
#set numbers
self.V_1.setText(str(U[0]))
self.I_1.setText(str(I[0]))
self.P_1.setText(str(P[0]))
self.V_2.setText(str(U[1]))
self.I_2.setText(str(I[1]))
self.P_2.setText(str(P[1]))
#Create database for plotting
self.Voltage = np.vstack([self.Voltage, np.array(U)])
self.Current = np.vstack([self.Current, np.array(I)])
self.Power = np.vstack([self.Power, np.array(P)])
# x = range(len(self.Temperature))
self.t.append(time.time())
#plot
if self.disable_plot == False:
self.plot_1.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,0])
self.plot_2.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,0])
self.plot_3.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,0])
self.plot_4.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,1])
self.plot_5.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,1])
self.plot_6.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,1])
def update_setValues(self,setV):
#sets setvalues obtained from update_all in gui ['setU', 'setI', 'OutputOn']
self.V_set_1.setText(f"{setV[0][0]}")
self.I_set_1.setText(f"{setV[1][0]}")
self.Output_1.setChecked(setV[2][0])
self.V_set_2.setText(f"{setV[0][1]}")
self.I_set_2.setText(f"{setV[1][1]}")
self.Output_2.setChecked(setV[2][1])
def set_V(self):
#updates the set voltage in global variables. The change will be detected by update_all and it will be passed to the device
setU = [get_float(self.V_set_1), get_float(self.V_set_2)]
self.sync_BK_9174B.update({'setU':setU})
def set_I(self):
#updates the set current in global variables. The change will be detected by update_all and it will be passed to the device
setI = [get_float(self.I_set_1), get_float(self.I_set_2)]
self.sync_BK_9174B.update({'setI':setI})
def set_Output(self):
#updates the set Output in global variables. The change will be detected by update_all and it will be passed to the device
setOutput = [self.Output_1.isChecked(), self.Output_2.isChecked()]
self.sync_BK_9174B.update({'OutputOn':setOutput})
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1,
self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2]
plots = plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
for i in [0,1]: #Loop for both channels
file.write(f"{self.Voltage[-1,i]}\t")
file.write(f"{self.Current[-1,i]}\t")
file.write(f"{self.Power[-1,i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9174B_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BK9174B_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,414 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Keithley_2230G
from design_files.Keithley_2230G_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_Keithley_2230G')
self.sync_Keithley_2230G = manager.sync_Keithley_2230G()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_Keithley_2230G')
self.sync_Keithley_2230G = manager.sync_Keithley_2230G()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_Keithley_2230G.update({'setU':[0,0,0], 'setI':[0,0,0], 'OutputOn':[False, False, False], 'U':[0,0,0], 'I':[0,0,0], 'P':[0,0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Voltage, Current, Power")
self.graphWidget.setLabel('left', 'Voltage [V], Current [A], Power [W]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
pen7 = pg.mkPen(color=(255, 127, 127), width=2)
pen8 = pg.mkPen(color=(127, 255, 70), width=2)
pen9 = pg.mkPen(color=(255, 127, 70), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'V Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'I Ch: 1')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'P Ch: 1')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'V Ch: 2')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'I Ch: 2')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'P Ch: 2')
self.plot_7 = self.graphWidget.plot(temp,[1,0],pen = pen7, name = 'V Ch: 3')
self.plot_8 = self.graphWidget.plot(temp,[1,0],pen = pen8, name = 'I Ch: 3')
self.plot_9 = self.graphWidget.plot(temp,[1,0],pen = pen9, name = 'P Ch: 3')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.checkBox_V_1.stateChanged.connect(self.plot_hide)
self.checkBox_I_1.stateChanged.connect(self.plot_hide)
self.checkBox_P_1.stateChanged.connect(self.plot_hide)
self.checkBox_V_2.stateChanged.connect(self.plot_hide)
self.checkBox_I_2.stateChanged.connect(self.plot_hide)
self.checkBox_P_2.stateChanged.connect(self.plot_hide)
self.checkBox_V_3.stateChanged.connect(self.plot_hide)
self.checkBox_I_3.stateChanged.connect(self.plot_hide)
self.checkBox_P_3.stateChanged.connect(self.plot_hide)
self.V_set_1.editingFinished.connect(self.set_V)
self.I_set_1.editingFinished.connect(self.set_I)
self.Output_1.stateChanged.connect(self.set_Output)
self.V_set_2.editingFinished.connect(self.set_V)
self.I_set_2.editingFinished.connect(self.set_I)
self.Output_2.stateChanged.connect(self.set_Output)
self.V_set_3.editingFinished.connect(self.set_V)
self.I_set_3.editingFinished.connect(self.set_I)
self.Output_3.stateChanged.connect(self.set_Output)
#define constants
self.Voltage = np.zeros((1,3)) #store voltage data
self.Current = np.zeros((1,3)) #store current data
self.Power = np.zeros((1,3)) #store power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.V_set_1,self.I_set_1,self.V_set_2,self.I_set_2,self.V_set_3,self.I_set_3,self.line_Nplot]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath,self.line_saveInterval]#is used for config file
self.checkboxes_config = [self.Output_1, self.Output_2, self.Output_3,self.checkBox_disableplots,self.checkBox_save,
self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1, self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3,]#is used for config file
#read default values from config and set them in gui
self.read_default()
# #write values from gui to global variables.
self.set_V()
self.set_I()
self.set_Output()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.KL = Keithley_2230G.Keithley_2230G(address)
#start thread for communication with device
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setU', 'setI', 'OutputOn']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_Keithley_2230G.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if setU is changed new setU parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.KL.set_Voltage(CH, self.set_new[0][CH-1]) #CH is element of 1-3 but setU parameters have indices of 0-2
if self.set_new[1] != self.set_old[1]: #if setI is changed new setI parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.KL.set_Current(CH, self.set_new[1][CH-1]) #CH is element of 1-3 but setI parameters have indices of 0-2
if self.set_new[2] != self.set_old[2]: #if OutputOn is changed new OutputOn parameters are sent to device
for CH in [1,2,3]: #for loop for all 3 channels
self.KL.set_Output(CH, self.set_new[2][CH-1]) #CH is element of 1-3 but OutputOn parameters have indices of 0-2
self.update_setValues(self.set_new) #Change GUI
U = self.KL.read_Voltage() #read Voltage of all three channels
I = self.KL.read_Current() #read Current of all three channels
P = self.KL.read_Power() #read Power of all three channels
# P = [np.round(U[0]*I[0],4),np.round(U[1]*I[1],4),np.round(U[2]*I[2],4)] #calculates power by P=U*I and rounds to 4 digits
#Write measurement values into global variables
self.sync_Keithley_2230G.update({'U':U})
self.sync_Keithley_2230G.update({'I':I})
self.sync_Keithley_2230G.update({'P':P})
progress_callback.emit([U,I,P]) #Emits list of all three lists U,I,P
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.KL) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
U = List[0]
I = List[1]
P = List[2]
#set numbers
self.V_1.setText(str(U[0]))
self.I_1.setText(str(I[0]))
self.P_1.setText(str(P[0]))
self.V_2.setText(str(U[1]))
self.I_2.setText(str(I[1]))
self.P_2.setText(str(P[1]))
self.V_3.setText(str(U[2]))
self.I_3.setText(str(I[2]))
self.P_3.setText(str(P[2]))
#Create database for plotting
self.Voltage = np.vstack([self.Voltage, np.array(U)])
self.Current = np.vstack([self.Current, np.array(I)])
self.Power = np.vstack([self.Power, np.array(P)])
# x = range(len(self.Temperature))
self.t.append(time.time())
#plot
if self.disable_plot == False:
self.plot_1.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,0])
self.plot_2.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,0])
self.plot_3.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,0])
self.plot_4.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,1])
self.plot_5.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,1])
self.plot_6.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,1])
self.plot_7.setData(self.t[-self.Npoints:],self.Voltage[-self.Npoints:,2])
self.plot_8.setData(self.t[-self.Npoints:],self.Current[-self.Npoints:,2])
self.plot_9.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,2])
def update_setValues(self,setV):
#sets setvalues obtained from update_all in gui ['setU', 'setI', 'OutputOn']
self.V_set_1.setText(f"{setV[0][0]}")
self.I_set_1.setText(f"{setV[1][0]}")
self.Output_1.setChecked(setV[2][0])
self.V_set_2.setText(f"{setV[0][1]}")
self.I_set_2.setText(f"{setV[1][1]}")
self.Output_2.setChecked(setV[2][1])
self.V_set_3.setText(f"{setV[0][2]}")
self.I_set_3.setText(f"{setV[1][2]}")
self.Output_3.setChecked(setV[2][2])
def set_V(self):
#updates the set voltage in global variables. The change will be detected by update_all and it will be passed to the device
setU = [get_float(self.V_set_1), get_float(self.V_set_2), get_float(self.V_set_3)]
self.sync_Keithley_2230G.update({'setU':setU})
def set_I(self):
#updates the set current in global variables. The change will be detected by update_all and it will be passed to the device
setI = [get_float(self.I_set_1), get_float(self.I_set_2), get_float(self.I_set_3)]
self.sync_Keithley_2230G.update({'setI':setI})
def set_Output(self):
#updates the set Output in global variables. The change will be detected by update_all and it will be passed to the device
setOutput = [self.Output_1.isChecked(), self.Output_2.isChecked(), self.Output_3.isChecked()]
self.sync_Keithley_2230G.update({'OutputOn':setOutput})
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_V_1, self.checkBox_I_1, self.checkBox_P_1,
self.checkBox_V_2, self.checkBox_I_2, self.checkBox_P_2,
self.checkBox_V_3, self.checkBox_I_3, self.checkBox_P_3]
plots = plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6, self.plot_7, self.plot_8, self.plot_9]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\tV Ch:3[V]\tI Ch:3[A]\tP Ch:3[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
for i in [0,1,2]: #Loop for all three channels
file.write(f"{self.Voltage[-1,i]}\t")
file.write(f"{self.Current[-1,i]}\t")
file.write(f"{self.Power[-1,i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\Keithley_2230G_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\Keithley_2230G_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,375 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
from datetime import datetime
import traceback, sys, os, subprocess
import numpy as np
import pyqtgraph as pg
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Keysight_34461A
import import_txt
from design_files.Keysight_34461A_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_K_34461A_2')
self.sync_K_34461A = manager.sync_K_34461A_2()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_K_34461A_2')
self.sync_K_34461A = manager.sync_K_34461A_2()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#Set default values in global variables. V (Value) is the measurement data, mode specifies current or voltage measurement (0 = voltage, 1 = current)
self.sync_K_34461A.update({'V':0, 'mode':0, 'sensor':['TC','R']})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setLabel('left', 'Voltage [V]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
self.plot_P = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'Voltage')
#set up pyQT threadpool
self.threadpool = QThreadPool()
#start standard threads
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.comboBox_Plot.currentIndexChanged.connect(self.change_plot)
self.comboBox_Plot.currentIndexChanged.connect(self.change_mode)
self.comboBox_sensor.currentIndexChanged.connect(self.change_sensor)
#define constants
self.measure = 0 #which measurement should be taken. 0 = voltage, 1 = current
self.Values = np.zeros((1)) #store Voltage or Current data
self.t = [time.time()] #store timestamps
self.t1 = [datetime.now()] #store timestamps with higher precision
self.last_save = self.t1[-1] #timestamp of last write-to-file event
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 1 #save intervall
self.lines_config_float = [self.line_Nplot,self.line_saveInterval] #is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath] #is used for config file
self.checkboxes_config = [self.checkBox_disableplots,self.checkBox_save] #is used for config file
#read default values from config and set them in gui
self.read_default()
#write current gui values to global vars
self.change_mode()
#update save intervall
self.change_timing()
def start_meas(self):
#Connect to device and configure it to measure what is selected in comboBox_Plot. Also sets the correct mode in global variables and chooses correct plot layout
address = self.line_devAdr.text()
self.MM = Keysight_34461A.Keysight34461A(address)
if self.comboBox_Plot.currentIndex() == 0:
self.MM.configure() #measure Voltage
self.sync_K_34461A.update({'mode':0}) #sets mode in global variables to the one set in gui
self.change_plot(0) #setup plot to show voltage
elif self.comboBox_Plot.currentIndex() == 1:
self.MM.configure(VoC = 'CURR', DC = 'DC') #measure current
self.sync_K_34461A.update({'mode':1}) #sets mode in global variables to the one set in gui
self.change_plot(1) #setup plot to show current
elif self.comboBox_Plot.currentIndex() == 2:
self.MM.configure_temp(Sensor='TC',Type='R')
self.sync_K_34461A.update({'mode':2}) #sets mode in global variables to the one set in gui
self.change_plot(1) #setup plot to show current
self.MM.initiate_measurement() #start measurement
#start thread for communication with device
self.worker = Worker(self.update_Value)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_Value(self, progress_callback):
#gets new measurement. If "mode" in global variables changed from last iteration the new measurement mode is set.
self.mode_old = self.sync_K_34461A.get('mode') #is needed to compare measurement mode in global variables from preveous iteration to the one in current iteration
self.sensor_old = self.sync_K_34461A.get('mode') #is needed to compare sensor type in global variables from preveous iteration to the one in current iteration
while self.running == True:
self.mode_new = self.sync_K_34461A.get('mode') #up to date measurement mode in global variabels
self.sensor_new = self.sync_K_34461A.get('sensor')
if self.mode_new != self.mode_old or self.sensor_new != self.sensor_old: #if measurement mode or sensor type was changed in gui, the device is re-configured
print(self.mode_new)
print(self.sensor_new)
self.comboBox_Plot.setCurrentIndex(self.mode_new)
self.MM.stop_measurement() #stop measurement so measurement mode can be changed
if self.mode_new == 0:
self.MM.configure() #measure Voltage
self.MM.initiate_measurement() #restart measurement
elif self.mode_new == 1:
self.MM.configure(VoC = 'CURR', DC = 'DC') #measure current
self.MM.initiate_measurement() #restart measurement
elif self.mode_new == 2:
self.MM.configure_temp(Sensor=self.sensor_new[0],Type=self.sensor_new[1]) #measure tmperaure
self.MM.initiate_measurement() #restart measurement
Val = self.MM.read()
self.sync_K_34461A.update({'V':Val})
progress_callback.emit([Val])
self.mode_old = self.mode_new #store measurement mode from this iteration in mode_old so it can be compared to the new global variables in the next iteration
self.sensor_old = self.sensor_new #strore sensor type from this iteration in sensor_old so it can be compared to the new global variables in the next iteration
time.sleep(0.5)
del(self.MM) #disconnect device when self.running is set to False
def update_gui(self,V):
#set numbers depending on what is plotted
if self.mode_new == 0:
self.line_V.setText(f"{V[0]:.3e}")
elif self.mode_new == 1:
self.line_A.setText(f"{V[0]:.3e}")
elif self.mode_new == 2:
self.line_Temp.setText(f"{V[0]:.3e}")
#Create database for plotting
self.Values = np.vstack([self.Values, np.array(V[0])])
self.t.append(time.time())
self.t1.append(datetime.now())
#plot
if self.disable_plot == False:
self.plot_P.setData(self.t[-self.Npoints:],self.Values[-self.Npoints:,0])
def change_plot(self,I): #changes plot axis labels, and resets stored data for plotting
if I == 0:
self.graphWidget.setLabel('left', 'Voltage [V]')
self.Values = np.zeros((1)) #reset Voltage or Current data
self.t = [time.time()] #reset timestamps
self.line_Temp.setText('NaN') #set text in 'temperature' field to NaN, to indicate it is not measured
self.line_A.setText('NaN') # set text in 'current' field to NaN, to indicate it is not measured
elif I == 1:
self.graphWidget.setLabel('left', 'Current [A]')
self.Values = np.zeros((1)) #reset Voltage or Current data
self.t = [time.time()] #reset timestamps
self.line_Temp.setText('NaN') #set text in 'temperature' field to NaN, to indicate it is not measured
self.line_V.setText('NaN') # set text in 'voltage' field to NaN, to indicate it is not measured
elif I == 2:
self.graphWidget.setLabel('left', 'Temperaure [C°]')
self.Values = np.zeros((1)) #reset Voltage or Current data
self.t = [time.time()] #reset timestamps
self.line_V.setText('NaN') # set text in 'voltage' field to NaN, to indicate it is not measured
self.line_A.setText('NaN') # set text in 'Current' field to NaN, to indicate it is not measured
def change_mode(self):
#updates "mode" in global variables. This is detected by "update_Value" and the device is set to the correct mode
self.sync_K_34461A.update({'mode':self.comboBox_Plot.currentIndex()})
def change_sensor(self,I):
#updates "sensor" in global variables. "update_Value" and the device is set to the correct mode
if I == 0: #assign the correct sensor types to selected Index (Manual p.251)
self.sync_K_34461A.update({'sensor':['RTD','85']})
elif I == 1:
self.sync_K_34461A.update({'sensor':['FRTD','82']})
elif I == 2:
self.sync_K_34461A.update({'sensor':['FTH','5000']})
elif I == 3:
self.sync_K_34461A.update({'sensor':['THER','5000']})
elif I == 4:
self.sync_K_34461A.update({'sensor':['TC','E']})
elif I == 5:
self.sync_K_34461A.update({'sensor':['TC','J']})
elif I == 6:
self.sync_K_34461A.update({'sensor':['TC','K']})
elif I == 7:
self.sync_K_34461A.update({'sensor':['TC','N']})
elif I == 8:
self.sync_K_34461A.update({'sensor':['TC','R']})
elif I == 9:
self.sync_K_34461A.update({'sensor':['TC','T']})
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True and self.t1[-1] > self.last_save:
#write only, if there is a new timestamp
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tVoltage[V]\tCurrent[A]\tTemperature[°C]\n')
file = open(path,'a')
#file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
file.write(self.t1[-1].strftime("%Y-%m-%d_%H-%M-%S.%f")+'\t')
if self.mode_new == 0:
file.write(f"{self.sync_K_34461A.get('V')}\t0\t0\n")
elif self.mode_new == 1:
file.write(f"0\t{self.sync_K_34461A.get('V')}\t0\n")
elif self.mode_new == 2:
file.write(f"0\t0\t{self.sync_K_34461A.get('V')}\n")
self.last_save = self.t1[-1]
file.close
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Additionally measurement mode is saved. Overwrites old values in config file.
path = self.current_dir+'\\configs\\Keysight_34461A_config_2.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write(str(self.comboBox_Plot.currentIndex())+'\t')
file.write(str(self.comboBox_sensor.currentIndex()))
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
path = self.current_dir+'\\configs\\Keysight_34461A_config_2.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
return
formats = ['.0f','.2f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.comboBox_Plot.setCurrentIndex(int(vals[0][-2]))
self.comboBox_sensor.setCurrentIndex(int(vals[0][-1]))
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop.
self.running = False
time.sleep(1) #make shure threads have enough time to close
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,375 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
from datetime import datetime
import traceback, sys, os, subprocess
import numpy as np
import pyqtgraph as pg
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Keysight_34461A
import import_txt
from design_files.Keysight_34461A_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_K_34461A')
self.sync_K_34461A = manager.sync_K_34461A()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_K_34461A')
self.sync_K_34461A = manager.sync_K_34461A()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#Set default values in global variables. V (Value) is the measurement data, mode specifies current or voltage measurement (0 = voltage, 1 = current)
self.sync_K_34461A.update({'V':0, 'mode':0, 'sensor':['TC','R']})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setLabel('left', 'Voltage [V]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
self.plot_P = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'Voltage')
#set up pyQT threadpool
self.threadpool = QThreadPool()
#start standard threads
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.comboBox_Plot.currentIndexChanged.connect(self.change_plot)
self.comboBox_Plot.currentIndexChanged.connect(self.change_mode)
self.comboBox_sensor.currentIndexChanged.connect(self.change_sensor)
#define constants
self.measure = 0 #which measurement should be taken. 0 = voltage, 1 = current
self.Values = np.zeros((1)) #store Voltage or Current data
self.t = [time.time()] #store timestamps
self.t1 = [datetime.now()] #store timestamps with higher precision
self.last_save = self.t1[-1] #timestamp of last write-to-file event
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 1 #save intervall
self.lines_config_float = [self.line_Nplot,self.line_saveInterval] #is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath] #is used for config file
self.checkboxes_config = [self.checkBox_disableplots,self.checkBox_save] #is used for config file
#read default values from config and set them in gui
self.read_default()
#write current gui values to global vars
self.change_mode()
#update save intervall
self.change_timing()
def start_meas(self):
#Connect to device and configure it to measure what is selected in comboBox_Plot. Also sets the correct mode in global variables and chooses correct plot layout
address = self.line_devAdr.text()
self.MM = Keysight_34461A.Keysight34461A(address)
if self.comboBox_Plot.currentIndex() == 0:
self.MM.configure() #measure Voltage
self.sync_K_34461A.update({'mode':0}) #sets mode in global variables to the one set in gui
self.change_plot(0) #setup plot to show voltage
elif self.comboBox_Plot.currentIndex() == 1:
self.MM.configure(VoC = 'CURR', DC = 'DC') #measure current
self.sync_K_34461A.update({'mode':1}) #sets mode in global variables to the one set in gui
self.change_plot(1) #setup plot to show current
elif self.comboBox_Plot.currentIndex() == 2:
self.MM.configure_temp(Sensor='TC',Type='R')
self.sync_K_34461A.update({'mode':2}) #sets mode in global variables to the one set in gui
self.change_plot(1) #setup plot to show current
self.MM.initiate_measurement() #start measurement
#start thread for communication with device
self.worker = Worker(self.update_Value)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_Value(self, progress_callback):
#gets new measurement. If "mode" in global variables changed from last iteration the new measurement mode is set.
self.mode_old = self.sync_K_34461A.get('mode') #is needed to compare measurement mode in global variables from preveous iteration to the one in current iteration
self.sensor_old = self.sync_K_34461A.get('mode') #is needed to compare sensor type in global variables from preveous iteration to the one in current iteration
while self.running == True:
self.mode_new = self.sync_K_34461A.get('mode') #up to date measurement mode in global variabels
self.sensor_new = self.sync_K_34461A.get('sensor')
if self.mode_new != self.mode_old or self.sensor_new != self.sensor_old: #if measurement mode or sensor type was changed in gui, the device is re-configured
print(self.mode_new)
print(self.sensor_new)
self.comboBox_Plot.setCurrentIndex(self.mode_new)
self.MM.stop_measurement() #stop measurement so measurement mode can be changed
if self.mode_new == 0:
self.MM.configure() #measure Voltage
self.MM.initiate_measurement() #restart measurement
elif self.mode_new == 1:
self.MM.configure(VoC = 'CURR', DC = 'DC') #measure current
self.MM.initiate_measurement() #restart measurement
elif self.mode_new == 2:
self.MM.configure_temp(Sensor=self.sensor_new[0],Type=self.sensor_new[1]) #measure tmperaure
self.MM.initiate_measurement() #restart measurement
Val = self.MM.read()
self.sync_K_34461A.update({'V':Val})
progress_callback.emit([Val])
self.mode_old = self.mode_new #store measurement mode from this iteration in mode_old so it can be compared to the new global variables in the next iteration
self.sensor_old = self.sensor_new #strore sensor type from this iteration in sensor_old so it can be compared to the new global variables in the next iteration
time.sleep(0.5)
del(self.MM) #disconnect device when self.running is set to False
def update_gui(self,V):
#set numbers depending on what is plotted
if self.mode_new == 0:
self.line_V.setText(f"{V[0]:.3e}")
elif self.mode_new == 1:
self.line_A.setText(f"{V[0]:.3e}")
elif self.mode_new == 2:
self.line_Temp.setText(f"{V[0]:.3e}")
#Create database for plotting
self.Values = np.vstack([self.Values, np.array(V[0])])
self.t.append(time.time())
self.t1.append(datetime.now())
#plot
if self.disable_plot == False:
self.plot_P.setData(self.t[-self.Npoints:],self.Values[-self.Npoints:,0])
def change_plot(self,I): #changes plot axis labels, and resets stored data for plotting
if I == 0:
self.graphWidget.setLabel('left', 'Voltage [V]')
self.Values = np.zeros((1)) #reset Voltage or Current data
self.t = [time.time()] #reset timestamps
self.line_Temp.setText('NaN') #set text in 'temperature' field to NaN, to indicate it is not measured
self.line_A.setText('NaN') # set text in 'current' field to NaN, to indicate it is not measured
elif I == 1:
self.graphWidget.setLabel('left', 'Current [A]')
self.Values = np.zeros((1)) #reset Voltage or Current data
self.t = [time.time()] #reset timestamps
self.line_Temp.setText('NaN') #set text in 'temperature' field to NaN, to indicate it is not measured
self.line_V.setText('NaN') # set text in 'voltage' field to NaN, to indicate it is not measured
elif I == 2:
self.graphWidget.setLabel('left', 'Temperaure [C°]')
self.Values = np.zeros((1)) #reset Voltage or Current data
self.t = [time.time()] #reset timestamps
self.line_V.setText('NaN') # set text in 'voltage' field to NaN, to indicate it is not measured
self.line_A.setText('NaN') # set text in 'Current' field to NaN, to indicate it is not measured
def change_mode(self):
#updates "mode" in global variables. This is detected by "update_Value" and the device is set to the correct mode
self.sync_K_34461A.update({'mode':self.comboBox_Plot.currentIndex()})
def change_sensor(self,I):
#updates "sensor" in global variables. "update_Value" and the device is set to the correct mode
if I == 0: #assign the correct sensor types to selected Index (Manual p.251)
self.sync_K_34461A.update({'sensor':['RTD','85']})
elif I == 1:
self.sync_K_34461A.update({'sensor':['FRTD','82']})
elif I == 2:
self.sync_K_34461A.update({'sensor':['FTH','5000']})
elif I == 3:
self.sync_K_34461A.update({'sensor':['THER','5000']})
elif I == 4:
self.sync_K_34461A.update({'sensor':['TC','E']})
elif I == 5:
self.sync_K_34461A.update({'sensor':['TC','J']})
elif I == 6:
self.sync_K_34461A.update({'sensor':['TC','K']})
elif I == 7:
self.sync_K_34461A.update({'sensor':['TC','N']})
elif I == 8:
self.sync_K_34461A.update({'sensor':['TC','R']})
elif I == 9:
self.sync_K_34461A.update({'sensor':['TC','T']})
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True and self.t1[-1] > self.last_save:
#write only, if there is a new timestamp
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tVoltage[V]\tCurrent[A]\tTemperature[°C]\n')
file = open(path,'a')
#file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
file.write(self.t1[-1].strftime("%Y-%m-%d_%H-%M-%S.%f")+'\t')
if self.mode_new == 0:
file.write(f"{self.sync_K_34461A.get('V')}\t0\t0\n")
elif self.mode_new == 1:
file.write(f"0\t{self.sync_K_34461A.get('V')}\t0\n")
elif self.mode_new == 2:
file.write(f"0\t0\t{self.sync_K_34461A.get('V')}\n")
self.last_save = self.t1[-1]
file.close
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Additionally measurement mode is saved. Overwrites old values in config file.
path = self.current_dir+'\\configs\\Keysight_34461A_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write(str(self.comboBox_Plot.currentIndex())+'\t')
file.write(str(self.comboBox_sensor.currentIndex()))
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
path = self.current_dir+'\\configs\\Keysight_34461A_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
return
formats = ['.0f','.2f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.comboBox_Plot.setCurrentIndex(int(vals[0][-2]))
self.comboBox_sensor.setCurrentIndex(int(vals[0][-1]))
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop.
self.running = False
time.sleep(1) #make shure threads have enough time to close
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,365 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback, sys, os
import numpy as np
import pyqtgraph as pg
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Keysight_U2042XA
import import_txt
from design_files.Keysight_U2042XA_design import Ui_Powermeter
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_Powermeter):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_K_U2042XA')
self.sync_K_U2042XA = manager.sync_K_U2042XA()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_K_U2042XA')
self.sync_K_U2042XA = manager.sync_K_U2042XA()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_K_U2042XA.update({'P':0, 'mode':0, 'DC':0.01, 'Trac_par':[0,0,'',0]}) #P(Power) value from CW or Pulsed measurement, mode = 0=CW,1=Pulse,or 2=Trace, DC (Dutycycle) 0.001-99.999, Trac_par(trace parameters): [duration, trigger delay, trigger level ('' = auto), resolution (0=high,1=med,2=low)]
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
w = self.graphWidget_in #number of plots can aesily be scaled up by adding more graphwiddgets to a list in enumerate (for i,w in enumeratre [self._in,self.ref,...])
w.setBackground('w')
w.setLabel('left', 'Power [dBm]')
w.setLabel('bottom', 'Time')
w.showGrid(x = True, y = True, alpha = 0.5)
axis = pg.DateAxisItem()
w.setAxisItems({'bottom':axis})
w.setTitle('P_input')
self.plot_P_in = w.plot(temp,[1,0],pen = pen1, name = 'Power')
#set up pyQT threadpool
self.threadpool = QThreadPool()
#start standard threads
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.button_updateTrace.clicked.connect(self.set_Trac_par)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.comboBox_mode.currentIndexChanged.connect(self.set_mode)
self.line_Dutycycle.editingFinished.connect(self.set_DC)
self.line_ATT.editingFinished.connect(self.set_ATT)
#define constants
self.Power = np.zeros((1,1)) #store temperature and power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 0.5 #save intervall
self.Ptrace = [0,1] #dummy variable so programm does not trip when trace is activated
self.ATT = 0 #store cable attenuation in following order [in,ref,trans]
self.set_old = [0,0] #variable to save the 'old' set values to compare them to the global variables. Since the length is only 2, it differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.line_freq, self.line_ATT,self.line_Duration, self.line_TrigDelay,self.line_Nplot]
self.lines_config_strings = [self.line_TrigLevel, self.line_devAdr,self.line_filePath,self.line_saveInterval]
self.checkboxes_config = [self.checkBox_disableplots,self.checkBox_save]
#read default values from config file and set them in gui
self.read_default()
#write gui values values in global variables and set attenuation(local)
self.set_mode()
self.set_Trac_par()
self.set_DC()
self.set_ATT()
#set save timing from gui
self.change_timing()
def start_meas(self):
#Connect to devices. If last argument in init is 1 calibration is performed, if it is 0 no calibration is performed
if self.checkBox_calibrate.isChecked() == True:
cal = 1
else:
cal = 0
address = self.line_devAdr.text()
freq = get_float(self.line_freq)
self.PM = Keysight_U2042XA.KeysightU2042XA(address, freq,cal)
#start thread for communication with device
worker = Worker(self.update_P)
worker.signals.progress.connect(self.update_gui)
self.threadpool.start(worker)
#turn off connect button
self.button_connect.setEnabled(False)
def update_P(self, progress_callback): #gets powermeasurements, either CW or trace
while self.running == True: #update as long as program is running
for i,n in enumerate(['mode', 'DC', 'Trac_par']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_K_U2042XA.get(n)
if self.set_new != self.set_old: #update device settings of device, if something changed
if self.set_new[0] == 0: #CW Measurement
self.PM.activate_CW()
self.Power = np.delete(self.Power, np.s_[-1::], 0) #delete last row from self.Power since it contains -999
self.t.pop(-1) #delete corresponding time as well
elif self.set_new[0] == 2: #trace measurement
self.PM.activate_trace()
if self.set_new[2][2] == '':
self.PM.set_trigger_level() #set trigger level to auto
else:
self.PM.set_trigger_level(self.set_new[2][2]) #set trigger level to value
self.PM.set_trigger_delay(float(self.line_TrigDelay.text())) #set trigger delay
self.PM.set_trace_time(float(self.line_Duration.text())) #set trace time
if self.set_new[2][3] == 0: #set trace resolution according to measurement mode from combobox_mode
res = 'HRES'
elif self.set_new[2][3] == 1:
res = 'MRES'
else:
res = 'LRES'
self.update_gui_setValues(self.set_new) #update set values in gui from global variables
if self.set_new[0] == 0 or self.set_new[0] == 1: #If mode is CW or pulse, just read current value and emit signal with value
P = self.PM.read()
self.sync_K_U2042XA.update({'P':P}) #Pass current value to global variables
progress_callback.emit([P]) #emit signal expects list, therefore, []
time.sleep(0.1)
else: #if mode is trace, read the trace
# time.sleep(0.5)
self.Ptrace = self.PM.read_trace(res) #get trace data
self.sync_K_U2042XA.update({'P':[-999]}) #set CW measurement to dummy -999 so Main program can handle it
progress_callback.emit([-999]) #emit 0 so function update_gui is called and CW power is set to zero
self.set_old = self.set_new.copy() #List needs to be copied so that only values are taken and not just a pointer is created
del(self.PM) #disconnect device when self.running is set to False
def update_gui(self,P):
#sets CW number in corresponding label and updates plot. Plot is different when trace is plotted.
#set numbers
self.line_Power_in.setText(f"{P[0]+self.ATT:.3f}")
if self.set_new[0] == 0 or self.set_new[0] == 1: #If mode is CW or pulse update P vs t plot
#Create database for plotting
self.Power = np.vstack([self.Power, np.array(P)+self.ATT])
self.t.append(time.time())
#plot
if self.disable_plot == False:
self.plot_P_in.setData(self.t[-self.Npoints:],self.Power[-self.Npoints:,0])
else: # if mode is trac, plot the trace
if self.disable_plot == False:
N = len(self.Ptrace)
dur = float(self.line_Duration.text())
dx = dur/N
x = [i*dx for i in range(0, N)]
self.Ptrace = [x+self.ATT for x in self.Ptrace] # add attenuation to trace
self.plot_P_in.setData(x,self.Ptrace)
def update_gui_setValues(self,setV):
#sets gui set_values to the values in global variables which are passed from update_P via setV
#Trac_par(trace parameters): [duration, trigger delay, trigger level ('' = auto), resolution (0=high,1=med,2=low)]
self.comboBox_mode.setCurrentIndex(setV[0])
self.line_Dutycycle.setText(str(setV[1]))
self.line_Duration.setText(str(setV[2][0]))
self.line_TrigDelay.setText(str(setV[2][1]))
self.line_TrigLevel.setText(str(setV[2][2]))
self.comboBox_res.setCurrentIndex(setV[2][3])
def set_Trac_par(self):
#updates trace parameters in global variables. The parameters are explaine in init where they are "filled in" (around line 110)
dur = get_float(self.line_Duration)
delay = get_float(self.line_TrigDelay)
res = self.comboBox_res.currentIndex()
if self.line_TrigLevel == '':
lev = ''
else:
lev = get_float(self.line_TrigLevel)
self.sync_K_U2042XA.update({'Trac_par':[dur,delay,lev,res]})
def set_DC(self):
#updates duty cycle in global variables. The parameters are explaine in init where they are "filled in" (around line 110)
self.sync_K_U2042XA.update({'DC':get_float(self.line_Dutycycle)})
def set_mode(self):
#updates measurement mode in global variables. The parameters are explaine in init where they are "filled in" (around line 110)
self.sync_K_U2042XA.update({'mode':self.comboBox_mode.currentIndex()})
def set_ATT(self):
#sets attenuation to current values
self.ATT = get_float(self.line_ATT)
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tPower[dBm]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
file.write(f"{self.Power[-1][0]}\n")
file.close
time.sleep(self.timing_save)
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Additionally resolution is saved. Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\Keysight_U2042XA_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write(str(self.comboBox_res.currentIndex()))
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\Keysight_U2042XA_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
return
formats = ['.3e', '.2f', '.2e','.2e','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.comboBox_res.setCurrentIndex(int(vals[0][-1]))
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1) #make sure all thread can finish
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,331 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Lakeshore218
from design_files.LS218_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_LS_218')
self.sync_LS_218 = manager.sync_LS_218()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_LS_218')
self.sync_LS_218 = manager.sync_LS_218()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_LS_218.update({'T':[0,0,0,0,0,0,0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Temperature")
self.graphWidget.setLabel('left', 'Temperature [K]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(255, 0, 255), width=2)
pen6 = pg.mkPen(color=(0, 255, 255), width=2)
pen7 = pg.mkPen(color=(255, 127, 127), width=2)
pen8 = pg.mkPen(color=(127, 255, 70), width=2)
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'Ch: 1')
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'Ch: 2')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'Ch: 3')
self.plot_4 = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'Ch: 4')
self.plot_5 = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'Ch: 5')
self.plot_6 = self.graphWidget.plot(temp,[1,0],pen = pen6, name = 'Ch: 6')
self.plot_7 = self.graphWidget.plot(temp,[1,0],pen = pen7, name = 'Ch: 7')
self.plot_8 = self.graphWidget.plot(temp,[1,0],pen = pen8, name = 'Ch: 8')
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and start threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_1.stateChanged.connect(self.plot_hide)
self.checkBox_2.stateChanged.connect(self.plot_hide)
self.checkBox_3.stateChanged.connect(self.plot_hide)
self.checkBox_4.stateChanged.connect(self.plot_hide)
self.checkBox_5.stateChanged.connect(self.plot_hide)
self.checkBox_6.stateChanged.connect(self.plot_hide)
self.checkBox_7.stateChanged.connect(self.plot_hide)
self.checkBox_8.stateChanged.connect(self.plot_hide)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
#define constants
self.Temperature = np.zeros((1,8)) #store temperature and power data
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,0] #variable to save the 'old' set values to compare them to the global variables. Since the length is only 3, it differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0,0,0,0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.line_Nplot]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath,self.line_saveInterval]#is used for config file
self.checkboxes_config = [self.checkBox_1, self.checkBox_2, self.checkBox_3, self.checkBox_4, self.checkBox_5, self.checkBox_6, self.checkBox_7, self.checkBox_8,self.checkBox_disableplots,self.checkBox_save]#is used for config file
#read default values from config and set them in gui
self.read_default()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.LS = Lakeshore218.LakeShore218(address)
#start thread for communication with device
self.worker = Worker(self.update_T)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_T(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to update_gui with emit(T)
while self.running == True:
T = self.LS.read(0) #read Temperature data from all 8 channels
self.sync_LS_218.update({'T':T})
progress_callback.emit(T)
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.LS) #disconnect device when self.running is set to False
def update_gui(self,T):
#set numbers
self.T_1.setText(str(T[0]))
self.T_2.setText(str(T[1]))
self.T_3.setText(str(T[2]))
self.T_4.setText(str(T[3]))
self.T_5.setText(str(T[4]))
self.T_6.setText(str(T[5]))
self.T_7.setText(str(T[6]))
self.T_8.setText(str(T[7]))
#Create database for plotting
self.Temperature = np.vstack([self.Temperature, np.array(T)])
x = range(len(self.Temperature))
self.t.append(time.time())
#plot
if self.disable_plot == False:
self.plot_1.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,0])
self.plot_2.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,1])
self.plot_3.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,2])
self.plot_4.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,3])
self.plot_5.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,4])
self.plot_6.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,5])
self.plot_7.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,6])
self.plot_8.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,7])
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_1, self.checkBox_2, self.checkBox_3, self.checkBox_4, self.checkBox_5,
self.checkBox_6, self.checkBox_7, self.checkBox_8]
plots = [self.plot_1, self.plot_2, self.plot_3, self.plot_4, self.plot_5,
self.plot_6, self.plot_7, self.plot_8]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tCh:1[K]\tCh:2[K]\tCh:3[K]\tCh:4[K]\tCh:5[K]\tCh:6[K]\tCh:7[K]\tCh:8[K]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
for d in self.Temperature[-1]:
file.write(f"{d}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\LS218_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\LS218_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,374 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
from datetime import datetime
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Lakeshore336
from design_files.LS336_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_LS_336')
self.sync_LS_336 = manager.sync_LS_336()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_LS_336')
self.sync_LS_336 = manager.sync_LS_336()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_LS_336.update({'setT':0, 'ramprate':'0','Contr_Ch':0, 'T':[0,0,0,0,0], 'Range':0,'PID':[0,0,0]})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("Temperature")
self.graphWidget.setLabel('left', 'Temperature [K]')
self.graphWidget.setLabel('bottom', 'Time (H)')
axis = pg.DateAxisItem()
self.graphWidget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
pen3 = pg.mkPen(color=(0, 255, 0), width=2)
pen4 = pg.mkPen(color=(255, 255, 0), width=2)
pen5 = pg.mkPen(color=(0, 0, 0), width=2)
self.plot_A = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'Ch: A')
self.plot_B = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'Ch: B')
self.plot_C = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'Ch: C')
self.plot_D = self.graphWidget.plot(temp,[1,0],pen = pen4, name = 'Ch: D')
self.plot_P = self.graphWidget.plot(temp,[1,0],pen = pen5, name = 'Power')
self.plot_P.hide()
self.graphWidget.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
worker_save = Worker(self.save)
self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_setPID.clicked.connect(self.set_PID)
self.button_connect.clicked.connect(self.start_meas)
self.line_Nplot.editingFinished.connect(self.set_Npoints)
self.line_saveInterval.editingFinished.connect(self.change_timing)
self.checkBox_A.stateChanged.connect(self.plot_hide)
self.checkBox_B.stateChanged.connect(self.plot_hide)
self.checkBox_C.stateChanged.connect(self.plot_hide)
self.checkBox_D.stateChanged.connect(self.plot_hide)
self.checkBox_pwr.stateChanged.connect(self.plot_hide)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.line_setT.editingFinished.connect(self.set_T)
self.line_Ramprate.editingFinished.connect(self.set_rate)
self.comboBox_Channel.currentIndexChanged.connect(self.set_channel)
self.comboBox_range.currentIndexChanged.connect(self.set_range)
#define constants
self.Temperature = np.zeros((1,5)) #store temperature and power data
self.t = [time.time()] #store timestamps
self.t1 = [datetime.now()] #store timestamps with higher precision
self.last_save = self.t1[-1] #timestamp of last write-to-file event
self.Npoints = 200 #number of point to plot
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,0] #variable to save the 'old' set values to compare them to the global variables. Since the length is only 3, it differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.line_setP,self.line_setI,self.line_setD,self.line_setT,self.line_Ramprate,self.line_Nplot]#is used for config file
self.lines_config_strings = [self.line_devAdr,self.line_filePath,self.line_saveInterval]#is used for config file
self.checkboxes_config = [self.checkBox_A, self.checkBox_B, self.checkBox_C, self.checkBox_D, self.checkBox_pwr,self.checkBox_disableplots,self.checkBox_save]#is used for config file
#read default values from fonfig and set them in gui
self.read_default()
#write values from gui to global variables.
self.set_T()
self.set_rate()
self.set_channel()
self.set_range()
self.set_PID()
#update save intervall to the gui value
self.change_timing()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.LS = Lakeshore336.LakeShore336(address)
#start thread for communication with device
self.worker = Worker(self.update_T)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_T(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
for i,n in enumerate(['setT','ramprate','Contr_Ch','Range','PID']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.sync_LS_336.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed self.changed is set to true and new parameters are send to device
self.LS.conf_outp(out=1, mode=1, inp=self.set_new[2]+1, powup=0) #configures output channel 1
self.LS.set_Ramp(out=1, ON=1, ramp=self.set_new[1]) #configues ramp settings, if Rate=0 the ramp is turned off
self.LS.set_T(out = 1, T = self.set_new[0]) #sets temperature setpoint
self.LS.turn_on_outp(out=1, range = self.set_new[3]) #turn heater on or off, according to Range
self.LS.conf_pid(1,self.set_new[4][0],self.set_new[4][1],self.set_new[4][2]) #set PID values
self.update_setValues(self.set_new)
T = self.LS.read(['A','B','C','D']) #read Temperature data from all 4 channels
T.append(0)
self.sync_LS_336.update({'T':T})
progress_callback.emit(T)
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# time.sleep(0.1)
del(self.LS) #disconnect device when self.running is set to False
def update_gui(self,T):
#set numbers
self.T_A.setText(str(T[0]))
self.T_B.setText(str(T[1]))
self.T_C.setText(str(T[2]))
self.T_D.setText(str(T[3]))
#Create database for plotting
self.Temperature = np.vstack([self.Temperature, np.array(T)])
x = range(len(self.Temperature))
self.t.append(time.time())
self.t1.append(datetime.now())
#plot
if self.disable_plot == False:
self.plot_A.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,0])
self.plot_B.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,1])
self.plot_C.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,2])
self.plot_D.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,3])
self.plot_P.setData(self.t[-self.Npoints:],self.Temperature[-self.Npoints:,4])
def update_setValues(self,setV):
#sets setvalues obtained from update_T in gui ['setT','ramprate','Contr_Ch','Range','PID']
self.line_setT.setText(f"{setV[0]}")
self.line_Ramprate.setText(f"{setV[1]}")
self.comboBox_Channel.setCurrentIndex(setV[2])
self.comboBox_range.setCurrentIndex(setV[3])
self.line_setP.setText(f"{setV[4][0]}")
self.line_setI.setText(f"{setV[4][1]}")
self.line_setD.setText(f"{setV[4][2]}")
def set_T(self):
#updates the set temperature in global variables. The change will be detected by update T and it will be passed to the device
self.sync_LS_336.update({'setT':get_float(self.line_setT)})
def set_rate(self):
#updates the ramprate in global variables. The change will be detected by update T and it will be passed to the device
self.sync_LS_336.update({'ramprate':get_float(self.line_Ramprate)})
def set_channel(self):
#updates the control channel in global variables. The change will be detected by update T and it will be passed to the device
self.sync_LS_336.update({'Contr_Ch':self.comboBox_Channel.currentIndex()})
def set_range(self):
#updates the reange in global variables. The change will be detected by update T and it will be passed to the device
self.sync_LS_336.update({'Range':self.comboBox_range.currentIndex()})
def set_PID(self):
#updates the PID values in global variables. The change will be detected by update T and it will be passed to the device
self.sync_LS_336.update({'PID':[get_float(self.line_setP),get_float(self.line_setI),get_float(self.line_setD)]})
def set_Npoints(self):
#sets the number of points to plot
self.Npoints = int(self.line_Nplot.text())
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_hide(self):
#shows or hides plots according to the checkboxes next to the plot area
boxes = [self.checkBox_A, self.checkBox_B, self.checkBox_C, self.checkBox_D, self.checkBox_pwr]
plots = [self.plot_A, self.plot_B, self.plot_C, self.plot_D, self.plot_P]
for b,p in zip(boxes,plots):
if b.isChecked() == True:
p.show()
else:
p.hide()
def change_timing(self):
#updates the timing which is used for "save". If no value it given, it is set to 1 s
self.timing_save = get_float(self.line_saveInterval,1)
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True and self.t1[-1] > self.last_save:
#write only, if there is a new timestamp
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tCh:A[K]\tCh:B[K]\tCh:C[K]\tCh:D[K]\tPower[%]\n')
file = open(path,'a')
#file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t') #original timestamp
file.write(self.t1[-1].strftime("%Y-%m-%d_%H-%M-%S.%f")+'\t')
for d in self.Temperature[-1]:
file.write(f"{d}\t")
file.write('\n')
self.last_save = self.t1[-1]
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Additionally control channel of LS336 is saved. Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\LS336_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write(str(self.comboBox_Channel.currentIndex()))
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\LS336_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.comboBox_Channel.setCurrentIndex(int(vals[0][-1]))
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,20 @@
This folder contains python instrument drivers.
Please read the documentation at (intranet only): https://portal.helmholtz-berlin.de/fg/hobicat/Checklisten/R%26D/Git%20Instrument%20drivers.docx?d=w6a384bc2d644432ebe4910489afc2328
Software:
Python 3.12
Qt designer https://build-system.fman.io/qt-designer-download
Packages are listed in requirements.txt
In the folder "StandAlones" are standalone prgrams for the instruments.
The programs are designed using QT designer and PyQt6. Therefore, the .ui files and converted files are also included in the folder. The files converted from .ui to .py are labeled _design.
ToDo:
in gui only the values that acutually changed in global variables should be reset.
remove dummy zero from plots
Keysight U2042XA: Pulse mode needs to be included
Keysight U2042XA: Trace should be refined (no timeout after)
Duplicate devices can be started from the same pogram. => Have a QComboBox where a device can be selected before "connect" button is pressed. This sets config file and dict name in global variables.

View File

@ -0,0 +1,279 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback, sys, os
import numpy as np
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from drivers import Tabor_LS6081B
import import_txt
from design_files.Tabor_LS6081B_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_T_LS6081B')
self.sync_T_LS6081B = manager.sync_T_LS6081B()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\env\\Scripts\\python.exe", [self.current_dir+'\\global_variables.py'])
manager.connect()
manager.register('sync_T_LS6081B')
self.sync_T_LS6081B = manager.sync_T_LS6081B()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.sync_T_LS6081B.update({'freq':4.8e9, 'Power':-10,'RF':False, 'Pulse':False, 'Pulsewidth':1e-3, 'DC':0.5})
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
#set up pyQT threadpool
self.threadpool = QThreadPool()
#start standard threads
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.button_RF.clicked.connect(self.update_RF)
self.button_Pulse.clicked.connect(self.update_Pulse)
self.line_DC.editingFinished.connect(self.update_DC)
self.line_Freq.editingFinished.connect(self.update_f)
self.line_Power.editingFinished.connect(self.update_P)
self.line_width.editingFinished.connect(self.update_w)
#define constants
self.running = True #true while app is running
self.set_new = [4.8e9, -10, False, False, 1e-3, 0.5] #variable to save the 'new' set values to compare them to the global variables
self.set_old = [0, 0, False, False, 0, 0] #variable to save the 'old' set values to compare them to the global variables
self.change = False
self.lines_config_float = [self.line_Freq, self.line_Power,self.line_width, self.line_DC] #is used for config file
self.lines_config_strings = [self.line_devAdr] #is used for config file
#read default values from config and set values in them in gui
self.read_default()
#write gui values in global variables. RF and Pulse is just kept off
self.update_DC()
self.update_f()
self.update_P()
self.update_w()
def start_meas(self):
#Connect to device
address = self.line_devAdr.text()
self.gen = Tabor_LS6081B.TaborLS6081B(address)
#start thread for communication with device
worker = Worker(self.update_output)
self.threadpool.start(worker)
print('connected')
def update_output(self,progress_callback): #check if global variables changed. If so, send new values to device
while self.running == True:
for i,n in enumerate(['freq', 'Power','RF', 'Pulse', 'Pulsewidth', 'DC']): #get new set values from global variables to compare them to old ones.
self.set_new[i] = self.sync_T_LS6081B.get(n)
if self.set_new != self.set_old:
f = self.set_new[0]
P = self.set_new[1]
RF = self.set_new[2]
Pulse = self.set_new[3]
w = self.set_new[4]
DC = self.set_new[5]
#turn RF ON or OFF with settings in gui
if RF == 1:
if Pulse == 0: #Check if pulse is activated or not
self.gen.CW(P, f, 1)
else:
self.gen.Pulse(P, f, w, DC, 1)
else:
self.gen.CW(P, f, 0)
#set gui to values in global variables
self.update_gui(self.set_new)
self.set_old = self.set_new.copy() #.copy() is needer, otherwise it sets just a pointer to self.set_new
time.sleep(0.1)
del(self.gen) #disconnect device when self.running is set to False
def update_gui(self,setV): #set values given in setV in the corresponding lineEdits
self.line_Freq.setText(f"{setV[0]:.6e}")
self.line_Power.setText(str(setV[1]))
self.line_width.setText(f"{setV[4]:.3e}")
self.line_DC.setText(str(setV[5]))
if setV[2] == 1: #set RF button in the correct state
self.button_RF.setText('RF ON/off')
self.label_RF.setStyleSheet("background-color: green")
else:
self.button_RF.setText('RF on/OFF')
self.label_RF.setStyleSheet("background-color: red")
if setV[3] == 1: #set Pulse button in the correct state
self.button_Pulse.setText('Pulse ON/off')
self.label_Pulse.setStyleSheet("background-color: green")
else:
self.button_Pulse.setText('Pulse on/OFF')
self.label_Pulse.setStyleSheet("background-color: red")
def update_f(self): #changes global variable. The change will be detected by update_output and it will be passed to the device
self.sync_T_LS6081B.update({'freq': get_float(self.line_Freq)})
def update_P(self): #changes global variable. The change will be detected by update_output and it will be passed to the device
self.sync_T_LS6081B.update({'Power': get_float(self.line_Power)})
def update_w(self): #changes global variable. The change will be detected by update_output and it will be passed to the device
self.sync_T_LS6081B.update({'Pulsewidth': get_float(self.line_width)})
def update_DC(self): #changes global variable. The change will be detected by update_output and it will be passed to the device
self.sync_T_LS6081B.update({'DC': get_float(self.line_DC)})
def update_RF(self): #updates global variable depending of the old state of the RF button. (If it was off, the new value is set to 1(= RF on))
if self.button_RF.text() == 'RF on/OFF':
self.sync_T_LS6081B.update({'RF': 1})
else:
self.sync_T_LS6081B.update({'RF': 0})
def update_Pulse(self): #updates global variable depending of the old state of the Pulse button. (If it was off, the new value is set to 1(= Pulse on))
if self.button_Pulse.text() == 'Pulse on/OFF':
self.sync_T_LS6081B.update({'Pulse': 1})
else:
self.sync_T_LS6081B.update({'Pulse': 0})
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\Tabor_LS6081B_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\Tabor_LS6081B_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
return
formats = ['.6e','.2f','.3e','.2f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][4:]):
l.setText(v)
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1 @@
In this folder the config files of the standalones are saved. They have to be in the format *_config.txt. This way they are ignored by git (through .gitignore).

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,842 @@
# Form implementation generated from reading ui file 'Agilent_304_FS_AG.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(839, 498)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout_3 = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout_3.setObjectName("gridLayout_3")
self.scrollArea = QtWidgets.QScrollArea(parent=self.centralwidget)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 815, 423))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.gridLayout_2 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents)
self.gridLayout_2.setObjectName("gridLayout_2")
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.gridLayout_4 = QtWidgets.QGridLayout()
self.gridLayout_4.setObjectName("gridLayout_4")
self.checkBox_save = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_save.setObjectName("checkBox_save")
self.gridLayout_4.addWidget(self.checkBox_save, 2, 3, 1, 1)
self.button_buffer_size = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_buffer_size.sizePolicy().hasHeightForWidth())
self.button_buffer_size.setSizePolicy(sizePolicy)
self.button_buffer_size.setMinimumSize(QtCore.QSize(80, 0))
self.button_buffer_size.setObjectName("button_buffer_size")
self.gridLayout_4.addWidget(self.button_buffer_size, 3, 3, 1, 1)
self.label_3 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy)
self.label_3.setObjectName("label_3")
self.gridLayout_4.addWidget(self.label_3, 3, 0, 1, 1)
self.line_filePath = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_filePath.sizePolicy().hasHeightForWidth())
self.line_filePath.setSizePolicy(sizePolicy)
self.line_filePath.setObjectName("line_filePath")
self.gridLayout_4.addWidget(self.line_filePath, 1, 1, 1, 2)
self.line_devAdr = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
self.line_devAdr.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_devAdr.sizePolicy().hasHeightForWidth())
self.line_devAdr.setSizePolicy(sizePolicy)
self.line_devAdr.setObjectName("line_devAdr")
self.gridLayout_4.addWidget(self.line_devAdr, 0, 1, 1, 2)
self.button_connect = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_connect.sizePolicy().hasHeightForWidth())
self.button_connect.setSizePolicy(sizePolicy)
self.button_connect.setMinimumSize(QtCore.QSize(80, 0))
self.button_connect.setObjectName("button_connect")
self.gridLayout_4.addWidget(self.button_connect, 0, 3, 1, 1)
self.label_7 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth())
self.label_7.setSizePolicy(sizePolicy)
self.label_7.setObjectName("label_7")
self.gridLayout_4.addWidget(self.label_7, 0, 0, 1, 1)
self.SB_Buffer_size = QtWidgets.QSpinBox(parent=self.scrollAreaWidgetContents)
self.SB_Buffer_size.setMaximum(999999)
self.SB_Buffer_size.setProperty("value", 36000)
self.SB_Buffer_size.setObjectName("SB_Buffer_size")
self.gridLayout_4.addWidget(self.SB_Buffer_size, 3, 1, 1, 1)
self.label_8 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_8.sizePolicy().hasHeightForWidth())
self.label_8.setSizePolicy(sizePolicy)
self.label_8.setObjectName("label_8")
self.gridLayout_4.addWidget(self.label_8, 1, 0, 1, 1)
self.label_2 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy)
self.label_2.setObjectName("label_2")
self.gridLayout_4.addWidget(self.label_2, 2, 0, 1, 1)
self.dSB_save_intervall = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.dSB_save_intervall.sizePolicy().hasHeightForWidth())
self.dSB_save_intervall.setSizePolicy(sizePolicy)
self.dSB_save_intervall.setMinimumSize(QtCore.QSize(80, 0))
self.dSB_save_intervall.setMaximum(999.99)
self.dSB_save_intervall.setObjectName("dSB_save_intervall")
self.gridLayout_4.addWidget(self.dSB_save_intervall, 2, 1, 1, 1)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_4.addItem(spacerItem, 2, 2, 1, 1)
self.label_4 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
self.label_4.setSizePolicy(sizePolicy)
self.label_4.setObjectName("label_4")
self.gridLayout_4.addWidget(self.label_4, 4, 0, 1, 1)
self.dSB_timing = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.dSB_timing.sizePolicy().hasHeightForWidth())
self.dSB_timing.setSizePolicy(sizePolicy)
self.dSB_timing.setMinimumSize(QtCore.QSize(80, 0))
self.dSB_timing.setMaximum(999.99)
self.dSB_timing.setObjectName("dSB_timing")
self.gridLayout_4.addWidget(self.dSB_timing, 4, 1, 1, 1)
self.gridLayout.addLayout(self.gridLayout_4, 0, 0, 3, 2)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout.addItem(spacerItem1, 5, 4, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout.addItem(spacerItem2, 5, 0, 1, 2)
self.checkBox_disableplots = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_disableplots.setObjectName("checkBox_disableplots")
self.gridLayout.addWidget(self.checkBox_disableplots, 4, 1, 1, 1)
self.SB_N_points = QtWidgets.QSpinBox(parent=self.scrollAreaWidgetContents)
self.SB_N_points.setMaximum(99999)
self.SB_N_points.setObjectName("SB_N_points")
self.gridLayout.addWidget(self.SB_N_points, 5, 3, 1, 1)
self.graphWidget = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget.sizePolicy().hasHeightForWidth())
self.graphWidget.setSizePolicy(sizePolicy)
self.graphWidget.setMinimumSize(QtCore.QSize(431, 280))
self.graphWidget.setObjectName("graphWidget")
self.gridLayout.addWidget(self.graphWidget, 0, 2, 5, 3)
self.label_5 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 5, 2, 1, 1)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.gridLayout.addItem(spacerItem3, 3, 1, 1, 1)
self.gridLayout_5 = QtWidgets.QGridLayout()
self.gridLayout_5.setHorizontalSpacing(10)
self.gridLayout_5.setObjectName("gridLayout_5")
self.label_9 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_9.setObjectName("label_9")
self.gridLayout_5.addWidget(self.label_9, 2, 0, 1, 1)
self.Button_start = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.Button_start.setObjectName("Button_start")
self.gridLayout_5.addWidget(self.Button_start, 7, 0, 1, 1)
self.label = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label.setObjectName("label")
self.gridLayout_5.addWidget(self.label, 1, 0, 1, 1)
self.line_P = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_P.sizePolicy().hasHeightForWidth())
self.line_P.setSizePolicy(sizePolicy)
self.line_P.setMinimumSize(QtCore.QSize(60, 19))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_P.setPalette(palette)
self.line_P.setAutoFillBackground(True)
self.line_P.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_P.setObjectName("line_P")
self.gridLayout_5.addWidget(self.line_P, 1, 1, 1, 1)
spacerItem4 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed)
self.gridLayout_5.addItem(spacerItem4, 0, 0, 1, 1)
self.line_status = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_status.sizePolicy().hasHeightForWidth())
self.line_status.setSizePolicy(sizePolicy)
self.line_status.setMinimumSize(QtCore.QSize(60, 19))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_status.setPalette(palette)
self.line_status.setAutoFillBackground(True)
self.line_status.setText("")
self.line_status.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_status.setObjectName("line_status")
self.gridLayout_5.addWidget(self.line_status, 4, 1, 1, 1)
self.label_11 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_11.setObjectName("label_11")
self.gridLayout_5.addWidget(self.label_11, 4, 0, 1, 1)
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.gridLayout_5.addItem(spacerItem5, 6, 0, 1, 1)
self.checkBox_Fan = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_Fan.setEnabled(False)
self.checkBox_Fan.setObjectName("checkBox_Fan")
self.gridLayout_5.addWidget(self.checkBox_Fan, 5, 1, 1, 1)
self.line_T = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_T.sizePolicy().hasHeightForWidth())
self.line_T.setSizePolicy(sizePolicy)
self.line_T.setMinimumSize(QtCore.QSize(60, 19))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_T.setPalette(palette)
self.line_T.setAutoFillBackground(True)
self.line_T.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_T.setObjectName("line_T")
self.gridLayout_5.addWidget(self.line_T, 2, 1, 1, 1)
self.Button_stop = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.Button_stop.setObjectName("Button_stop")
self.gridLayout_5.addWidget(self.Button_stop, 7, 1, 1, 1)
self.label_10 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_10.setObjectName("label_10")
self.gridLayout_5.addWidget(self.label_10, 5, 0, 1, 1)
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_5.addItem(spacerItem6, 4, 2, 1, 1)
self.line_f = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_f.sizePolicy().hasHeightForWidth())
self.line_f.setSizePolicy(sizePolicy)
self.line_f.setMinimumSize(QtCore.QSize(60, 19))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_f.setPalette(palette)
self.line_f.setAutoFillBackground(True)
self.line_f.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_f.setObjectName("line_f")
self.gridLayout_5.addWidget(self.line_f, 3, 1, 1, 1)
self.label_12 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_12.setObjectName("label_12")
self.gridLayout_5.addWidget(self.label_12, 3, 0, 1, 1)
self.gridLayout.addLayout(self.gridLayout_5, 3, 0, 2, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.gridLayout_3.addWidget(self.scrollArea, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 839, 26))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.checkBox_save.setText(_translate("MainWindow", "Save"))
self.button_buffer_size.setText(_translate("MainWindow", "Change Buffer Size"))
self.label_3.setText(_translate("MainWindow", "Buffer size"))
self.button_connect.setText(_translate("MainWindow", "Connect"))
self.label_7.setText(_translate("MainWindow", "Device Adress"))
self.label_8.setText(_translate("MainWindow", "File Path"))
self.label_2.setText(_translate("MainWindow", "Save interval [s]"))
self.label_4.setText(_translate("MainWindow", "Timing"))
self.checkBox_disableplots.setText(_translate("MainWindow", "Disable plot"))
self.label_5.setText(_translate("MainWindow", "# points to plot"))
self.label_9.setText(_translate("MainWindow", "Temperature [°C]"))
self.Button_start.setText(_translate("MainWindow", "Sart"))
self.label.setText(_translate("MainWindow", "Pressure [mbar]"))
self.line_P.setText(_translate("MainWindow", "0"))
self.label_11.setText(_translate("MainWindow", "Status"))
self.checkBox_Fan.setText(_translate("MainWindow", "On / Off"))
self.line_T.setText(_translate("MainWindow", "0"))
self.Button_stop.setText(_translate("MainWindow", "Stop"))
self.label_10.setText(_translate("MainWindow", "Fan"))
self.line_f.setText(_translate("MainWindow", "0"))
self.label_12.setText(_translate("MainWindow", "Pump freq [Hz]"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,607 @@
# Form implementation generated from reading ui file 'Keysight_34461A.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(787, 391)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.graphWidget = PlotWidget(parent=self.centralwidget)
self.graphWidget.setGeometry(QtCore.QRect(320, 10, 431, 281))
self.graphWidget.setObjectName("graphWidget")
self.checkBox_disableplots = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_disableplots.setGeometry(QtCore.QRect(200, 270, 91, 17))
self.checkBox_disableplots.setObjectName("checkBox_disableplots")
self.label_5 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_5.setGeometry(QtCore.QRect(291, 301, 81, 16))
self.label_5.setObjectName("label_5")
self.line_Nplot = QtWidgets.QLineEdit(parent=self.centralwidget)
self.line_Nplot.setGeometry(QtCore.QRect(390, 300, 59, 20))
self.line_Nplot.setObjectName("line_Nplot")
self.comboBox_Plot = QtWidgets.QComboBox(parent=self.centralwidget)
self.comboBox_Plot.setGeometry(QtCore.QRect(200, 220, 81, 22))
self.comboBox_Plot.setObjectName("comboBox_Plot")
self.comboBox_Plot.addItem("")
self.comboBox_Plot.addItem("")
self.comboBox_Plot.addItem("")
self.layoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget.setGeometry(QtCore.QRect(10, 110, 121, 68))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setHorizontalSpacing(10)
self.gridLayout.setObjectName("gridLayout")
self.label_10 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_10.setObjectName("label_10")
self.gridLayout.addWidget(self.label_10, 2, 0, 1, 1)
self.line_A = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_A.setPalette(palette)
self.line_A.setAutoFillBackground(True)
self.line_A.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_A.setObjectName("line_A")
self.gridLayout.addWidget(self.line_A, 1, 1, 1, 1)
self.line_V = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_V.setPalette(palette)
self.line_V.setAutoFillBackground(True)
self.line_V.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_V.setObjectName("line_V")
self.gridLayout.addWidget(self.line_V, 0, 1, 1, 1)
self.label = QtWidgets.QLabel(parent=self.layoutWidget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.label_9 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.label_9, 1, 0, 1, 1)
self.line_Temp = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_Temp.setPalette(palette)
self.line_Temp.setAutoFillBackground(True)
self.line_Temp.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_Temp.setObjectName("line_Temp")
self.gridLayout.addWidget(self.line_Temp, 2, 1, 1, 1)
self.layoutWidget_2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_2.setGeometry(QtCore.QRect(11, 11, 290, 51))
self.layoutWidget_2.setObjectName("layoutWidget_2")
self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget_2)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.line_devAdr = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
self.line_devAdr.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_devAdr.sizePolicy().hasHeightForWidth())
self.line_devAdr.setSizePolicy(sizePolicy)
self.line_devAdr.setObjectName("line_devAdr")
self.gridLayout_2.addWidget(self.line_devAdr, 0, 1, 1, 1)
self.line_filePath = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_filePath.sizePolicy().hasHeightForWidth())
self.line_filePath.setSizePolicy(sizePolicy)
self.line_filePath.setObjectName("line_filePath")
self.gridLayout_2.addWidget(self.line_filePath, 1, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_6.setObjectName("label_6")
self.gridLayout_2.addWidget(self.label_6, 0, 0, 1, 1)
self.label_7 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_7.setObjectName("label_7")
self.gridLayout_2.addWidget(self.label_7, 1, 0, 1, 1)
self.checkBox_save = QtWidgets.QCheckBox(parent=self.layoutWidget_2)
self.checkBox_save.setObjectName("checkBox_save")
self.gridLayout_2.addWidget(self.checkBox_save, 1, 2, 1, 1)
self.button_connect = QtWidgets.QPushButton(parent=self.layoutWidget_2)
self.button_connect.setObjectName("button_connect")
self.gridLayout_2.addWidget(self.button_connect, 0, 2, 1, 1)
self.layoutWidget1 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget1.setGeometry(QtCore.QRect(11, 68, 121, 22))
self.layoutWidget1.setObjectName("layoutWidget1")
self.gridLayout_3 = QtWidgets.QGridLayout(self.layoutWidget1)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.label_2 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_2.setObjectName("label_2")
self.gridLayout_3.addWidget(self.label_2, 0, 0, 1, 1)
self.line_saveInterval = QtWidgets.QLineEdit(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_saveInterval.sizePolicy().hasHeightForWidth())
self.line_saveInterval.setSizePolicy(sizePolicy)
self.line_saveInterval.setObjectName("line_saveInterval")
self.gridLayout_3.addWidget(self.line_saveInterval, 0, 1, 1, 1)
self.comboBox_sensor = QtWidgets.QComboBox(parent=self.centralwidget)
self.comboBox_sensor.setGeometry(QtCore.QRect(200, 250, 81, 22))
self.comboBox_sensor.setObjectName("comboBox_sensor")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.comboBox_sensor.addItem("")
self.label_11 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_11.setGeometry(QtCore.QRect(140, 250, 55, 19))
self.label_11.setObjectName("label_11")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 787, 18))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.line_devAdr, self.button_connect)
MainWindow.setTabOrder(self.button_connect, self.line_filePath)
MainWindow.setTabOrder(self.line_filePath, self.checkBox_save)
MainWindow.setTabOrder(self.checkBox_save, self.line_saveInterval)
MainWindow.setTabOrder(self.line_saveInterval, self.comboBox_Plot)
MainWindow.setTabOrder(self.comboBox_Plot, self.checkBox_disableplots)
MainWindow.setTabOrder(self.checkBox_disableplots, self.line_Nplot)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Multimeter"))
self.checkBox_disableplots.setText(_translate("MainWindow", "Disable plot"))
self.label_5.setText(_translate("MainWindow", "# points to plot"))
self.comboBox_Plot.setItemText(0, _translate("MainWindow", "Voltage"))
self.comboBox_Plot.setItemText(1, _translate("MainWindow", "Current"))
self.comboBox_Plot.setItemText(2, _translate("MainWindow", "Temp (34465 Only)"))
self.label_10.setText(_translate("MainWindow", "Temp [°C]"))
self.line_A.setText(_translate("MainWindow", "0"))
self.line_V.setText(_translate("MainWindow", "0"))
self.label.setText(_translate("MainWindow", "Voltage [V]"))
self.label_9.setText(_translate("MainWindow", "Current [A]"))
self.line_Temp.setText(_translate("MainWindow", "0"))
self.label_6.setText(_translate("MainWindow", "Device Adress"))
self.label_7.setText(_translate("MainWindow", "File Path"))
self.checkBox_save.setText(_translate("MainWindow", "Save"))
self.button_connect.setText(_translate("MainWindow", "Connect"))
self.label_2.setText(_translate("MainWindow", "Save interval [s]"))
self.comboBox_sensor.setItemText(0, _translate("MainWindow", "RTD"))
self.comboBox_sensor.setItemText(1, _translate("MainWindow", "FRTD"))
self.comboBox_sensor.setItemText(2, _translate("MainWindow", "Fthermistor"))
self.comboBox_sensor.setItemText(3, _translate("MainWindow", "Thermistor"))
self.comboBox_sensor.setItemText(4, _translate("MainWindow", "TC E"))
self.comboBox_sensor.setItemText(5, _translate("MainWindow", "TC J"))
self.comboBox_sensor.setItemText(6, _translate("MainWindow", "TC K"))
self.comboBox_sensor.setItemText(7, _translate("MainWindow", "TC N"))
self.comboBox_sensor.setItemText(8, _translate("MainWindow", "TC R"))
self.comboBox_sensor.setItemText(9, _translate("MainWindow", "TC T"))
self.label_11.setText(_translate("MainWindow", "Sensor Type"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget

View File

@ -0,0 +1,930 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Powermeter</class>
<widget class="QMainWindow" name="Powermeter">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>787</width>
<height>481</height>
</rect>
</property>
<property name="windowTitle">
<string>PM Control</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="PlotWidget" name="graphWidget_in" native="true">
<property name="geometry">
<rect>
<x>320</x>
<y>80</y>
<width>431</width>
<height>281</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_disableplots">
<property name="geometry">
<rect>
<x>500</x>
<y>370</y>
<width>91</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Disable plot</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>320</x>
<y>370</y>
<width>81</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string># points to plot</string>
</property>
</widget>
<widget class="QLineEdit" name="line_Nplot">
<property name="geometry">
<rect>
<x>410</x>
<y>370</y>
<width>59</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="button_updateTrace">
<property name="geometry">
<rect>
<x>160</x>
<y>390</y>
<width>111</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Update parameters</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>130</x>
<y>277</y>
<width>164</width>
<height>111</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Resolution</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_res">
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Med</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_Duration">
<property name="text">
<string>1e-3</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Trig delay[s]</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="line_TrigDelay">
<property name="text">
<string>1e-4</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Duration[s]</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Trig Lev [dBm]</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="line_TrigLevel"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>450</x>
<y>50</y>
<width>141</width>
<height>21</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<widget class="QLabel" name="line_Power_in">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Power [dBm]</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_3">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>290</width>
<height>51</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>File Path</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="checkBox_save">
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="line_filePath">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_devAdr">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Device Adress</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="button_connect">
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>110</y>
<width>185</width>
<height>72</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Calibrate on powerup</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="line_ATT">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Attenuation input [dB]</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_freq">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Frequency [Hz]</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_calibrate">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>190</x>
<y>250</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Trace</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_11">
<property name="geometry">
<rect>
<x>30</x>
<y>250</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Pulse</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QWidget" name="layoutWidget_2">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>121</width>
<height>22</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Save interval [s]</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_saveInterval">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>217</y>
<width>181</width>
<height>22</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="horizontalSpacing">
<number>15</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Measurement mode</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_mode">
<item>
<property name="text">
<string>CW</string>
</property>
</item>
<item>
<property name="text">
<string>Pulse</string>
</property>
</item>
<item>
<property name="text">
<string>Trace</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>11</x>
<y>280</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Dutycycle [%]</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_Dutycycle">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>1e-3</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>787</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionSet_default"/>
<addaction name="actionReset_default"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionSet_default">
<property name="text">
<string>Make current values default</string>
</property>
</action>
<action name="actionReset_default">
<property name="text">
<string>Reset default values</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>PlotWidget</class>
<extends>QWidget</extends>
<header location="global">pyqtgraph</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>line_devAdr</tabstop>
<tabstop>button_connect</tabstop>
<tabstop>line_filePath</tabstop>
<tabstop>checkBox_save</tabstop>
<tabstop>line_saveInterval</tabstop>
<tabstop>line_freq</tabstop>
<tabstop>line_ATT</tabstop>
<tabstop>checkBox_calibrate</tabstop>
<tabstop>comboBox_mode</tabstop>
<tabstop>line_Dutycycle</tabstop>
<tabstop>line_Duration</tabstop>
<tabstop>comboBox_res</tabstop>
<tabstop>line_TrigDelay</tabstop>
<tabstop>line_TrigLevel</tabstop>
<tabstop>button_updateTrace</tabstop>
<tabstop>line_Nplot</tabstop>
<tabstop>checkBox_disableplots</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,428 @@
# Form implementation generated from reading ui file 'Keysight_U2042XA.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Powermeter(object):
def setupUi(self, Powermeter):
Powermeter.setObjectName("Powermeter")
Powermeter.resize(787, 481)
self.centralwidget = QtWidgets.QWidget(parent=Powermeter)
self.centralwidget.setObjectName("centralwidget")
self.graphWidget_in = PlotWidget(parent=self.centralwidget)
self.graphWidget_in.setGeometry(QtCore.QRect(320, 80, 431, 281))
self.graphWidget_in.setObjectName("graphWidget_in")
self.checkBox_disableplots = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_disableplots.setGeometry(QtCore.QRect(500, 370, 91, 17))
self.checkBox_disableplots.setObjectName("checkBox_disableplots")
self.label_5 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_5.setGeometry(QtCore.QRect(320, 370, 81, 16))
self.label_5.setObjectName("label_5")
self.line_Nplot = QtWidgets.QLineEdit(parent=self.centralwidget)
self.line_Nplot.setGeometry(QtCore.QRect(410, 370, 59, 20))
self.line_Nplot.setObjectName("line_Nplot")
self.button_updateTrace = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_updateTrace.setGeometry(QtCore.QRect(160, 390, 111, 23))
self.button_updateTrace.setObjectName("button_updateTrace")
self.layoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget.setGeometry(QtCore.QRect(130, 277, 164, 111))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label_3 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1)
self.comboBox_res = QtWidgets.QComboBox(parent=self.layoutWidget)
self.comboBox_res.setObjectName("comboBox_res")
self.comboBox_res.addItem("")
self.comboBox_res.addItem("")
self.comboBox_res.addItem("")
self.gridLayout.addWidget(self.comboBox_res, 1, 1, 1, 1)
self.line_Duration = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_Duration.setObjectName("line_Duration")
self.gridLayout.addWidget(self.line_Duration, 0, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 2, 0, 1, 1)
self.line_TrigDelay = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_TrigDelay.setObjectName("line_TrigDelay")
self.gridLayout.addWidget(self.line_TrigDelay, 2, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
self.label_8 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 3, 0, 1, 1)
self.line_TrigLevel = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_TrigLevel.setObjectName("line_TrigLevel")
self.gridLayout.addWidget(self.line_TrigLevel, 3, 1, 1, 1)
self.layoutWidget1 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget1.setGeometry(QtCore.QRect(450, 50, 141, 21))
self.layoutWidget1.setObjectName("layoutWidget1")
self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget1)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.line_Power_in = QtWidgets.QLabel(parent=self.layoutWidget1)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_Power_in.setPalette(palette)
self.line_Power_in.setAutoFillBackground(True)
self.line_Power_in.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_Power_in.setObjectName("line_Power_in")
self.gridLayout_2.addWidget(self.line_Power_in, 0, 1, 1, 1)
self.label = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
self.layoutWidget_3 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_3.setGeometry(QtCore.QRect(10, 20, 290, 51))
self.layoutWidget_3.setObjectName("layoutWidget_3")
self.gridLayout_4 = QtWidgets.QGridLayout(self.layoutWidget_3)
self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
self.gridLayout_4.setObjectName("gridLayout_4")
self.label_7 = QtWidgets.QLabel(parent=self.layoutWidget_3)
self.label_7.setObjectName("label_7")
self.gridLayout_4.addWidget(self.label_7, 1, 0, 1, 1)
self.checkBox_save = QtWidgets.QCheckBox(parent=self.layoutWidget_3)
self.checkBox_save.setObjectName("checkBox_save")
self.gridLayout_4.addWidget(self.checkBox_save, 1, 2, 1, 1)
self.line_filePath = QtWidgets.QLineEdit(parent=self.layoutWidget_3)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_filePath.sizePolicy().hasHeightForWidth())
self.line_filePath.setSizePolicy(sizePolicy)
self.line_filePath.setObjectName("line_filePath")
self.gridLayout_4.addWidget(self.line_filePath, 1, 1, 1, 1)
self.line_devAdr = QtWidgets.QLineEdit(parent=self.layoutWidget_3)
self.line_devAdr.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_devAdr.sizePolicy().hasHeightForWidth())
self.line_devAdr.setSizePolicy(sizePolicy)
self.line_devAdr.setObjectName("line_devAdr")
self.gridLayout_4.addWidget(self.line_devAdr, 0, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(parent=self.layoutWidget_3)
self.label_6.setObjectName("label_6")
self.gridLayout_4.addWidget(self.label_6, 0, 0, 1, 1)
self.button_connect = QtWidgets.QPushButton(parent=self.layoutWidget_3)
self.button_connect.setObjectName("button_connect")
self.gridLayout_4.addWidget(self.button_connect, 0, 2, 1, 1)
self.layoutWidget2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget2.setGeometry(QtCore.QRect(10, 110, 185, 72))
self.layoutWidget2.setObjectName("layoutWidget2")
self.gridLayout_3 = QtWidgets.QGridLayout(self.layoutWidget2)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.label_14 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_14.setObjectName("label_14")
self.gridLayout_3.addWidget(self.label_14, 2, 0, 1, 1)
self.line_ATT = QtWidgets.QLineEdit(parent=self.layoutWidget2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_ATT.sizePolicy().hasHeightForWidth())
self.line_ATT.setSizePolicy(sizePolicy)
self.line_ATT.setObjectName("line_ATT")
self.gridLayout_3.addWidget(self.line_ATT, 1, 1, 1, 1)
self.label_12 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_12.setObjectName("label_12")
self.gridLayout_3.addWidget(self.label_12, 1, 0, 1, 1)
self.line_freq = QtWidgets.QLineEdit(parent=self.layoutWidget2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_freq.sizePolicy().hasHeightForWidth())
self.line_freq.setSizePolicy(sizePolicy)
self.line_freq.setObjectName("line_freq")
self.gridLayout_3.addWidget(self.line_freq, 0, 1, 1, 1)
self.label_13 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_13.setObjectName("label_13")
self.gridLayout_3.addWidget(self.label_13, 0, 0, 1, 1)
self.checkBox_calibrate = QtWidgets.QCheckBox(parent=self.layoutWidget2)
self.checkBox_calibrate.setText("")
self.checkBox_calibrate.setObjectName("checkBox_calibrate")
self.gridLayout_3.addWidget(self.checkBox_calibrate, 2, 1, 1, 1)
self.label_9 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_9.setGeometry(QtCore.QRect(190, 250, 61, 21))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_9.setFont(font)
self.label_9.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_9.setObjectName("label_9")
self.label_11 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_11.setGeometry(QtCore.QRect(30, 250, 61, 21))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.label_11.setFont(font)
self.label_11.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_11.setObjectName("label_11")
self.layoutWidget_2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_2.setGeometry(QtCore.QRect(10, 80, 121, 22))
self.layoutWidget_2.setObjectName("layoutWidget_2")
self.gridLayout_7 = QtWidgets.QGridLayout(self.layoutWidget_2)
self.gridLayout_7.setContentsMargins(0, 0, 0, 0)
self.gridLayout_7.setObjectName("gridLayout_7")
self.label_16 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_16.setObjectName("label_16")
self.gridLayout_7.addWidget(self.label_16, 0, 0, 1, 1)
self.line_saveInterval = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_saveInterval.sizePolicy().hasHeightForWidth())
self.line_saveInterval.setSizePolicy(sizePolicy)
self.line_saveInterval.setObjectName("line_saveInterval")
self.gridLayout_7.addWidget(self.line_saveInterval, 0, 1, 1, 1)
self.widget = QtWidgets.QWidget(parent=self.centralwidget)
self.widget.setGeometry(QtCore.QRect(10, 217, 181, 22))
self.widget.setObjectName("widget")
self.gridLayout_5 = QtWidgets.QGridLayout(self.widget)
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
self.gridLayout_5.setHorizontalSpacing(15)
self.gridLayout_5.setObjectName("gridLayout_5")
self.label_10 = QtWidgets.QLabel(parent=self.widget)
self.label_10.setObjectName("label_10")
self.gridLayout_5.addWidget(self.label_10, 0, 0, 1, 1)
self.comboBox_mode = QtWidgets.QComboBox(parent=self.widget)
self.comboBox_mode.setObjectName("comboBox_mode")
self.comboBox_mode.addItem("")
self.comboBox_mode.addItem("")
self.comboBox_mode.addItem("")
self.gridLayout_5.addWidget(self.comboBox_mode, 0, 1, 1, 1)
self.widget1 = QtWidgets.QWidget(parent=self.centralwidget)
self.widget1.setGeometry(QtCore.QRect(11, 280, 111, 22))
self.widget1.setObjectName("widget1")
self.gridLayout_6 = QtWidgets.QGridLayout(self.widget1)
self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
self.gridLayout_6.setObjectName("gridLayout_6")
self.label_15 = QtWidgets.QLabel(parent=self.widget1)
self.label_15.setObjectName("label_15")
self.gridLayout_6.addWidget(self.label_15, 0, 0, 1, 1)
self.line_Dutycycle = QtWidgets.QLineEdit(parent=self.widget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Dutycycle.sizePolicy().hasHeightForWidth())
self.line_Dutycycle.setSizePolicy(sizePolicy)
self.line_Dutycycle.setObjectName("line_Dutycycle")
self.gridLayout_6.addWidget(self.line_Dutycycle, 0, 1, 1, 1)
Powermeter.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=Powermeter)
self.menubar.setGeometry(QtCore.QRect(0, 0, 787, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
Powermeter.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=Powermeter)
self.statusbar.setObjectName("statusbar")
Powermeter.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=Powermeter)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=Powermeter)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(Powermeter)
QtCore.QMetaObject.connectSlotsByName(Powermeter)
Powermeter.setTabOrder(self.line_devAdr, self.button_connect)
Powermeter.setTabOrder(self.button_connect, self.line_filePath)
Powermeter.setTabOrder(self.line_filePath, self.checkBox_save)
Powermeter.setTabOrder(self.checkBox_save, self.line_saveInterval)
Powermeter.setTabOrder(self.line_saveInterval, self.line_freq)
Powermeter.setTabOrder(self.line_freq, self.line_ATT)
Powermeter.setTabOrder(self.line_ATT, self.checkBox_calibrate)
Powermeter.setTabOrder(self.checkBox_calibrate, self.comboBox_mode)
Powermeter.setTabOrder(self.comboBox_mode, self.line_Dutycycle)
Powermeter.setTabOrder(self.line_Dutycycle, self.line_Duration)
Powermeter.setTabOrder(self.line_Duration, self.comboBox_res)
Powermeter.setTabOrder(self.comboBox_res, self.line_TrigDelay)
Powermeter.setTabOrder(self.line_TrigDelay, self.line_TrigLevel)
Powermeter.setTabOrder(self.line_TrigLevel, self.button_updateTrace)
Powermeter.setTabOrder(self.button_updateTrace, self.line_Nplot)
Powermeter.setTabOrder(self.line_Nplot, self.checkBox_disableplots)
def retranslateUi(self, Powermeter):
_translate = QtCore.QCoreApplication.translate
Powermeter.setWindowTitle(_translate("Powermeter", "PM Control"))
self.checkBox_disableplots.setText(_translate("Powermeter", "Disable plot"))
self.label_5.setText(_translate("Powermeter", "# points to plot"))
self.button_updateTrace.setText(_translate("Powermeter", "Update parameters"))
self.label_3.setText(_translate("Powermeter", "Resolution"))
self.comboBox_res.setItemText(0, _translate("Powermeter", "High"))
self.comboBox_res.setItemText(1, _translate("Powermeter", "Med"))
self.comboBox_res.setItemText(2, _translate("Powermeter", "Low"))
self.line_Duration.setText(_translate("Powermeter", "1e-3"))
self.label_4.setText(_translate("Powermeter", "Trig delay[s]"))
self.line_TrigDelay.setText(_translate("Powermeter", "1e-4"))
self.label_2.setText(_translate("Powermeter", "Duration[s]"))
self.label_8.setText(_translate("Powermeter", "Trig Lev [dBm]"))
self.line_Power_in.setText(_translate("Powermeter", "0"))
self.label.setText(_translate("Powermeter", "Power [dBm]"))
self.label_7.setText(_translate("Powermeter", "File Path"))
self.checkBox_save.setText(_translate("Powermeter", "Save"))
self.label_6.setText(_translate("Powermeter", "Device Adress"))
self.button_connect.setText(_translate("Powermeter", "Connect"))
self.label_14.setText(_translate("Powermeter", "Calibrate on powerup"))
self.label_12.setText(_translate("Powermeter", "Attenuation input [dB]"))
self.label_13.setText(_translate("Powermeter", "Frequency [Hz]"))
self.label_9.setText(_translate("Powermeter", "Trace"))
self.label_11.setText(_translate("Powermeter", "Pulse"))
self.label_16.setText(_translate("Powermeter", "Save interval [s]"))
self.label_10.setText(_translate("Powermeter", "Measurement mode"))
self.comboBox_mode.setItemText(0, _translate("Powermeter", "CW"))
self.comboBox_mode.setItemText(1, _translate("Powermeter", "Pulse"))
self.comboBox_mode.setItemText(2, _translate("Powermeter", "Trace"))
self.label_15.setText(_translate("Powermeter", "Dutycycle [%]"))
self.line_Dutycycle.setText(_translate("Powermeter", "1e-3"))
self.menuFile.setTitle(_translate("Powermeter", "File"))
self.actionSet_default.setText(_translate("Powermeter", "Make current values default"))
self.actionReset_default.setText(_translate("Powermeter", "Reset default values"))
from pyqtgraph import PlotWidget

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,854 @@
# Form implementation generated from reading ui file 'LS336.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(787, 423)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.layoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget.setGeometry(QtCore.QRect(12, 110, 141, 87))
self.layoutWidget.setObjectName("layoutWidget")
self.formLayout = QtWidgets.QFormLayout(self.layoutWidget)
self.formLayout.setContentsMargins(0, 0, 0, 0)
self.formLayout.setObjectName("formLayout")
self.label = QtWidgets.QLabel(parent=self.layoutWidget)
self.label.setObjectName("label")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
self.T_A = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.T_A.setPalette(palette)
self.T_A.setAutoFillBackground(True)
self.T_A.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.T_A.setObjectName("T_A")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.T_A)
self.label_2 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
self.T_B = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.T_B.setPalette(palette)
self.T_B.setAutoFillBackground(True)
self.T_B.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.T_B.setObjectName("T_B")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.T_B)
self.label_3 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_3.setObjectName("label_3")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3)
self.T_C = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.T_C.setPalette(palette)
self.T_C.setAutoFillBackground(True)
self.T_C.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.T_C.setObjectName("T_C")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.T_C)
self.label_4 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_4.setObjectName("label_4")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_4)
self.T_D = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.T_D.setPalette(palette)
self.T_D.setAutoFillBackground(True)
self.T_D.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.T_D.setObjectName("T_D")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.T_D)
self.checkBox_A = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_A.setGeometry(QtCore.QRect(230, 190, 70, 17))
self.checkBox_A.setChecked(True)
self.checkBox_A.setObjectName("checkBox_A")
self.checkBox_B = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_B.setGeometry(QtCore.QRect(230, 210, 70, 17))
self.checkBox_B.setChecked(True)
self.checkBox_B.setObjectName("checkBox_B")
self.checkBox_C = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_C.setGeometry(QtCore.QRect(230, 230, 70, 17))
self.checkBox_C.setChecked(True)
self.checkBox_C.setObjectName("checkBox_C")
self.checkBox_D = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_D.setGeometry(QtCore.QRect(230, 250, 70, 17))
self.checkBox_D.setChecked(True)
self.checkBox_D.setObjectName("checkBox_D")
self.checkBox_pwr = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_pwr.setGeometry(QtCore.QRect(230, 270, 70, 17))
self.checkBox_pwr.setChecked(False)
self.checkBox_pwr.setObjectName("checkBox_pwr")
self.checkBox_disableplots = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_disableplots.setGeometry(QtCore.QRect(230, 170, 81, 17))
self.checkBox_disableplots.setObjectName("checkBox_disableplots")
self.label_5 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_5.setGeometry(QtCore.QRect(311, 301, 81, 16))
self.label_5.setObjectName("label_5")
self.line_Nplot = QtWidgets.QLineEdit(parent=self.centralwidget)
self.line_Nplot.setGeometry(QtCore.QRect(400, 301, 59, 20))
self.line_Nplot.setObjectName("line_Nplot")
self.button_setPID = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_setPID.setGeometry(QtCore.QRect(10, 310, 75, 23))
self.button_setPID.setObjectName("button_setPID")
self.line_setI = QtWidgets.QLineEdit(parent=self.centralwidget)
self.line_setI.setEnabled(True)
self.line_setI.setGeometry(QtCore.QRect(24, 247, 41, 20))
self.line_setI.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_setI.setObjectName("line_setI")
self.label_12 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_12.setGeometry(QtCore.QRect(11, 273, 16, 16))
self.label_12.setObjectName("label_12")
self.line_setP = QtWidgets.QLineEdit(parent=self.centralwidget)
self.line_setP.setGeometry(QtCore.QRect(24, 221, 41, 20))
self.line_setP.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_setP.setObjectName("line_setP")
self.line_setD = QtWidgets.QLineEdit(parent=self.centralwidget)
self.line_setD.setGeometry(QtCore.QRect(24, 273, 41, 20))
self.line_setD.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_setD.setObjectName("line_setD")
self.label_11 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_11.setGeometry(QtCore.QRect(11, 247, 16, 16))
self.label_11.setObjectName("label_11")
self.label_10 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_10.setGeometry(QtCore.QRect(11, 221, 16, 16))
self.label_10.setObjectName("label_10")
self.graphWidget = PlotWidget(parent=self.centralwidget)
self.graphWidget.setGeometry(QtCore.QRect(320, 10, 431, 281))
self.graphWidget.setObjectName("graphWidget")
self.layoutWidget1 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget1.setGeometry(QtCore.QRect(82, 222, 131, 111))
self.layoutWidget1.setObjectName("layoutWidget1")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget1)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label_8 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 1, 0, 1, 1)
self.label_9 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.label_9, 0, 0, 1, 1)
self.line_Ramprate = QtWidgets.QLineEdit(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Ramprate.sizePolicy().hasHeightForWidth())
self.line_Ramprate.setSizePolicy(sizePolicy)
self.line_Ramprate.setObjectName("line_Ramprate")
self.gridLayout.addWidget(self.line_Ramprate, 1, 1, 1, 1)
self.line_setT = QtWidgets.QLineEdit(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_setT.sizePolicy().hasHeightForWidth())
self.line_setT.setSizePolicy(sizePolicy)
self.line_setT.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_setT.setObjectName("line_setT")
self.gridLayout.addWidget(self.line_setT, 0, 1, 1, 1)
self.label_13 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_13.setObjectName("label_13")
self.gridLayout.addWidget(self.label_13, 2, 0, 1, 1)
self.comboBox_Channel = QtWidgets.QComboBox(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.comboBox_Channel.sizePolicy().hasHeightForWidth())
self.comboBox_Channel.setSizePolicy(sizePolicy)
self.comboBox_Channel.setObjectName("comboBox_Channel")
self.comboBox_Channel.addItem("")
self.comboBox_Channel.addItem("")
self.comboBox_Channel.addItem("")
self.comboBox_Channel.addItem("")
self.gridLayout.addWidget(self.comboBox_Channel, 2, 1, 1, 1)
self.label_14 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_14.setObjectName("label_14")
self.gridLayout.addWidget(self.label_14, 3, 0, 1, 1)
self.comboBox_range = QtWidgets.QComboBox(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.comboBox_range.sizePolicy().hasHeightForWidth())
self.comboBox_range.setSizePolicy(sizePolicy)
self.comboBox_range.setObjectName("comboBox_range")
self.comboBox_range.addItem("")
self.comboBox_range.addItem("")
self.comboBox_range.addItem("")
self.comboBox_range.addItem("")
self.gridLayout.addWidget(self.comboBox_range, 3, 1, 1, 1)
self.layoutWidget2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget2.setGeometry(QtCore.QRect(10, 10, 291, 53))
self.layoutWidget2.setObjectName("layoutWidget2")
self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget2)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_6 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_6.setObjectName("label_6")
self.gridLayout_2.addWidget(self.label_6, 0, 0, 1, 1)
self.line_devAdr = QtWidgets.QLineEdit(parent=self.layoutWidget2)
self.line_devAdr.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_devAdr.sizePolicy().hasHeightForWidth())
self.line_devAdr.setSizePolicy(sizePolicy)
self.line_devAdr.setObjectName("line_devAdr")
self.gridLayout_2.addWidget(self.line_devAdr, 0, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_7.setObjectName("label_7")
self.gridLayout_2.addWidget(self.label_7, 1, 0, 1, 1)
self.line_filePath = QtWidgets.QLineEdit(parent=self.layoutWidget2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_filePath.sizePolicy().hasHeightForWidth())
self.line_filePath.setSizePolicy(sizePolicy)
self.line_filePath.setObjectName("line_filePath")
self.gridLayout_2.addWidget(self.line_filePath, 1, 1, 1, 1)
self.checkBox_save = QtWidgets.QCheckBox(parent=self.layoutWidget2)
self.checkBox_save.setObjectName("checkBox_save")
self.gridLayout_2.addWidget(self.checkBox_save, 1, 2, 1, 1)
self.button_connect = QtWidgets.QPushButton(parent=self.layoutWidget2)
self.button_connect.setObjectName("button_connect")
self.gridLayout_2.addWidget(self.button_connect, 0, 2, 1, 1)
self.layoutWidget_2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_2.setGeometry(QtCore.QRect(10, 70, 121, 22))
self.layoutWidget_2.setObjectName("layoutWidget_2")
self.gridLayout_3 = QtWidgets.QGridLayout(self.layoutWidget_2)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.label_15 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_15.setObjectName("label_15")
self.gridLayout_3.addWidget(self.label_15, 0, 0, 1, 1)
self.line_saveInterval = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_saveInterval.sizePolicy().hasHeightForWidth())
self.line_saveInterval.setSizePolicy(sizePolicy)
self.line_saveInterval.setObjectName("line_saveInterval")
self.gridLayout_3.addWidget(self.line_saveInterval, 0, 1, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 787, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.line_devAdr, self.button_connect)
MainWindow.setTabOrder(self.button_connect, self.line_filePath)
MainWindow.setTabOrder(self.line_filePath, self.checkBox_save)
MainWindow.setTabOrder(self.checkBox_save, self.line_saveInterval)
MainWindow.setTabOrder(self.line_saveInterval, self.line_setP)
MainWindow.setTabOrder(self.line_setP, self.line_setI)
MainWindow.setTabOrder(self.line_setI, self.line_setD)
MainWindow.setTabOrder(self.line_setD, self.button_setPID)
MainWindow.setTabOrder(self.button_setPID, self.line_setT)
MainWindow.setTabOrder(self.line_setT, self.line_Ramprate)
MainWindow.setTabOrder(self.line_Ramprate, self.comboBox_Channel)
MainWindow.setTabOrder(self.comboBox_Channel, self.comboBox_range)
MainWindow.setTabOrder(self.comboBox_range, self.checkBox_disableplots)
MainWindow.setTabOrder(self.checkBox_disableplots, self.checkBox_A)
MainWindow.setTabOrder(self.checkBox_A, self.checkBox_B)
MainWindow.setTabOrder(self.checkBox_B, self.checkBox_C)
MainWindow.setTabOrder(self.checkBox_C, self.checkBox_D)
MainWindow.setTabOrder(self.checkBox_D, self.checkBox_pwr)
MainWindow.setTabOrder(self.checkBox_pwr, self.line_Nplot)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Lakeshore-336"))
self.label.setText(_translate("MainWindow", "T Channel A [K]"))
self.T_A.setText(_translate("MainWindow", "0"))
self.label_2.setText(_translate("MainWindow", "T Channel B [K]"))
self.T_B.setText(_translate("MainWindow", "0"))
self.label_3.setText(_translate("MainWindow", "T Channel C [K]"))
self.T_C.setText(_translate("MainWindow", "0"))
self.label_4.setText(_translate("MainWindow", "T Channel D [K]"))
self.T_D.setText(_translate("MainWindow", "0"))
self.checkBox_A.setText(_translate("MainWindow", "Ch A"))
self.checkBox_B.setText(_translate("MainWindow", "Ch B"))
self.checkBox_C.setText(_translate("MainWindow", "Ch C"))
self.checkBox_D.setText(_translate("MainWindow", "Ch D"))
self.checkBox_pwr.setText(_translate("MainWindow", "Power"))
self.checkBox_disableplots.setText(_translate("MainWindow", "Disable plots"))
self.label_5.setText(_translate("MainWindow", "# points to plot"))
self.button_setPID.setText(_translate("MainWindow", "set PID"))
self.label_12.setText(_translate("MainWindow", "D"))
self.label_11.setText(_translate("MainWindow", "I"))
self.label_10.setText(_translate("MainWindow", "P"))
self.label_8.setText(_translate("MainWindow", "Rate [K/min]"))
self.label_9.setText(_translate("MainWindow", "T set [K]"))
self.label_13.setText(_translate("MainWindow", "CH [0-4]"))
self.comboBox_Channel.setItemText(0, _translate("MainWindow", "A"))
self.comboBox_Channel.setItemText(1, _translate("MainWindow", "B"))
self.comboBox_Channel.setItemText(2, _translate("MainWindow", "C"))
self.comboBox_Channel.setItemText(3, _translate("MainWindow", "D"))
self.label_14.setText(_translate("MainWindow", "Range"))
self.comboBox_range.setItemText(0, _translate("MainWindow", "OFF"))
self.comboBox_range.setItemText(1, _translate("MainWindow", "Low"))
self.comboBox_range.setItemText(2, _translate("MainWindow", "Med"))
self.comboBox_range.setItemText(3, _translate("MainWindow", "High"))
self.label_6.setText(_translate("MainWindow", "Device Adress"))
self.label_7.setText(_translate("MainWindow", "File Path"))
self.checkBox_save.setText(_translate("MainWindow", "Save"))
self.button_connect.setText(_translate("MainWindow", "Connect"))
self.label_15.setText(_translate("MainWindow", "Save interval [s]"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,414 @@
# Form implementation generated from reading ui file 'Tabor_LS6081B.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(329, 286)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.label = QtWidgets.QLabel(parent=self.centralwidget)
self.label.setGeometry(QtCore.QRect(30, 60, 61, 31))
font = QtGui.QFont()
font.setPointSize(16)
self.label.setFont(font)
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_2.setGeometry(QtCore.QRect(170, 60, 61, 31))
font = QtGui.QFont()
font.setPointSize(16)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.layoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget.setGeometry(QtCore.QRect(160, 110, 131, 53))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_5 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_5.setObjectName("label_5")
self.gridLayout_2.addWidget(self.label_5, 1, 0, 1, 1)
self.label_6 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_6.setObjectName("label_6")
self.gridLayout_2.addWidget(self.label_6, 0, 0, 1, 1)
self.line_DC = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_DC.setObjectName("line_DC")
self.gridLayout_2.addWidget(self.line_DC, 1, 1, 1, 1)
self.line_width = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_width.setObjectName("line_width")
self.gridLayout_2.addWidget(self.line_width, 0, 1, 1, 1)
self.button_RF = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_RF.setGeometry(QtCore.QRect(30, 180, 93, 28))
self.button_RF.setObjectName("button_RF")
self.button_Pulse = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_Pulse.setGeometry(QtCore.QRect(180, 180, 93, 28))
self.button_Pulse.setObjectName("button_Pulse")
self.label_RF = QtWidgets.QLabel(parent=self.centralwidget)
self.label_RF.setGeometry(QtCore.QRect(30, 210, 91, 21))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 63, 63))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 63, 63))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 63, 63))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.label_RF.setPalette(palette)
self.label_RF.setAutoFillBackground(True)
self.label_RF.setObjectName("label_RF")
self.label_Pulse = QtWidgets.QLabel(parent=self.centralwidget)
self.label_Pulse.setGeometry(QtCore.QRect(180, 210, 91, 21))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 63, 63))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 63, 63))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 63, 63))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.label_Pulse.setPalette(palette)
self.label_Pulse.setAutoFillBackground(True)
self.label_Pulse.setObjectName("label_Pulse")
self.layoutWidget1 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget1.setGeometry(QtCore.QRect(10, 110, 131, 53))
self.layoutWidget1.setObjectName("layoutWidget1")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget1)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label_4 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1)
self.label_3 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
self.line_Power = QtWidgets.QLineEdit(parent=self.layoutWidget1)
self.line_Power.setObjectName("line_Power")
self.gridLayout.addWidget(self.line_Power, 1, 1, 1, 1)
self.line_Freq = QtWidgets.QLineEdit(parent=self.layoutWidget1)
self.line_Freq.setObjectName("line_Freq")
self.gridLayout.addWidget(self.line_Freq, 0, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_7.setGeometry(QtCore.QRect(16, 20, 69, 23))
self.label_7.setObjectName("label_7")
self.line_devAdr = QtWidgets.QLineEdit(parent=self.centralwidget)
self.line_devAdr.setEnabled(True)
self.line_devAdr.setGeometry(QtCore.QRect(91, 21, 133, 20))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_devAdr.sizePolicy().hasHeightForWidth())
self.line_devAdr.setSizePolicy(sizePolicy)
self.line_devAdr.setObjectName("line_devAdr")
self.button_connect = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_connect.setGeometry(QtCore.QRect(230, 20, 75, 23))
self.button_connect.setObjectName("button_connect")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 329, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.line_devAdr, self.button_connect)
MainWindow.setTabOrder(self.button_connect, self.line_Freq)
MainWindow.setTabOrder(self.line_Freq, self.line_Power)
MainWindow.setTabOrder(self.line_Power, self.line_width)
MainWindow.setTabOrder(self.line_width, self.line_DC)
MainWindow.setTabOrder(self.line_DC, self.button_RF)
MainWindow.setTabOrder(self.button_RF, self.button_Pulse)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Tabor LS6081B"))
self.label.setText(_translate("MainWindow", "CW"))
self.label_2.setText(_translate("MainWindow", "Pulse"))
self.label_5.setText(_translate("MainWindow", "DC [%]"))
self.label_6.setText(_translate("MainWindow", "Width [s]"))
self.button_RF.setText(_translate("MainWindow", "RF on/OFF"))
self.button_Pulse.setText(_translate("MainWindow", "Pulse on/OFF"))
self.label_RF.setText(_translate("MainWindow", "<html><head/><body><p><br/></p></body></html>"))
self.label_Pulse.setText(_translate("MainWindow", "<html><head/><body><p><br/></p></body></html>"))
self.label_4.setText(_translate("MainWindow", "P [dBm]"))
self.label_3.setText(_translate("MainWindow", "Freq. [Hz]"))
self.label_7.setText(_translate("MainWindow", "Device Adress"))
self.button_connect.setText(_translate("MainWindow", "Connect"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))

View File

@ -0,0 +1,185 @@
import serial
import time
import numpy as np
timedelta = 0.02
class AG_304_FS:
def __init__(self,adress):
#establish connection to device
try:
self.inst = serial.Serial(adress, 9600, timeout=1) # Replace with your COM port and baudrate
print(f'connected to {adress}')
except:
print(f'could not connect to {adress}')
return
time.sleep(1)
def __del__(self):
self.inst.close()
print('Disconnected')
def read_pressure(self):
'''read the pressure from the controller (Window 224, see manual)'''
hex_string = "028032323430033837" # pressure
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
val_b = data_b[6:13]
try:
val = float(val_b)
except ValueError:
val = 0
return(val)
def read_temp(self):
'''read the pump temperature (Window 204)'''
hex_string = "028032303430033835" # temperature
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
val_b = data_b[6:12] #get rid of additional bytes
try:
val = float(val_b)
except ValueError:
val = 0
return(val)
def read_status(self):
'''read pump status (window 205)'''
hex_string = "028032303530033834" # status
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
val_b = data_b[6:12] #get rid of additional bytes
status = ['Stop', 'Waiting intlk', ' Starting', 'Autotuning', 'Braking', 'Normal', 'Fail']
try:
val = int(val_b)
except ValueError:
val = 6
return(status[val])
def read_freq(self):
'''read pump frequency [Hz] (window 203)'''
hex_string = "028032303330033832" # temperature
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
val_b = data_b[6:12] #get rid of additional bytes
try:
val = int(val_b)
except ValueError:
val = 0
return(val)
def read_fan_status(self):
'''reads the status of the fan (window 144)'''
hex_string = "028031343430033832"
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
val_b = data_b[5:7] #get rid of additional bytes (Response is different here compared to others)
val = int(val_b)
return(val)
def set_fan_status(self,on):
'''sets the status of the fan (window 144)'''
if on == True or on == 'On' or on == 'ON' or on == 'on' or on == 1:
hex_string = "02803134333132034236" # sets external fan activation to on
# hex_string = "02803134343130034233"
else:
hex_string = "02803134333131034235" # sets external fan activation to off
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
print(data_b)
val_b = data_b[5:7] #get rid of additional bytes (Response is different here compared to others)
val = int(val_b)
return(val)
def start_pump(self):
'''start pump (Window 000)'''
hex_string = "02803030303131034233"
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
# if data_b[2:3] == b'\x06':
# print('Starting Pump')
# else:
# print('Pump cannot be started.')
def stop_pump(self):
'''stop pump (Window ...)'''
hex_string = "02803030303130034232"
# Convert the hex string to bytes
bytes_to_send = bytes.fromhex(hex_string)
# Send the bytes to the COM port
self.inst.write(bytes_to_send)
# Read response
data_b = self.inst.read(100) # read up to hundred bytes or timeout is reached
# if data_b == data_b[2:3] == b'\x06':
# print('Stop Pump')
# else:
# print('Pump cannot be stopped.')
# test area
# adress = 'COM2'
# ag = AG_304_FS(adress)
# print(ag.read_pressure())
# ag.__del__()
##Open the COM port
# ser = serial.Serial('COM2', 9600, timeout=1) # Replace with your COM port and baudrate
# # Define the hex string
# hex_string = "028032303530033834" # pump status
# hex_string = "028032323430033837" # pressure
# # Convert the hex string to bytes
# bytes_to_send = bytes.fromhex(hex_string)
# # Send the bytes to the COM port
# ser.write(bytes_to_send)
# # Read response
# s = ser.read(100) # read up to ten bytes (timeout)
# print(s)
# # Close the COM port
# ser.close()

View File

@ -0,0 +1,96 @@
import pyvisa
import time
timedelta = 0.02
class BK_9132B:
def __init__(self,adress):
#establish connection to device with pyvisa. The device is initiallized with visa adress "adress"
self.rm = pyvisa.ResourceManager()
try:
self.inst = self.rm.open_resource(adress)
except:
print(f'could not connect to {adress}')
return
time.sleep(1)
def __del__(self):
self.rm.close()
def read_Voltage(self):
#reads applied voltage of all three channels simultaneously. Output has format [V1, V2, V3].
command = f':MEAS:VOLT:ALL?'
data = str(self.inst.query(command))
data = data.split(', ') #Split string in single objects
data = [float(i) for i in data]
time.sleep(timedelta)
return data
def read_Current(self):
#reads applied current of all three channels simultaneously. Output has format [I1, I2, I3].
command = f':MEAS:CURR:ALL?'
data = str(self.inst.query(command))
data = data.split(', ') #Split string in single objects
data = [float(i) for i in data]
time.sleep(timedelta)
return data
def read_Power(self):
#reads applied power of all three channels simultaneously. Output has format [P1, P2, P3].
command = f':MEAS:POW:ALL?'
data = str(self.inst.query(command))
data = data.split(', ') #Split string in single objects
data = [float(i) for i in data]
time.sleep(timedelta)
return data
def set_Voltage(self, CH, Voltage):
#sets Voltage in Volt for channel CH
#Selects channel which voltage should be changed:
command = f'INST CH{CH}'
self.inst.write(command)
time.sleep(timedelta)
#Sets voltage of selected channel:
command = f':SOUR:VOLT {Voltage}'
self.inst.write(command)
time.sleep(timedelta)
def set_Current(self, CH, Current):
#sets Current in Ampere for channel CH
#Selects channel which current should be changed:
command = f'INST CH{CH}'
self.inst.write(command)
time.sleep(timedelta)
#Sets current of selected channel:
command = f':SOUR:CURR {Current}'
self.inst.write(command)
time.sleep(timedelta)
def set_Output(self, CH, On):
#sets Output of channel CH on or off.
# On -> On = True,
# Off -> On = False
#Selects channel which output should be changed:
command = f'INST CH{CH}'
self.inst.write(command)
time.sleep(timedelta)
#Sets output of selected channel:
if On == True:
command = ':SOUR:CHAN:OUTP ON'
self.inst.write(command)
elif On == False:
command = ':SOUR:CHAN:OUTP OFF'
self.inst.write(command)
time.sleep(timedelta)

View File

@ -0,0 +1,107 @@
import pyvisa
import time
timedelta = 0.02
class BK_9174B:
def __init__(self,adress):
#establish connection to device with pyvisa. The device is initiallized with visa adress "adress"
self.rm = pyvisa.ResourceManager()
try:
self.inst = self.rm.open_resource(adress, baud_rate=57600) #Default baud_rate is 9600 but this results in an error.
except:
print(f'could not connect to {adress}')
return
time.sleep(1)
def __del__(self):
self.rm.close()
def read_Voltage(self):
#reads applied voltage of both channels simultaneously. Output has format [V1, V2].
command1 = f':MEAS:VOLT?'
command2 = f':MEAS:VOLT 2?'
data1 = str(self.inst.query(command1))
time.sleep(timedelta)
data2 = str(self.inst.query(command2))
data = [float(data1), float(data2)]
time.sleep(timedelta)
return data
def read_Current(self):
#reads applied current of both channels simultaneously. Output has format [I1, I2].
command1 = f':MEAS:CURR?'
command2 = f':MEAS:CURR 2?'
data1 = str(self.inst.query(command1))
time.sleep(timedelta)
data2 = str(self.inst.query(command2))
data = [float(data1), float(data2)]
time.sleep(timedelta)
return data
def set_Voltage(self, CH, Voltage):
#sets Voltage in Volt for channel CH
if CH==1:
command = f':VOLT {Voltage}'
self.inst.write(command)
time.sleep(timedelta)
if CH==2:
command = f':VOLT2 {Voltage}'
self.inst.write(command)
time.sleep(timedelta)
def set_Current(self, CH, Current):
#sets Current in Ampere for channel CH
if CH==1:
command = f':CURR {Current}'
self.inst.write(command)
time.sleep(timedelta)
if CH==2:
command = f':CURR2 {Current}'
self.inst.write(command)
time.sleep(timedelta)
def set_Output(self, CH, On):
#sets Output of channel CH on or off.
# ON = True -> Turns output on
# ON = False -> Turns output off
if CH==1:
if On == True:
command = ':OUT ON'
self.inst.write(command)
elif On == False:
command = ':OUT OFF'
self.inst.write(command)
if CH==2:
if On == True:
command = ':OUT2 ON'
self.inst.write(command)
elif On == False:
command = ':OUT2 OFF'
self.inst.write(command)
time.sleep(timedelta)
def set_Voltage_slewrate(self, CH, slewrate):
#sets slew rate of channel CH, [slewrate] = V/ms
if CH==1:
command = f':OUT:SR:VOLT {slewrate}'
self.inst.write(command)
time.sleep(timedelta)
if CH==2:
command = f':OUT:SR:VOLT2 {slewrate}'
self.inst.write(command)
time.sleep(timedelta)

View File

@ -0,0 +1,106 @@
import pyvisa
import time
timedelta = 0.05
class Keithley_2230G:
def __init__(self,adress):
#establish connection to device with pyvisa. The device is initiallized with visa adress "adress"
self.rm = pyvisa.ResourceManager()
try:
self.inst = self.rm.open_resource(adress)
except:
print(f'could not connect to {adress}')
return
time.sleep(1)
self.set_Output(1, False)
time.sleep(0.1)
self.set_Output(2, False)
time.sleep(0.1)
self.set_Output(3, False)
time.sleep(0.1)
def __del__(self):
self.rm.close()
def read_Voltage(self):
#reads applied voltage of all three channels simultaneously. Output has format [V1, V2, V3].
command = f':MEAS:VOLT? ALL'
data = str(self.inst.query(command))
data = data.split(', ') #Split string in single objects
data = [float(i) for i in data]
time.sleep(timedelta)
return data
def read_Current(self):
#reads applied current of all three channels simultaneously. Output has format [I1, I2, I3].
command = f':MEAS:CURR? ALL'
data = str(self.inst.query(command))
data = data.split(', ') #Split string in single objects
data = [float(i) for i in data]
time.sleep(timedelta)
return data
def read_Power(self):
#reads applied power of all three channels simultaneously. Output has format [P1, P2, P3].
command = f':MEAS:POW? ALL'
data = str(self.inst.query(command))
data = data.split(', ') #Split string in single objects
data = [float(i) for i in data]
time.sleep(timedelta)
return data
def set_Voltage(self, CH, Voltage):
#sets Voltage in Volt for channel CH
#Selects channel which voltage should be changed:
command = f':INST:SEL CH{CH}'
self.inst.write(command)
time.sleep(timedelta)
#Sets voltage of selected channel:
command = f':SOURCE:VOLT {Voltage}V'
self.inst.write(command)
time.sleep(timedelta)
def set_Current(self, CH, Current):
#sets Current in Ampere for channel CH
#Selects channel which current should be changed:
command = f':INST:SEL CH{CH}'
self.inst.write(command)
time.sleep(timedelta)
#Sets current of selected channel:
command = f':SOURCE:CURR {Current}A'
self.inst.write(command)
time.sleep(timedelta)
def set_Output(self, CH, On):
#sets Output of channel CH on or off.
# On -> On = True,
# Off -> On = False
#Selects channel which output should be changed:
command = f':INST:SEL CH{CH}'
self.inst.write(command)
time.sleep(timedelta)
#Sets output of selected channel:
if On == True:
command = 'SOURCE:OUTP:ENAB ON'
self.inst.write(command)
time.sleep(timedelta)
command = 'SOUR:OUTP ON' #in case all three channels were disabled the device sets output = off automatically. Enabling one channel again will not turn on the output again. We have to do it by hand.
self.inst.write(command)
elif On == False:
command = 'SOURCE:OUTP:ENAB OFF'
self.inst.write(command)
time.sleep(timedelta)

View File

@ -0,0 +1,90 @@
import socket
import time
import re
Buffer = 2048
class Keysight34461A:
def __init__(self, ip):
#establishes ethernet connection to the device with ip "ip"
try:
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((ip, 5024))
time.sleep(0.2)
self.s.recv(Buffer)
except:
print(f'could not connect to device with IP: {ip}')
def __del__(self):
#closes the connection
self.s.send(b'ABOR\r\n')
self.s.close()
def configure(self,VoC = 'VOLT', DC = 'DC', meas_range = 'AUTO', trig_source = 'IMM', trig_count = 'INF'):
#configures the device to measure the desired value:
#VoC(Volt or Current): measure volt or current. Values: "VOLT";"CURR";'
#DC(DirectCureent): measure DC or AC. Values: "DC";"AC"
#meas_range:sets the measurement range. Values:'AUTO' maybe others, I cant't find them in the manual
#trig_source: sets how the device in triggered. Values: 'IMM', 'BUS', 'EXT', 'INT' (see manual p.434)
#trig_count:How many triggers are excepted before device stops measurement. Values:'INF', (1 to 1e6)
command = f'CONF:{VoC}:{DC} {meas_range}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
command = f'CONF:{VoC}:RANG {meas_range}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
command = f'TRIG:SOUR {trig_source}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
command = f'TRIG:COUN {trig_count}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
def configure_temp(self,Sensor = 'TC', Type = 'R', trig_source = 'IMM', trig_count = 'INF'):
#configures the device to measure temperature:
#Sensor: <probe_type>: {FRTD|RTD|FTHermistor|THERmistor|TCouple} (Manual p.451)
#Type: 85 (only possible value for RTD/FRTD), 5000 (only possible value for THERmistor/FTHermistor), or E, J, K, N, R, T (TCouple).
#trig_source: sets how the device in triggered. Values: 'IMM', 'BUS', 'EXT', 'INT' (see manual p.434)
#trig_count:How many triggers are excepted before device stops measurement. Values:'INF', (1 to 1e6)
command = f'CONF:TEMP {Sensor},{Type}\r\n'
print(command)
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
command = f'TRIG:SOUR {trig_source}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
command = f'TRIG:COUN {trig_count}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
def initiate_measurement(self):
#initializes measurement
self.s.send(b'INIT\r\n')
time.sleep(0.2)
def stop_measurement(self):
#stops measurement
self.s.send(b'ABOR\r\n')
time.sleep(0.2)
def read(self):
#gets current value from device
self.s.send(b'R? 1\r\n')
time.sleep(0.2)
data = str(self.s.recv(Buffer))[14:]
try:
data = float(data.split('\\')[0])
except:
data = 0
self.s.send(b'R?\r\n')
time.sleep(0.2)
self.s.recv(Buffer)[14:]
return data

View File

@ -0,0 +1,79 @@
import pyvisa
import time
class KeysightU2042XA:
def __init__(self,adress,freq,cal=1):
#establish connection to device with pyvisa. The device is initiallized with visa adress "adress" and with frequency "freq". If cal == 1 a on e time calibration
#and zeroing is performed
self.rm = pyvisa.ResourceManager()
try:
self.inst = self.rm.open_resource(adress)
except:
print(f'could not connect to {adress}')
return
self.inst.timeout = 20000
self.inst.write('SYST:PRES')
# time.sleep(0.2)
self.inst.write(f'SENS:FREQ {freq}')
time.sleep(0.2)
if cal == 1:
self.inst.write('CAL:ZERO:AUTO ONCE')
time.sleep(16)
self.inst.write('CAL:AUTO ONCE')
time.sleep(6)
self.inst.write('CAL:ZERO:AUTO OFF')
self.inst.write('CAL:AUTO OFF')
self.inst.write('INIT:CONT ON')
time.sleep(2)
def __del__(self):
self.rm.close()
def activate_CW(self):
#bring the device in a state to measure CW. The values can then be obtained by "read"
self.inst.write('CAL:ZERO:AUTO OFF')
self.inst.write('CAL:AUTO OFF')
self.inst.write('DET:FUNC AVER')
self.inst.write('INIT:CONT ON')
def activate_trace(self):
#brings the device in a state to measure traces. The traces are obtained with read_trace
self.inst.write('CAL:ZERO:AUTO OFF')
self.inst.write('CAL:AUTO OFF')
self.inst.write('DET:FUNC NORM')
self.inst.write('INIT:CONT OFF')
self.inst.write('TRIG:SOUR INT')
self.inst.write('TRAC:STAT ON')
def read(self):
#reads the CW or Pulse measurement from the device
data = float(self.inst.query('FETC?'))
return data
def read_trace(self,res):
#reads a trace with resolution "res" from the device
self.inst.write('INIT')
# data = self.inst.query(f"TRAC? {res}")
data = self.inst.query_binary_values(f"TRAC? {res}", datatype='f', is_big_endian = True)
# self.inst.write('TRAC? LRES')
# data = self.inst.read_raw()
return data
def set_trace_time(self,t):
#sets the duration of the trace
self.inst.write(f"SENS:TRAC:TIME {t}")
def set_trigger_delay(self,t):
#sets the trigger delay of the trace
print(f'TRIG:DEL {t}')
self.inst.write(f'TRIG:DEL {t}')
def set_trigger_level(self,*args):
#sets the trigger level of the device. If no argument is given it is set to auto
if args:
self.inst.write(f"TRIG:LEV:AUTO 0")
self.inst.write(f"TRIG:LEV {args[0]}")
else:
self.inst.write(f"TRIG:LEV:AUTO 1")

View File

@ -0,0 +1,43 @@
import pyvisa
import time
class LakeShore218:
def __init__(self,adress):
#establish connection to device with pyvisa. The device is initiallized with visa adress "adress"
self.rm = pyvisa.ResourceManager()
try:
self.inst = self.rm.open_resource(adress)
except:
print(f'could not connect to {adress}')
return
time.sleep(1)
def __del__(self):
self.rm.close()
def read(self,CH):
#reads temperature Data in Kelvin from channels specified in CH. CH can be 1-8 for integer output of Channel CH.
#if CH=0 the output is a List of all 8 channels. CH can be a List (e.g. [1,4,7]) for the output of a List of specific channels.
if isinstance(CH, int): #if CH is a integer: Read a single channel
if CH>=0 and CH<9:
command = f'KRDG? {CH}'
data = str(self.inst.query(command))
data = data.split(',') #Split string in single objects (important for CH=0)
data = [float(i) for i in data]
time.sleep(0.1)
elif isinstance(CH, list): #if CH is a list: Read all specified channels manually.
data = []
for i in CH:
command = f'KRDG? {i}'
data_single = float(self.inst.query(command))
data.append(data_single)
time.sleep(0.1)
else:
data = [0]
return data

View File

@ -0,0 +1,76 @@
import socket
import time
TCP_PORT = 7777
Buffer = 80
class LakeShore336:
def __init__(self, ip):
#establishes connection to device via ethernet.
try:
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((ip, TCP_PORT))
self.s.settimeout(1)
time.sleep(0.2)
except:
print(f'could not connect to device with IP: {ip}')
def __del__(self):
self.s.close()
def read(self,CH): #reads temperature Data in Kelvin from channels specified in CH. CH is in format ['A','B','C','D']
for i in CH:
command = f'KRDG? {i}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
data = str(self.s.recv(Buffer))[2:]
data = data.split('\\r\\n')
data = [float(i) for i in data[:-1]]
return data
def set_T(self,out,T):
#set the temperture setpoint "T" (in preferred units of the control loop sensor) of output "out"
command = f'SETP {out},{T}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
def set_Ramp(self,out,ON,ramp):
#sets temperature rate of output "out", turns it on, if "ON" is not 0 or 'OFF', with ramprate "ramp" in Kelvin per minute.
#If a ramprate of 0 is entered, the ramprate is turned off
if ramp == 0:
ON = 0
if ON == 0 or ON == 'OFF':
command = f'RAMP {out},0\r\n'
else:
command = f'RAMP {out},{ON},{ramp}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
def conf_outp(self,out=1,mode=0,inp=1,powup=0):
#configures putputmode:
#<out> Specifies which output to configure: 14.
#<mode> Specifies the control mode. Valid entries: 0 = Off, 1 = ClosedLoop PID, 2 = Zone, 3 = Open Loop, 4 = Monitor Out,5 = Warmup Supply
#<inp> Specifies which input to use for control: 0 = None, 1 = A, 2 = B, 3 = C, 4 = D, 5 = Input D2, 6 = Input D3, 7 = Input D4,8 = Input D5 for 3062 option)
#<powerup enable> Specifies whether the output remains on or shuts off afterpower cycle. Valid entries: 0 = powerup enable off,1 = powerup enable on.
command = f'OUTMODE {out},{mode},{inp},{powup}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
def turn_on_outp(self, out=1, range = 0):
#turns the heater output on or off by setting the heater range to:
#For outputs 1 and 2: 0 = Off, 1 = Low, 2 = Medium, 3 = High
#For outputs 3 and 4: 0 = Off, 1 = On
command = f'Range {out},{range}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)
def conf_pid(self, out, Pid, pId, piD):
#sets PID values of output "out"
# <output> Specifies which outputs control loop to configure: 1 or 2.
# <P value> The value for output Proportional (gain): 0.1 to 1000.
# <I value> The value for output Integral (reset): 0.1 to 1000.
# <D value> The value for output Derivative (rate): 0 to 200.
command = f'PID {out},{Pid},{pId},{piD}\r\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.2)

View File

@ -0,0 +1,78 @@
import socket
import time
TCP_PORT = 10000
Buffer = 80
class TaborLS6081B:
def __init__(self, ip):
#establishes connection via ethernet to ip "ip"
try:
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
time.sleep(0.1)
self.s.settimeout(5)
time.sleep(0.1)
self.s.connect((ip, TCP_PORT))
time.sleep(0.2)
except:
print(f'could not connect to device with IP: {ip}')
def __del__(self):
#closes connection
time.sleep(0.1)
command = 'OUTP OFF\n'
self.s.send(command.encode('utf-8'))
self.s.close()
def CW(self,P,freq,ON):
# enables CW mode, and can turn power on or off
#P (Power): sets power value in dBm. Values:-100-20
#freq: sets frequency. Values: 9e3-12e9
#ON: turn RF on or off. Values: 'OFF','On',0,1
command = 'INIT:CONT ON\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = 'SOUR:PULS OFF\n'
time.sleep(0.1)
self.s.send(command.encode('utf-8'))
command = f'SOUR:FREQ {freq}\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = f'SOUR:POW {P}\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = f'OUTP {ON}\n'
self.s.send(command.encode('utf-8'))
def Pulse(self,P,freq,width,duty,ON):
# enables pulse mode, and can turn power on or off. Uses internal source for timing.
#P (Power): sets power value in dBm. Values:-100-20
#freq: sets frequency. Values: 9e3-12e9
#width: length of pulse (including off time) Values: (1-1e-6)s
#duty(dutycycle): sets the duty cycle of the puls. Values:0-1 Setting it to 0 or 1 might not be the best thing (haven't tried it)
#ON: turn RF on or off. Values: 'OFF','On',0,1
command = 'INIT:CONT ON\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = f'SOUR:FREQ {freq}\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = f'SOUR:POW {P}\n'
self.s.send(command.encode('utf-8'))
command = 'SOUR:PULS 1\n'
time.sleep(0.1)
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = ':PULS:SOUR INT\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = f':PULS:FREQ {1/width}\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = f':PULS:WIDT {duty*width}\n'
self.s.send(command.encode('utf-8'))
time.sleep(0.1)
command = f'OUTP {ON}\n'
self.s.send(command.encode('utf-8'))

View File

@ -0,0 +1,93 @@
import multiprocessing
import multiprocessing.managers
#This starts a server (mulitprocessing basemanager) where all standalones store their current measurement values and set_parameters. This data can be accessed from
#all python instances running on this computer. It can be extended so it can be reached from other PCs aswell.
#The dictionarioes which store the values must be initialized and registered here. To register a new dictionary an (empty) dictionary must be created and a function
#must be defined which returns this dictionary. After that the dictionary must be registered in the manager. This is done with:
#MyListManager.register('syncdict',get_dict) where 'syncdict' is the name that other programs use to reach this dictionary and get_dict the function which return the
#dictionary.
#The values don't have to be stored in dictionaries. List or simple variables also work. But I haven't tested all posibillities.
#To access these dictionaries from other programs, a basemanager must be created in the program which is then connected to the manager created here. There the
#dictionary must also be registered. Finally a local variable is created which points at the dictionary on this server. The following example is from Keysigh_U2042XA_control
#manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
#manager.connect()
#manager.register('sync_K_U2042XA')
#self.sync_K_U2042XA = manager.sync_K_U2042XA() <- the local variable "self.sync_K_U2042XA" can have any name
class MyListManager(multiprocessing.managers.BaseManager):
pass
#!!!
#please use unambigous names
#!!!
syncdict = {} #dummy where everything can be stored
sync_AG_304 = {}
sync_K_U2042XA = {}
sync_K_34461A = {}
sync_K_34461A_2 = {}
sync_T_LS6081B = {}
sync_LS_336 = {}
sync_LS_218 = {}
sync_BK_9131B = {}
sync_BK_9132B = {}
sync_BK_9132B_2 = {}
sync_BK_9174B = {}
sync_BK_9174B_2 = {}
sync_Keithley_2230G = {}
def get_dict():
return syncdict
def get_dict_sync_AG_304():
return sync_AG_304
def get_dict_sync_K_U2042XA():
return sync_K_U2042XA
def get_dict_sync_K_34461A():
return sync_K_34461A
def get_dict_sync_K_34461A_2():
return sync_K_34461A_2
def get_dict_sync_T_LS6081B():
return sync_T_LS6081B
def get_dict_sync_LS_336():
return sync_LS_336
def get_dict_sync_LS_218():
return sync_LS_218
def get_dict_sync_BK_9131B():
return sync_BK_9131B
def get_dict_sync_BK_9132B():
return sync_BK_9132B
def get_dict_sync_BK_9132B_2():
return sync_BK_9132B_2
def get_dict_sync_BK_9174B():
return sync_BK_9174B
def get_dict_sync_BK_9174B_2():
return sync_BK_9174B_2
def get_dict_sync_Keithley_2230G():
return sync_Keithley_2230G
def main():
MyListManager.register('syncdict',get_dict)
MyListManager.register('sync_AG_304',get_dict_sync_AG_304)
MyListManager.register('sync_K_U2042XA',get_dict_sync_K_U2042XA)
MyListManager.register('sync_T_LS6081B',get_dict_sync_T_LS6081B)
MyListManager.register('sync_LS_336',get_dict_sync_LS_336)
MyListManager.register('sync_K_34461A',get_dict_sync_K_34461A)
MyListManager.register('sync_K_34461A_2',get_dict_sync_K_34461A_2)
MyListManager.register('sync_LS_218',get_dict_sync_LS_218)
MyListManager.register('sync_BK_9131B', get_dict_sync_BK_9131B)
MyListManager.register('sync_BK_9132B', get_dict_sync_BK_9132B)
MyListManager.register('sync_BK_9132B_2', get_dict_sync_BK_9132B_2)
MyListManager.register('sync_BK_9174B', get_dict_sync_BK_9174B)
MyListManager.register('sync_BK_9174B_2', get_dict_sync_BK_9174B_2)
MyListManager.register('sync_Keithley_2230G', get_dict_sync_Keithley_2230G)
manager = MyListManager(address=('localhost',5001), authkey=b'')
manager.start()
input("Press Enter (Not Str+C) to exit. But kill client first".center(50,"-")) #keeps program running until enter is pressed
manager.shutdown()
if __name__ == '__main__':
main()

View File

@ -0,0 +1,204 @@
import csv
import numpy as np
import fnmatch
import datetime
def read_wdate(path,dateformat,rowheader = 0,delim = '\t'):
#imports csv data from path, with header in rows to "rowheader", time in first column in "dateformat", and with delimiter "delim". Returns header and times as list and data as numpy array.
rows = []
header = []
with open(path, 'r') as file:
csvreader = csv.reader(file,delimiter = delim)
for i, row in enumerate(csvreader):
header.append(row)
if i == rowheader:
break
for row in csvreader:
rows.append(row)
rows = rows[rowheader:]
temp = rows[0] #Check if las column is empty and adjust number of colums
if temp[-1] == '':
c = len(temp)-1
else:
c = len(temp)
out = np.empty([len(rows),c-1])
if len(fnmatch.filter(rows[-1],'*,*')) > 0: #Convert comma to point in numbers if necassary
for i,r in enumerate(rows):
temp = [s.replace(',','.') for s in r]
for n,s in enumerate(temp): #replace empty entries to 0, so it can be converted
if s == '' or s == 'Off':
temp[n] = '0'
elif s == 'On':
temp[n] = '1'
try: #if therer a non convertable string in the row replace them with NaN
out[i] = np.asarray(temp[1:c],dtype = float) #convert row to np array and set in in "out" array
except:
for k,v in enumerate(temp[1:c]): #find the entry that cannot be converted and set it to NaN
try:
float(v)
except:
temp[k+1] = 'Nan'
out[i] = np.asarray(temp[1:c],dtype = float) #convert the modified row to np array and set it in "out"
else:
for i,r in enumerate(rows):
for n,s in enumerate(r): #replace empty entries to 0, so it can be converted
if s == '' or s == 'Off':
r[n] = '0'
elif s == 'On':
r[n] = '1'
try: #if therer a non convertable string in the row replace them with NaN
out[i] = np.asarray(r[1:c],dtype = float) #convert row to np array and set in in "out" array
except:
for k,v in enumerate(r[1:c]): #find the entry that cannot be converted and set it to NaN
try:
float(v)
except:
r[k+1] = 'NaN'
out[i] = np.asarray(r[1:c],dtype = float) #convert the modified row to np array and set it in "out"
#Create time list
times = []
for r in rows:
times.append(datetime.datetime.strptime(r[0],dateformat))
return(header,out,times)
def read_wheader(path,rowheader = 0,delim = '\t'):
#imports csv data from path, with header in rows to "rowheader", and with delimiter "delim". Returns header as list and data as numpy array.
rows = []
header = []
with open(path, 'r') as file:
csvreader = csv.reader(file,delimiter = delim)
for i, row in enumerate(csvreader):
header.append(row)
if i == rowheader:
break
for row in csvreader:
rows.append(row)
rows = rows[rowheader:]
temp = rows[0] #Check if las column is empty and adjust number of colums
if temp[-1] == '':
c = len(temp)-1
else:
c = len(temp)
out = np.empty([len(rows),c])
if len(fnmatch.filter(rows[-1],'*,*')) > 0: #Convert comma to point in numbers if necassary
for i,r in enumerate(rows):
temp = [s.replace(',','.') for s in r]
for n,s in enumerate(temp): #replace empty entries to 0, so it can be converted
if s == '' or s == 'Off':
temp[n] = '0'
elif s == 'On':
temp[n] = '1'
try: #if therer a non convertable string in the row replace them with NaN
out[i] = np.asarray(temp[0:c],dtype = float) #convert row to np array and set in in "out" array
except:
for k,v in enumerate(temp[0:c]): #find the entry that cannot be converted and set it to NaN
try:
float(v)
except:
temp[k] = 'Nan'
out[i] = np.asarray(temp[0:c],dtype = float) #convert the modified row to np array and set it in "out"
else:
for i,r in enumerate(rows):
for n,s in enumerate(r): #replace empty entries to 0, so it can be converted
if s == '' or s == 'Off':
r[n] = '0'
elif s == 'On':
r[n] = '1'
try: #if therer a non convertable string in the row replace them with NaN
out[i] = np.asarray(r[0:c],dtype = float) #convert row to np array and set in in "out" array
except:
for k,v in enumerate(r[0:c]): #find the entry that cannot be converted and set it to NaN
try:
float(v)
except:
r[k] = 'NaN'
out[i] = np.asarray(r[0:c],dtype = float) #convert the modified row to np array and set it in "out"
return(header,out)
def read_raw_np(path,delim = '\t'): #imports csv data from path, without header, and with delimiter "delim". Returns data as numpy array.
rows = []
with open(path, 'r') as file:
csvreader = csv.reader(file,delimiter = delim)
for row in csvreader:
rows.append(row)
temp = rows[0] #Check if last column is empty and adjust number of colums
if temp[-1] == '':
c = len(temp)-1
else:
c = len(temp)
out = np.empty([len(rows),c])
if len(fnmatch.filter(rows[-1],'*,*')) > 0: #Convert comma to point in numbers if necassary
for i,r in enumerate(rows):
temp = [s.replace(',','.') for s in r]
for n,s in enumerate(temp): #replace empty entries to 0, so it can be converted
if s == '' or s == 'Off':
temp[n] = '0'
elif s == 'On':
temp[n] = '1'
try: #if therer a non convertable string in the row replace them with NaN
out[i] = np.asarray(temp[0:c],dtype = float) #convert row to np array and set in in "out" array
except:
for k,v in enumerate(temp[0:c]): #find the entry that cannot be converted and set it to NaN
try:
float(v)
except:
temp[k] = 'NaN'
out[i] = np.asarray(temp[0:c],dtype = float) #convert the modified row to np array and set it in "out"
else:
for i,r in enumerate(rows):
for n,s in enumerate(r): #replace empty entries to 0, so it can be converted
if s == '' or s == 'Off':
r[n] = '0'
elif s == 'On':
r[n] = '1'
try: #if therer a non convertable string in the row replace them with NaN
out[i] = np.asarray(r[0:c],dtype = float) #convert row to np array and set in in "out" array
except:
for k,v in enumerate(r[0:c]): #find the entry that cannot be converted and set it to NaN
try:
float(v)
except:
r[k] = 'NaN'
out[i] = np.asarray(r[0:c],dtype = float) #convert the modified row to np array and set it in "out"
return(out)
def read_raw(path,delim = '\t',convert = False):
#imports csv data from path, without header, and with delimiter "delim". Can also import strings. Returns data as list. If convert = True commas will be changed to points.
#Carefull: not only converts commas in numbers, but in all strings.
rows = []
with open(path, 'r') as file:
csvreader = csv.reader(file,delimiter = delim)
for row in csvreader:
rows.append(row)
temp = rows[0] #Check if last column is empty and adjust number of colums
if temp[-1] == '':
c = len(temp)-1
else:
c = len(temp)
out = [len(rows),c]
if len(fnmatch.filter(rows[-1],'*,*')) > 0 and convert == True: #Convert comma to point in numbers if necassary
for i,r in enumerate(rows):
temp = [s.replace(',','.') for s in r]
out[i] = temp[0:c]
else:
for i,r in enumerate(rows):
out[i] = r[0:c]
return(out)

View File

@ -0,0 +1,10 @@
numpy==1.26.4
PyQt6==6.6.1
PyQt6-Qt6==6.6.2
PyQt6-sip==13.6.0
pyqtgraph==0.13.4
pyserial==3.5
PyVISA==1.14.1
PyVISA-py==0.7.2
simple-pid==2.0.1
typing_extensions==4.10.0

BIN
Legacy/TF_Control/.DS_Store vendored Normal file

Binary file not shown.

20
Legacy/TF_Control/.gitignore vendored Normal file
View File

@ -0,0 +1,20 @@
## list of files and file extensions that should be ignored by git
#pycache files
*pyc
# #config files
# *_config.txt
imc_Cernox_calibr_config.txt
#virtual environment
env
.venv
#cernox calibration
calibration_data
#test data for Result_window
test_data
#the usual messy files
test.*

View File

@ -0,0 +1,377 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
from timeit import default_timer as timer
from datetime import datetime
import csv
import random
import traceback, sys, os
import numpy as np
from scipy.optimize import curve_fit
from design_files.AMR_calibration_design import Ui_MainWindow
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from scripts import import_txt
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
def update_single_entry(dict,name,ind,val): #updates a single value in global vars. To do so it gets the current value of "dict('name')", replaces "val" at indec "ind" and sends this back
data = dict.get(f"{name}") #get data
data[ind] = val #replace entry
dict.update({f"{name}":data}) #send data back
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables}
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.register('sync_BK_9131B')
manager.register('sync_BK_9174B')
manager.register('sync_BK_9174B_2')
manager.register('sync_imc')
manager.register('sync_converted')
self.sync_BK_9131B = manager.sync_BK_9131B()
self.sync_BK_9174B = manager.sync_BK_9174B()
self.sync_BK_9174B_2 = manager.sync_BK_9174B_2()
self.sync_imc = manager.sync_imc()
self.sync_converted = manager.sync_converted()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\.venv\\Scripts\\python.exe", [self.current_dir+'\\global_variables_TF.py'])
manager.connect()
manager.register('sync_BK_9131B')
manager.register('sync_BK_9174B')
manager.register('sync_BK_9174B_2')
manager.register('sync_imc')
manager.register('sync_converted')
self.sync_BK_9131B = manager.sync_BK_9131B()
self.sync_BK_9174B = manager.sync_BK_9174B()
self.sync_BK_9174B_2 = manager.sync_BK_9174B_2()
self.sync_imc = manager.sync_imc()
self.sync_converted = manager.sync_converted()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, in case they are not defined in global variables
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
#set up pyQT threadpool
self.threadpool = QThreadPool()
#start standard threads
worker = Worker(self.convert_Data)
self.threadpool.start(worker)
#define signals and slots
self.action_save_default.triggered.connect(self.save_default)
self.action_load_default.triggered.connect(self.load_default)
self.dSB_timing.valueChanged.connect(self.set_timing)
self.comboBox.currentIndexChanged.connect(self.select_output)
self.Button_calibrate.clicked.connect(self.start_calibration)
self.Button_load.clicked.connect(self.load_params)
#define constants
self.running = True #True as long as programm is running. Is set to false in close event
self.convert = False #true while when ComboBox is set to Flux density. If it is True, voltage data is converted to flux density.
self.timing = 0.1 #wait time in function "update_Data".
self.SB_all = [self.sB_nPoints, self.dSB_settling_time, self.dSB_timing] #list of all Spinboxes, helps for saving and loading of default values
self.lines_all = [self.line_savePath,self.line_loadPath] #list of all lines, helps for saving and loading of default values
#read default values from config and set values in gui
self.load_default()
#print programm name
print('AMR calibration')
def calibrate(self, progress_callback): #sets "number of points" random fields and records the FG and AMR response. With this data a 3 dimensional fit is performed
#define constants and functions
# I_all = [[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1],[random.random(),random.random(),random.random()],[random.random(),random.random(),random.random()]]#list of all combinations for coil currents that are used
I_all = [[random.random()*0.2,random.random()*0.2,random.random()*0.2] for i in range(self.sB_nPoints.value())] #enable this for random fields
FG = [] #store fluxgate data for each field
V_all = [] #store output voltage of AMR sensors for each field. They are orders [15 times X_sensors, 15 times Y, 15 times Z]
def f(B,a,b,c,d): #function for fitting. (Dissertation Felix p.49 eq.3.2)
Bx,By,Bz = B
return a*Bx + b*By + c*Bz + d
#get data for fitting
##this part is for preset fields
# for n in range(2): #take all points twice, with and without relais activated
# #set field
# if n == 0:
# self.sync_BK_9131B.update({'OutputOn':[False,False,False]})
# i=0
# else:
# self.sync_BK_9131B.update({'SetU':[5,5,5]})
# self.sync_BK_9131B.update({'SetI':[1,1,1]})
# self.sync_BK_9131B.update({'OutputOn':[True,True,True]})
# i = len(I_all)-1
##if you don't want to use preset fields, comment the lines above and delete the tab infront of the following for loop
for i,I in enumerate(I_all):
if i == int(len(I_all)/2): #turn on relais after half of the points
self.sync_BK_9131B.update({'setU':[5,5,5]})
self.sync_BK_9131B.update({'setI':[1,1,1]})
self.sync_BK_9131B.update({'OutputOn':[True,True,True]})
self.sync_BK_9174B.update({'setI':I[0:2]})
update_single_entry(self.sync_BK_9174B_2,'setI',0,I[2])
self.sync_BK_9174B.update({'OutputOn':[True,True]})
update_single_entry(self.sync_BK_9174B_2,'OutputOn',0,True)
time.sleep(self.dSB_settling_time.value())
#get data
FG.append([i*100 for i in self.sync_imc.get('FG')]) #multiply times 100 to convert V to µT
V_all.append(self.sync_imc.get('AMR_x') + self.sync_imc.get('AMR_y') + self.sync_imc.get('AMR_z'))
#update "current point" label
self.lab_currentpoint.setText(f"{i}")
self.sync_BK_9131B.update({'OutputOn':[False,False,False]})#turn off relais
#reset power supplies to zero
I = [0 for n in range(3)]
self.sync_BK_9174B.update({'setI':[0,0]})
update_single_entry(self.sync_BK_9174B_2,'setI',0,0)
self.sync_BK_9174B.update({'OutputOn':[False,False]})
update_single_entry(self.sync_BK_9174B_2,'OutputOn',0,False)
self.sync_BK_9131B.update({'OutputOn':[False,False,False]})
#perform fit
FGn= np.array(FG).transpose() #convert fluxgate data to numpy array so curve_fit can use it
self.params = [] #store fit parameters
for n in range(45):
V = np.array([sub[n] for sub in V_all]) #get voltage data of one sensor at all fields, and convert them to numpy array so curve_fit can use it
self.params.append(curve_fit(f,FGn,V))
#update "current point" label to 0 to indicate that the fit is complete
self.lab_currentpoint.setText('0')
#store parameters in file
self.save_params()
def convert_Data(self, progress_callback):#is constantly running. If self.convert == True the voltage data is converted to B
Bx = [0 for i in range(15)] #store converted AMR data
By = [0 for i in range(15)]
Bz = [0 for i in range(15)]
while self.running == True:
if self.convert == True:
start = timer()
#get current voltage data from imc
Vx = self.sync_imc.get('AMR_x')
Vy = self.sync_imc.get('AMR_y')
Vz = self.sync_imc.get('AMR_z')
#solve system of linear equation according to Felix' diss p.49 eq. 3.3.
for i,V in enumerate(zip(Vx,Vy,Vz)):
V = np.array(V) #convert tuple from zip into np.array
V0 = np.array([self.params[i][0][3],self.params[i+15][0][3],self.params[i+30][0][3]]) #get the offset voltages of all sensors in group number i
S = np.array([self.params[i][0][0:3],self.params[i+15][0][0:3],self.params[i+30][0][0:3]]) #assemble the sensitivity matrix of group number i
try:
B = np.linalg.solve(S,V-V0) #solve the linear equation
except:
B = [0,0,0]
print(i)
Bx[i] = B[0]
By[i] = B[1]
Bz[i] = B[2]
#write converted data in sync_converted
self.sync_converted.update({'AMR_x':Bx})
self.sync_converted.update({'AMR_y':By})
self.sync_converted.update({'AMR_z':Bz})
end = timer()
# print(end-start)
try:
time.sleep(self.timing-(end-start))
except:
print(end-start)
else:
#just pass imc data to sync_converted which is accessed by "Main.py" for plotting the AMR data
Vx = self.sync_imc.get('AMR_x')
Vy = self.sync_imc.get('AMR_y')
Vz = self.sync_imc.get('AMR_z')
self.sync_converted.update({'AMR_x':Vx})
self.sync_converted.update({'AMR_y':Vy})
self.sync_converted.update({'AMR_z':Vz})
time.sleep(self.timing)
def start_calibration(self): #is called when "perform calibration" is clicked. Starts a new thread with self.calibrate().
worker_cal = Worker(self.calibrate)
self.threadpool.start(worker_cal)
def select_output(self): #is triggered when between "voltage" and "flux density" is switched. Sets self.convert to the corresponding value. In case "flux density" is chosen, it start a threat von "self.convert_data()"
if self.comboBox.currentText() == 'Voltage':
self.convert = False
else:
self.convert = True
def set_timing(self,t): #is triggered when timing is changed. Sets variable self.timing to the new value
self.timing = t
def save_params(self): #saves self.params (the fit parameters) to file. Is called at the end of self.calibrate
extension = "\\" + time.strftime("%Y-%m-%d_%H-%M-%S",time.gmtime(time.time()))+".txt"
path = self.line_savePath.text() + extension
path_short = path[:-4] + "_short.txt"
print(path)
#create list of only the parameters, without erros
params_short = []
for L in self.params:
params_short.append(L[0])
try:
file = open(path,'w')
for i in self.params:
file.write(f"{i}\t")
file_short = open(path_short,'w')
for i in params_short:
file_short.write(f"{i}\t")
file.close
file_short.close()
except:
print('Invalid path')
def load_params(self):#loads self.params (the fit parameters) from file and sets self.params to the new values. Is called when load button is pushed
path = self.line_loadPath.text()
try: #exit function if file does not exist
rows = []
with open(path, 'r') as file:
csvreader = csv.reader(file,delimiter = '\t')
for row in csvreader:
rows.append(row)
#recreate arrays
coeffs = []
for r in rows[0][0:45]: #last entry is '' at index 45
r_short = r[2:-1] #get rid of "[ "at the beginning, and "]" at the end
r_split = r_short.split(' ') #split at every space
coeff_list = [x for x in r_split if x != ''] #get rid of empty entries that can occur if a double space was written in the text file
coeff_list = [float(x) for x in coeff_list] #convert str to float
coeff_array = np.array(coeff_list)
coeffs.append([coeff_array,0]) #append a list with a dummy zero, just so the data structure is as it was when self.params is created by the programm
self.params = coeffs
print(self.params)
except:
print('could not load data')
return
def save_default(self):
#saves current set values to txt file in subdirectory configs. Saves values from al spin boxes and text lines.
#Overwrites old values in config file.
path = self.current_dir+'\\configs\\AMR_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for SB in self.SB_all:
temp = f"{SB.value()}"
file.write(temp+'\t')
for l in self.lines_all:
file.write(l.text()+'\t')
file.write('\n')
file.close
def load_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. (If no config file exists, it does nothing.)
path = self.current_dir+'\\configs\\AMR_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
for l,v in zip(self.lines_all,vals[0][-len(self.lines_all):]):
l.setText(v)
except:
return
for SB,v in zip(self.SB_all,vals[0]):
if type(SB) == QDoubleSpinBox:
v = float(v) #convert string in txt to float, so number can be set in dSB
else:
v = int(v) #convert string in txt to int, so number can be set in SB
SB.setValue(v)
for l,v in zip(self.lines_all,vals[0][-len(self.lines_all):]):
l.setText(v)
def closeEvent(self,event): #when window is closed self.running and self.monitor are set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,3 @@
15 1.5 0.1 D:\Data\TF_2024-09-20\AMR_Kalibration

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,697 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
from datetime import datetime
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
from scripts import import_txt
import pyqtgraph.opengl as gl
from scipy.optimize import curve_fit
import collections
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from design_files.BT_3D_Plot_design import Ui_MainWindow
class Vector:
def __init__(self, vec_0, vec_direction, length, width, color, view):
#transform axis such that it fits the real setup
vec_direction_new = np.array([1,1,1], dtype=float)
vec_direction_new[0] = vec_direction[1]
vec_direction_new[1] = vec_direction[0] #plus or minus on the right side?
vec_direction_new[2] = vec_direction[2]
self.vec_0 = vec_0
self.vec_direction = vec_direction_new
self.length = length
self.width = width
self.color = color
self.view = view
#After initialization draw Vector
self.draw()
def Calc_Vec1_Vec2(self): #Calculate start- and end-vector of the vector to be drawn
vec_direction_length = np.sqrt(self.vec_direction[0]**2+self.vec_direction[1]**2+self.vec_direction[2]**2)
if vec_direction_length == 0:
direction_normalized = np.array([0,0,0])
else:
direction_normalized = self.vec_direction/vec_direction_length
self.vec1 = self.vec_0 - direction_normalized*self.length/2
self.vec2 = self.vec_0 + direction_normalized*self.length/2
self.headvec1 = np.empty(shape=(0,3))
self.headvec2 = np.empty(shape=(0,3))
Headsteps = 5
headlength = self.length/5
headsegment = headlength/Headsteps
for i in range(0,Headsteps):
vec1x = self.vec2 + i*headsegment*direction_normalized
vec2x = self.vec2 + (i+1)*headsegment*direction_normalized
self.headvec1 = np.append(self.headvec1, [vec1x], axis=0)
self.headvec2 = np.append(self.headvec2, [vec2x], axis=0)
def draw(self):
self.Calc_Vec1_Vec2()
#Draw Line of Vector
linedata = np.array([self.vec1,self.vec2])
self.Line = gl.GLLinePlotItem()
self.Line.setData(pos=linedata, mode="lines", color=np.array([self.color,self.color]), width=self.width)
self.Line.setGLOptions('translucent')
self.view.addItem(self.Line)
#Draw Head of Vector
self.headline1 = gl.GLLinePlotItem()
self.headline2 = gl.GLLinePlotItem()
self.headline3 = gl.GLLinePlotItem()
self.headline4 = gl.GLLinePlotItem()
self.headline5 = gl.GLLinePlotItem()
self.headlinearray = [self.headline1, self.headline2, self.headline3, self.headline4, self.headline5]
i=0
for headline in self.headlinearray:
headlinedata = np.array([self.headvec1[i,:],self.headvec2[i,:]])
headlinewidth = (1-i/5)*20
headline.setData(pos=headlinedata, mode="lines", color=np.array([self.color,self.color]), width=headlinewidth)
headline.setGLOptions('translucent')
self.view.addItem(headline)
i=i+1
def set_changes(self): #Everytime a setting has changed this function should be called to update changes in the plot
#ChangeLine
linedata = np.array([self.vec1,self.vec2])
self.Line.setData(pos=linedata, mode="lines", color=np.array([self.color,self.color]), width=self.width)
#ChangeHead
i=0
for headline in self.headlinearray:
# print(str(np.shape(self.headvec1)) +" " +str(np.shape(self.headvec2)))
headlinedata = np.array([self.headvec1[i,:],self.headvec2[i,:]])
headlinewidth = (1-i/5)*20
headline.setData(pos=headlinedata, mode="lines", color=np.array([self.color,self.color]), width=headlinewidth)
i=i+1
def change_direction(self, vec_direction):
#transform axis such that it fits the real setup
vec_direction_new = np.array([1,1,1], dtype=float)
vec_direction_new[0] = vec_direction[1]
vec_direction_new[1] = vec_direction[0] #plus or minus on the right side?
vec_direction_new[2] = vec_direction[2]
self.vec_direction = vec_direction_new
self.Calc_Vec1_Vec2()
self.set_changes()
def change_length(self, length):
self.length = length
self.Calc_Vec1_Vec2()
self.set_changes()
def change_width(self, width):
self.width = width
self.Line.setData(width=self.width)
self.set_changes()
def change_color(self, color):
self.color = color
self.Line.setData(color=np.array([self.color,self.color]))
self.set_changes()
class Plane:
def __init__(self, vec0, vec1, vec2, color, view): #vec0 base edge of plane, vec1 and vec2 edges relative to vec0
self.vec0 = vec0
self.vec1 = vec1
self.vec2 = vec2
self.color = color
self.view = view
self.draw()
def draw(self):
VecData = [self.vec0, self.vec0+self.vec1, self.vec0+self.vec2, self.vec0+self.vec1+self.vec2, self.vec0+self.vec1, self.vec0+self.vec2]
PlaneMeshData = gl.MeshData()
PlaneMeshData.setVertexes(verts=VecData)
self.PlaneItem = gl.GLMeshItem(meshdata=PlaneMeshData, smooth=False, glOptions="translucent")
self.PlaneItem.setColor(self.color)
self.view.addItem(self.PlaneItem)
def change_color(self, color):
self.color = color
self.PlaneItem.setColor(self.color)
class Quader:
def __init__(self, vec0, vec1, vec2, vec3, color, view): #vec0 base edge of quader, vec1 and vec2 and vec3 edges relative to vec0
self.vec0 = vec0
self.vec1 = vec1
self.vec2 = vec2
self.vec3 = vec3
self.color = color
self.view = view
self.draw()
def draw(self):
self.colorfactor1 = np.array([0.8,0.8,0.8,1])
self.colorfactor2 = np.array([0.6,0.6,0.6,1])
self.Plane1 = Plane(self.vec0, self.vec1, self.vec2, self.color, self.view)
self.Plane2 = Plane(self.vec0, self.vec2, self.vec3, self.color*self.colorfactor1, self.view)
self.Plane3 = Plane(self.vec0, self.vec1, self.vec3, self.color*self.colorfactor2, self.view)
self.Plane4 = Plane(self.vec0+self.vec1+self.vec2+self.vec3, -self.vec1, -self.vec2, self.color, self.view)
self.Plane5 = Plane(self.vec0+self.vec1+self.vec2+self.vec3, -self.vec3, -self.vec2, self.color*self.colorfactor1, self.view)
self.Plane6 = Plane(self.vec0+self.vec1+self.vec2+self.vec3, -self.vec3, -self.vec1, self.color*self.colorfactor2, self.view)
def change_color(self,color):
self.color = color
self.Plane1.change_color(self.color)
self.Plane2.change_color(self.color*self.colorfactor1)
self.Plane3.change_color(self.color*self.colorfactor2)
self.Plane4.change_color(self.color)
self.Plane5.change_color(self.color*self.colorfactor1)
self.Plane6.change_color(self.color*self.colorfactor2)
class Niobium:
def __init__(self, vec0, vec1, vec2, vec3, color, view): #vec0 base edge of quader, vec1 and vec2 and vec3 edges relative to vec0
self.vec0 = vec0
self.vec1 = vec1
self.vec2 = vec2
self.vec3 = vec3
self.color = color
self.view = view
self.NoSegments = 8
self.draw()
def draw(self):
self.Quader1 = Quader(self.vec0+self.vec3/self.NoSegments*7, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.Quader2 = Quader(self.vec0+self.vec3/self.NoSegments*6, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.Quader3 = Quader(self.vec0+self.vec3/self.NoSegments*5, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.Quader4 = Quader(self.vec0+self.vec3/self.NoSegments*4, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.Quader5 = Quader(self.vec0+self.vec3/self.NoSegments*3, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.Quader6 = Quader(self.vec0+self.vec3/self.NoSegments*2, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.Quader7 = Quader(self.vec0+self.vec3/self.NoSegments*1, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.Quader8 = Quader(self.vec0+self.vec3/self.NoSegments*0, self.vec1, self.vec2, self.vec3/self.NoSegments, self.color, self.view)
self.QuaderList = [self.Quader1, self.Quader2, self.Quader3, self.Quader4,
self.Quader5, self.Quader6, self.Quader7, self.Quader8]
def change_color(self, ColorArray):
i=0
for Quader in self.QuaderList:
Quader.change_color(ColorArray[i])
i=i+1
def linearfunction(x,a,b): #Linear function for fitting purposes
return a*x+b
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup T plot
self.graphWidget.setBackground('w')
self.graphWidget.setTitle("T gradient")
self.graphWidget.setLabel('left', 'z (cm)')
self.graphWidget.setLabel('bottom', 'T (K)')
temp = [0,1]
pen1 = pg.mkPen(color=(255, 0, 0), width=2) #Pen for temperature plotting
pen2 = pg.mkPen(color=(40, 40, 40), width=1 ) #Pen for Tc (dashed line) plotting
pen3 = pg.mkPen(color=(255, 100, 100), width=1 ) #Pen for linear gradient fit
self.plot_1 = self.graphWidget.plot(temp,[1,0],pen = pen1, name = 'T', symbol ='x', symbolPen ='r', symbolBrush = 0.2)
self.plot_2 = self.graphWidget.plot(temp,[1,0],pen = pen2, name = 'Tc')
self.plot_3 = self.graphWidget.plot(temp,[1,0],pen = pen3, name = 'T Gradient')
#setup 3D BT Plot
self.openGLWidget.setBackgroundColor("white")
#Niobium Sample
#Dimensions in cm
Nbx = 6
Nby = 10
Nbz = 0.3
vec0 = np.array([-Nbz/2,-Nbx/2,-Nby/2])
vec1 = np.array([0,0,Nby])
vec2 = np.array([0,Nbx,0])
vec3 = np.array([Nbz,0,0])
self.Niobium1 = Niobium(vec0,vec3,vec2,vec1, np.array([0.2,0.2,0.2,1]), self.openGLWidget)
xdiff = 1 #Distance between niobium sample and B-vectors
# yVectorArray = np.linspace(-3,3,3)
yVectorArray = [1.3,0,-1.3,1.3,0,-1.3,1.3,0,-1.3,1.3,0,-1.3,1.3,0,-1.3]
# zVectorArray = np.linspace(-5,5,5)
zVectorArray = [3.2,3.2,3.2,1.6,1.6,1.6,0,0,0,-1.6,-1.6,-1.6,-3.2,-3.2,-3.2]
self.vectorcolor = [0.2,0.8,0.2,1]
self.vectorwidth = 4
self.VectorArray = []
# for y in yVectorArray:
# for z in zVectorArray:
# self.VectorArray.append(Vector(np.array([xdiff,y,z]), np.array([1,1,1]), 1, self.vectorwidth, self.vectorcolor,self.openGLWidget))
for i in range(0,15):
y = yVectorArray[i]
z = zVectorArray[i]
self.VectorArray.append(Vector(np.array([xdiff,y,z]), np.array([1,1,1]), 1, self.vectorwidth, self.vectorcolor,self.openGLWidget))
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_connect.clicked.connect(self.start_meas)
self.checkBox_disableplots.stateChanged.connect(self.set_displot)
self.T_scale_min.editingFinished.connect(self.set_T_scale_min)
self.T_scale_max.editingFinished.connect(self.set_T_scale_max)
self.Tc.editingFinished.connect(self.set_Tc_value)
self.Time_Slider.valueChanged.connect(self.set_Qslider_pos)
self.Saved_seconds.editingFinished.connect(self.set_Saved_seconds_value)
self.checkBox_livedata.stateChanged.connect(self.set_ShowLiveData)
self.Play_Pause.clicked.connect(self.set_Replay_Play)
self.Replay_speed.editingFinished.connect(self.set_Replay_speed_value)
self.Show_sc_phase.stateChanged.connect(self.set_Show_sc_phase_value)
self.Show_gradient_fit.stateChanged.connect(self.plot_gradient_hide)
#define constants
self.BT_Storage = collections.deque([]) #store magnetic field and temperature data
self.BT_Replay_Storage = collections.deque([]) #store magnetic field and temperature data from BT_Storage deque for Replay functionality
self.Qslider_pos = 1 #Position of the replay Qslider in [0,100]
self.ShowLiveData = True #If True then live data is plotted in the 3D plot. If False then Replay-Mode is activated
self.Replay_Play = False #Play / Pause state for replay function
self.Replay_speed_value = 1 #Replay speed
self.Show_sc_phase_value = True #If True: Show sc area in 3D plot
self.t = [time.time()] #store timestamps
self.Npoints = 200 #number of point to plot
self.Tscale_min = 0 #Max T value for colors in 3d plot
self.Tscale_max = 20 #Max T value for colors in 3d plot
self.Tc_value = 9.2 #Value of Tc for plotting dashed line and coloring superconducting state
self.Saved_seconds_value = 30 #Number of seconds in which the last measurements are saved for replay functionality
self.CernoxPositions = np.linspace(1/16*10,15/16*10,8) #Cernox positions in cm
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.timing_save = 5 #save intervall [s]
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.T_scale_min, self.T_scale_max, self.B_scale_min, self.B_scale_max, self.Tc, self.Replay_speed, self.Saved_seconds]#is used for config file
self.lines_config_strings = []#is used for config file
self.checkboxes_config = [self.checkBox_disableplots,self.Show_sc_phase, self.Show_gradient_fit]#is used for config file
#read default values from config and set them in gui
# self.read_default()
def start_meas(self):
self.bla=0 #Variable for dummy measurements
#establish connection to global variables}
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
# manager.register('sync_LS_218')
manager.register('sync_converted')
# self.sync_LS_218 = manager.sync_LS_218()
self.sync_converted = manager.sync_converted()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\.venv\\Scripts\\python.exe", [self.current_dir+'\\global_variables_TF.py'])
manager.connect()
# manager.register('sync_LS_218')
manager.register('sync_converted')
# self.sync_LS_218 = manager.sync_LS_218()
self.sync_converted = manager.sync_converted()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, in case they are not defined in global variables
self.sync_converted.update({'T':[0,0,0,0,0,0,0,0]})
self.worker = Worker(self.update_all)
self.worker.signals.progress.connect(self.update_gui)
self.threadpool.start(self.worker)
def update_all(self, progress_callback):
#get values from device and write them to global variables. Checks if global variables changed from last iteration. Also pass it to upddate_gui with emit(T)
while self.running == True:
#Get magnetic field data from AMR-sensors:
AMR_x = self.sync_converted.get('AMR_x')
AMR_y = self.sync_converted.get('AMR_y')
AMR_z = self.sync_converted.get('AMR_z')
Array_B = [] #List with [[AMR1_x, AMR1_y, AMR1_z], [AMR2_x, AMR2_y, AMR2_z], [AMR3_x, AMR3_y, AMR3_z], ...]
for i in range(0,15):
B = np.array([AMR_x[i], AMR_y[i], AMR_z[i]])
Array_B.append(B)
#Get temperature data from sync_converted dict
Array_T = self.sync_converted.get('T')
#DUMMY DATA FOR TEST
# Array_B = []
# for i in range(0,15):
# B = np.array([1+0.5*np.sin(self.bla),np.sin(self.bla),np.cos(self.bla)])
# Array_B.append(B)
# Array_T = []
# for i in range(0,8):
# T = 10+5*np.sin(i*0.5+self.bla*0.2)
# Array_T.append(T)
self.bla = self.bla + 0.1
time.sleep(0.03)
progress_callback.emit([Array_B, Array_T]) #Emits list of all B and T measurements
# self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
# del(self.BK) #disconnect device when self.running is set to False
def update_gui(self, List):
#Convert List into original format
Array_B = List[0]
Array_T = List[1]
currenttime = time.time()
#save newest data + timestamp in queues
self.BT_Storage.append([currenttime, Array_B, Array_T])
#check for Saved_seconds limit in BT_Storage. In case of older measurements -> Delete them
needfordelete = True
i = 0
while needfordelete and i<=len(self.BT_Storage): #Just if needfordelete = True: Check and delete old entries
timestamp = self.BT_Storage[i][0]
if timestamp < currenttime - self.Saved_seconds_value: #if timestamp is older than current time minus saved_seconds_value
self.BT_Storage.popleft() #Delete oldest entry
else:
needfordelete = False #If all entries are within the time interval: No need for continue with deleting-for-loop
i=i+1
if self.ShowLiveData == True: #Show live measured data
self.update_Plots([currenttime, Array_B, Array_T])
self.Replay_Play = False
else: #Show replay data (according to position of Qslider)
if self.Replay_Play == False: #"Slider Mode" without playback
self.latest_time_in_Replay_Storage = self.BT_Replay_Storage[-1][0] #show the newest timestamp in BT_Replay_Storage
self.oldest_time_in_Replay_Storage = self.BT_Replay_Storage[0][0] #show the newest timestamp in BT_Replay_Storage
timediff = self.latest_time_in_Replay_Storage - self.oldest_time_in_Replay_Storage
self.slider_time = self.latest_time_in_Replay_Storage -(1-self.Qslider_pos)*timediff
index = self.get_deque_index_closest_to_timestamp(self.BT_Replay_Storage, self.slider_time) #index closest to slider_time
Array_B = self.BT_Replay_Storage[index][1]
Array_T = self.BT_Replay_Storage[index][2]
self.update_Plots([self.slider_time, Array_B, Array_T])
self.last_pause_time = time.time()
else: #"Playback Mode" with set playback speed
play_time = self.slider_time + (currenttime - self.last_pause_time)*self.Replay_speed_value
if play_time >= self.latest_time_in_Replay_Storage: #If play_time reaches the end of BT_Replay_Storage start from beginning
self.last_pause_time = time.time()
index = self.get_deque_index_closest_to_timestamp(self.BT_Replay_Storage, play_time) #index closest to play_time
Array_B = self.BT_Replay_Storage[index][1]
Array_T = self.BT_Replay_Storage[index][2]
self.update_Plots([play_time, Array_B, Array_T])
def update_Plots(self,value):
timestamp = value[0]
Array_B = value[1]
Array_T = value[2]
B_label_Array = [self.B_3,self.B_2,self.B_1,
self.B_6,self.B_5,self.B_4,
self.B_9,self.B_8,self.B_7,
self.B_12,self.B_11,self.B_10,
self.B_15,self.B_14,self.B_13]
for i,Vector in enumerate(self.VectorArray):
B = Array_B[i]
Vector.change_direction(B)
# Vector.change_length(1+0.5*np.sin(self.bla+i/10))
#Change B in textlabel
B_total = np.linalg.norm(B)
B_label_Array[i].setText(str(np.round(B_total,2)))
colorarray = []
T_label_Array = [self.T_1,self.T_2,self.T_3,self.T_4,self.T_5,self.T_6,self.T_7,self.T_8]
for i,T_label in enumerate(T_label_Array):
T = Array_T[i]
if self.Show_sc_phase_value == True and T <= self.Tc_value:
red = (T-self.Tscale_min)/(self.Tscale_max - self.Tscale_min)
blue = 1-(T-self.Tscale_min)/(self.Tscale_max - self.Tscale_min)
color = np.array([red*0.6,0.6,0.5,1])
else:
red = (T-self.Tscale_min)/(self.Tscale_max - self.Tscale_min)
blue = 1-(T-self.Tscale_min)/(self.Tscale_max - self.Tscale_min)
color = np.array([red,0,blue,1])
colorarray.append(color)
#Change T in textlabel
T_label.setText(str(np.round(T,2)))
self.Niobium1.change_color(colorarray)
#Update T Plot
self.plot_1.setData(Array_T,np.flip(self.CernoxPositions))
self.plot_2.setData([self.Tc_value, self.Tc_value],[0,10]) #Tc Line
#Linear fit for temperature gradient
GradientParams, GradientCov = curve_fit(linearfunction, self.CernoxPositions, Array_T)
GradientStd = np.diag(GradientCov)
self.Line_T_gradient.setText(str(np.round(GradientParams[0],2)) +" +- " +str(np.round(GradientStd[0],2)))
#Plot Gradient Fit
self.plot_3.setData(linearfunction(self.CernoxPositions,*GradientParams),np.flip(self.CernoxPositions))
#set plotted time in time-label
self.line_Time_in_plot.setText(str(time.strftime('%H:%M:%S', time.localtime(timestamp))))
def get_deque_index_closest_to_timestamp(self, deque, timestamp): #with timestamps in the 0.st column of deque
timediffarray = np.empty(shape=(1,0))
for value in deque:
timediff = np.abs(value[0]-timestamp) #timedifference in seconds
timediffarray = np.append(timediffarray, timediff)
min_index = np.argmin(timediffarray) #search for the index with the lowest difference in time to timestamp
return min_index
def set_Qslider_pos(self, value):
self.Qslider_pos = value/100
# print(self.Qslider_pos)
def set_ShowLiveData(self):
self.ShowLiveData = self.checkBox_livedata.isChecked()
if self.ShowLiveData == False:
self.BT_Replay_Storage = self.BT_Storage.copy() #Write current BT_Storage buffer into Replay_Storage which isnt changed every iteration
print("saved")
def set_Replay_Play(self): #Change state of Replay_Play from True (Play) to False (Pause) and reverse
if self.Replay_Play == True:
self.Replay_Play = False
else:
self.Replay_Play = True
def set_Replay_speed_value(self):
self.Replay_speed_value = get_float(self.Replay_speed)
def set_Show_sc_phase_value(self):
self.Show_sc_phase_value = self.Show_sc_phase.isChecked()
def set_T_scale_min(self):
self.Tscale_min = get_float(self.T_scale_min)
# print(self.T_scale_min)
def set_T_scale_max(self):
self.Tscale_max = get_float(self.T_scale_max)
def set_Tc_value(self):
self.Tc_value = get_float(self.Tc)
def set_Saved_seconds_value(self):
self.Saved_seconds_value = get_float(self.Saved_seconds)
def set_displot(self):
#sets variable to disable plot so checkbox state does not need be read out every iteration
self.disable_plot = self.checkBox_disableplots.isChecked()
def plot_gradient_hide(self):
#shows or hides gradient fit plot according to the checkbox
if self.Show_gradient_fit.isChecked() == True:
self.plot_3.show()
else:
self.plot_3.hide()
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BT_3D_Plot_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\BT_3D_Plot_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.2f','.2f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,599 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
from scripts import import_txt
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from design_files.B_Field_Compensation_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
def update_single_entry(dict,name,ind,val): #updates a single value in global vars. To do so it gets the current value of "dict('name')", replaces "val" at indec "ind" and sends this back
data = dict.get(f"{name}") #get data
data[ind] = val #replace entry
dict.update({f"{name}":data}) #send data back
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables
try: #try to connect to global variables
self.manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
self.manager.connect()
self.manager.register('syncdict')
self.manager.register('sync_imc')
self.manager.register('sync_BK_9174B')
self.manager.register('sync_BK_9174B_2')
self.manager.register('sync_BK_9131B')
self.syncdict = self.manager.syncdict()
self.sync_imc = self.manager.sync_imc()
self.sync_BK_9174B = self.manager.sync_BK_9174B()
self.sync_BK_9174B_2 = self.manager.sync_BK_9174B_2()
self.sync_BK_9131B = self.manager.sync_BK_9131B()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\.venv\\Scripts\\python.exe", [self.current_dir+'\\global_variables_TF.py'])
self.manager.connect()
self.manager.register('syncdict')
self.manager.register('sync_imc')
self.manager.register('sync_BK_9174B')
self.manager.register('sync_BK_9174B_2')
self.manager.register('sync_BK_9131B')
self.syncdict = self.manager.syncdict()
self.sync_imc = self.manager.sync_imc()
self.sync_BK_9174B = self.manager.sync_BK_9174B()
self.sync_BK_9174B_2 = self.manager.sync_BK_9174B_2()
self.sync_BK_9131B = self.manager.sync_BK_9131B()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, if they are not defined in global variables
self.syncdict.update({'B_set':[0,0,0], 'Start_Compensation':False, 'Status_Compensation': 0, 'Temperature_Caution': False})
# Status_Compensation: 0: No B-field compensation performed
# 1: Compensation is running
# 2: Compensation finished and succeeded
# 3: Compensation failed
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget_x.setBackground('w')
self.graphWidget_x.setTitle("Compensation on x-axis")
self.graphWidget_x.setLabel('left', 'B_x (µT)')
self.graphWidget_x.setLabel('bottom', '#iterations')
self.graphWidget_y.setBackground('w')
self.graphWidget_y.setTitle("Compensation on y-axis")
self.graphWidget_y.setLabel('left', 'B_y (µT)')
self.graphWidget_y.setLabel('bottom', '#iterations')
self.graphWidget_z.setBackground('w')
self.graphWidget_z.setTitle("Compensation on z-axis")
self.graphWidget_z.setLabel('left', 'B_z (µT)')
self.graphWidget_z.setLabel('bottom', '#iterations')
pen1 = pg.mkPen(color=(255, 0, 0), width=2)
pen2 = pg.mkPen(color=(0, 0, 255), width=2)
self.plot_x_1 = self.graphWidget_x.plot([0,1],[1,0],pen = pen1, name = 'B_x_set')
self.plot_x_2 = self.graphWidget_x.plot([0,1],[1,0],pen = pen2, name = 'B_x')
self.graphWidget_x.addLegend()
self.plot_y_1 = self.graphWidget_y.plot([0,1],[1,0],pen = pen1, name = 'B_y_set')
self.plot_y_2 = self.graphWidget_y.plot([0,1],[1,0],pen = pen2, name = 'B_y')
self.graphWidget_y.addLegend()
self.plot_z_1 = self.graphWidget_z.plot([0,1],[1,0],pen = pen1, name = 'B_z_set')
self.plot_z_2 = self.graphWidget_z.plot([0,1],[1,0],pen = pen2, name = 'B_z')
self.graphWidget_z.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define and standard threads.
# worker_save = Worker(self.save)
# self.threadpool.start(worker_save)
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.line_B_x_set.editingFinished.connect(self.set_B_set)
self.line_B_y_set.editingFinished.connect(self.set_B_set)
self.line_B_z_set.editingFinished.connect(self.set_B_set)
self.Button_Set_Field.clicked.connect(self.set_start_compensation)
self.checkBox_y2_coil.stateChanged.connect(self.set_y2_coil_Enabled)
self.comboBox_Temp_Sensor.currentIndexChanged.connect(self.set_temp_sensor)
self.line_Max_Temp.editingFinished.connect(self.set_max_temperature)
self.checkBox_Turn_Off_Coils.stateChanged.connect(self.set_Turn_Off_Coils)
#define constants
self.running = True
self.B_set = [0,0,0] #list containing x,y,z set values
self.Start_Compensation = False # boolean, which has to be set true in order to start compensation
self.Coil_Constant = [0,0,0] #Coil constant in muT/A
self.set_old = [0,0,1] #variable to save the 'old' set values to compare them to the global variables. It differs from set_new in the first iteration. This ensures that new parameters are send to the device
self.set_new = [0,0,0] #variable to save the new set values to compare them to the old ones
self.lines_config_float = [self.line_B_x_set,self.line_B_y_set, self.line_B_z_set, self.line_Max_Difference, self.line_Max_iterations, self.line_B_equil_time, self.line_HHC_param_x, self.line_HHC_param_y, self.line_HHC_param_y2, self.line_HHC_param_z, self.line_Max_Temp]#is used for config file
self.lines_config_strings = []#is used for config file
self.checkboxes_config = [self.checkBox_y2_coil, self.checkBox_Turn_Off_Coils]#is used for config file
self.combobox_config = [self.comboBox_Temp_Sensor]#is used for config file
self.y2_coil_Enabled = False # Boolean if second y-coil pair should be used
self.temp_sensor = 0 # Selected temperature sensor Channel
self.max_temperature = 320 # Maximum temperature, at which coils should be turned off
self.Turn_Off_Coils = False #Boolean if Coils should be turned off for temperatures above self.max_temperature
self.LS336_never_connected_before = True
#read default values from config and set them in gui
self.read_default()
#write values from gui to global variables.
self.set_B_set()
self.set_max_temperature()
# Start standard thread
self.worker = Worker(self.update_all)
self.threadpool.start(self.worker)
# Start temperature monitoring thread
worker_temperature = Worker(self.temperature_thread)
self.threadpool.start(worker_temperature)
def update_all(self, progress_callback):
#Checks if global variables changed from last iteration.
while self.running == True:
for i,n in enumerate(['B_set', 'Start_Compensation']): #get new set values from global variables and compare to old ones.
self.set_new[i] = self.syncdict.get(n)
if self.set_new != self.set_old: #if a button is clicked or global variables are changed the program checks which setting has been changed.
if self.set_new[0] != self.set_old[0]: #if B_set is changed new B_set parameters are saved locally
self.B_set = self.set_new[0]
if self.set_new[1] != self.set_old[1]: #if Start_Compensation is changed new Start_Compensation is saved locally
self.Start_Compensation = self.set_new[1]
self.update_setValues(self.set_new) #Change GUI text lines
self.set_old = self.set_new[:] #List needs to be sliced so that only values are taken and not just a pointer is created
if self.Start_Compensation == True: #Start Field Compensation
# Update compensation status in GUI
self.line_iteration_step.setText('Starting compensation.')
self.line_iteration_step.setStyleSheet("background-color: white")
# Update global variable
self.syncdict.update({'Status_Compensation':1})
i = 0 #iteration number
I = [0,0,0] #HHC Current
# Pull coil constants from GUI lines
self.Coil_Constant = [get_float(self.line_HHC_param_x), get_float(self.line_HHC_param_y), get_float(self.line_HHC_param_z)]
#set HHC current to 0A
self.sync_BK_9174B.update({'setI':[0, 0]})
if self.checkBox_y2_coil.isChecked() == True:
self.sync_BK_9174B_2.update({'setI':[0, 0]})
else:
update_single_entry(self.sync_BK_9174B_2, "setI", 0, 0)
#set max. voltage of HHC to 70V (in order to get constant current mode)
self.sync_BK_9174B.update({'setU':[70, 70]})
if self.checkBox_y2_coil.isChecked() == True:
self.sync_BK_9174B_2.update({'setU':[70, 70]})
else:
update_single_entry(self.sync_BK_9174B_2, "setU", 0, 70)
#turn on power supplies for HHC
self.sync_BK_9174B.update({'OutputOn':[True, True]})
if self.checkBox_y2_coil.isChecked() == True:
self.sync_BK_9174B_2.update({'OutputOn':[True, True]})
else:
update_single_entry(self.sync_BK_9174B_2, "OutputOn", 0, True)
#Turn off x,y,z-coil relais
self.sync_BK_9131B.update({'OutputOn':[False, False, False]})
#Set current and voltage of x,y,z-coil relais
self.sync_BK_9131B.update({'setI':[1,1,1]})
self.sync_BK_9131B.update({'setU':[5,5,5]})
time.sleep(1)
B_measured = self.sync_imc.get('FG') # Pull fluxgate data from global variables
for x in [0,1,2]:
B_measured[x] = B_measured[x]*100 #Conversion to muT
# Create array with all measured B-values for plotting
B_array = np.empty(shape=(0,3))
B_array = np.append(B_array,[B_measured],axis=0) # Save first measurement point already taken
# Uptdate plots
self.plot_x_1.setData([0,1],[self.B_set[0],self.B_set[0]])
self.plot_x_2.setData(np.arange(1),B_array[:,0])
self.plot_y_1.setData([0,1],[self.B_set[1],self.B_set[1]])
self.plot_y_2.setData(np.arange(1),B_array[:,1])
self.plot_z_1.setData([0,1],[self.B_set[2],self.B_set[2]])
self.plot_z_2.setData(np.arange(1),B_array[:,2])
# Calculate the difference between the set B-field and the measured values
B_Delta_x = (self.B_set[0] - B_measured[0])
B_Delta_y = (self.B_set[1] - B_measured[1])
B_Delta_z = (self.B_set[2] - B_measured[2])
# Create lists containing old and new coil-flip status
FlipStatus_new = [False, False, False]
FlipStatus_old = [False, False, False]
# Iterations are performed until the maximum number of iterations is reached or the difference is smaller than the given one
while i <= get_float(self.line_Max_iterations) and (np.abs(B_Delta_x) > get_float(self.line_Max_Difference) or np.abs(B_Delta_y) > get_float(self.line_Max_Difference) or np.abs(B_Delta_z) > get_float(self.line_Max_Difference)):
for k in [0,1,2]: # iterate on all three axes
I[k] = I[k] + (self.B_set[k] - B_measured[k])*(1/self.Coil_Constant[k]) # calculate new current set value
if I[k] < 0: # if current is negative, change the new flip status
FlipStatus_new[k] = True
else:
FlipStatus_new[k] = False
if self.checkBox_y2_coil.isChecked() == True and I[k] > 3:
I[k] = 3
if self.checkBox_y2_coil.isChecked() == False and I[k] >1.5:
I[k] = 1.5
print(I)
print(FlipStatus_new)
print(f"old{FlipStatus_old}")
if FlipStatus_new != FlipStatus_old: # if one of the flip status has changed compared to the old status, switch on the relais for flipping the current direction
self.sync_BK_9131B.update({'OutputOn':FlipStatus_new})
print("Switch")
time.sleep(0.5)
# set old flip status to the new one
FlipStatus_old = FlipStatus_new.copy()
for k in [0,1,2]: # iterate on all three axes and set the current of the power supplies
if k==0: # in case of x-direction
update_single_entry(self.sync_BK_9174B, "setI", k, np.abs(I[k]))
print(self.y2_coil_Enabled)
print(I[1])
if k==1: # in case of y-direction
if self.y2_coil_Enabled == True:
I_set = np.abs(I[k])/2
if I_set > 1.5:
I_set = 1.5
update_single_entry(self.sync_BK_9174B, "setI", 1, I_set)
update_single_entry(self.sync_BK_9174B_2, "setI", 1, I_set)
print("Klappt")
else: #Using just one power supply is enough
I_set = np.abs(I[k])
if I_set > 1.5:
I_set = 1.5
update_single_entry(self.sync_BK_9174B, "setI", 1, I_set)
if k==2: # in case of z-direction use BK_9174B_2
update_single_entry(self.sync_BK_9174B_2, "setI", 0, np.abs(I[k]))
# else: # in case of x- or y-direction use BK_9174B
# update_single_entry(self.sync_BK_9174B, "setI", k, np.abs(I[k]))
time.sleep(get_float(self.line_B_equil_time)) # wait for a given time period
B_measured = self.sync_imc.get('FG') # Pull fluxgate data from global variables
for x in [0,1,2]:
B_measured[x] = B_measured[x]*100 #Conversion to muT
# Calculate the difference between the set B-field and the measured values
B_Delta_x = (self.B_set[0] - B_measured[0])
B_Delta_y = (self.B_set[1] - B_measured[1])
B_Delta_z = (self.B_set[2] - B_measured[2])
B_array = np.append(B_array,[B_measured],axis=0) # append measured field for plotting
# plot B-fields of all three axes
self.plot_x_1.setData([0,i+2],[self.B_set[0],self.B_set[0]])
self.plot_x_2.setData(np.arange(i+2),B_array[:,0])
self.plot_y_1.setData([0,i+2],[self.B_set[1],self.B_set[1]])
self.plot_y_2.setData(np.arange(i+2),B_array[:,1])
self.plot_z_1.setData([0,i+2],[self.B_set[2],self.B_set[2]])
self.plot_z_2.setData(np.arange(i+2),B_array[:,2])
# if one B_set value is zero, calculating the percentual deviation is not possible
if self.B_set[0] != 0:
B_dev_x = 100*(self.B_set[0] - B_measured[0])/self.B_set[0]
self.line_B_x_dev.setText(str(np.round(B_dev_x,4)))
else:
self.line_B_x_dev.setText('/')
if self.B_set[1] != 0:
B_dev_y = 100*(self.B_set[1] - B_measured[1])/self.B_set[1]
self.line_B_y_dev.setText(str(np.round(B_dev_y,4)))
else:
self.line_B_y_dev.setText('/')
if self.B_set[2] != 0:
B_dev_z = 100*(self.B_set[2] - B_measured[2])/self.B_set[2]
self.line_B_z_dev.setText(str(np.round(B_dev_z,4)))
else:
self.line_B_z_dev.setText('/')
self.line_iteration_step.setText(str(i))
i=i+1
self.syncdict.update({'Start_Compensation':False})
if i <= get_float(self.line_Max_iterations):
self.line_iteration_step.setText('Compensation finished!')
self.line_iteration_step.setStyleSheet("background-color: lightgreen")
self.syncdict.update({'Status_Compensation':2})
else:
self.line_iteration_step.setText('Compensation failed!')
self.line_iteration_step.setStyleSheet("background-color: red")
self.syncdict.update({'Status_Compensation':3})
print("Closed")
def temperature_thread(self,progress_callback):
Caution_Message_Written = False
while self.running == True:
if self.temp_sensor > 0: #Read temperature if sensor is selected
if self.LS336_never_connected_before == True: #If never connected to LS336 before: Connect to LS336:
print("Try to connect to LS336")
try:
self.manager.register('sync_LS_336')
self.sync_LS_336 = self.manager.sync_LS_336()
LS336_connected = True
except:
print("Connecting to LS336 failed!")
LS336_connected = False
time.sleep(1)
self.LS336_never_connected_before = False
if LS336_connected == True:
T = self.sync_LS_336.get('T')[int(self.temp_sensor - 1)]
else:
T = 0
self.line_coil_temperature.setText(f"{np.round(T,2)}")
if self.Turn_Off_Coils == True and T > self.max_temperature:
if Caution_Message_Written == False:
print("Caution: Coil temperature above maximum!")
self.syncdict.update({'Temperature_Caution': True}) # Set temperature warning in global params
self.line_coil_temperature.setStyleSheet("background-color: red")
Caution_Message_Written = True
#turn off power supplies
self.sync_BK_9174B.update({'OutputOn':[False, False]})
self.sync_BK_9174B_2.update({'OutputOn':[False, False]})
if T <= self.max_temperature and Caution_Message_Written == True:
self.line_coil_temperature.setStyleSheet("background-color: white")
self.syncdict.update({'Temperature_Caution': False}) # Set temperature warning in global params to False
Caution_Message_Written = False
else:
LS336_never_connected_before = False
def update_setValues(self,values):
#sets setvalues obtained from update_all in gui
self.line_B_x_set.setText(f"{values[0][0]}")
self.line_B_y_set.setText(f"{values[0][1]}")
self.line_B_z_set.setText(f"{values[0][2]}")
def set_B_set(self):
#updates the B_set values in global variables. The change will be detected by update_all
B_set = [get_float(self.line_B_x_set), get_float(self.line_B_y_set), get_float(self.line_B_z_set)]
self.syncdict.update({'B_set':B_set})
def set_start_compensation(self):
self.syncdict.update({'Start_Compensation':True})
def set_y2_coil_Enabled(self):
if self.y2_coil_Enabled == False:
self.y2_coil_Enabled = True
else:
self.y2_coil_Enabled = False
#Turn off BK_9174B_2 CH2
update_single_entry(self.sync_BK_9174B_2, "setI", 1, 0)
update_single_entry(self.sync_BK_9174B_2, "OutputOn", 1, False)
def set_temp_sensor(self, value):
self.temp_sensor = value #0: No Sensor, 1:A, 2:B, 3:C, 4:D
def set_max_temperature(self):
self.max_temperature = get_float(self.line_Max_Temp)
def set_Turn_Off_Coils(self):
self.Turn_Off_Coils = self.checkBox_Turn_Off_Coils.isChecked()
def save(self, progress_callback):
#if save checkbox is checked it writes measurement values to file specified in line.filePath. There the full path including file extension must be given.
while self.running == True:
time.sleep(self.timing_save) #wait is at beginning so first point is not corrupted when app just started.
if self.checkBox_save.isChecked() == True:
path = self.line_filePath.text()
if os.path.isfile(path) == False:
with open(path,'a') as file:
file.write('date\tV Ch:1[V]\tI Ch:1[A]\tP Ch:1[W]\tV Ch:2[V]\tI Ch:2[A]\tP Ch:2[W]\tV Ch:3[V]\tI Ch:3[A]\tP Ch:3[W]\n')
file = open(path,'a')
file.write(time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime(self.t[-1]))+'\t')
for i in [0,1,2]: #Loop for all three channels
file.write(f"{self.Voltage[-1,i]}\t")
file.write(f"{self.Current[-1,i]}\t")
file.write(f"{self.Power[-1,i]}\t")
file.write('\n')
file.close
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\B_Field_Compensation_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
for c in self.combobox_config:
file.write(str(c.currentIndex())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\B_Field_Compensation_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f', '.2f','.0f','.2f', '.2f' , '.2f' , '.2f', '.2f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
for c,v in zip(self.combobox_config,vals[0][len(self.lines_config_float)+len(self.lines_config_strings)+len(self.checkboxes_config):]):
c.setCurrentIndex(int(v))
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,21 @@
Keithley_2230: 1:AMR supply voltage (9V, (1A))
2:AMR Flip ((20V), 0.2A)
3:AMR Test (does not work)
BK_9131B(BK30): 1:Heater copperblock (top)
2:Heater copperblock (bottom)
3:Cryostat LED (3-5V)
BK_9132(BK60 1)(Visa:...28): 1:Cryostat (helium heater)
2:Cernox relaisbox fan (9V, (1A))
3:Cernox relaisbox relais (4V, (1A))
BK_9132B(Bk60 2)(Visa:...04): 1:Relais X-coil (5V, (1A))
2:Relais Y-coil (5V, (1A))
3:Relais Z-coil (5V, (1A))
BK_9174B(BK70 1)(ASRL4::INSTR): 1:X-Coil(70V, I)
2:Y-Coil(70V, I)
BK_9174B(BK70 2)(ASRL5::INSTR): 1:Z-Coil(70V, I)
2:Free

1096
Legacy/TF_Control/Main.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
# To-Do
Cernox Calibration for CRAFT: np.array (np.mean) to python List conversion
# TF measurement
python.exe -m PyQt6.uic.pyuic evaporate_LN2_design.ui -o evaporate_LN2_design.py
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.helmholtz-berlin.de/fg-isrf/tf-measurement.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.helmholtz-berlin.de/fg-isrf/tf-measurement/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

View File

@ -0,0 +1,536 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import numpy as np
import pyqtgraph as pg
from scripts import import_txt
import random
from scipy.optimize import curve_fit
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from design_files.Result_window_design import Ui_MainWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget_B.setBackground('w')
self.graphWidget_B.setTitle("Trapped flux vs. B-field")
self.graphWidget_B.setLabel('bottom', 'Absolute magnetic field |B| (µT)')
self.graphWidget_B.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_Gradient.setBackground('w')
self.graphWidget_Gradient.setTitle("Trapped flux vs. temperature gradient")
self.graphWidget_Gradient.setLabel('bottom', 'Temperature gradient (K/cm)')
self.graphWidget_Gradient.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_CooldownSpeed.setBackground('w')
self.graphWidget_CooldownSpeed.setTitle("Trapped flux vs. cooldown speed (K/s)")
self.graphWidget_CooldownSpeed.setLabel('bottom', 'Cooldown speed (K/s)')
self.graphWidget_CooldownSpeed.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_TransitionTime.setBackground('w')
self.graphWidget_TransitionTime.setTitle("Trapped flux vs. transition time (K/s)")
self.graphWidget_TransitionTime.setLabel('bottom', 'Tansition time (s)')
self.graphWidget_TransitionTime.setLabel('left', 'Trapped flux (µT)')
pen1 = pg.mkPen(color=(255, 255, 255), width=2)
self.plot_B = self.graphWidget_B.plot([1,0],[1,0],pen = pen1, name = 'B', symbol ='x', symbolPen ='r', symbolBrush = 0.2)
self.plot_Gradient = self.graphWidget_Gradient.plot([1,0],[1,0],pen = pen1, name = 'B', symbol ='x', symbolPen ='r', symbolBrush = 0.2)
self.plot_CooldownSpeed = self.graphWidget_CooldownSpeed.plot([1,0],[1,0],pen = pen1, name = 'B', symbol ='x', symbolPen ='r', symbolBrush = 0.2)
self.plot_trans_time = self.graphWidget_TransitionTime.plot([1,0],[1,0],pen = pen1, name = 'B', symbol ='x', symbolPen ='r', symbolBrush = 0.2)
# self.graphWidget_B.addLegend()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_refresh.clicked.connect(self.import_data)
self.listWidget_files.itemSelectionChanged.connect(self.list_changed)
self.button_select_all.clicked.connect(self.select_all)
self.comboBox_plot_settings.currentIndexChanged.connect(self.set_plot_settings)
self.comboBox_select_sensor.currentIndexChanged.connect(self.update_plots)
self.line_Plot_B_Field.editingFinished.connect(self.update_plots)
self.line_Plot_T_Gradients.editingFinished.connect(self.update_plots)
self.line_Plot_B_Field.editingFinished.connect(self.update_plots)
self.dSB_Plot_B_Field_Tolerance.valueChanged.connect(self.set_Tolerances)
self.dSB_Plot_Cooldown_Speed_Tolerance.valueChanged.connect(self.set_Tolerances)
self.dSB_Plot_T_Gradients_Tolerance.valueChanged.connect(self.set_Tolerances)
self.dSB_Plot_Transition_Time_Tolerance.valueChanged.connect(self.set_Tolerances)
# self.actionSet_default.triggered.connect(self.set_default)
# self.actionReset_default.triggered.connect(self.read_default)
#define constants
self.Npoints = 200 #number of point to plot
self.files_selected = []
self.file_path = 0 #File path for loading calibration
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.select_mean_single = 0 #Select if mean value of all absolute AMR-B-fields or a single sensor should be selected. (0: Mean of abs., 1: Abs. of single sensor, 2: Single sensor direction)
self.B_Tolerance = 0 #Tolerance when searching for specific B-fields
self.Gradient_Tolerance = 0 #Tolerance when searching for specific T-Gradients
self.Cooldown_Speed_Tolerance = 0 #Tolerance when searching for specific Cooldown-Speeds
self.row_length = 96 #Standard row-length (#columns) of data_array. This value will be updated in import_data
self.mcol = ["#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F","#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F"] #define matlab colors
self.marker = ['x','o','s','t','d','+','p','arrow_up','t1','h','crosshair','t3','star','arrow_down'] #some marker styles for plotting
self.lines_config_float = []#is used for config file
self.lines_config_strings = [self.line_Plot_B_Field, self.line_Plot_T_Gradients,
self.line_Plot_Cooldown_Speed, self.line_Plot_Transition_Time,
self.line_Path]#is used for config file
self.checkboxes_config = []#is used for config file
self.combobox_config = [self.comboBox_plot_settings, self.comboBox_select_sensor]#is used for config file
self.SB_config = [self.dSB_Plot_B_Field_Tolerance,self.dSB_Plot_T_Gradients_Tolerance,
self.dSB_Plot_Cooldown_Speed_Tolerance,self.dSB_Plot_Transition_Time_Tolerance]
#read default values from config and set them in gui
self.read_default()
def import_data(self):
#imports data from folder and fills list. After it is finished it calls update_plots
path = self.line_Path.text()
try: #if path does not exists nothing is plotted
files = os.listdir(path)
except:
print('Error: Please enter valid path')
return
self.data = {}
selected = self.files_selected #store old selected items so it not overwritten when new data is set in list
self.listWidget_files.clear()
#store data from all files in data
for p in files:
[header,data_arr,times] = import_txt.read_w3dates(path+'\\'+p, '%Y-%m-%d_%H-%M-%S',delim = '\t')
self.data[f"{p}"] = [header[0],data_arr,times] #header ist list in list, therefore, header[0]
self.listWidget_files.addItem(f"{p}") #put files in list
#fill file list and check the one previously checked
for i in selected:
self.listWidget_files.setCurrentIndex(i)
if files != []:
try:
self.row_length = len(self.data[f"{files[0]}"][1][0,:]) #Update row length (# columns) of data array. Until now its value is 96
except:
print("File "+str(files[0])+" is empty.")
if selected != []: #Update plots automatically when refreshing / reloading updated measurements
self.update_plots()
def list_changed(self):
#Updates self.files_selected. It is executed when an item in list is selected.
self.files_selected = self.listWidget_files.selectedIndexes()
self.update_plots()
def select_all(self):
#activates all files refreshes.
self.listWidget_files.selectAll()
self.files_selected = self.listWidget_files.selectedIndexes()
self.import_data()
def update_plots(self):
#only use selected files:
data_all = np.empty((0,self.row_length))
for i in self.listWidget_files.selectedItems():
data_all = np.append(data_all,self.data[i.text()][1],0)
if len(data_all[:,0]) == 0: #Just in case nothing is loaded. Plotting an empty array would cause error
return
#correct:
#0: time_start
#1: time_end_ramp
#2: time_save_point
#3,4,5,6 B fluxgates, including magnitude
#7: global gradient (from top and bottom sensor)
#8: average global gradient (average of local gradients)
#9: error of average global gradient
#10: transition time
#11: average global cooldown rate
#12: error of average global cooldown rate
#13: List of local gradients
#14: List of local cooldown rates
#15,...,59: B AMR (ext. B applied, sample superconducting)
#60,...,104: B AMR (ext. B off) -> Trapped flux
#Pick out data from data_all (substract 3 from all indices compared to list
#above, since times are not included in data_all)
B_start = data_all[:,0:4]
gradient = data_all[:,5:7]
trans_time = data_all[:,7]
rate = data_all[:,8:10]
B_TF = data_all[:,57:102]
#calculate Magnitude of B_TF of all cooldowns
B_TF_mag = np.empty((len(B_TF),15))
for i in range(len(B_TF)):
B_TF_mag[i,:] = [np.sqrt(x**2+y**2+z**2) for x,y,z in zip(B_TF[i,0:15],B_TF[i,15:30],B_TF[i,30:45])]
#Select trapped flux
if self.select_mean_single == 0: #Mean of all absolute values (all sensors)
B_TF = np.mean(B_TF_mag, axis = 1)
elif self.select_mean_single == 1: ##Absolute value of one sensor
B_TF = B_TF_mag[:,self.comboBox_select_sensor.currentIndex()]
elif self.select_mean_single == 2: #Value of single sensor in one direction
B_TF = B_TF[:,self.comboBox_select_sensor.currentIndex()]
#sort the data according to the three lines and tolerances
#get lists of sorting values
B_sort = self.line_Plot_B_Field.text().split(sep=',')
T_sort = self.line_Plot_T_Gradients.text().split(sep=',')
S_sort = self.line_Plot_Cooldown_Speed.text().split(sep=',')
TT_sort = self.line_Plot_Transition_Time.text().split(sep=',')
if B_sort != ['']:
B_sort = [float(x) for x in B_sort]
if T_sort != ['']:
T_sort = [float(x) for x in T_sort]
if S_sort != ['']:
S_sort = [float(x) for x in S_sort]
if TT_sort != ['']:
TT_sort = [float(x) for x in TT_sort]
sort = [B_sort,T_sort,S_sort,TT_sort]
tolerances = [self.dSB_Plot_B_Field_Tolerance.value(),self.dSB_Plot_T_Gradients_Tolerance.value(),
self.dSB_Plot_Cooldown_Speed_Tolerance.value(),self.dSB_Plot_Transition_Time_Tolerance.value()]
#sort out data depending on how the lines are filled. If no line has more than one entry, sort out points that do not fall in the tolerances. If one line has more than one entry, create multiple plots. If more than one line has entries, return error.
ind = []
lens = I = [len(x) for x in [B_sort,T_sort,S_sort,TT_sort] if len(x) > 1]
if len(lens) == 0: #no line has more than one entry => only sort out points that do not fall in the tolerances
for i in range(len(data_all)):
skip = False #if skip is True, the index will not be appended to ind. Default is False
point_data = [B_start[i,1], gradient[i,0],
rate[i,0], trans_time[i]] #get data of the point which will be compared to the sort values.
for d,s,t in zip(point_data,sort,tolerances): #go through all sorting values, if any condition is not fullfilled the index is not appended to ind
if s != ['']: #check is the sorting value is not empty. If it is empty, the loop iteration is not skipped
if abs(d - s[0]) >= t: #check if the point is within the tolerances
skip = True #only if the point does not fall within the tolerances, skip is set to True and index will not be appended to ind
if skip == False:
ind.append(i) #append index of points that fall in the tolerances
#plot data
#create error array (systematic error = 2µT)
e_B_TF = np.full(len(B_TF[ind]),2)
#clear graph widgets and add new plots
for i,w in enumerate([self.graphWidget_B, self.graphWidget_Gradient,
self.graphWidget_CooldownSpeed,
self.graphWidget_TransitionTime
]):
w.clear()
if i == 0: #graph B
self.scatter_B = pg.ScatterPlotItem(x = B_start[ind,1], y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
err = pg.ErrorBarItem(x = B_start[ind,1], y = B_TF[ind], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_B)
w.addItem(err)
elif i == 1: #graph gradient
self.scatter_Gradient = pg.ScatterPlotItem(x = gradient[ind,0],y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
err = pg.ErrorBarItem(x = gradient[ind,0], y = B_TF[ind], left = gradient[ind,1], right = gradient[ind,1], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_Gradient)
w.addItem(err)
elif i == 2: #graph cooldown speed
self.scatter_CooldownSpeed = pg.ScatterPlotItem(x = rate[ind,0], y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
# err = pg.ErrorBarItem(x = rate[ind,0], y = B_TF[ind], left = rate[ind,1], right = rate[ind,1], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_CooldownSpeed)
elif i == 3: #graph transition time
self.scatter_transitionTime = pg.ScatterPlotItem(x = trans_time[ind], y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
err = pg.ErrorBarItem(x = trans_time[ind], y = B_TF[ind], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_transitionTime)
elif len(lens) == 1: #one line has more than one entry. So a set of plots should be generated from this line
ind_dict = {} #dictionary in which the sorted data will be saved
labels = [] #list in which labels of plots will be saved
#find sorting list with more than one entry
I = [i for i,x in enumerate(sort) if len(x) > 1]
I = I[0]
if len(B_sort) > 1:
for B in B_sort: #Find indices of data points where B = value in B_sort
ind = [i for i,x in enumerate(B_start[:,1]) if abs(x-B)<tolerances[0]]
ind_dict[str(B)] = ind
labels.append(f"B = {B} µT")
elif len(T_sort) > 1:
for T in T_sort: #Find indices of data points where Gradient = value in T_sort
ind = [i for i,x in enumerate(gradient[:,0]) if abs(x-T)<tolerances[1]]
ind_dict[str(T)] = ind
labels.append(f"nabla T = {T} K/cm")
elif len(S_sort) > 1:
for S in S_sort: #Find indices of data points where cooldownrate = value in S_sort
ind = [i for i,x in enumerate(rate[:,0]) if abs(x-S)<tolerances[2]]
ind_dict[str(S)] = ind
labels.append(f"rate = {S} K/s")
elif len(TT_sort) > 1:
for TT in TT_sort: #Find indices of data points where TransitionTime = value in TT_sort
ind = [i for i,x in enumerate(trans_time[:,0]) if abs(x-TT)<tolerances[3]]
ind_dict[str(TT)] = ind
labels.append(f"Transition time = {TT} s")
#kick out any points that do not fall in the tolerances of the other lines
sort.pop(I) #pop out the sorting list with more than one entry wich is already used for sorting
tolerances.pop(I)
for key in ind_dict.keys(): #go through all points in ind_dict
pop=[] #list of indices to be popped out because to do not fit the tolerances
for i,ind in enumerate(ind_dict[key]):
point_data = [B_start[ind,1], gradient[ind,0], rate[ind,0], trans_time[ind]]
point_data.pop(I) #pop out data of sorting list which is already used
for d,s,t in zip(point_data,sort,tolerances): #go through all sorting values, if any condition is not fullfilled index is removed from the dictionary
if s != ['']: #check is the sorting value is not empty. If it is empty, the loop iteration is not skipped
if abs(d - s[0]) >= t: #check if the point outside the tolerance
pop.append(i)
break #get out of loop so no more indices are deleted
#delete indices that are in pop
ind_dict[key] = [x for i,x in enumerate(ind_dict[key]) if i not in pop]
#create error array (systematic error = 2µT)
e_B_TF = np.full(len(data_all),2)
#clear all graph widgets, add a legend and add new scatter plots
for i,w in enumerate([self.graphWidget_B, self.graphWidget_Gradient,
self.graphWidget_CooldownSpeed,
self.graphWidget_TransitionTime
]):
w.clear()
w.addLegend()
#add new scatter and errorbars to plots
for n,key in enumerate(ind_dict.keys()):
if i == 0: #graph B
scatter = pg.ScatterPlotItem(x = B_start[ind_dict[key],1], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
err = pg.ErrorBarItem(x = B_start[ind_dict[key],1], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_B.addItem(scatter)
self.graphWidget_B.addItem(err)
if i == 1: #graph gradient
scatter = pg.ScatterPlotItem(x = gradient[ind_dict[key],0], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
err = pg.ErrorBarItem(x = gradient[ind_dict[key],0], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], left = gradient[ind_dict[key],1], right = gradient[ind_dict[key],1], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_Gradient.addItem(scatter)
self.graphWidget_Gradient.addItem(err)
if i == 2: #graph cooldown rate
scatter = pg.ScatterPlotItem(x = rate[ind_dict[key],0], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
# err = pg.ErrorBarItem(x = rate[ind_dict[key],0], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], left = rate[ind_dict[key],1], right = rate[ind_dict[key],1], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_CooldownSpeed.addItem(scatter)
# self.graphWidget_CooldownSpeed.addItem(err)
if i == 3: #graph transition time
scatter = pg.ScatterPlotItem(x = trans_time[ind_dict[key]], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
err = pg.ErrorBarItem(x = trans_time[ind_dict[key]], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_TransitionTime.addItem(scatter)
self.graphWidget_TransitionTime.addItem(err)
elif len(lens) > 1:
print('ERROR: more than one sorting line has more than one entry. Please select only one line with more than one entry. Aborting...')
return
def set_Tolerances(self):
#Set tolerance values for filtering
self.B_Tolerance = self.dSB_Plot_B_Field_Tolerance.value()
self.Gradient_Tolerance = self.dSB_Plot_T_Gradients_Tolerance.value()
self.Cooldown_Speed_Tolerance = self.dSB_Plot_Cooldown_Speed_Tolerance.value()
self.Transition_Time_Tolerance = self.dSB_Plot_Transition_Time_Tolerance.value()
self.update_plots()
def set_plot_settings(self, value):
#Set plot settings (mean B-value of all AMR-sensors / absolute value of single sensor / single sensor direction)
self.select_mean_single = value
#set the right entries in qComboBox_select_sensor
if self.select_mean_single == 0: #Mean of all absolute values (all sensors)
self.comboBox_select_sensor.setEnabled(False)
self.comboBox_select_sensor.clear()
elif self.select_mean_single == 1: #Absolute value of one sensor
self.comboBox_select_sensor.setEnabled(True)
self.comboBox_select_sensor.clear()
for i in range(1,16): #Add 15 values
self.comboBox_select_sensor.addItem("Sensor "+str(i))
elif self.select_mean_single == 2: #Value of single sensor in one direction
self.comboBox_select_sensor.setEnabled(True)
self.comboBox_select_sensor.clear()
#Add 45 values
for i in range(1,16):
for direction in ["x", "y", "z"]:
self.comboBox_select_sensor.addItem("Sensor "+str(i) +" "+str(direction))
self.update_plots()
def nearest_value_in_array(self, array, value): #Returns index of closest entry in array compared to value
index = (np.abs(array - value)).argmin()
return(index)
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\result_window_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.lines_config_float:
temp = f"{get_float(l)}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
for c in self.combobox_config:
file.write(str(c.currentIndex())+'\t')
for SB in self.SB_config:
temp = f"{SB.value()}"
file.write(temp+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\result_window_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
formats = ['.2f', '.2f', '.2f','.2f','.2f','.0f']
for l,v,f in zip(self.lines_config_float,vals[0],formats):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
l.setText(format(v,f))
for l,v in zip(self.lines_config_strings,vals[0][len(self.lines_config_float):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.lines_config_float)+
len(self.lines_config_strings):]):
c.setChecked(v == 'True')
for c,v in zip(self.combobox_config,vals[0][len(self.lines_config_float)+
len(self.lines_config_strings)+
len(self.checkboxes_config):]):
c.setCurrentIndex(int(v))
for SB,v in zip(self.SB_config,vals[0][len(self.lines_config_float)+
len(self.lines_config_strings)+
len(self.checkboxes_config)+
len(self.combobox_config):]):
v = float(v)
SB.setValue(v)
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

Binary file not shown.

View File

@ -0,0 +1 @@
15 2.0 0.1 D:\Data\TF_CRAFT_2025-07-03\AMR_Calibration

View File

@ -0,0 +1 @@
0.0 0.32 0.02 0.0 -100.0 50.0 12.0 9.3 9.5 0.15 -100.0 0.03 300.0 4.0 0.05 15.0 300.0 20.0 0 D:\Data\TF_CRAFT_2025-07-03\points D:\TF_control\configs\Bext_compensation_data\Bext_Test.txt False 0

View File

@ -0,0 +1 @@
0.0 -100.0 0.0 0.05 10.0 1.0 134.0 92.9 92.9 237.0 319.0 True True 3

View File

@ -0,0 +1 @@
[[[0, 0, 0], [0.3690559701492537, 0.04218299246501614, 0.0, 0.005305485232067509], [false, true, false]], [[0, -100.0, 0], [0.3704238805970149, 1.108686759956943, 0.0, 0.004224050632911393], [false, true, false]]]

View File

@ -0,0 +1 @@
0.1 1.0 100 3600 20.0 20.0 75.0 75.0 12.0 12.0 10.0 0 7 0.03 0.0 2.5 0.3 0.0 2.5 0.3 0.0 0.0 -100.0 0.0 0.36 0.05 0.003 0.36 1.117 0.002 0.219 0.333 0.064 D:\Data\TF_CRAFT_2025-07-03\monitoring.txt True True False False False False False False True True True True True True True False True False False True False False True True

View File

@ -0,0 +1 @@
200.0 10.0 False

View File

@ -0,0 +1 @@
200.0 1.0 False

View File

@ -0,0 +1 @@
4.0 19.0 0.5 60.0 5.0 3.0 0.0 D:\Data\TF_CRAFT_2025-07-03\Cernox_Calibration False 0

View File

@ -0,0 +1 @@
D:\Data\TF_2025-02-25\points 0 -1 0.0 0.0 0.0 0.0

Binary file not shown.

View File

@ -0,0 +1,909 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
import traceback,sys,os
import pickle
import numpy as np
import pyqtgraph as pg
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from scripts import import_txt, analyse_cooldown_tools
from design_files.Analyse_cooldown_design import Ui_MainWindow
from Raw_data import RawdataWindow
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
class cooldown():
'''Contains the metadata of a cooldown'''
def __init__(self,times:list, gradient:float, av_gradient:list, loc_gradient:list,
trans_time:float, rate:list, rate_loc:list, indixes:list, B_start:list,
B_expelled:list, B_trapped:list, WM:list, good:bool):
self.times:list = times #list of times: strart_ramp, stop_ramp, save button_pressed
self.gradient_glob:float = gradient #global gradient obtained between sensor 1 and 8
self.gradient_average:list = av_gradient #average of all local gradients, second list element is error
self.gradient_local:list = loc_gradient #list of all local gradients
self.trans_time:float = trans_time #transition time
self.rate:list = rate #average cooldown rate of all local cooldown rates with error
self.rate_local:list = rate_loc #list of all local cooldown rates
self.indixes:list = indixes #list of indixes at which cernox sensors reach
self.B_start:list = B_start #start field from fluxgate. List contains four entries: [Bx, By, Bz, |B|]
self.B_expelled:list = B_expelled #expelled field from AMR senors. List containts 60 entries: [15xBx, 15xBy, 15xBz, 15x|B|]
self.B_trapped:list = B_trapped #trapped field from AMR senors. List contains 60 entries: [15xBx, 15xBy, 15xBz, 15x|B|]
self.WM:list = WM #wave magnitude. List contains three entries: [WM_x, WM_y, WM_z]
self.good:bool = good #whether the cooldown was good or not
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
def find_index_of_first_equal_to(lst, value):
'''Finds the index of the first element in a list that is equal to a given value. Returns -1 if no such element is found.'''
return next((i for i, x in enumerate(lst) if x == value), np.nan)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
self.graphWidget_B.setBackground('w')
self.graphWidget_B.setTitle("Trapped flux vs. B-field")
self.graphWidget_B.setLabel('bottom', 'B_y (µT)')
self.graphWidget_B.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_B.showGrid(x = True, y = True)
self.graphWidget_Gradient.setBackground('w')
self.graphWidget_Gradient.setTitle("Trapped flux vs. temperature gradient")
self.graphWidget_Gradient.setLabel('bottom', 'Temperature gradient (K/cm)')
self.graphWidget_Gradient.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_Gradient.showGrid(x = True, y = True)
self.graphWidget_CooldownSpeed.setBackground('w')
self.graphWidget_CooldownSpeed.setTitle("Trapped flux vs. cooldown speed (K/s)")
self.graphWidget_CooldownSpeed.setLabel('bottom', 'Cooldown speed (K/s)')
self.graphWidget_CooldownSpeed.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_CooldownSpeed.showGrid(x = True, y = True)
self.graphWidget_transitiontime.setBackground('w')
self.graphWidget_transitiontime.setTitle("Trapped flux vs. transition time (s)")
self.graphWidget_transitiontime.setLabel('bottom', 'transition time (s)')
self.graphWidget_transitiontime.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_transitiontime.showGrid(x = True, y = True)
self.graphWidget_WM_x.setBackground('w')
self.graphWidget_WM_x.setTitle("Wave Amplitude X vs. transition time (K/s)")
self.graphWidget_WM_x.setLabel('bottom', 'transition time (K/s)')
self.graphWidget_WM_x.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_WM_x.showGrid(x = True, y = True)
self.graphWidget_WM_y.setBackground('w')
self.graphWidget_WM_y.setTitle("Wave Amplitude Y vs. transition time (K/s)")
self.graphWidget_WM_y.setLabel('bottom', 'transition time (K/s)')
self.graphWidget_WM_y.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_WM_y.showGrid(x = True, y = True)
self.graphWidget_WM_z.setBackground('w')
self.graphWidget_WM_z.setTitle("Wave Amplitude Z vs. transition time (K/s)")
self.graphWidget_WM_z.setLabel('bottom', 'transition time (K/s)')
self.graphWidget_WM_z.setLabel('left', 'Trapped flux (µT)')
self.graphWidget_WM_z.showGrid(x = True, y = True)
self.graphWidget_free.setBackground('w')
self.graphWidget_free.setTitle("")
self.graphWidget_free.setLabel('bottom', '')
self.graphWidget_free.setLabel('left', '')
pen1 = pg.mkPen(color=(255, 255, 255), width=2)
# create some dummy data
x = np.array([0, 1, 2, 3, 4])
y = np.array([2, 4, 6, 8, 10])
y_err = np.array([0.5, 1, 1.5, 2, 2.5])
# create an error bar item
self.err_B = pg.ErrorBarItem(x=x, y=y, top=y_err, bottom=y_err, pen=pg.mkPen('k', width=1))
self.err_Gradient = pg.ErrorBarItem(x=x, y=y, left=y_err, right=y_err, top = y_err, bottom=y_err, pen=pg.mkPen('k', width=1))
self.err_CooldownSpeed = pg.ErrorBarItem(x=x, y=y, left=y_err, right=y_err, top = y_err, bottom=y_err, pen=pg.mkPen('k', width=1))
self.err_transitionTime = pg.ErrorBarItem(x=x, y=y, top = y_err, bottom=y_err, pen=pg.mkPen('k', width=1))
# add the error bar item to the plot
self.graphWidget_B.addItem(self.err_B)
self.graphWidget_Gradient.addItem(self.err_Gradient)
self.graphWidget_CooldownSpeed.addItem(self.err_CooldownSpeed)
self.graphWidget_transitiontime.addItem(self.err_transitionTime)
# create a scatter plot with markers
self.scatter_B = pg.ScatterPlotItem(x=x, y=y, pen=None, symbol ='x', size=10)
self.scatter_Gradient = pg.ScatterPlotItem(x=x, y=y, pen=None, symbol ='x', size=10)
self.scatter_CooldownSpeed = pg.ScatterPlotItem(x=x, y=y, pen=None, symbol ='x', size=10)
self.scatter_transitionTime = pg.ScatterPlotItem(x=x, y=y, pen=None, symbol ='x', size=10)
self.scatter_WM_x = pg.ScatterPlotItem(x=x, y=y, pen=None, symbol ='x', size=10)
self.scatter_WM_y = pg.ScatterPlotItem(x=x, y=y, pen=None, symbol ='x', size=10)
self.scatter_WM_z = pg.ScatterPlotItem(x=x, y=y, pen=None, symbol ='x', size=10)
# add the scatter plot to the plot
self.graphWidget_B.addItem(self.scatter_B)
self.graphWidget_Gradient.addItem(self.scatter_Gradient)
self.graphWidget_CooldownSpeed.addItem(self.scatter_CooldownSpeed)
self.graphWidget_transitiontime.addItem(self.scatter_transitionTime)
self.graphWidget_WM_x.addItem(self.scatter_WM_x)
self.graphWidget_WM_y.addItem(self.scatter_WM_y)
self.graphWidget_WM_z.addItem(self.scatter_WM_z)
#set up pyQT threadpool
self.threadpool = QThreadPool()
#define signals and slots
self.actionSet_default.triggered.connect(self.set_default)
self.actionReset_default.triggered.connect(self.read_default)
self.button_refresh_summary.clicked.connect(self.refresh_points_list)
self.button_refresh_summary.clicked.connect(self.refresh_data_list)
self.button_refresh_raw.clicked.connect(self.refresh_data_list)
self.button_refresh_raw.clicked.connect(self.refresh_points_list)
self.listWidget_files_summary.itemSelectionChanged.connect(self.list_changed)
self.listWidget_files_raw.itemSelectionChanged.connect(self.list_changed)
self.button_select_all_summary.clicked.connect(self.select_all)
self.button_select_all_raw.clicked.connect(self.select_all_raw)
self.button_select_all_points.clicked.connect(self.select_all_points)
self.button_clear_points.clicked.connect(self.clear_points)
self.comboBox_plot_settings.currentIndexChanged.connect(self.set_plot_settings)
# self.comboBox_select_sensor.currentIndexChanged.connect(self.update_plots)
# self.line_Plot_B_Field.editingFinished.connect(self.update_plots)
# self.line_Plot_T_Gradients.editingFinished.connect(self.update_plots)
# self.line_Plot_B_Field.editingFinished.connect(self.update_plots)
self.listWidget_points.itemSelectionChanged.connect(self.update_plots)
self.button_import.clicked.connect(self.import_data)
self.button_start_analysis.clicked.connect(self.start_analysis)
self.button_select_good_points.clicked.connect(self.select_good_points)
self.button_save_cooldowns.clicked.connect(self.save_cooldowns)
self.button_import_cd.clicked.connect(self.load_cooldowns)
self.button_update_plots.clicked.connect(self.update_plots)
self.button_export_points.clicked.connect(self.export_acitve_points)
self.dSB_Plot_B_Field_Tolerance.valueChanged.connect(self.set_Tolerances)
self.dSB_Plot_Cooldown_Speed_Tolerance.valueChanged.connect(self.set_Tolerances)
self.dSB_Plot_T_Gradients_Tolerance.valueChanged.connect(self.set_Tolerances)
self.dSB_Plot_Transition_Time_Tolerance.valueChanged.connect(self.set_Tolerances)
self.scatter_Gradient.sigClicked.connect(self.find_point_name)
self.scatter_B.sigClicked.connect(self.find_point_name)
self.scatter_CooldownSpeed.sigClicked.connect(self.find_point_name)
self.scatter_transitionTime.sigClicked.connect(self.find_point_name)
# self.actionSet_default.triggered.connect(self.set_default)
# self.actionReset_default.triggered.connect(self.read_default)
#define constants
self.w = None #constant to keep track of raw data window
self.files_selected = [] #list to keep the selected indices of point files. Is needed to keep the same indices aactived after refreshing.
self.files_selected_raw = [] #list to keep the selected indices of raw files. Is needed to keep the same indices aactived after refreshing.
self.file_path = 0 #File path for loading calibration
self.running = True #true while app is running
self.disable_plot = False #constant to disable plot to improve performance. Is changed by checkbox checkBox_disableplots
self.select_mean_single = 0 #Select if mean value of all absolute AMR-B-fields or a single sensor should be selected. (0: Mean of abs., 1: Abs. of single sensor, 2: Single sensor direction)
self.B_Tolerance = 0 #Tolerance when searching for specific B-fields
self.Gradient_Tolerance = 0 #Tolerance when searching for specific T-Gradients
self.Cooldown_Speed_Tolerance = 0 #Tolerance when searching for specific Cooldown-Speeds
self.row_length = 96 #Standard row-length (#columns) of data_array. This value will be updated in import_data
self.points_list = [] #store all points
self.cooldowns = {} #store cooldowns
self.mcol = ["#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F","#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F"] #define matlab colors
self.marker = ['x','o','s','t','d','+','p','arrow_up','t1','h','crosshair','t3','star','arrow_down']
self.dSB_all = [self.dSB_Plot_B_Field_Tolerance, self.dSB_Plot_T_Gradients_Tolerance,
self.dSB_Plot_Cooldown_Speed_Tolerance, self.dSB_Tc, self.dSB_Tc_top,
self.dSB_Tc_bottom]#is used for config file
self.lines_config_strings = [self.line_path_points, self.line_path_data,
self.line_Plot_B_Field, self.line_Plot_T_Gradients,
self.line_Plot_Cooldown_Speed, self.line_Plot_Transition_Time]#is used for config file
self.checkboxes_config = [self.checkBox_C_1, self.checkBox_C__2, self.checkBox_C_3,
self.checkBox_C_4, self.checkBox_C_5, self.checkBox_C_6,
self.checkBox_C_7, self.checkBox_C_8, self.checkBox_CRAFT]#is used for config file
self.combobox_config = [self.comboBox_plot_settings]#is used for config file
self.decided = True #constant which is set to true after a decision is made whether a cooldown is good or bad. This is needed for self.analyze_cooldown() to know if next cooldown can be analysed
#read default values from config and set them in gui
self.read_default()
#open raw data window
if self.w is None:
self.w = RawdataWindow()
self.w.show()
def refresh_points_list(self):
#imports data from folder and fills list. After it is finished it calls update_plots
path = self.line_path_points.text()
try: #if path does not exists nothing is plotted
files = os.listdir(path)
except:
print('Error: Please enter valid path')
return
self.data = {}
selected = self.files_selected #store old selected items so it not overwritten when new data is set in list
self.listWidget_files_summary.clear()
#store data from all files in data
for p in files:
# [header,data_arr,times] = import_txt.read_w2dates(path+'\\'+p, '%Y-%m-%d_%H-%M-%S',delim = '\t')
# self.data[f"{p}"] = [header[0],data_arr,time] #header is list in list, therefore, header[0]
self.listWidget_files_summary.addItem(f"{p}") #put files in list
#fill file list and check the one previously checked
for i in selected:
self.listWidget_files_summary.setCurrentIndex(i)
if files != []:
try:
self.row_length = len(self.data[f"{files[0]}"][1][0,:]) #Update row length (# columns) of data array. Until now its value is 96
except:
print("File "+str(files[0])+" is empty.")
# if selected != []: #Update plots automatically when refreshing / reloading updated measurements
# self.update_plots()
def refresh_data_list(self):
#imports data from folder and fills list. After it is finished it calls update_plots
path = self.line_path_data.text()
try: #if path does not exists nothing is plotted
files = os.listdir(path)
except:
print('Error: Please enter valid path')
return
selected = self.files_selected_raw #store old selected items so it not overwritten when new data is set in list
self.listWidget_files_raw.clear()
#store data from all files in data
for p in files:
# [header,data_arr,times] = import_txt.read_w2dates(path+'\\'+p, '%Y-%m-%d_%H-%M-%S',delim = '\t')
# self.data[f"{p}"] = [header[0],data_arr,time] #header is list in list, therefore, header[0]
self.listWidget_files_raw.addItem(f"{p}") #put files in list
#fill file list and check the one previously checked
for i in selected:
self.listWidget_files_raw.setCurrentIndex(i)
if files != []:
try:
self.row_length = len(self.data[f"{files[0]}"][1][0,:]) #Update row length (# columns) of data array. Until now its value is 96
except:
print("File "+str(files[0])+" is empty.")
# if selected != []: #Update plots automatically when refreshing / reloading updated measurements
self.update_plots()
def import_data(self):#imports data from selected files
#import points from files
self.points_list = [] #clear list
for s in self.files_selected:
path = self.line_path_points.text() + '\\' + s.data()
[header,data_arr,times] = import_txt.read_w3dates(path, '%Y-%m-%d_%H-%M-%S',delim = '\t')
self.points_list.extend(times)
#import "raw" data from files
self.data_list = [] #List to store the data of all raw files
for s in self.files_selected_raw:
path = self.line_path_data.text() + '\\' + s.data()
[header,data,times] = import_txt.read_wdate(path,'timestamp',delim=' ')
boundary_times = [times[0], times[-1]]
self.data_list.append([times,data,boundary_times])
#put start times in point List
self.listWidget_points.clear()
for p in self.points_list:
self.listWidget_points.addItem(f"{p[0]}")
def start_analysis(self):
'''starts self.analyse in a new thread. Is called when "start" button is clicked. '''
worker_ana = Worker(self.analyse)
worker_ana.signals.progress.connect(self.update_raw_plots) #The values from analyse must be transmitted via a signal, so that the gui is set in the main thread. If the plots are not updated in the main thread, they freeze.
self.threadpool.start(worker_ana)
def analyse(self,progress_callback):
'''performes analysis of selected cooldowns and emits signal to start update_raw_plots in main thread. Is started in start_analysis.'''
points_selected = self.listWidget_points.selectedIndexes()
#iterate though points
for p in points_selected:
ind = p.row() #get point index
name = p.data()
name.replace(' ','_')
times = self.points_list[ind] #get start and stop times from current point
#select correct data file for the point
for i,l in enumerate(self.data_list):
if times[0] >= l[2][0] and times[0] <= l[2][1]: #check if start time of point lies within the boundary times of the data file
data_ind = i
break
#find start and stop indixes in data file and prepare data
i_start = find_index_of_first_equal_to(self.data_list[data_ind][0], times[0])
i_stop = find_index_of_first_equal_to(self.data_list[data_ind][0], times[2])+1 #make shure point is included. This is necessary for analyse_B_field.
time_slice = self.data_list[data_ind][0][i_start:i_stop]
data_slice = self.data_list[data_ind][1][i_start:i_stop,:]
temp_slice = self.data_list[data_ind][1][i_start:i_stop,0:8]
#preapre list of active cernox sensors for analysis
act_sens = [] #list of active sensors
for i,c in enumerate([self.checkBox_C_1, self.checkBox_C__2, self.checkBox_C_3,
self.checkBox_C_4, self.checkBox_C_5, self.checkBox_C_6,
self.checkBox_C_7, self.checkBox_C_8]):
if c.isChecked() == True:
act_sens.append(i+1)
#perform analysis and discern wether CRAFT was used or mVTS. If CRAFT was used, fits need to be performed with the data
if self.checkBox_CRAFT.isChecked() == False:
[grad_glob, av_grad_glob, e_av_grad_glob, trans_time, av_rate_glob, e_av_rate_glob,
grad_loc, rate_loc, indices] = analyse_cooldown_tools.calc_gradient(
temp_slice,time_slice,act_sens,Tc = self.dSB_Tc.value(),return_indices=True)
[B_start, B_expelled, B_trapped, WM, indices_B] = analyse_cooldown_tools.analyse_B_field(data_slice, time_slice,times)
indices.extend(indices_B) #extend indices with indices from analyse_B_field to plot the times at which the fields are measured
#add cooldown to cooldown dictionary as good cooldown. Whether it is good or bad is updated later in self.accept_points
self.cooldowns[name] = cooldown(times, grad_glob, [av_grad_glob,e_av_grad_glob], grad_loc,
trans_time, [av_rate_glob,e_av_rate_glob], rate_loc,
indices, B_start, B_expelled, B_trapped, WM, True)
progress_callback.emit([time_slice, data_slice, grad_loc, indices, WM, 0, 0, name])
else:
[grad_glob, av_grad_glob, e_av_grad_glob, trans_time, av_rate_glob, e_av_rate_glob,
grad_loc, rate_loc, indices, popt_T1, popt_T2] = analyse_cooldown_tools.calc_gradient_CRAFT(
temp_slice,time_slice,act_sens,Tc_top = self.dSB_Tc_top.value(),
Tc_bottom = self.dSB_Tc_bottom.value(),return_indices=True)
[B_start, B_expelled, B_trapped, WM, indices_B] = analyse_cooldown_tools.analyse_B_field(data_slice, time_slice,times)
indices.extend(indices_B) #extend indices with indices from analyse_B_field to plot the times at which the fields are measured
#add cooldown to cooldown dictionary as good cooldown. Whether it is good or bad is updated later in self.accept_points
self.cooldowns[name] = cooldown(times, grad_glob, [av_grad_glob,e_av_grad_glob], grad_loc,
trans_time, [av_rate_glob,e_av_rate_glob], rate_loc,
indices, B_start, B_expelled, B_trapped, WM, True)
progress_callback.emit([time_slice, data_slice, grad_loc, indices, WM, popt_T1, popt_T2, act_sens, name])
self.decided = False
#wait until decision is made
while self.decided == False:
time.sleep(0.1)
def update_raw_plots(self,plot_data):
'''updates plots in raw plots window. Is called from self.analyse() by
the emitted signal'''
#make shure raw window is open
self.w.show()
#get T_c, depending on wether CRAFT was used or mVTS
if self.checkBox_CRAFT.isChecked() == False:
T_c = self.dSB_Tc.value()
else:
T_c = [self.dSB_Tc_top.value(), self.dSB_Tc_bottom.value()]
#pass data to rawdataWindow and plot it
self.w.update_plots(plot_data[0],plot_data[1],plot_data[2],plot_data[3],plot_data[4],
plot_data[5], plot_data[6], plot_data[7], T_c)
self.accept_points(plot_data[-1])
def accept_points(self,name):
'''Asks the user if a cooldown is good or bad. If Yes, then the cooldown is marked as good. If No, then the cooldown is marked as bad. The method is called after the raw data is plotted'''
button = QMessageBox.question(self, 'Accept points','Accept depicted point?')
if button == QMessageBox.StandardButton.Yes:
self.cooldowns[name].good = True
else:
self.cooldowns[name].good = False
self.decided = True
def select_good_points(self):
'''Selects all cooldowns that have been marked as good'''
for cd in self.cooldowns:
item = self.listWidget_points.findItems(cd,Qt.MatchFlag.MatchExactly)[0]
item.setSelected(self.cooldowns[cd].good)
def save_cooldowns(self):
'''Saves cooldowns to pickle file'''
fname = QFileDialog.getSaveFileName(self, 'Open file', r'D:',"*.pickle")[0]
with open(fname, 'wb') as handle:
pickle.dump(self.cooldowns, handle)
def load_cooldowns(self):
'''Loads cooldowns from pickle file'''
fname = QFileDialog.getOpenFileName(self, 'Open file', r'D:',"*.pickle")[0]
with open(fname, 'rb') as handle:
self.cooldowns.update(pickle.load(handle)) #add cooldowns to existing cooldown dictionary
#fill in points list from cooldowns
self.listWidget_points.clear()
for cd in self.cooldowns:
self.listWidget_points.addItem(cd)
def list_changed(self):
#Updates self.files_selected. It is executed when an item in list is selected.
self.files_selected = self.listWidget_files_summary.selectedIndexes()
self.files_selected_raw = self.listWidget_files_raw.selectedIndexes()
def select_all(self):
#activates all files refreshes.
self.listWidget_files_summary.selectAll()
self.files_selected = self.listWidget_files_summary.selectedIndexes()
self.refresh_points_list()
def select_all_raw(self):
#activates all files refreshes.
self.listWidget_files_raw.selectAll()
self.files_selected_raw = self.listWidget_files_raw.selectedIndexes()
self.refresh_points_list()
def select_all_points(self):
'''activates all points. If all are already activates, deactivates all'''
if len(self.listWidget_points.selectedIndexes()) == self.listWidget_points.count():
self.listWidget_points.clearSelection()
else:
self.listWidget_points.selectAll()
def clear_points(self):
'''clears list of points and deletes all cooldowns'''
self.listWidget_points.clear()
self.cooldowns = {}
def update_plots(self):
#create list of names of selected points
names = []
for i in self.listWidget_points.selectedItems():
names.append(i.data(0))
#create np.arrays of, B_start, gradient, cooldown rate, transition time, B_TF
B_start = np.empty((len(names),4))
gradient = np.empty((len(names),2))
rate = np.empty((len(names),2))
trans_time = np.empty((len(names),1))
B_TF = np.empty((len(names),60))
WM_x = np.empty((len(names)))
WM_y = np.empty((len(names)))
WM_z = np.empty((len(names)))
for i,n in enumerate(names):
if self.checkBox_local_gradient.isChecked() == True: #use local or average gradient
gradient[i,:] = np.array([
self.cooldowns[n].gradient_local[self.SB_sensor_gradient.value()-1],
self.cooldowns[n].gradient_average[1]])
else:
gradient[i,:] = self.cooldowns[n].gradient_average
B_start[i,:] = self.cooldowns[n].B_start
rate[i,:] = self.cooldowns[n].rate
trans_time[i] = self.cooldowns[n].trans_time
B_TF[i,:] = self.cooldowns[n].B_trapped
e_B_TF = np.zeros((len(B_TF))) + 2
WM_x[i] = self.cooldowns[n].WM[0]
WM_y[i] = self.cooldowns[n].WM[1]
WM_z[i] = self.cooldowns[n].WM[2]
#Select trapped flux
if self.select_mean_single == 0: #Mean of all absolute values (all sensors)
B_TF = np.mean(B_TF[:,45:], axis = 1)
elif self.select_mean_single == 1: ##Absolute value of one sensor
B_TF = B_TF[:,45+self.comboBox_select_sensor.currentIndex()]
elif self.select_mean_single == 2: #Value of single sensor in one direction
B_TF = B_TF[:,self.comboBox_select_sensor.currentIndex()]
#find good "beam size" for error bars. Make this 1 percent of the x or y axis
beam_size_B = (max(B_start[:,1]) - min(B_start[:,1]))/100
beam_size_gradient = (max(gradient[:,1]) - min(gradient[:,1]))/5
beam_size_rate = (max(rate[:,1]) - min(rate[:,1]))/5
beam_size_time = (max(trans_time) - min(trans_time))/100
#sort the data according to the three lines and tolerances
#get lists of sorting values
B_sort = self.line_Plot_B_Field.text().split(sep=',')
T_sort = self.line_Plot_T_Gradients.text().split(sep=',')
S_sort = self.line_Plot_Cooldown_Speed.text().split(sep=',')
TT_sort = self.line_Plot_Transition_Time.text().split(sep=',')
if B_sort != ['']:
B_sort = [float(x) for x in B_sort]
if T_sort != ['']:
T_sort = [float(x) for x in T_sort]
if S_sort != ['']:
S_sort = [float(x) for x in S_sort]
if TT_sort != ['']:
TT_sort = [float(x) for x in TT_sort]
sort = [B_sort,T_sort,S_sort,TT_sort]
tolerances = [self.dSB_Plot_B_Field_Tolerance.value(),self.dSB_Plot_T_Gradients_Tolerance.value(),
self.dSB_Plot_Cooldown_Speed_Tolerance.value(),self.dSB_Plot_Transition_Time_Tolerance.value()]
#sort out data depending on how the lines are filled. If no line has more than one entry, sort out points that do not fall in the tolerances. If one line has more than one entry, create multiple plots. If more than one line has entries, return error.
ind = []
lens = I = [len(x) for x in [B_sort,T_sort,S_sort,TT_sort] if len(x) > 1]
if len(lens) == 0: #no line has more than one entry => only sort out points that do not fall in the tolerances
for i,n in enumerate(names):
skip = False #if skip is True, the index will not be appended to ind. Default is False
point_data = [self.cooldowns[n].B_start[1], self.cooldowns[n].gradient_average[0],
self.cooldowns[n].rate[0], self.cooldowns[n].trans_time] #get data of the point which will be compared to the sort values.
for d,s,t in zip(point_data,sort,tolerances): #go through all sorting values, if any condition is not fullfilled the index is not appended to ind
if s != ['']: #check is the sorting value is not empty. If it is empty, the loop iteration is not skipped
if abs(d - s[0]) >= t: #check if the point is within the tolerances
skip = True #only if the point does not fall within the tolerances, skip is set to True and index will not be appended to ind
if skip == False:
ind.append(i) #append index of points that fall in the tolerances
self.active_points = ind #save indeces of activated points in so it can be used in "find_opint_name" and "export points"
#plot data
#adjust length of e_B_TF
e_B_TF = e_B_TF[ind]
#clear graph widgets and add new plots
for i,w in enumerate([self.graphWidget_B, self.graphWidget_Gradient,
self.graphWidget_CooldownSpeed, self.graphWidget_transitiontime,
self.graphWidget_WM_x, self.graphWidget_WM_y, self.graphWidget_WM_z]):
w.clear()
if i == 0: #graph B
self.scatter_B = pg.ScatterPlotItem(x = B_start[ind,1], y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
err = pg.ErrorBarItem(x = B_start[ind,1], y = B_TF[ind], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_B)
self.scatter_B.sigClicked.connect(self.find_point_name)
elif i == 1: #graph gradient
self.scatter_Gradient = pg.ScatterPlotItem(x = gradient[ind,0],y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
err = pg.ErrorBarItem(x = gradient[ind,0], y = B_TF[ind], left = gradient[ind,1], right = gradient[ind,1], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_Gradient)
self.scatter_Gradient.sigClicked.connect(self.find_point_name)
elif i == 2: #graph cooldown speed
self.scatter_CooldownSpeed = pg.ScatterPlotItem(x = rate[ind,0], y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
err = pg.ErrorBarItem(x = rate[ind,0], y = B_TF[ind], left = rate[ind,1], right = rate[ind,1], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_CooldownSpeed)
self.scatter_CooldownSpeed.sigClicked.connect(self.find_point_name)
elif i == 3: #graph transition time
self.scatter_transitionTime = pg.ScatterPlotItem(x = trans_time[ind,0], y = B_TF[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
err = pg.ErrorBarItem(x = trans_time[ind,0], y = B_TF[ind], top = e_B_TF, bottom = e_B_TF, pen=pg.mkPen(color = self.mcol[0], width = 2))
w.addItem(self.scatter_transitionTime)
self.scatter_transitionTime.sigClicked.connect(self.find_point_name)
elif i == 4: #graph wavemagnitude x
self.scatter_WM_x = pg.ScatterPlotItem(x = trans_time[ind,0], y = WM_x[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
w.addItem(self.scatter_WM_x)
self.scatter_WM_x.sigClicked.connect(self.find_point_name)
continue #do not add errorbaritem to plot
elif i == 5: #graph wavemagnitude x
self.scatter_WM_y = pg.ScatterPlotItem(x = trans_time[ind,0], y = WM_y[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
w.addItem(self.scatter_WM_y)
self.scatter_WM_y.sigClicked.connect(self.find_point_name)
continue #do not add errorbaritem to plot
elif i == 6: #graph wavemagnitude x
self.scatter_WM_z = pg.ScatterPlotItem(x = trans_time[ind,0], y = WM_z[ind], pen=pg.mkPen(color = self.mcol[0]), brush = pg.mkBrush(color = self.mcol[0]), symbol ='x', hoverable = True, size = 10)
w.addItem(self.scatter_WM_z)
self.scatter_WM_z.sigClicked.connect(self.find_point_name)
continue #do not add errorbaritem to plot
w.addItem(err)
elif len(lens) == 1: #one line has more than one entry. So a set of plots should be generated from this line
ind_dict = {} #dictionary in which the sorted data will be saved
labels = [] #list in which labels of plots will be saved
#find sorting list with more than one entry
I = [i for i,x in enumerate(sort) if len(x) > 1]
I = I[0]
if len(B_sort) > 1:
for B in B_sort: #Find indices of data points where B = value in B_sort
ind = [i for i,x in enumerate(B_start[:,1]) if abs(x-B)<tolerances[0]]
ind_dict[str(B)] = ind
labels.append(f"B = {B} µT")
elif len(T_sort) > 1:
for T in T_sort: #Find indices of data points where Gradient = value in T_sort
ind = [i for i,x in enumerate(gradient[:,0]) if abs(x-T)<tolerances[1]]
ind_dict[str(T)] = ind
labels.append(f"nabla T = {T} K/cm")
elif len(S_sort) > 1:
for S in S_sort: #Find indices of data points where cooldownrate = value in S_sort
ind = [i for i,x in enumerate(rate[:,0]) if abs(x-S)<tolerances[2]]
ind_dict[str(S)] = ind
labels.append(f"rate = {S} K/s")
elif len(TT_sort) > 1:
for TT in TT_sort: #Find indices of data points where TransitionTime = value in TT_sort
ind = [i for i,x in enumerate(trans_time[:,0]) if abs(x-TT)<tolerances[3]]
ind_dict[str(TT)] = ind
labels.append(f"Transition time = {TT} s")
#kick out any points that do not fall in the tolerances of the other lines
sort.pop(I) #pop out the sorting list with more than one entry wich is already used for sorting
tolerances.pop(I)
for key in ind_dict.keys(): #go through all points in ind_dict
pop=[] #list of indices to be popped out because to do not fit the tolerances
for i,ind in enumerate(ind_dict[key]):
point_data = [B_start[ind,1], gradient[ind,0], rate[ind,0], trans_time[ind]]
point_data.pop(I) #pop out data of sorting list which is already used
for d,s,t in zip(point_data,sort,tolerances): #go through all sorting values, if any condition is not fullfilled index is removed from the dictionary
if s != ['']: #check is the sorting value is not empty. If it is empty, the loop iteration is not skipped
if abs(d - s[0]) >= t: #check if the point outside the tolerance
pop.append(i)
break #get out of loop so no more indices are deleted
#delete indices that are in pop
ind_dict[key] = [x for i,x in enumerate(ind_dict[key]) if i not in pop]
#clear all graph widgets, add a legend and add new scatter plots
for i,w in enumerate([self.graphWidget_B, self.graphWidget_Gradient, self.graphWidget_CooldownSpeed, self.graphWidget_transitiontime]):
w.clear()
w.addLegend()
#add new scatter and errorbars to plots
for n,key in enumerate(ind_dict.keys()):
if i == 0: #graph B
scatter = pg.ScatterPlotItem(x = B_start[ind_dict[key],1], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
err = pg.ErrorBarItem(x = B_start[ind_dict[key],1], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_B.addItem(scatter)
self.graphWidget_B.addItem(err)
if i == 1: #graph gradient
scatter = pg.ScatterPlotItem(x = gradient[ind_dict[key],0], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
err = pg.ErrorBarItem(x = gradient[ind_dict[key],0], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], left = gradient[ind_dict[key],1], right = gradient[ind_dict[key],1], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_Gradient.addItem(scatter)
self.graphWidget_Gradient.addItem(err)
if i == 2: #graph cooldown rate
scatter = pg.ScatterPlotItem(x = rate[ind_dict[key],0], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
err = pg.ErrorBarItem(x = rate[ind_dict[key],0], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], left = rate[ind_dict[key],1], right = rate[ind_dict[key],1], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_CooldownSpeed.addItem(scatter)
self.graphWidget_CooldownSpeed.addItem(err)
if i == 3: #graph transition time
scatter = pg.ScatterPlotItem(x = trans_time[ind_dict[key],0], y = B_TF[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
err = pg.ErrorBarItem(x = trans_time[ind_dict[key],0], y = B_TF[ind_dict[key]], top = e_B_TF[:len(ind_dict[key])], bottom = e_B_TF[:len(ind_dict[key])], pen=pg.mkPen(color = self.mcol[n], width = 2))
self.graphWidget_transitiontime.addItem(scatter)
self.graphWidget_transitiontime.addItem(err)
if i == 4: #graph transition time
scatter = pg.ScatterPlotItem(x = trans_time[ind_dict[key],0], y = WM_x[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
self.graphWidget_WM_x.addItem(scatter)
if i == 5: #graph transition time
scatter = pg.ScatterPlotItem(x = trans_time[ind_dict[key],0], y = WM_y[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
self.graphWidget_WM_y.addItem(scatter)
if i == 6: #graph transition time
scatter = pg.ScatterPlotItem(x = trans_time[ind_dict[key],0], y = WM_z[ind_dict[key]], pen=pg.mkPen(color = self.mcol[n]), brush = pg.mkBrush(color = self.mcol[n]), symbol =self.marker[n], hoverable = True, size = 10, name = labels[n])
self.graphWidget_WM_z.addItem(scatter)
elif len(lens) > 1:
print('ERROR: more than one sorting line has more than one entry. Please select only one line with more than one entry. Aborting...')
return
def find_point_name(self, graph, points, ev):
if len(points) == 1:
ind = points[0].index()
selected_points = self.listWidget_points.selectedIndexes()
I = self.active_points[ind]
name = selected_points[I].data()
print(name)
def select_data(self, raw_data, B_Array, TF_Array): #selects data for plotting depending on line_Plot_B_Field, line_Plot_T_Gradients, line_Plot_Cooldown_Speed. B_Array needed since one can select specific B_values to be plotted
Array_length = len(raw_data) #Array length of raw_data / B_Array / TF_Array
Array_width = len(raw_data[0,:])
#Convert string (of line) into list of floats
if self.line_Plot_B_Field.text() != '':
B_select_string = self.line_Plot_B_Field.text().split(",")
B_select = [float(x) for x in B_select_string]
else:
B_select = []
if self.line_Plot_T_Gradients.text() != '':
Gradient_select_string = self.line_Plot_T_Gradients.text().split(",")
Gradient_select = [float(x) for x in Gradient_select_string]
else:
Gradient_select = []
if self.line_Plot_Cooldown_Speed.text() != '':
Cooldown_speed_select_string = self.line_Plot_Cooldown_Speed.text().split(",")
Cooldown_speed_select = [float(x) for x in Cooldown_speed_select_string]
else:
Cooldown_speed_select = []
#Create emtpy array / empty list for filtered data as return value
raw_data_filtered = np.empty(shape=(0,Array_width))
B_Array_filtered = []
B_TF_Array_filtered = []
for i in range(0,Array_length):
B = B_Array[i]
Gradient = raw_data[i,0]
Cooldown_speed = raw_data[i,2]
#Booleans from which ALL have to be True in order to sign one measurement point (row) as filtered one
Bool1 = True
Bool2 = True
Bool3 = True
#if selection list isnt empty -> Start filtering
if B_select != []:
for B_s in B_select:
if np.absolute(B - B_s) > self.B_Tolerance:
Bool1 = False
if Gradient_select != []:
for G_s in Gradient_select:
if np.absolute(Gradient - G_s) > self.Gradient_Tolerance:
Bool2 = False
if Cooldown_speed_select != []:
for C_s in Cooldown_speed_select:
if np.absolute(Cooldown_speed - C_s) > self.Cooldown_Speed_Tolerance:
Bool3 = False
if Bool1 and Bool2 and Bool3: #If all Booleans are True: Measurement point (row) corresponds to filter settings -> Append it to filtered array / lists
raw_data_filtered = np.append(raw_data_filtered, [raw_data[i,:]], axis=0)
B_Array_filtered.append(B)
B_TF_Array_filtered.append(TF_Array[i])
return [raw_data_filtered, B_Array_filtered, B_TF_Array_filtered]
def set_Tolerances(self):
#Set tolerance values for filtering
self.B_Tolerance = self.dSB_Plot_B_Field_Tolerance.value()
self.Gradient_Tolerance = self.dSB_Plot_T_Gradients_Tolerance.value()
self.Cooldown_Speed_Tolerance = self.dSB_Plot_Cooldown_Speed_Tolerance.value()
self.Transition_Time_Tolerance = self.dSB_Plot_Transition_Time_Tolerance.value()
self.update_plots()
def set_plot_settings(self, value):
#Set plot settings (mean B-value of all AMR-sensors / absolute value of single sensor / single sensor direction)
self.select_mean_single = value
#set the right entries in qComboBox_select_sensor
if self.select_mean_single == 0: #Mean of all absolute values (all sensors)
self.comboBox_select_sensor.setEnabled(False)
self.comboBox_select_sensor.clear()
elif self.select_mean_single == 1: #Absolute value of one sensor
self.comboBox_select_sensor.setEnabled(True)
self.comboBox_select_sensor.clear()
for i in range(1,16): #Add 15 values
self.comboBox_select_sensor.addItem("Sensor "+str(i))
elif self.select_mean_single == 2: #Value of single sensor in one direction
self.comboBox_select_sensor.setEnabled(True)
self.comboBox_select_sensor.clear()
#Add 45 values
for direction in ["x", "y", "z"]:
for i in range(1,16):
self.comboBox_select_sensor.addItem("Sensor "+str(i) +" "+str(direction))
# self.update_plots()
def export_acitve_points(self):
'''creates list of names of points currently displayed and saves this list in a txt file.
Does not work if multiple plots are displayed'''
selected_points = self.listWidget_points.selectedIndexes()
names = [selected_points[i].data() for i in self.active_points]
fname = QFileDialog.getSaveFileName(self, 'Open file', r'D:',"*.txt")[0]
with open(fname, 'w') as file:
for name in names:
file.write(name + '\n')
def nearest_value_in_array(self, array, value): #Returns index of closest entry in array compared to value
index = (np.abs(array - value)).argmin()
return(index)
def set_default(self):
#saves current set values to txt file in subdirectory configs. All entries that are saved are defined in self.lines_config
#Overwrites old values in config file.
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\analyse_cooldowns_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for l in self.dSB_all:
temp = f"{l.value()}"
file.write(temp+'\t')
for l in self.lines_config_strings:
file.write(l.text()+'\t')
for c in self.checkboxes_config:
file.write(str(c.isChecked())+'\t')
for c in self.combobox_config:
file.write(str(c.currentIndex())+'\t')
file.write('\n')
file.close
def read_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. Then self.change is set to true so values are send
#to device. (If no config file exists, it does nothing.)
current_dir = os.path.dirname(os.path.abspath(__file__))
path = current_dir+'\\configs\\analyse_cooldowns_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
print('no config file found on')
print(path)
return
for SB,v in zip(self.dSB_all,vals[0]):
v = float(v) #convert string in txt to float, so number can be formatted according to "formats" when it's set
SB.setValue(v)
for l,v in zip(self.lines_config_strings,vals[0][len(self.dSB_all):]):
l.setText(v)
for c,v in zip(self.checkboxes_config,vals[0][len(self.dSB_all)+len(self.lines_config_strings):]):
c.setChecked(v == 'True')
for c,v in zip(self.combobox_config,vals[0][len(self.dSB_all)+len(self.lines_config_strings)+len(self.checkboxes_config):]):
c.setCurrentIndex(int(v))
self.change = True
def closeEvent(self,event): #when window is closed self.running is set to False, so all threads stop
self.running = False
self.w = None
time.sleep(1)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,160 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import os,sys
import numpy as np
import pyqtgraph as pg
import datetime,time
from design_files.Raw_data_design import Ui_MainWindow
def smooth_transition(x, a, b, c, x0):
"""
A function that is constant before t0 and transitions smoothly into a linear function after t0.
Parameters:
t : array-like, time values
t0 : float, transition point
a : float, constant value before t0
b : float, slope of the linear function after t0
c : float, controls the smoothness of the transition
Returns:
array-like, function values
"""
return a + (b * (x - x0)) / (1 + np.exp(-c * np.clip(x - x0, -100, 100)))
# Define linear fit function:
def linear_fit(x, a, b):
'''
Linear function for fitting of CRAFT data
'''
return a+b*x
class RawdataWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(self.current_dir)
#import Gui from QT designer file
super(RawdataWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plots
self.plot_widgets = [self.graphWidget_AMR_mag,self.graphWidget_AMR_x,self.graphWidget_AMR_y,self.graphWidget_AMR_z,self.graphWidget_FG,self.graphWidget_T] #list of all plots for easier handling
self.plot_colors = ['#a6cee3', '#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6','#6a3d9a','#e7298a','#b15928','#016c59','#d9d9d9','#000000'] #list of colors for plot
self.plots_T = [i for i in range(8)] #will contain all plots in temperature grapgh widget. Is already the correct lengths, so the right amount of plots are created for the widget. Contains numbers from 0 to the number of plots so the elements can also be used as index below.
self.plots_fluxgate = [i for i in range(3)] #will contain all plots in Fluxgate grapgh widget. Is already the correct lengths, so the right amount of plots are created for the widget. Contains numbers from 0 to the number of plots so the elements can also be used as index below.
self.plots_AMR_x = [i for i in range(15)] #will contain all plots in AMR_x grapgh widget. Is already the correct lengths, so the right amount of plots are created for the widget. Contains numbers from 0 to the number of plots so the elements can also be used as index below.
self.plots_AMR_y = [i for i in range(15)] #will contain all plots in AMR_y grapgh widget. Is already the correct lengths, so the right amount of plots are created for the widget. Contains numbers from 0 to the number of plots so the elements can also be used as index below.
self.plots_AMR_z = [i for i in range(15)] #will contain all plots in AMR_z grapgh widget. Is already the correct lengths, so the right amount of plots are created for the widget. Contains numbers from 0 to the number of plots so the elements can also be used as index below.
self.plots_AMR_mag = [i for i in range(15)] #will contain all plots in AMR_mag grapgh widget. Is already the correct lengths, so the right amount of plots are created for the widget. Contains numbers from 0 to the number of plots so the elements can also be used as index below.
self.plots_grad = [i for i in range(1)] #will contain all plots in grad_loc grapgh widget. Is already the correct lengths, so the right amount of plots are created for the widget. Contains numbers from 0 to the number of plots so the elements can also be used as index below.
self.plots_ind_T = [i for i in range(8)]
self.plot_sets = [self.plots_AMR_mag, self.plots_AMR_x, self.plots_AMR_y, self.plots_AMR_z, self.plots_fluxgate, self.plots_T]#list of all plot-sets. Each plot-set contains all plots of one graph widget
self.pens = [pg.mkPen(color = c, width = 2) for c in self.plot_colors]
self.titles = ['AMR Magnitude', 'AMR x', 'AMR y', 'AMR z', 'Fluxgates', 'Temperature'] #Plot titles
self.ylabel = ['B [µT]', 'B [µT]', 'B [µT]', 'B [µT]', 'B [µT]', 'Temperature [K]'] #y axis labels for plots
self.axis = [] #list of axis. They are needed to set x axis to time. List is filled below
#all plots with time on x axis
for i in range(len(self.plot_widgets)): #fill list with axis
self.axis.append(pg.DateAxisItem())
for widget, title, label, axis, plot_set in zip(self.plot_widgets, self.titles, self.ylabel, self.axis, self.plot_sets):
#setup background, title, labels, grid, and time axis
widget.setBackground('w')
widget.setTitle(title)
widget.setLabel('left', label)
widget.setLabel('bottom', 'Temperature')
widget.showGrid(x= True, y= True, alpha = 0.5)
widget.setAxisItems({'bottom':axis})
temp = [time.time(),time.time()-1]
for i in plot_set: #since plot_set so far just contains numbers from 0 to the number of desired plots, the elements can also be used as index
plot_set[i] = (widget.plot(temp,[1,0],pen = self.pens[i]))
# plot_set[i].clear()
#local gradient plot
self.graphWidget_grad_loc.setBackground('w')
self.graphWidget_grad_loc.setTitle("local gradient")
self.graphWidget_grad_loc.setLabel('bottom', 'Sensor (1 at top edge)')
self.graphWidget_grad_loc.setLabel('left', 'dT/dz [K/cm]')
self.plots_grad[0] = (self.graphWidget_grad_loc.plot([1,0],[1,0],color = self.plot_colors[0],symbol = 'x',symbolsize = 20))
#define signals and slots
#define constants
self.mcol = ["#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F","#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F"] #define matlab colors
self.marker = ['o','s','t','d','+','p','x','arrow_up','t1','h','crosshair','t3','star','arrow_down']
self.pen_lines = pg.mkPen(color = 'k', width = 1)
self.pen_B_lines = pg.mkPen(color = 'r', width = 1)
self.lines = [] #list will store vertical lines for later delation
def update_plots(self,times,data,grad_loc,indices, Wave_mag, popt_T1,popt_T2, act_sens, T_c):
#clear temperature plot
self.graphWidget_T.clear()
#calculate AMR magnitude
AMR_mag = np.zeros(shape = (len(data[:,0]),15))
for j in range(15):
for i in range(len(data[:,0])):
AMR_mag[i,j] = np.sqrt(data[i,j+8]**2 + data[i,j+23]**2 + data[i,j+38]**2)
timestamps = [t.timestamp() for t in times]
#plot horizontal line in temperature plot as T_c
if type(T_c) == float:
self.graphWidget_T.addLine(y = T_c, pen = self.pen_lines)
else:
self.graphWidget_T.addLine(y = T_c[0], pen = self.pen_lines)
self.graphWidget_T.addLine(y = T_c[1], pen = self.pen_lines)
#plot vertical lines for temperature at indices in temperature, AMR_x, AMR_y, AMR_z and fluxgate plots
#delete lines that are stored in self.xlines
for line in self.lines:
for widget in self.plot_widgets:
widget.removeItem(line)
for widget in self.plot_widgets:#create new lines
for i in indices[:-3]: #ignore the last 3 indices which correspond to the magnetic field
self.lines.append(widget.addLine(x = timestamps[i], pen = self.pen_lines))
#plot vertical lines for magnetic field at last three indices in temperature, AMR_x, AMR_y, AMR_z and fluxgate plots
for widget in self.plot_widgets:#create new lines
# for i in indices[-3]: #To plot all just uncomment
self.lines.append(widget.addLine(x = timestamps[indices[-2]], pen = self.pen_B_lines)) #only plot where expelled flux point is taken, since the other two and at the beginning and end anyways.
# #plot horizontal line in AMR plots at wave magnitude
# self.lines.append(self.graphWidget_AMR_x.addLine(y = Wave_mag[0], pen = self.pen_B_lines))
# self.lines.append(self.graphWidget_AMR_y.addLine(y = Wave_mag[1], pen = self.pen_B_lines))
# self.lines.append(self.graphWidget_AMR_z.addLine(y = Wave_mag[2], pen = self.pen_B_lines))
#set data in AMR plots
for set,ydata in zip(self.plot_sets,[AMR_mag, data[:,8:23], data[:,23:38], data[:,38:53], data[:,53:56]]):
for i,plot in enumerate(set):
plot.setData(timestamps,ydata[:,i])
#set data in temperature plot
for i in act_sens:
self.graphWidget_T.plot(timestamps,data[:,i-1], pen = self.pens[i-1])
#set data in gradient plot
if type(popt_T1) == int: #if CRAFT data is analysed, local gradients are not plotted
x = [i+1 for i in range(8)]
self.plots_grad[0].setData(x,grad_loc)
#plot fits in temperature plot from popt_T1 and popt_T2 values, if they are given (not zero)
if type(popt_T1) == np.ndarray:
x = np.linspace(0, popt_T1[-1] - popt_T1[-2], 100)
x_plot = np.linspace(popt_T1[-2], popt_T1[-1], 100)
self.graphWidget_T.plot(x = x_plot,
y = smooth_transition(x, *popt_T1[:4]), pen = self.pens[-1])
self.graphWidget_T.plot(x = x_plot,
y = smooth_transition(x, *popt_T2[:4]), pen = self.pens[-1])

View File

@ -0,0 +1 @@
0.0 0.0 0.0 0.0 16.0 20.5 D:\Glaskryostat\Data\2025-04-01 Nb3SN-Nb-Cu-HZB-SI\points D:\Glaskryostat\Data\2025-04-01 Nb3SN-Nb-Cu-HZB-SI True False False False False False False True True 0

View File

@ -0,0 +1,924 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1922</width>
<height>1101</height>
</rect>
</property>
<property name="windowTitle">
<string>Analyse Cooldowns</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1902</width>
<height>1040</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
<widget class="PlotWidget" name="graphWidget_transitiontime" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Summary files to include</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QListWidget" name="listWidget_files_summary">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="button_refresh_summary">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="button_select_all_summary">
<property name="text">
<string>Select all</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Raw files to include</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QListWidget" name="listWidget_files_raw">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="button_refresh_raw">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="button_select_all_raw">
<property name="text">
<string>Select all</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="line_path_data">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>230</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>230</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>D:\Glaskryostat\Data\Summary\calibrated_data</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Data Path</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_path_points">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>D:\Glaskryostat\Data\Summary\points</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Summary Path</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="button_import">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Import</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="button_import_cd">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Import Cooldowns</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="PlotWidget" name="graphWidget_B" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="PlotWidget" name="graphWidget_WM_x" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="3">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Active cernox</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select Points</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="10" colspan="3">
<widget class="QListWidget" name="listWidget_points">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QCheckBox" name="checkBox_CRAFT">
<property name="text">
<string>CRAFT</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QLabel" name="label_9">
<property name="text">
<string>T_c Top</string>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="QLabel" name="label_10">
<property name="text">
<string>T_c Bottom</string>
</property>
</widget>
</item>
<item row="1" column="3" rowspan="10">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox_C_1">
<property name="text">
<string>Cernox 1</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_C__2">
<property name="text">
<string>Cernox 2</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_C_3">
<property name="text">
<string>Cernox 3</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_C_4">
<property name="text">
<string>Cernox 4</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_C_5">
<property name="text">
<string>Cernox 5</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_C_6">
<property name="text">
<string>Cernox 6</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_C_7">
<property name="text">
<string>Cernox 7</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_C_8">
<property name="text">
<string>Cernox 8</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="11" column="3">
<widget class="QPushButton" name="button_clear_points">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Clear cooldowns</string>
</property>
</widget>
</item>
<item row="11" column="4">
<widget class="QPushButton" name="button_save_cooldowns">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Save cooldowns</string>
</property>
</widget>
</item>
<item row="11" column="1" colspan="2">
<widget class="QPushButton" name="button_select_good_points">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select good cd</string>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="QDoubleSpinBox" name="dSB_Tc_top">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="singleStep">
<double>0.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="4" rowspan="2">
<widget class="QDoubleSpinBox" name="dSB_Tc">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="singleStep">
<double>0.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="button_start_analysis">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QPushButton" name="button_select_all_points">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select all</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="label_6">
<property name="text">
<string>T_c</string>
</property>
</widget>
</item>
<item row="10" column="4">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="4">
<widget class="QDoubleSpinBox" name="dSB_Tc_bottom">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="singleStep">
<double>0.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="2">
<widget class="PlotWidget" name="graphWidget_free" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="PlotWidget" name="graphWidget_Gradient" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::WheelFocus</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="PlotWidget" name="graphWidget_CooldownSpeed" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="PlotWidget" name="graphWidget_WM_y" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="PlotWidget" name="graphWidget_WM_z" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>230</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_8">
<item row="10" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Tolerance (+/-)</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="line_Plot_B_Field">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_T_Gradients_Tolerance">
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="line_Plot_T_Gradients">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_B_Field_Tolerance">
<property name="maximum">
<double>999.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="line_Plot_Cooldown_Speed">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_20">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot settings</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_Cooldown_Speed_Tolerance">
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot T-Gradients [K/cm]</string>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QPushButton" name="button_export_points">
<property name="text">
<string>Export current points</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_19">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot dT/dt [K/s]</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot transition time [s]</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<widget class="QPushButton" name="button_update_plots">
<property name="text">
<string>Update Plots</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot B-fields [µT] (y-direction)</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="line_Plot_Transition_Time">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QComboBox" name="comboBox_plot_settings">
<item>
<property name="text">
<string>Mean of all sensors</string>
</property>
</item>
<item>
<property name="text">
<string>Single sensor (absolute value)</string>
</property>
</item>
<item>
<property name="text">
<string>Single sensor direction</string>
</property>
</item>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QComboBox" name="comboBox_select_sensor">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_Transition_Time_Tolerance">
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBox_local_gradient">
<property name="text">
<string>Local Gradient</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Use Cernox [1-8]</string>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QSpinBox" name="SB_sensor_gradient">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1922</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionSet_default"/>
<addaction name="actionReset_default"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionSet_default">
<property name="text">
<string>Make current values default</string>
</property>
</action>
<action name="actionReset_default">
<property name="text">
<string>Reset default values</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>PlotWidget</class>
<extends>QWidget</extends>
<header>pyqtgraph</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,546 @@
# Form implementation generated from reading ui file 'Analyse_cooldown.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1922, 1101)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.scrollArea = QtWidgets.QScrollArea(parent=self.centralwidget)
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Shadow.Plain)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 1902, 1040))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.gridLayout_6 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents)
self.gridLayout_6.setObjectName("gridLayout_6")
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.graphWidget_transitiontime = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_transitiontime.sizePolicy().hasHeightForWidth())
self.graphWidget_transitiontime.setSizePolicy(sizePolicy)
self.graphWidget_transitiontime.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_transitiontime.setObjectName("graphWidget_transitiontime")
self.gridLayout.addWidget(self.graphWidget_transitiontime, 0, 2, 1, 1)
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setObjectName("gridLayout_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.gridLayout_3 = QtWidgets.QGridLayout()
self.gridLayout_3.setObjectName("gridLayout_3")
self.label_3 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy)
self.label_3.setObjectName("label_3")
self.gridLayout_3.addWidget(self.label_3, 0, 0, 1, 2)
self.listWidget_files_summary = QtWidgets.QListWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.listWidget_files_summary.sizePolicy().hasHeightForWidth())
self.listWidget_files_summary.setSizePolicy(sizePolicy)
self.listWidget_files_summary.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.MultiSelection)
self.listWidget_files_summary.setObjectName("listWidget_files_summary")
self.gridLayout_3.addWidget(self.listWidget_files_summary, 1, 0, 1, 2)
self.button_refresh_summary = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_refresh_summary.setObjectName("button_refresh_summary")
self.gridLayout_3.addWidget(self.button_refresh_summary, 2, 0, 1, 1)
self.button_select_all_summary = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_select_all_summary.setObjectName("button_select_all_summary")
self.gridLayout_3.addWidget(self.button_select_all_summary, 2, 1, 1, 1)
self.horizontalLayout_2.addLayout(self.gridLayout_3)
self.gridLayout_4 = QtWidgets.QGridLayout()
self.gridLayout_4.setObjectName("gridLayout_4")
self.label_4 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
self.label_4.setSizePolicy(sizePolicy)
self.label_4.setObjectName("label_4")
self.gridLayout_4.addWidget(self.label_4, 0, 0, 1, 2)
self.listWidget_files_raw = QtWidgets.QListWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.listWidget_files_raw.sizePolicy().hasHeightForWidth())
self.listWidget_files_raw.setSizePolicy(sizePolicy)
self.listWidget_files_raw.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.MultiSelection)
self.listWidget_files_raw.setObjectName("listWidget_files_raw")
self.gridLayout_4.addWidget(self.listWidget_files_raw, 1, 0, 1, 2)
self.button_refresh_raw = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_refresh_raw.setObjectName("button_refresh_raw")
self.gridLayout_4.addWidget(self.button_refresh_raw, 2, 0, 1, 1)
self.button_select_all_raw = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_select_all_raw.setObjectName("button_select_all_raw")
self.gridLayout_4.addWidget(self.button_select_all_raw, 2, 1, 1, 1)
self.horizontalLayout_2.addLayout(self.gridLayout_4)
self.gridLayout_2.addLayout(self.horizontalLayout_2, 3, 0, 1, 2)
self.line_path_data = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_path_data.sizePolicy().hasHeightForWidth())
self.line_path_data.setSizePolicy(sizePolicy)
self.line_path_data.setMinimumSize(QtCore.QSize(230, 0))
self.line_path_data.setMaximumSize(QtCore.QSize(230, 16777215))
self.line_path_data.setObjectName("line_path_data")
self.gridLayout_2.addWidget(self.line_path_data, 1, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy)
self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
self.line_path_points = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_path_points.sizePolicy().hasHeightForWidth())
self.line_path_points.setSizePolicy(sizePolicy)
self.line_path_points.setMinimumSize(QtCore.QSize(200, 0))
self.line_path_points.setObjectName("line_path_points")
self.gridLayout_2.addWidget(self.line_path_points, 0, 1, 1, 1)
self.label = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setObjectName("label")
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
self.button_import = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_import.sizePolicy().hasHeightForWidth())
self.button_import.setSizePolicy(sizePolicy)
self.button_import.setObjectName("button_import")
self.gridLayout_2.addWidget(self.button_import, 2, 0, 1, 1)
self.button_import_cd = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_import_cd.sizePolicy().hasHeightForWidth())
self.button_import_cd.setSizePolicy(sizePolicy)
self.button_import_cd.setObjectName("button_import_cd")
self.gridLayout_2.addWidget(self.button_import_cd, 2, 1, 1, 1)
self.gridLayout.addLayout(self.gridLayout_2, 0, 0, 1, 1)
self.graphWidget_B = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_B.sizePolicy().hasHeightForWidth())
self.graphWidget_B.setSizePolicy(sizePolicy)
self.graphWidget_B.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_B.setObjectName("graphWidget_B")
self.gridLayout.addWidget(self.graphWidget_B, 0, 1, 1, 1)
self.graphWidget_WM_x = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_WM_x.sizePolicy().hasHeightForWidth())
self.graphWidget_WM_x.setSizePolicy(sizePolicy)
self.graphWidget_WM_x.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_WM_x.setObjectName("graphWidget_WM_x")
self.gridLayout.addWidget(self.graphWidget_WM_x, 0, 3, 1, 1)
self.gridLayout_5 = QtWidgets.QGridLayout()
self.gridLayout_5.setObjectName("gridLayout_5")
self.label_7 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_7.setObjectName("label_7")
self.gridLayout_5.addWidget(self.label_7, 0, 3, 1, 1)
self.label_5 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth())
self.label_5.setSizePolicy(sizePolicy)
self.label_5.setObjectName("label_5")
self.gridLayout_5.addWidget(self.label_5, 0, 0, 1, 3)
self.listWidget_points = QtWidgets.QListWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.listWidget_points.sizePolicy().hasHeightForWidth())
self.listWidget_points.setSizePolicy(sizePolicy)
self.listWidget_points.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.MultiSelection)
self.listWidget_points.setObjectName("listWidget_points")
self.gridLayout_5.addWidget(self.listWidget_points, 1, 0, 10, 3)
self.checkBox_CRAFT = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_CRAFT.setObjectName("checkBox_CRAFT")
self.gridLayout_5.addWidget(self.checkBox_CRAFT, 5, 4, 1, 1)
self.label_9 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_9.setObjectName("label_9")
self.gridLayout_5.addWidget(self.label_9, 6, 4, 1, 1)
self.label_10 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_10.setObjectName("label_10")
self.gridLayout_5.addWidget(self.label_10, 8, 4, 1, 1)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.checkBox_C_1 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C_1.setChecked(True)
self.checkBox_C_1.setObjectName("checkBox_C_1")
self.verticalLayout.addWidget(self.checkBox_C_1)
self.checkBox_C__2 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C__2.setChecked(True)
self.checkBox_C__2.setObjectName("checkBox_C__2")
self.verticalLayout.addWidget(self.checkBox_C__2)
self.checkBox_C_3 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C_3.setChecked(True)
self.checkBox_C_3.setObjectName("checkBox_C_3")
self.verticalLayout.addWidget(self.checkBox_C_3)
self.checkBox_C_4 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C_4.setChecked(True)
self.checkBox_C_4.setObjectName("checkBox_C_4")
self.verticalLayout.addWidget(self.checkBox_C_4)
self.checkBox_C_5 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C_5.setChecked(True)
self.checkBox_C_5.setObjectName("checkBox_C_5")
self.verticalLayout.addWidget(self.checkBox_C_5)
self.checkBox_C_6 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C_6.setChecked(True)
self.checkBox_C_6.setObjectName("checkBox_C_6")
self.verticalLayout.addWidget(self.checkBox_C_6)
self.checkBox_C_7 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C_7.setChecked(True)
self.checkBox_C_7.setObjectName("checkBox_C_7")
self.verticalLayout.addWidget(self.checkBox_C_7)
self.checkBox_C_8 = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_C_8.setChecked(True)
self.checkBox_C_8.setObjectName("checkBox_C_8")
self.verticalLayout.addWidget(self.checkBox_C_8)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.gridLayout_5.addLayout(self.verticalLayout, 1, 3, 10, 1)
self.button_clear_points = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_clear_points.sizePolicy().hasHeightForWidth())
self.button_clear_points.setSizePolicy(sizePolicy)
self.button_clear_points.setObjectName("button_clear_points")
self.gridLayout_5.addWidget(self.button_clear_points, 11, 3, 1, 1)
self.button_save_cooldowns = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_save_cooldowns.sizePolicy().hasHeightForWidth())
self.button_save_cooldowns.setSizePolicy(sizePolicy)
self.button_save_cooldowns.setObjectName("button_save_cooldowns")
self.gridLayout_5.addWidget(self.button_save_cooldowns, 11, 4, 1, 1)
self.button_select_good_points = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_select_good_points.sizePolicy().hasHeightForWidth())
self.button_select_good_points.setSizePolicy(sizePolicy)
self.button_select_good_points.setObjectName("button_select_good_points")
self.gridLayout_5.addWidget(self.button_select_good_points, 11, 1, 1, 2)
self.dSB_Tc_top = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Tc_top.setMouseTracking(False)
self.dSB_Tc_top.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
self.dSB_Tc_top.setSingleStep(0.0)
self.dSB_Tc_top.setObjectName("dSB_Tc_top")
self.gridLayout_5.addWidget(self.dSB_Tc_top, 7, 4, 1, 1)
self.dSB_Tc = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Tc.setMouseTracking(False)
self.dSB_Tc.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
self.dSB_Tc.setSingleStep(0.0)
self.dSB_Tc.setObjectName("dSB_Tc")
self.gridLayout_5.addWidget(self.dSB_Tc, 3, 4, 2, 1)
self.button_start_analysis = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_start_analysis.sizePolicy().hasHeightForWidth())
self.button_start_analysis.setSizePolicy(sizePolicy)
self.button_start_analysis.setObjectName("button_start_analysis")
self.gridLayout_5.addWidget(self.button_start_analysis, 1, 4, 1, 1)
self.button_select_all_points = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.button_select_all_points.sizePolicy().hasHeightForWidth())
self.button_select_all_points.setSizePolicy(sizePolicy)
self.button_select_all_points.setObjectName("button_select_all_points")
self.gridLayout_5.addWidget(self.button_select_all_points, 11, 0, 1, 1)
self.label_6 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_6.setObjectName("label_6")
self.gridLayout_5.addWidget(self.label_6, 2, 4, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.gridLayout_5.addItem(spacerItem1, 10, 4, 1, 1)
self.dSB_Tc_bottom = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Tc_bottom.setMouseTracking(False)
self.dSB_Tc_bottom.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
self.dSB_Tc_bottom.setSingleStep(0.0)
self.dSB_Tc_bottom.setObjectName("dSB_Tc_bottom")
self.gridLayout_5.addWidget(self.dSB_Tc_bottom, 9, 4, 1, 1)
self.gridLayout.addLayout(self.gridLayout_5, 1, 0, 1, 1)
self.graphWidget_free = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_free.sizePolicy().hasHeightForWidth())
self.graphWidget_free.setSizePolicy(sizePolicy)
self.graphWidget_free.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_free.setObjectName("graphWidget_free")
self.gridLayout.addWidget(self.graphWidget_free, 1, 2, 1, 1)
self.graphWidget_Gradient = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_Gradient.sizePolicy().hasHeightForWidth())
self.graphWidget_Gradient.setSizePolicy(sizePolicy)
self.graphWidget_Gradient.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_Gradient.setFocusPolicy(QtCore.Qt.FocusPolicy.WheelFocus)
self.graphWidget_Gradient.setObjectName("graphWidget_Gradient")
self.gridLayout.addWidget(self.graphWidget_Gradient, 1, 1, 1, 1)
self.graphWidget_CooldownSpeed = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_CooldownSpeed.sizePolicy().hasHeightForWidth())
self.graphWidget_CooldownSpeed.setSizePolicy(sizePolicy)
self.graphWidget_CooldownSpeed.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_CooldownSpeed.setObjectName("graphWidget_CooldownSpeed")
self.gridLayout.addWidget(self.graphWidget_CooldownSpeed, 2, 1, 1, 1)
self.graphWidget_WM_y = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_WM_y.sizePolicy().hasHeightForWidth())
self.graphWidget_WM_y.setSizePolicy(sizePolicy)
self.graphWidget_WM_y.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_WM_y.setObjectName("graphWidget_WM_y")
self.gridLayout.addWidget(self.graphWidget_WM_y, 1, 3, 1, 1)
self.graphWidget_WM_z = PlotWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.graphWidget_WM_z.sizePolicy().hasHeightForWidth())
self.graphWidget_WM_z.setSizePolicy(sizePolicy)
self.graphWidget_WM_z.setMinimumSize(QtCore.QSize(420, 230))
self.graphWidget_WM_z.setObjectName("graphWidget_WM_z")
self.gridLayout.addWidget(self.graphWidget_WM_z, 2, 3, 1, 1)
self.gridLayout_8 = QtWidgets.QGridLayout()
self.gridLayout_8.setObjectName("gridLayout_8")
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.gridLayout_8.addItem(spacerItem2, 10, 1, 1, 1)
self.label_16 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_16.setObjectName("label_16")
self.gridLayout_8.addWidget(self.label_16, 0, 3, 1, 1)
self.line_Plot_B_Field = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_B_Field.sizePolicy().hasHeightForWidth())
self.line_Plot_B_Field.setSizePolicy(sizePolicy)
self.line_Plot_B_Field.setText("")
self.line_Plot_B_Field.setObjectName("line_Plot_B_Field")
self.gridLayout_8.addWidget(self.line_Plot_B_Field, 1, 2, 1, 1)
self.dSB_Plot_T_Gradients_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_T_Gradients_Tolerance.setSingleStep(0.01)
self.dSB_Plot_T_Gradients_Tolerance.setObjectName("dSB_Plot_T_Gradients_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_T_Gradients_Tolerance, 2, 3, 1, 1)
self.line_Plot_T_Gradients = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_T_Gradients.sizePolicy().hasHeightForWidth())
self.line_Plot_T_Gradients.setSizePolicy(sizePolicy)
self.line_Plot_T_Gradients.setText("")
self.line_Plot_T_Gradients.setObjectName("line_Plot_T_Gradients")
self.gridLayout_8.addWidget(self.line_Plot_T_Gradients, 2, 2, 1, 1)
self.dSB_Plot_B_Field_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_B_Field_Tolerance.setMaximum(999.0)
self.dSB_Plot_B_Field_Tolerance.setObjectName("dSB_Plot_B_Field_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_B_Field_Tolerance, 1, 3, 1, 1)
self.line_Plot_Cooldown_Speed = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_Cooldown_Speed.sizePolicy().hasHeightForWidth())
self.line_Plot_Cooldown_Speed.setSizePolicy(sizePolicy)
self.line_Plot_Cooldown_Speed.setText("")
self.line_Plot_Cooldown_Speed.setObjectName("line_Plot_Cooldown_Speed")
self.gridLayout_8.addWidget(self.line_Plot_Cooldown_Speed, 3, 2, 1, 1)
self.label_20 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_20.sizePolicy().hasHeightForWidth())
self.label_20.setSizePolicy(sizePolicy)
self.label_20.setObjectName("label_20")
self.gridLayout_8.addWidget(self.label_20, 5, 0, 1, 1)
self.dSB_Plot_Cooldown_Speed_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_Cooldown_Speed_Tolerance.setSingleStep(0.01)
self.dSB_Plot_Cooldown_Speed_Tolerance.setObjectName("dSB_Plot_Cooldown_Speed_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_Cooldown_Speed_Tolerance, 3, 3, 1, 1)
self.label_18 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_18.sizePolicy().hasHeightForWidth())
self.label_18.setSizePolicy(sizePolicy)
self.label_18.setObjectName("label_18")
self.gridLayout_8.addWidget(self.label_18, 2, 0, 1, 2)
self.button_export_points = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_export_points.setObjectName("button_export_points")
self.gridLayout_8.addWidget(self.button_export_points, 9, 1, 1, 2)
self.label_19 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_19.sizePolicy().hasHeightForWidth())
self.label_19.setSizePolicy(sizePolicy)
self.label_19.setObjectName("label_19")
self.gridLayout_8.addWidget(self.label_19, 3, 0, 1, 2)
self.label_22 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_22.sizePolicy().hasHeightForWidth())
self.label_22.setSizePolicy(sizePolicy)
self.label_22.setObjectName("label_22")
self.gridLayout_8.addWidget(self.label_22, 4, 0, 1, 2)
self.button_update_plots = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_update_plots.setObjectName("button_update_plots")
self.gridLayout_8.addWidget(self.button_update_plots, 8, 1, 1, 2)
self.label_17 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_17.sizePolicy().hasHeightForWidth())
self.label_17.setSizePolicy(sizePolicy)
self.label_17.setObjectName("label_17")
self.gridLayout_8.addWidget(self.label_17, 1, 0, 1, 2)
self.line_Plot_Transition_Time = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_Transition_Time.sizePolicy().hasHeightForWidth())
self.line_Plot_Transition_Time.setSizePolicy(sizePolicy)
self.line_Plot_Transition_Time.setText("")
self.line_Plot_Transition_Time.setObjectName("line_Plot_Transition_Time")
self.gridLayout_8.addWidget(self.line_Plot_Transition_Time, 4, 2, 1, 1)
self.comboBox_plot_settings = QtWidgets.QComboBox(parent=self.scrollAreaWidgetContents)
self.comboBox_plot_settings.setObjectName("comboBox_plot_settings")
self.comboBox_plot_settings.addItem("")
self.comboBox_plot_settings.addItem("")
self.comboBox_plot_settings.addItem("")
self.gridLayout_8.addWidget(self.comboBox_plot_settings, 5, 1, 1, 2)
self.comboBox_select_sensor = QtWidgets.QComboBox(parent=self.scrollAreaWidgetContents)
self.comboBox_select_sensor.setEnabled(False)
self.comboBox_select_sensor.setObjectName("comboBox_select_sensor")
self.gridLayout_8.addWidget(self.comboBox_select_sensor, 6, 1, 1, 2)
self.dSB_Plot_Transition_Time_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_Transition_Time_Tolerance.setSingleStep(0.1)
self.dSB_Plot_Transition_Time_Tolerance.setObjectName("dSB_Plot_Transition_Time_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_Transition_Time_Tolerance, 4, 3, 1, 1)
self.checkBox_local_gradient = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_local_gradient.setObjectName("checkBox_local_gradient")
self.gridLayout_8.addWidget(self.checkBox_local_gradient, 7, 1, 1, 1)
self.label_8 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_8.setObjectName("label_8")
self.gridLayout_8.addWidget(self.label_8, 7, 2, 1, 1)
self.SB_sensor_gradient = QtWidgets.QSpinBox(parent=self.scrollAreaWidgetContents)
self.SB_sensor_gradient.setMinimum(1)
self.SB_sensor_gradient.setMaximum(8)
self.SB_sensor_gradient.setObjectName("SB_sensor_gradient")
self.gridLayout_8.addWidget(self.SB_sensor_gradient, 7, 3, 1, 1)
self.gridLayout.addLayout(self.gridLayout_8, 2, 0, 1, 1)
self.gridLayout_6.addLayout(self.gridLayout, 0, 0, 1, 1)
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.horizontalLayout.addWidget(self.scrollArea)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1922, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Analyse Cooldowns"))
self.label_3.setText(_translate("MainWindow", "Summary files to include"))
self.button_refresh_summary.setText(_translate("MainWindow", "Refresh"))
self.button_select_all_summary.setText(_translate("MainWindow", "Select all"))
self.label_4.setText(_translate("MainWindow", "Raw files to include"))
self.button_refresh_raw.setText(_translate("MainWindow", "Refresh"))
self.button_select_all_raw.setText(_translate("MainWindow", "Select all"))
self.line_path_data.setText(_translate("MainWindow", "D:\\Glaskryostat\\Data\\Summary\\calibrated_data"))
self.label_2.setText(_translate("MainWindow", "Data Path"))
self.line_path_points.setText(_translate("MainWindow", "D:\\Glaskryostat\\Data\\Summary\\points"))
self.label.setText(_translate("MainWindow", "Summary Path"))
self.button_import.setText(_translate("MainWindow", "Import"))
self.button_import_cd.setText(_translate("MainWindow", "Import Cooldowns"))
self.label_7.setText(_translate("MainWindow", "Active cernox"))
self.label_5.setText(_translate("MainWindow", "Select Points"))
self.checkBox_CRAFT.setText(_translate("MainWindow", "CRAFT"))
self.label_9.setText(_translate("MainWindow", "T_c Top"))
self.label_10.setText(_translate("MainWindow", "T_c Bottom"))
self.checkBox_C_1.setText(_translate("MainWindow", "Cernox 1"))
self.checkBox_C__2.setText(_translate("MainWindow", "Cernox 2"))
self.checkBox_C_3.setText(_translate("MainWindow", "Cernox 3"))
self.checkBox_C_4.setText(_translate("MainWindow", "Cernox 4"))
self.checkBox_C_5.setText(_translate("MainWindow", "Cernox 5"))
self.checkBox_C_6.setText(_translate("MainWindow", "Cernox 6"))
self.checkBox_C_7.setText(_translate("MainWindow", "Cernox 7"))
self.checkBox_C_8.setText(_translate("MainWindow", "Cernox 8"))
self.button_clear_points.setText(_translate("MainWindow", "Clear cooldowns"))
self.button_save_cooldowns.setText(_translate("MainWindow", "Save cooldowns"))
self.button_select_good_points.setText(_translate("MainWindow", "Select good cd"))
self.button_start_analysis.setText(_translate("MainWindow", "Start"))
self.button_select_all_points.setText(_translate("MainWindow", "Select all"))
self.label_6.setText(_translate("MainWindow", "T_c"))
self.label_16.setText(_translate("MainWindow", "Tolerance (+/-)"))
self.label_20.setText(_translate("MainWindow", "Plot settings"))
self.label_18.setText(_translate("MainWindow", "Plot T-Gradients [K/cm]"))
self.button_export_points.setText(_translate("MainWindow", "Export current points"))
self.label_19.setText(_translate("MainWindow", "Plot dT/dt [K/s]"))
self.label_22.setText(_translate("MainWindow", "Plot transition time [s]"))
self.button_update_plots.setText(_translate("MainWindow", "Update Plots"))
self.label_17.setText(_translate("MainWindow", "Plot B-fields [µT] (y-direction)"))
self.comboBox_plot_settings.setItemText(0, _translate("MainWindow", "Mean of all sensors"))
self.comboBox_plot_settings.setItemText(1, _translate("MainWindow", "Single sensor (absolute value)"))
self.comboBox_plot_settings.setItemText(2, _translate("MainWindow", "Single sensor direction"))
self.checkBox_local_gradient.setText(_translate("MainWindow", "Local Gradient"))
self.label_8.setText(_translate("MainWindow", "Use Cernox [1-8]"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,614 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>242</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>391</width>
<height>191</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Save Path (folder):</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_savePath"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Load Path (file):</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="line_loadPath"/>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="Button_load">
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Current point</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Settling Time [s]</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="dSB_settling_time">
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>1.500000000000000</double>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="dSB_timing">
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>Voltage</string>
</property>
</item>
<item>
<property name="text">
<string>Flux density</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="lab_currentpoint">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Number of points</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="sB_nPoints">
<property name="enabled">
<bool>false</bool>
</property>
<property name="value">
<number>15</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>timing [s]</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="Button_calibrate">
<property name="text">
<string>Perform Calibration</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>409</width>
<height>18</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="action_save_default"/>
<addaction name="action_load_default"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="action_save_default">
<property name="text">
<string>Make current values default</string>
</property>
</action>
<action name="action_load_default">
<property name="text">
<string>Load default values</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,260 @@
# Form implementation generated from reading ui file 'AMR_calibration.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(409, 242)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.layoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 391, 191))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout_3 = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_5 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_5.setObjectName("label_5")
self.gridLayout_2.addWidget(self.label_5, 0, 0, 1, 1)
self.line_savePath = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_savePath.setObjectName("line_savePath")
self.gridLayout_2.addWidget(self.line_savePath, 0, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_6.setObjectName("label_6")
self.gridLayout_2.addWidget(self.label_6, 1, 0, 1, 1)
self.line_loadPath = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_loadPath.setObjectName("line_loadPath")
self.gridLayout_2.addWidget(self.line_loadPath, 1, 1, 1, 1)
self.Button_load = QtWidgets.QPushButton(parent=self.layoutWidget)
self.Button_load.setObjectName("Button_load")
self.gridLayout_2.addWidget(self.Button_load, 1, 2, 1, 1)
self.gridLayout_3.addLayout(self.gridLayout_2, 0, 0, 1, 1)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.label_2 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.label_4 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1)
self.dSB_settling_time = QtWidgets.QDoubleSpinBox(parent=self.layoutWidget)
self.dSB_settling_time.setMinimum(0.01)
self.dSB_settling_time.setProperty("value", 1.5)
self.dSB_settling_time.setObjectName("dSB_settling_time")
self.gridLayout.addWidget(self.dSB_settling_time, 1, 1, 1, 1)
self.dSB_timing = QtWidgets.QDoubleSpinBox(parent=self.layoutWidget)
self.dSB_timing.setMinimum(0.01)
self.dSB_timing.setProperty("value", 0.1)
self.dSB_timing.setObjectName("dSB_timing")
self.gridLayout.addWidget(self.dSB_timing, 5, 1, 1, 1)
self.comboBox = QtWidgets.QComboBox(parent=self.layoutWidget)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.gridLayout.addWidget(self.comboBox, 4, 0, 1, 2)
self.lab_currentpoint = QtWidgets.QLabel(parent=self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.lab_currentpoint.setPalette(palette)
self.lab_currentpoint.setAutoFillBackground(True)
self.lab_currentpoint.setObjectName("lab_currentpoint")
self.gridLayout.addWidget(self.lab_currentpoint, 2, 1, 1, 1)
self.label = QtWidgets.QLabel(parent=self.layoutWidget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.sB_nPoints = QtWidgets.QSpinBox(parent=self.layoutWidget)
self.sB_nPoints.setEnabled(True)
self.sB_nPoints.setProperty("value", 15)
self.sB_nPoints.setObjectName("sB_nPoints")
self.gridLayout.addWidget(self.sB_nPoints, 0, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
self.Button_calibrate = QtWidgets.QPushButton(parent=self.layoutWidget)
self.Button_calibrate.setObjectName("Button_calibrate")
self.gridLayout.addWidget(self.Button_calibrate, 3, 0, 1, 2)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout.addItem(spacerItem, 0, 2, 1, 1)
self.gridLayout_3.addLayout(self.gridLayout, 1, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 409, 18))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.action_save_default = QtGui.QAction(parent=MainWindow)
self.action_save_default.setObjectName("action_save_default")
self.action_load_default = QtGui.QAction(parent=MainWindow)
self.action_load_default.setObjectName("action_load_default")
self.menuFile.addAction(self.action_save_default)
self.menuFile.addAction(self.action_load_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "AMR_Calibration"))
self.label_5.setText(_translate("MainWindow", "Save Path (folder):"))
self.label_6.setText(_translate("MainWindow", "Load Path (file):"))
self.Button_load.setText(_translate("MainWindow", "Load"))
self.label_2.setText(_translate("MainWindow", "Current point"))
self.label_4.setText(_translate("MainWindow", "Settling Time [s]"))
self.comboBox.setItemText(0, _translate("MainWindow", "Voltage"))
self.comboBox.setItemText(1, _translate("MainWindow", "Flux density"))
self.lab_currentpoint.setText(_translate("MainWindow", "0"))
self.label.setText(_translate("MainWindow", "Number of points"))
self.label_3.setText(_translate("MainWindow", "timing [s]"))
self.Button_calibrate.setText(_translate("MainWindow", "Perform Calibration"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.action_save_default.setText(_translate("MainWindow", "Make current values default"))
self.action_load_default.setText(_translate("MainWindow", "Load default values"))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,929 @@
# Form implementation generated from reading ui file 'Automation_Measurement.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(664, 876)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget)
self.tabWidget.setGeometry(QtCore.QRect(10, 10, 291, 491))
self.tabWidget.setObjectName("tabWidget")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.checkBox_Unlimited_Measurements = QtWidgets.QCheckBox(parent=self.tab)
self.checkBox_Unlimited_Measurements.setEnabled(True)
self.checkBox_Unlimited_Measurements.setGeometry(QtCore.QRect(10, 140, 151, 17))
self.checkBox_Unlimited_Measurements.setObjectName("checkBox_Unlimited_Measurements")
self.layoutWidget = QtWidgets.QWidget(parent=self.tab)
self.layoutWidget.setGeometry(QtCore.QRect(10, 30, 201, 93))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.line_Min_Gradient = QtWidgets.QLineEdit(parent=self.layoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Min_Gradient.sizePolicy().hasHeightForWidth())
self.line_Min_Gradient.setSizePolicy(sizePolicy)
self.line_Min_Gradient.setObjectName("line_Min_Gradient")
self.gridLayout_2.addWidget(self.line_Min_Gradient, 0, 1, 1, 1)
self.label_20 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_20.setObjectName("label_20")
self.gridLayout_2.addWidget(self.label_20, 0, 0, 1, 1)
self.label_22 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_22.setObjectName("label_22")
self.gridLayout_2.addWidget(self.label_22, 1, 0, 1, 1)
self.line_Gradient_Stepwidth = QtWidgets.QLineEdit(parent=self.layoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Gradient_Stepwidth.sizePolicy().hasHeightForWidth())
self.line_Gradient_Stepwidth.setSizePolicy(sizePolicy)
self.line_Gradient_Stepwidth.setObjectName("line_Gradient_Stepwidth")
self.gridLayout_2.addWidget(self.line_Gradient_Stepwidth, 2, 1, 1, 1)
self.line_Max_Gradient = QtWidgets.QLineEdit(parent=self.layoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Max_Gradient.sizePolicy().hasHeightForWidth())
self.line_Max_Gradient.setSizePolicy(sizePolicy)
self.line_Max_Gradient.setObjectName("line_Max_Gradient")
self.gridLayout_2.addWidget(self.line_Max_Gradient, 1, 1, 1, 1)
self.label_23 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_23.setObjectName("label_23")
self.gridLayout_2.addWidget(self.label_23, 2, 0, 1, 1)
self.tabWidget.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.lineEdit_Gradient_List = QtWidgets.QLineEdit(parent=self.tab_2)
self.lineEdit_Gradient_List.setGeometry(QtCore.QRect(10, 160, 221, 31))
self.lineEdit_Gradient_List.setObjectName("lineEdit_Gradient_List")
self.label_19 = QtWidgets.QLabel(parent=self.tab_2)
self.label_19.setGeometry(QtCore.QRect(10, 140, 231, 19))
self.label_19.setObjectName("label_19")
self.layoutWidget_2 = QtWidgets.QWidget(parent=self.tab_2)
self.layoutWidget_2.setGeometry(QtCore.QRect(10, 30, 201, 93))
self.layoutWidget_2.setObjectName("layoutWidget_2")
self.gridLayout_3 = QtWidgets.QGridLayout(self.layoutWidget_2)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.label_25 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_25.setObjectName("label_25")
self.gridLayout_3.addWidget(self.label_25, 0, 0, 1, 1)
self.line_Min_Bext = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Min_Bext.sizePolicy().hasHeightForWidth())
self.line_Min_Bext.setSizePolicy(sizePolicy)
self.line_Min_Bext.setObjectName("line_Min_Bext")
self.gridLayout_3.addWidget(self.line_Min_Bext, 0, 1, 1, 1)
self.label_27 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_27.setObjectName("label_27")
self.gridLayout_3.addWidget(self.label_27, 2, 0, 1, 1)
self.label_26 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_26.setObjectName("label_26")
self.gridLayout_3.addWidget(self.label_26, 1, 0, 1, 1)
self.line_Stepwidth_Bext = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Stepwidth_Bext.sizePolicy().hasHeightForWidth())
self.line_Stepwidth_Bext.setSizePolicy(sizePolicy)
self.line_Stepwidth_Bext.setObjectName("line_Stepwidth_Bext")
self.gridLayout_3.addWidget(self.line_Stepwidth_Bext, 2, 1, 1, 1)
self.line_Max_Bext = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Max_Bext.sizePolicy().hasHeightForWidth())
self.line_Max_Bext.setSizePolicy(sizePolicy)
self.line_Max_Bext.setObjectName("line_Max_Bext")
self.gridLayout_3.addWidget(self.line_Max_Bext, 1, 1, 1, 1)
self.listWidget_Gradients_Progress = QtWidgets.QListWidget(parent=self.tab_2)
self.listWidget_Gradients_Progress.setGeometry(QtCore.QRect(170, 200, 61, 211))
self.listWidget_Gradients_Progress.setObjectName("listWidget_Gradients_Progress")
self.listWidget_Gradients = QtWidgets.QListWidget(parent=self.tab_2)
self.listWidget_Gradients.setGeometry(QtCore.QRect(80, 200, 81, 211))
self.listWidget_Gradients.setObjectName("listWidget_Gradients")
self.tabWidget.addTab(self.tab_2, "")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
self.tabWidget.addTab(self.tab_3, "")
self.tab_4 = QtWidgets.QWidget()
self.tab_4.setObjectName("tab_4")
self.listWidget_Bext_Progress = QtWidgets.QListWidget(parent=self.tab_4)
self.listWidget_Bext_Progress.setGeometry(QtCore.QRect(160, 30, 91, 311))
self.listWidget_Bext_Progress.setObjectName("listWidget_Bext_Progress")
self.listWidget_Bext = QtWidgets.QListWidget(parent=self.tab_4)
self.listWidget_Bext.setGeometry(QtCore.QRect(20, 30, 131, 311))
self.listWidget_Bext.setObjectName("listWidget_Bext")
self.label_38 = QtWidgets.QLabel(parent=self.tab_4)
self.label_38.setGeometry(QtCore.QRect(20, 10, 61, 19))
self.label_38.setObjectName("label_38")
self.label_39 = QtWidgets.QLabel(parent=self.tab_4)
self.label_39.setGeometry(QtCore.QRect(160, 10, 61, 19))
self.label_39.setObjectName("label_39")
self.pushButton_Perform_Compensation = QtWidgets.QPushButton(parent=self.tab_4)
self.pushButton_Perform_Compensation.setGeometry(QtCore.QRect(20, 350, 151, 21))
self.pushButton_Perform_Compensation.setObjectName("pushButton_Perform_Compensation")
self.pushButton_Abort_Compensation = QtWidgets.QPushButton(parent=self.tab_4)
self.pushButton_Abort_Compensation.setGeometry(QtCore.QRect(20, 370, 151, 21))
self.pushButton_Abort_Compensation.setObjectName("pushButton_Abort_Compensation")
self.pushButton_Compensation_Take_It = QtWidgets.QPushButton(parent=self.tab_4)
self.pushButton_Compensation_Take_It.setEnabled(False)
self.pushButton_Compensation_Take_It.setGeometry(QtCore.QRect(180, 350, 101, 21))
self.pushButton_Compensation_Take_It.setObjectName("pushButton_Compensation_Take_It")
self.line_2 = QtWidgets.QFrame(parent=self.tab_4)
self.line_2.setGeometry(QtCore.QRect(0, 390, 291, 16))
self.line_2.setFrameShape(QtWidgets.QFrame.Shape.HLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
self.line_2.setObjectName("line_2")
self.line_Bext_Compensation_Path = QtWidgets.QLineEdit(parent=self.tab_4)
self.line_Bext_Compensation_Path.setGeometry(QtCore.QRect(10, 410, 251, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Bext_Compensation_Path.sizePolicy().hasHeightForWidth())
self.line_Bext_Compensation_Path.setSizePolicy(sizePolicy)
self.line_Bext_Compensation_Path.setObjectName("line_Bext_Compensation_Path")
self.pushButton_load_Bext_Compensation = QtWidgets.QPushButton(parent=self.tab_4)
self.pushButton_load_Bext_Compensation.setGeometry(QtCore.QRect(10, 440, 101, 20))
self.pushButton_load_Bext_Compensation.setObjectName("pushButton_load_Bext_Compensation")
self.tabWidget.addTab(self.tab_4, "")
self.frame = QtWidgets.QFrame(parent=self.centralwidget)
self.frame.setGeometry(QtCore.QRect(10, 510, 621, 311))
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Plain)
self.frame.setLineWidth(3)
self.frame.setMidLineWidth(3)
self.frame.setObjectName("frame")
self.graphWidget_Temp_Top = PlotWidget(parent=self.frame)
self.graphWidget_Temp_Top.setGeometry(QtCore.QRect(10, 140, 281, 161))
self.graphWidget_Temp_Top.setObjectName("graphWidget_Temp_Top")
self.label_18 = QtWidgets.QLabel(parent=self.frame)
self.label_18.setGeometry(QtCore.QRect(10, 10, 151, 19))
font = QtGui.QFont()
font.setFamily("MS Shell Dlg 2")
font.setPointSize(14)
font.setBold(False)
font.setItalic(False)
font.setWeight(50)
self.label_18.setFont(font)
self.label_18.setObjectName("label_18")
self.layoutWidget1 = QtWidgets.QWidget(parent=self.frame)
self.layoutWidget1.setGeometry(QtCore.QRect(10, 50, 241, 82))
self.layoutWidget1.setObjectName("layoutWidget1")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget1)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.line_PID_Temperature_Time = QtWidgets.QLineEdit(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_PID_Temperature_Time.sizePolicy().hasHeightForWidth())
self.line_PID_Temperature_Time.setSizePolicy(sizePolicy)
self.line_PID_Temperature_Time.setObjectName("line_PID_Temperature_Time")
self.gridLayout.addWidget(self.line_PID_Temperature_Time, 2, 1, 1, 1)
self.label_16 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_16.setObjectName("label_16")
self.gridLayout.addWidget(self.label_16, 1, 0, 1, 1)
self.line_PID_Temperature_Tolerance = QtWidgets.QLineEdit(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_PID_Temperature_Tolerance.sizePolicy().hasHeightForWidth())
self.line_PID_Temperature_Tolerance.setSizePolicy(sizePolicy)
self.line_PID_Temperature_Tolerance.setObjectName("line_PID_Temperature_Tolerance")
self.gridLayout.addWidget(self.line_PID_Temperature_Tolerance, 1, 1, 1, 1)
self.label_17 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_17.setObjectName("label_17")
self.gridLayout.addWidget(self.label_17, 2, 0, 1, 1)
self.label_37 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_37.setObjectName("label_37")
self.gridLayout.addWidget(self.label_37, 0, 0, 1, 1)
self.line_PID_Temperature_Average_Time = QtWidgets.QLineEdit(parent=self.layoutWidget1)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_PID_Temperature_Average_Time.sizePolicy().hasHeightForWidth())
self.line_PID_Temperature_Average_Time.setSizePolicy(sizePolicy)
self.line_PID_Temperature_Average_Time.setObjectName("line_PID_Temperature_Average_Time")
self.gridLayout.addWidget(self.line_PID_Temperature_Average_Time, 0, 1, 1, 1)
self.graphWidget_Temp_Bottom = PlotWidget(parent=self.frame)
self.graphWidget_Temp_Bottom.setGeometry(QtCore.QRect(310, 140, 281, 161))
self.graphWidget_Temp_Bottom.setObjectName("graphWidget_Temp_Bottom")
self.pushButton_Stop_Waiting = QtWidgets.QPushButton(parent=self.frame)
self.pushButton_Stop_Waiting.setGeometry(QtCore.QRect(270, 99, 81, 21))
self.pushButton_Stop_Waiting.setObjectName("pushButton_Stop_Waiting")
self.layoutWidget2 = QtWidgets.QWidget(parent=self.frame)
self.layoutWidget2.setGeometry(QtCore.QRect(440, 80, 151, 53))
self.layoutWidget2.setObjectName("layoutWidget2")
self.gridLayout_7 = QtWidgets.QGridLayout(self.layoutWidget2)
self.gridLayout_7.setContentsMargins(0, 0, 0, 0)
self.gridLayout_7.setObjectName("gridLayout_7")
self.label_36 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_36.setObjectName("label_36")
self.gridLayout_7.addWidget(self.label_36, 0, 0, 1, 1)
self.line_Buffer_Length = QtWidgets.QLineEdit(parent=self.layoutWidget2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Buffer_Length.sizePolicy().hasHeightForWidth())
self.line_Buffer_Length.setSizePolicy(sizePolicy)
self.line_Buffer_Length.setObjectName("line_Buffer_Length")
self.gridLayout_7.addWidget(self.line_Buffer_Length, 0, 1, 1, 1)
self.label_21 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_21.setObjectName("label_21")
self.gridLayout_7.addWidget(self.label_21, 1, 0, 1, 1)
self.line_Plot_Seconds = QtWidgets.QLineEdit(parent=self.layoutWidget2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_Seconds.sizePolicy().hasHeightForWidth())
self.line_Plot_Seconds.setSizePolicy(sizePolicy)
self.line_Plot_Seconds.setObjectName("line_Plot_Seconds")
self.gridLayout_7.addWidget(self.line_Plot_Seconds, 1, 1, 1, 1)
self.frame_2 = QtWidgets.QFrame(parent=self.centralwidget)
self.frame_2.setGeometry(QtCore.QRect(310, 30, 321, 471))
self.frame_2.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Shadow.Plain)
self.frame_2.setLineWidth(3)
self.frame_2.setMidLineWidth(3)
self.frame_2.setObjectName("frame_2")
self.label_24 = QtWidgets.QLabel(parent=self.frame_2)
self.label_24.setGeometry(QtCore.QRect(10, 10, 181, 19))
font = QtGui.QFont()
font.setFamily("MS Shell Dlg 2")
font.setPointSize(14)
font.setBold(False)
font.setItalic(False)
font.setWeight(50)
self.label_24.setFont(font)
self.label_24.setObjectName("label_24")
self.pushButton_Start_Measurement = QtWidgets.QPushButton(parent=self.frame_2)
self.pushButton_Start_Measurement.setGeometry(QtCore.QRect(20, 300, 131, 20))
self.pushButton_Start_Measurement.setObjectName("pushButton_Start_Measurement")
self.label_34 = QtWidgets.QLabel(parent=self.frame_2)
self.label_34.setGeometry(QtCore.QRect(20, 40, 97, 19))
self.label_34.setObjectName("label_34")
self.line_Points_Folder_Path = QtWidgets.QLineEdit(parent=self.frame_2)
self.line_Points_Folder_Path.setGeometry(QtCore.QRect(120, 40, 181, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Points_Folder_Path.sizePolicy().hasHeightForWidth())
self.line_Points_Folder_Path.setSizePolicy(sizePolicy)
self.line_Points_Folder_Path.setObjectName("line_Points_Folder_Path")
self.pushButton_Stop_Measurement = QtWidgets.QPushButton(parent=self.frame_2)
self.pushButton_Stop_Measurement.setGeometry(QtCore.QRect(170, 300, 131, 20))
self.pushButton_Stop_Measurement.setObjectName("pushButton_Stop_Measurement")
self.pushButton_Calculate_Parameters = QtWidgets.QPushButton(parent=self.frame_2)
self.pushButton_Calculate_Parameters.setGeometry(QtCore.QRect(190, 380, 41, 21))
self.pushButton_Calculate_Parameters.setObjectName("pushButton_Calculate_Parameters")
self.label_3 = QtWidgets.QLabel(parent=self.frame_2)
self.label_3.setGeometry(QtCore.QRect(18, 410, 101, 19))
self.label_3.setObjectName("label_3")
self.line_time_per_cooldown = QtWidgets.QLineEdit(parent=self.frame_2)
self.line_time_per_cooldown.setEnabled(True)
self.line_time_per_cooldown.setGeometry(QtCore.QRect(130, 410, 41, 19))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_time_per_cooldown.sizePolicy().hasHeightForWidth())
self.line_time_per_cooldown.setSizePolicy(sizePolicy)
self.line_time_per_cooldown.setObjectName("line_time_per_cooldown")
self.label_4 = QtWidgets.QLabel(parent=self.frame_2)
self.label_4.setGeometry(QtCore.QRect(180, 410, 61, 19))
self.label_4.setObjectName("label_4")
self.line_total_time_needed = QtWidgets.QLabel(parent=self.frame_2)
self.line_total_time_needed.setGeometry(QtCore.QRect(250, 410, 61, 20))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_total_time_needed.setPalette(palette)
self.line_total_time_needed.setAutoFillBackground(True)
self.line_total_time_needed.setText("")
self.line_total_time_needed.setObjectName("line_total_time_needed")
self.line = QtWidgets.QFrame(parent=self.frame_2)
self.line.setGeometry(QtCore.QRect(0, 350, 321, 16))
self.line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
self.line.setObjectName("line")
self.layoutWidget3 = QtWidgets.QWidget(parent=self.frame_2)
self.layoutWidget3.setGeometry(QtCore.QRect(20, 182, 201, 111))
self.layoutWidget3.setObjectName("layoutWidget3")
self.gridLayout_4 = QtWidgets.QGridLayout(self.layoutWidget3)
self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
self.gridLayout_4.setObjectName("gridLayout_4")
self.label_29 = QtWidgets.QLabel(parent=self.layoutWidget3)
self.label_29.setObjectName("label_29")
self.gridLayout_4.addWidget(self.label_29, 0, 0, 1, 1)
self.comboBox_Current_Mode = QtWidgets.QComboBox(parent=self.layoutWidget3)
self.comboBox_Current_Mode.setObjectName("comboBox_Current_Mode")
self.comboBox_Current_Mode.addItem("")
self.comboBox_Current_Mode.addItem("")
self.comboBox_Current_Mode.addItem("")
self.gridLayout_4.addWidget(self.comboBox_Current_Mode, 0, 1, 1, 1)
self.label_30 = QtWidgets.QLabel(parent=self.layoutWidget3)
self.label_30.setObjectName("label_30")
self.gridLayout_4.addWidget(self.label_30, 1, 0, 1, 1)
self.line_Gradient = QtWidgets.QLineEdit(parent=self.layoutWidget3)
self.line_Gradient.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Gradient.sizePolicy().hasHeightForWidth())
self.line_Gradient.setSizePolicy(sizePolicy)
self.line_Gradient.setObjectName("line_Gradient")
self.gridLayout_4.addWidget(self.line_Gradient, 1, 1, 1, 1)
self.label_31 = QtWidgets.QLabel(parent=self.layoutWidget3)
self.label_31.setObjectName("label_31")
self.gridLayout_4.addWidget(self.label_31, 2, 0, 1, 1)
self.line_Bext = QtWidgets.QLineEdit(parent=self.layoutWidget3)
self.line_Bext.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Bext.sizePolicy().hasHeightForWidth())
self.line_Bext.setSizePolicy(sizePolicy)
self.line_Bext.setObjectName("line_Bext")
self.gridLayout_4.addWidget(self.line_Bext, 2, 1, 1, 1)
self.label_32 = QtWidgets.QLabel(parent=self.layoutWidget3)
self.label_32.setObjectName("label_32")
self.gridLayout_4.addWidget(self.label_32, 3, 0, 1, 1)
self.line_Speed = QtWidgets.QLineEdit(parent=self.layoutWidget3)
self.line_Speed.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Speed.sizePolicy().hasHeightForWidth())
self.line_Speed.setSizePolicy(sizePolicy)
self.line_Speed.setObjectName("line_Speed")
self.gridLayout_4.addWidget(self.line_Speed, 3, 1, 1, 1)
self.layoutWidget4 = QtWidgets.QWidget(parent=self.frame_2)
self.layoutWidget4.setGeometry(QtCore.QRect(18, 90, 241, 82))
self.layoutWidget4.setObjectName("layoutWidget4")
self.gridLayout_5 = QtWidgets.QGridLayout(self.layoutWidget4)
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
self.gridLayout_5.setObjectName("gridLayout_5")
self.line_Base_Temperature = QtWidgets.QLineEdit(parent=self.layoutWidget4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Base_Temperature.sizePolicy().hasHeightForWidth())
self.line_Base_Temperature.setSizePolicy(sizePolicy)
self.line_Base_Temperature.setObjectName("line_Base_Temperature")
self.gridLayout_5.addWidget(self.line_Base_Temperature, 0, 1, 1, 1)
self.line_Cooldown_Finished_Temperature = QtWidgets.QLineEdit(parent=self.layoutWidget4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Cooldown_Finished_Temperature.sizePolicy().hasHeightForWidth())
self.line_Cooldown_Finished_Temperature.setSizePolicy(sizePolicy)
self.line_Cooldown_Finished_Temperature.setObjectName("line_Cooldown_Finished_Temperature")
self.gridLayout_5.addWidget(self.line_Cooldown_Finished_Temperature, 1, 1, 1, 1)
self.label_33 = QtWidgets.QLabel(parent=self.layoutWidget4)
self.label_33.setObjectName("label_33")
self.gridLayout_5.addWidget(self.label_33, 1, 0, 1, 1)
self.label_28 = QtWidgets.QLabel(parent=self.layoutWidget4)
self.label_28.setObjectName("label_28")
self.gridLayout_5.addWidget(self.label_28, 0, 0, 1, 1)
self.label_35 = QtWidgets.QLabel(parent=self.layoutWidget4)
self.label_35.setObjectName("label_35")
self.gridLayout_5.addWidget(self.label_35, 2, 0, 1, 1)
self.line_Sensor_Distance = QtWidgets.QLineEdit(parent=self.layoutWidget4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Sensor_Distance.sizePolicy().hasHeightForWidth())
self.line_Sensor_Distance.setSizePolicy(sizePolicy)
self.line_Sensor_Distance.setObjectName("line_Sensor_Distance")
self.gridLayout_5.addWidget(self.line_Sensor_Distance, 2, 1, 1, 1)
self.layoutWidget5 = QtWidgets.QWidget(parent=self.frame_2)
self.layoutWidget5.setGeometry(QtCore.QRect(20, 380, 161, 21))
self.layoutWidget5.setObjectName("layoutWidget5")
self.gridLayout_6 = QtWidgets.QGridLayout(self.layoutWidget5)
self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
self.gridLayout_6.setObjectName("gridLayout_6")
self.label = QtWidgets.QLabel(parent=self.layoutWidget5)
self.label.setObjectName("label")
self.gridLayout_6.addWidget(self.label, 0, 0, 1, 1)
self.line_Number_Cooldowns = QtWidgets.QLabel(parent=self.layoutWidget5)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_Number_Cooldowns.setPalette(palette)
self.line_Number_Cooldowns.setAutoFillBackground(True)
self.line_Number_Cooldowns.setText("")
self.line_Number_Cooldowns.setObjectName("line_Number_Cooldowns")
self.gridLayout_6.addWidget(self.line_Number_Cooldowns, 0, 1, 1, 1)
self.line_Status = QtWidgets.QLabel(parent=self.frame_2)
self.line_Status.setGeometry(QtCore.QRect(63, 440, 251, 20))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_Status.setPalette(palette)
self.line_Status.setAutoFillBackground(True)
self.line_Status.setText("")
self.line_Status.setObjectName("line_Status")
self.label_2 = QtWidgets.QLabel(parent=self.frame_2)
self.label_2.setGeometry(QtCore.QRect(20, 440, 32, 16))
self.label_2.setObjectName("label_2")
self.pushButton_Pause_Measurement = QtWidgets.QPushButton(parent=self.frame_2)
self.pushButton_Pause_Measurement.setGeometry(QtCore.QRect(20, 330, 131, 20))
self.pushButton_Pause_Measurement.setObjectName("pushButton_Pause_Measurement")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 664, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(3)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Automation of Measurements"))
self.checkBox_Unlimited_Measurements.setText(_translate("MainWindow", "Unlimited Measurements"))
self.label_20.setText(_translate("MainWindow", "Min Gradient (K)"))
self.label_22.setText(_translate("MainWindow", "Max Gradient (K)"))
self.label_23.setText(_translate("MainWindow", "Gradient stepwidth (K) "))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "TF vs DT"))
self.label_19.setText(_translate("MainWindow", "List of gradients (K/cm). Separated by \";\""))
self.label_25.setText(_translate("MainWindow", "Min Bext (µT)"))
self.label_27.setText(_translate("MainWindow", "Bext stepwidth (µT)"))
self.label_26.setText(_translate("MainWindow", "Max Bext (µT)"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "TF vs Bext"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "TF vs Speed"))
self.label_38.setText(_translate("MainWindow", "Bext list"))
self.label_39.setText(_translate("MainWindow", "Status"))
self.pushButton_Perform_Compensation.setText(_translate("MainWindow", "Perform compensation"))
self.pushButton_Abort_Compensation.setText(_translate("MainWindow", "Abort compensation"))
self.pushButton_Compensation_Take_It.setText(_translate("MainWindow", "Take it"))
self.pushButton_load_Bext_Compensation.setText(_translate("MainWindow", "Load data"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _translate("MainWindow", "B Compensation"))
self.label_18.setText(_translate("MainWindow", "PID parameter"))
self.label_16.setText(_translate("MainWindow", "Temperature tolerance (K)"))
self.label_17.setText(_translate("MainWindow", "Time"))
self.label_37.setText(_translate("MainWindow", "Temp. average time (s)"))
self.pushButton_Stop_Waiting.setText(_translate("MainWindow", "Stop waiting"))
self.label_36.setText(_translate("MainWindow", "Buffer (s)"))
self.label_21.setText(_translate("MainWindow", "Plot (s)"))
self.label_24.setText(_translate("MainWindow", "General parameter"))
self.pushButton_Start_Measurement.setText(_translate("MainWindow", "Start measurement"))
self.label_34.setText(_translate("MainWindow", "Points folder path"))
self.pushButton_Stop_Measurement.setText(_translate("MainWindow", "Stop measurement"))
self.pushButton_Calculate_Parameters.setText(_translate("MainWindow", "Calc."))
self.label_3.setText(_translate("MainWindow", "Time/Cooldown (s)"))
self.label_4.setText(_translate("MainWindow", ", total time:"))
self.label_29.setText(_translate("MainWindow", "Current mode:"))
self.comboBox_Current_Mode.setItemText(0, _translate("MainWindow", "TF vs DT"))
self.comboBox_Current_Mode.setItemText(1, _translate("MainWindow", "TF vs Bext"))
self.comboBox_Current_Mode.setItemText(2, _translate("MainWindow", "TF vs Speed"))
self.label_30.setText(_translate("MainWindow", "Gradient (K/cm)"))
self.label_31.setText(_translate("MainWindow", "Bext (µT)"))
self.label_32.setText(_translate("MainWindow", "Speed (K/s)"))
self.label_33.setText(_translate("MainWindow", "Cooldown finished T (K)"))
self.label_28.setText(_translate("MainWindow", "Base temperature (K)"))
self.label_35.setText(_translate("MainWindow", "Sensor distance (cm)"))
self.label.setText(_translate("MainWindow", "Cooldowns:"))
self.label_2.setText(_translate("MainWindow", "Status:"))
self.pushButton_Pause_Measurement.setText(_translate("MainWindow", "Click to pause"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec())

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,438 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1250</width>
<height>737</height>
</rect>
</property>
<property name="windowTitle">
<string>Results</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1236</width>
<height>687</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1" rowspan="3">
<widget class="PlotWidget" name="graphWidget_B" native="true"/>
</item>
<item row="0" column="2" rowspan="3">
<widget class="PlotWidget" name="graphWidget_CooldownSpeed" native="true"/>
</item>
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout_8">
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_19">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot dT/dt [K/s]</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_Cooldown_Speed_Tolerance">
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_20">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot settings</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot T-Gradients [K/cm]</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot transition time [s]</string>
</property>
</widget>
</item>
<item row="10" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="line_Plot_B_Field">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_T_Gradients_Tolerance">
<property name="singleStep">
<double>0.010000000000000</double>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="line_Plot_T_Gradients">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="line_Plot_Cooldown_Speed">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_B_Field_Tolerance">
<property name="maximum">
<double>999.000000000000000</double>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<widget class="QComboBox" name="comboBox_select_sensor">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QComboBox" name="comboBox_plot_settings">
<item>
<property name="text">
<string>Mean of all sensors</string>
</property>
</item>
<item>
<property name="text">
<string>Single sensor (absolute value)</string>
</property>
</item>
<item>
<property name="text">
<string>Single sensor direction</string>
</property>
</item>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QPushButton" name="button_update_plots">
<property name="text">
<string>Update Plots</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Plot B-fields [µT] (y-direction)</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="line_Plot_Transition_Time">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QDoubleSpinBox" name="dSB_Plot_Transition_Time_Tolerance">
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QSpinBox" name="SB_sensor_gradient">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="label_8">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Use Cernox [1-8]</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Tolerance (+/-)</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkBox_local_gradient">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Local Gradient</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Folder Path</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="line_Path">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>d:\Profile\a2958\Eigene Dateien\Python Auslesesoftware\tf-control\test_data</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="1">
<widget class="PlotWidget" name="graphWidget_Gradient" native="true"/>
</item>
<item row="3" column="2">
<widget class="PlotWidget" name="graphWidget_TransitionTime" native="true"/>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="1">
<widget class="QPushButton" name="button_select_all">
<property name="text">
<string>Select all</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Files to include</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QListWidget" name="listWidget_files">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="button_refresh">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1250</width>
<height>18</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionSet_default"/>
<addaction name="actionReset_default"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionSet_default">
<property name="text">
<string>Make current values default</string>
</property>
</action>
<action name="actionReset_default">
<property name="text">
<string>Reset default values</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>PlotWidget</class>
<extends>QWidget</extends>
<header>pyqtgraph</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,259 @@
# Form implementation generated from reading ui file 'Result_window.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1250, 737)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.scrollArea = QtWidgets.QScrollArea(parent=self.centralwidget)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 1236, 687))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.gridLayout_2 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents)
self.gridLayout_2.setObjectName("gridLayout_2")
self.graphWidget_B = PlotWidget(parent=self.scrollAreaWidgetContents)
self.graphWidget_B.setObjectName("graphWidget_B")
self.gridLayout_2.addWidget(self.graphWidget_B, 0, 1, 3, 1)
self.graphWidget_CooldownSpeed = PlotWidget(parent=self.scrollAreaWidgetContents)
self.graphWidget_CooldownSpeed.setObjectName("graphWidget_CooldownSpeed")
self.gridLayout_2.addWidget(self.graphWidget_CooldownSpeed, 0, 2, 3, 1)
self.gridLayout_8 = QtWidgets.QGridLayout()
self.gridLayout_8.setObjectName("gridLayout_8")
self.label_19 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_19.sizePolicy().hasHeightForWidth())
self.label_19.setSizePolicy(sizePolicy)
self.label_19.setObjectName("label_19")
self.gridLayout_8.addWidget(self.label_19, 4, 0, 1, 2)
self.dSB_Plot_Cooldown_Speed_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_Cooldown_Speed_Tolerance.setSingleStep(0.01)
self.dSB_Plot_Cooldown_Speed_Tolerance.setObjectName("dSB_Plot_Cooldown_Speed_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_Cooldown_Speed_Tolerance, 4, 3, 1, 1)
self.label_20 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_20.sizePolicy().hasHeightForWidth())
self.label_20.setSizePolicy(sizePolicy)
self.label_20.setObjectName("label_20")
self.gridLayout_8.addWidget(self.label_20, 6, 0, 1, 1)
self.label_18 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_18.sizePolicy().hasHeightForWidth())
self.label_18.setSizePolicy(sizePolicy)
self.label_18.setObjectName("label_18")
self.gridLayout_8.addWidget(self.label_18, 3, 0, 1, 2)
self.label_22 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_22.sizePolicy().hasHeightForWidth())
self.label_22.setSizePolicy(sizePolicy)
self.label_22.setObjectName("label_22")
self.gridLayout_8.addWidget(self.label_22, 5, 0, 1, 2)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.gridLayout_8.addItem(spacerItem, 10, 1, 1, 1)
self.line_Plot_B_Field = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_B_Field.sizePolicy().hasHeightForWidth())
self.line_Plot_B_Field.setSizePolicy(sizePolicy)
self.line_Plot_B_Field.setText("")
self.line_Plot_B_Field.setObjectName("line_Plot_B_Field")
self.gridLayout_8.addWidget(self.line_Plot_B_Field, 2, 2, 1, 1)
self.dSB_Plot_T_Gradients_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_T_Gradients_Tolerance.setSingleStep(0.01)
self.dSB_Plot_T_Gradients_Tolerance.setObjectName("dSB_Plot_T_Gradients_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_T_Gradients_Tolerance, 3, 3, 1, 1)
self.line_Plot_T_Gradients = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_T_Gradients.sizePolicy().hasHeightForWidth())
self.line_Plot_T_Gradients.setSizePolicy(sizePolicy)
self.line_Plot_T_Gradients.setText("")
self.line_Plot_T_Gradients.setObjectName("line_Plot_T_Gradients")
self.gridLayout_8.addWidget(self.line_Plot_T_Gradients, 3, 2, 1, 1)
self.line_Plot_Cooldown_Speed = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_Cooldown_Speed.sizePolicy().hasHeightForWidth())
self.line_Plot_Cooldown_Speed.setSizePolicy(sizePolicy)
self.line_Plot_Cooldown_Speed.setText("")
self.line_Plot_Cooldown_Speed.setObjectName("line_Plot_Cooldown_Speed")
self.gridLayout_8.addWidget(self.line_Plot_Cooldown_Speed, 4, 2, 1, 1)
self.dSB_Plot_B_Field_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_B_Field_Tolerance.setMaximum(999.0)
self.dSB_Plot_B_Field_Tolerance.setObjectName("dSB_Plot_B_Field_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_B_Field_Tolerance, 2, 3, 1, 1)
self.comboBox_select_sensor = QtWidgets.QComboBox(parent=self.scrollAreaWidgetContents)
self.comboBox_select_sensor.setEnabled(False)
self.comboBox_select_sensor.setObjectName("comboBox_select_sensor")
self.gridLayout_8.addWidget(self.comboBox_select_sensor, 7, 1, 1, 2)
self.comboBox_plot_settings = QtWidgets.QComboBox(parent=self.scrollAreaWidgetContents)
self.comboBox_plot_settings.setObjectName("comboBox_plot_settings")
self.comboBox_plot_settings.addItem("")
self.comboBox_plot_settings.addItem("")
self.comboBox_plot_settings.addItem("")
self.gridLayout_8.addWidget(self.comboBox_plot_settings, 6, 1, 1, 2)
self.button_update_plots = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_update_plots.setObjectName("button_update_plots")
self.gridLayout_8.addWidget(self.button_update_plots, 9, 1, 1, 2)
self.label_17 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_17.sizePolicy().hasHeightForWidth())
self.label_17.setSizePolicy(sizePolicy)
self.label_17.setObjectName("label_17")
self.gridLayout_8.addWidget(self.label_17, 2, 0, 1, 2)
self.line_Plot_Transition_Time = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Plot_Transition_Time.sizePolicy().hasHeightForWidth())
self.line_Plot_Transition_Time.setSizePolicy(sizePolicy)
self.line_Plot_Transition_Time.setText("")
self.line_Plot_Transition_Time.setObjectName("line_Plot_Transition_Time")
self.gridLayout_8.addWidget(self.line_Plot_Transition_Time, 5, 2, 1, 1)
self.dSB_Plot_Transition_Time_Tolerance = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents)
self.dSB_Plot_Transition_Time_Tolerance.setSingleStep(0.1)
self.dSB_Plot_Transition_Time_Tolerance.setObjectName("dSB_Plot_Transition_Time_Tolerance")
self.gridLayout_8.addWidget(self.dSB_Plot_Transition_Time_Tolerance, 5, 3, 1, 1)
self.SB_sensor_gradient = QtWidgets.QSpinBox(parent=self.scrollAreaWidgetContents)
self.SB_sensor_gradient.setEnabled(False)
self.SB_sensor_gradient.setMinimum(1)
self.SB_sensor_gradient.setMaximum(8)
self.SB_sensor_gradient.setObjectName("SB_sensor_gradient")
self.gridLayout_8.addWidget(self.SB_sensor_gradient, 8, 3, 1, 1)
self.label_8 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_8.setEnabled(False)
self.label_8.setObjectName("label_8")
self.gridLayout_8.addWidget(self.label_8, 8, 2, 1, 1)
self.label_16 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_16.setObjectName("label_16")
self.gridLayout_8.addWidget(self.label_16, 1, 3, 1, 1)
self.checkBox_local_gradient = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents)
self.checkBox_local_gradient.setEnabled(False)
self.checkBox_local_gradient.setObjectName("checkBox_local_gradient")
self.gridLayout_8.addWidget(self.checkBox_local_gradient, 8, 1, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout_8, 3, 0, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_2 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy)
self.label_2.setMinimumSize(QtCore.QSize(80, 0))
self.label_2.setObjectName("label_2")
self.horizontalLayout_2.addWidget(self.label_2)
self.line_Path = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Path.sizePolicy().hasHeightForWidth())
self.line_Path.setSizePolicy(sizePolicy)
self.line_Path.setMinimumSize(QtCore.QSize(250, 0))
self.line_Path.setObjectName("line_Path")
self.horizontalLayout_2.addWidget(self.line_Path)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.gridLayout_2.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)
self.graphWidget_Gradient = PlotWidget(parent=self.scrollAreaWidgetContents)
self.graphWidget_Gradient.setObjectName("graphWidget_Gradient")
self.gridLayout_2.addWidget(self.graphWidget_Gradient, 3, 1, 1, 1)
self.graphWidget_TransitionTime = PlotWidget(parent=self.scrollAreaWidgetContents)
self.graphWidget_TransitionTime.setObjectName("graphWidget_TransitionTime")
self.gridLayout_2.addWidget(self.graphWidget_TransitionTime, 3, 2, 1, 1)
self.gridLayout_3 = QtWidgets.QGridLayout()
self.gridLayout_3.setObjectName("gridLayout_3")
self.button_select_all = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_select_all.setObjectName("button_select_all")
self.gridLayout_3.addWidget(self.button_select_all, 2, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents)
self.label_3.setObjectName("label_3")
self.gridLayout_3.addWidget(self.label_3, 0, 0, 1, 2)
self.listWidget_files = QtWidgets.QListWidget(parent=self.scrollAreaWidgetContents)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.listWidget_files.sizePolicy().hasHeightForWidth())
self.listWidget_files.setSizePolicy(sizePolicy)
self.listWidget_files.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.MultiSelection)
self.listWidget_files.setObjectName("listWidget_files")
self.gridLayout_3.addWidget(self.listWidget_files, 1, 0, 1, 2)
self.button_refresh = QtWidgets.QPushButton(parent=self.scrollAreaWidgetContents)
self.button_refresh.setObjectName("button_refresh")
self.gridLayout_3.addWidget(self.button_refresh, 2, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_3.addItem(spacerItem2, 1, 2, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout_3, 1, 0, 1, 1)
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.gridLayout.addWidget(self.scrollArea, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1250, 18))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Results"))
self.label_19.setText(_translate("MainWindow", "Plot dT/dt [K/s]"))
self.label_20.setText(_translate("MainWindow", "Plot settings"))
self.label_18.setText(_translate("MainWindow", "Plot T-Gradients [K/cm]"))
self.label_22.setText(_translate("MainWindow", "Plot transition time [s]"))
self.comboBox_plot_settings.setItemText(0, _translate("MainWindow", "Mean of all sensors"))
self.comboBox_plot_settings.setItemText(1, _translate("MainWindow", "Single sensor (absolute value)"))
self.comboBox_plot_settings.setItemText(2, _translate("MainWindow", "Single sensor direction"))
self.button_update_plots.setText(_translate("MainWindow", "Update Plots"))
self.label_17.setText(_translate("MainWindow", "Plot B-fields [µT] (y-direction)"))
self.label_8.setText(_translate("MainWindow", "Use Cernox [1-8]"))
self.label_16.setText(_translate("MainWindow", "Tolerance (+/-)"))
self.checkBox_local_gradient.setText(_translate("MainWindow", "Local Gradient"))
self.label_2.setText(_translate("MainWindow", "Folder Path"))
self.line_Path.setText(_translate("MainWindow", "d:\\Profile\\a2958\\Eigene Dateien\\Python Auslesesoftware\\tf-control\\test_data"))
self.button_select_all.setText(_translate("MainWindow", "Select all"))
self.label_3.setText(_translate("MainWindow", "Files to include"))
self.button_refresh.setText(_translate("MainWindow", "Refresh"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget

View File

@ -0,0 +1,513 @@
# Form implementation generated from reading ui file 'evaporate_LN2_design.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(267, 251)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.widget = QtWidgets.QWidget(parent=self.centralwidget)
self.widget.setGeometry(QtCore.QRect(20, 30, 150, 145))
self.widget.setObjectName("widget")
self.gridLayout = QtWidgets.QGridLayout(self.widget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.checkBox_PID = QtWidgets.QCheckBox(parent=self.widget)
self.checkBox_PID.setEnabled(False)
self.checkBox_PID.setText("")
self.checkBox_PID.setCheckable(True)
self.checkBox_PID.setObjectName("checkBox_PID")
self.gridLayout.addWidget(self.checkBox_PID, 5, 1, 1, 1)
self.label_5 = QtWidgets.QLabel(parent=self.widget)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1)
self.Label_R = QtWidgets.QLabel(parent=self.widget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.Label_R.setPalette(palette)
self.Label_R.setAutoFillBackground(True)
self.Label_R.setText("")
self.Label_R.setObjectName("Label_R")
self.gridLayout.addWidget(self.Label_R, 4, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(parent=self.widget)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
self.label = QtWidgets.QLabel(parent=self.widget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.dSB_T_stop = QtWidgets.QDoubleSpinBox(parent=self.widget)
self.dSB_T_stop.setMaximum(300.0)
self.dSB_T_stop.setObjectName("dSB_T_stop")
self.gridLayout.addWidget(self.dSB_T_stop, 0, 1, 1, 1)
self.dSB_P = QtWidgets.QDoubleSpinBox(parent=self.widget)
self.dSB_P.setObjectName("dSB_P")
self.gridLayout.addWidget(self.dSB_P, 1, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(parent=self.widget)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
self.label_4 = QtWidgets.QLabel(parent=self.widget)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 5, 0, 1, 1)
self.Label_T_is = QtWidgets.QLabel(parent=self.widget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.Label_T_is.setPalette(palette)
self.Label_T_is.setAutoFillBackground(True)
self.Label_T_is.setText("")
self.Label_T_is.setObjectName("Label_T_is")
self.gridLayout.addWidget(self.Label_T_is, 3, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(parent=self.widget)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 2, 0, 1, 1)
self.Label_P_is = QtWidgets.QLabel(parent=self.widget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.Label_P_is.setPalette(palette)
self.Label_P_is.setAutoFillBackground(True)
self.Label_P_is.setText("")
self.Label_P_is.setObjectName("Label_P_is")
self.gridLayout.addWidget(self.Label_P_is, 2, 1, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 267, 26))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionMake_current_values_default = QtGui.QAction(parent=MainWindow)
self.actionMake_current_values_default.setObjectName("actionMake_current_values_default")
self.actionReset_default_values = QtGui.QAction(parent=MainWindow)
self.actionReset_default_values.setObjectName("actionReset_default_values")
self.menuFile.addAction(self.actionMake_current_values_default)
self.menuFile.addAction(self.actionReset_default_values)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Evaporate LN2"))
self.label_5.setText(_translate("MainWindow", "R[Ohm]"))
self.label_3.setText(_translate("MainWindow", "T_is [K]"))
self.label.setText(_translate("MainWindow", "T_max [K]"))
self.label_2.setText(_translate("MainWindow", "P max [W]"))
self.label_4.setText(_translate("MainWindow", "PID"))
self.label_6.setText(_translate("MainWindow", "P is [W]"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionMake_current_values_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default_values.setText(_translate("MainWindow", "Reset default values"))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,873 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>722</width>
<height>534</height>
</rect>
</property>
<property name="windowTitle">
<string>imc Cernox Calibration</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="PlotWidget" name="graphWidget" native="true">
<property name="geometry">
<rect>
<x>340</x>
<y>10</y>
<width>371</width>
<height>281</height>
</rect>
</property>
</widget>
<widget class="QSlider" name="Slider_select_cernox">
<property name="geometry">
<rect>
<x>350</x>
<y>310</y>
<width>231</width>
<height>16</height>
</rect>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
<widget class="QPushButton" name="button_start_measurement">
<property name="geometry">
<rect>
<x>150</x>
<y>70</y>
<width>161</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Start / Cancel Measurement</string>
</property>
</widget>
<widget class="QPushButton" name="button_perform_calibration">
<property name="geometry">
<rect>
<x>150</x>
<y>200</y>
<width>161</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Perform Fit</string>
</property>
</widget>
<widget class="QComboBox" name="comboBox_Fit_Interpolation">
<property name="geometry">
<rect>
<x>20</x>
<y>200</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<item>
<property name="text">
<string>Fit</string>
</property>
</item>
<item>
<property name="text">
<string>Interpolation</string>
</property>
</item>
</widget>
<widget class="QPushButton" name="button_load_data">
<property name="geometry">
<rect>
<x>20</x>
<y>360</y>
<width>221</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Load fit data from file path</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>240</y>
<width>271</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Interpolation_res">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Interpolation resolution (points / Kelvin)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QCheckBox" name="checkBox_default_file_path">
<property name="geometry">
<rect>
<x>20</x>
<y>310</y>
<width>131</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Use default file path</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="button_load_rawdata">
<property name="geometry">
<rect>
<x>20</x>
<y>390</y>
<width>221</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Load only raw data from file path</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>600</x>
<y>310</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>#Cernox</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="line_Cernox">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>111</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Tsteps">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>T Steps (K)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="button_connect">
<property name="geometry">
<rect>
<x>11</x>
<y>22</y>
<width>65</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>330</y>
<width>221</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>File Path</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_filePath">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_2">
<property name="geometry">
<rect>
<x>20</x>
<y>110</y>
<width>171</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Equilibr_time_imc_to_LS">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>Equilibr. time (s)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>450</y>
<width>198</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>Forward data</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_LS_imc">
<item>
<property name="text">
<string>LS218</string>
</property>
</item>
<item>
<property name="text">
<string>Calibrated imc</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_3">
<property name="geometry">
<rect>
<x>20</x>
<y>140</y>
<width>171</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Equilibr_time_LS_to_imc">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Equilibr. time (s)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_37">
<property name="geometry">
<rect>
<x>200</x>
<y>110</y>
<width>131</width>
<height>22</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>imc -&gt; t -&gt; LS218</string>
</property>
</widget>
<widget class="QLabel" name="label_38">
<property name="geometry">
<rect>
<x>200</x>
<y>140</y>
<width>131</width>
<height>22</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>LS218 -&gt; t -&gt; imc</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>722</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionSet_default"/>
<addaction name="actionReset_default"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionSet_default">
<property name="text">
<string>Make current values default</string>
</property>
</action>
<action name="actionReset_default">
<property name="text">
<string>Reset default values</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>PlotWidget</class>
<extends>QWidget</extends>
<header location="global">pyqtgraph</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>line_filePath</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,960 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>722</width>
<height>552</height>
</rect>
</property>
<property name="windowTitle">
<string>imc Cernox Calibration CRAFT</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="PlotWidget" name="graphWidget" native="true">
<property name="geometry">
<rect>
<x>340</x>
<y>10</y>
<width>371</width>
<height>281</height>
</rect>
</property>
</widget>
<widget class="QSlider" name="Slider_select_cernox">
<property name="geometry">
<rect>
<x>350</x>
<y>310</y>
<width>231</width>
<height>16</height>
</rect>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
<widget class="QPushButton" name="button_start_measurement">
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>161</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Start / Cancel Measurement</string>
</property>
</widget>
<widget class="QPushButton" name="button_perform_calibration">
<property name="geometry">
<rect>
<x>150</x>
<y>230</y>
<width>161</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Perform Fit</string>
</property>
</widget>
<widget class="QComboBox" name="comboBox_Fit_Interpolation">
<property name="geometry">
<rect>
<x>20</x>
<y>230</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<item>
<property name="text">
<string>Fit</string>
</property>
</item>
<item>
<property name="text">
<string>Interpolation</string>
</property>
</item>
</widget>
<widget class="QPushButton" name="button_load_data">
<property name="geometry">
<rect>
<x>20</x>
<y>390</y>
<width>221</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Load fit data from file path</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>270</y>
<width>271</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Interpolation_res">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Interpolation resolution (points / Kelvin)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QCheckBox" name="checkBox_default_file_path">
<property name="geometry">
<rect>
<x>20</x>
<y>340</y>
<width>131</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Use default file path</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="button_load_rawdata">
<property name="geometry">
<rect>
<x>20</x>
<y>420</y>
<width>221</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Load only raw data from file path</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>600</x>
<y>310</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>#Cernox</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="line_Cernox">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>170</green>
<blue>170</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>100</y>
<width>111</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Tsteps">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>T Steps (K)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QPushButton" name="button_connect">
<property name="geometry">
<rect>
<x>11</x>
<y>22</y>
<width>65</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>360</y>
<width>221</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>File Path</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="line_filePath">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_2">
<property name="geometry">
<rect>
<x>20</x>
<y>170</y>
<width>171</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Equilibr_time_imc_to_LS">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>Equilibr. time (s)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>480</y>
<width>198</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>Forward data</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_LS_imc">
<item>
<property name="text">
<string>LS218</string>
</property>
</item>
<item>
<property name="text">
<string>Calibrated imc</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_3">
<property name="geometry">
<rect>
<x>20</x>
<y>200</y>
<width>171</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Equilibr_time_LS_to_imc">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Equilibr. time (s)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_37">
<property name="geometry">
<rect>
<x>200</x>
<y>170</y>
<width>131</width>
<height>22</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>imc -&gt; t -&gt; LS218</string>
</property>
</widget>
<widget class="QLabel" name="label_38">
<property name="geometry">
<rect>
<x>200</x>
<y>200</y>
<width>131</width>
<height>22</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>LS218 -&gt; t -&gt; imc</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget_4">
<property name="geometry">
<rect>
<x>150</x>
<y>100</y>
<width>111</width>
<height>21</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Wait_time">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_39">
<property name="text">
<string>Wait (s)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_5">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>111</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Tstart">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_40">
<property name="text">
<string>T Start (K)</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_6">
<property name="geometry">
<rect>
<x>150</x>
<y>60</y>
<width>111</width>
<height>24</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="1">
<widget class="QLineEdit" name="line_Tstop">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_41">
<property name="text">
<string>T Stop (K)</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>722</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionSet_default"/>
<addaction name="actionReset_default"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionSet_default">
<property name="text">
<string>Make current values default</string>
</property>
</action>
<action name="actionReset_default">
<property name="text">
<string>Reset default values</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>PlotWidget</class>
<extends>QWidget</extends>
<header location="global">pyqtgraph</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>line_filePath</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,433 @@
# Form implementation generated from reading ui file 'imc_Cernox_calibr_CRAFT.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(722, 552)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.graphWidget = PlotWidget(parent=self.centralwidget)
self.graphWidget.setGeometry(QtCore.QRect(340, 10, 371, 281))
self.graphWidget.setObjectName("graphWidget")
self.Slider_select_cernox = QtWidgets.QSlider(parent=self.centralwidget)
self.Slider_select_cernox.setGeometry(QtCore.QRect(350, 310, 231, 16))
self.Slider_select_cernox.setMinimum(1)
self.Slider_select_cernox.setMaximum(8)
self.Slider_select_cernox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.Slider_select_cernox.setTickPosition(QtWidgets.QSlider.TickPosition.TicksBelow)
self.Slider_select_cernox.setTickInterval(1)
self.Slider_select_cernox.setObjectName("Slider_select_cernox")
self.button_start_measurement = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_start_measurement.setGeometry(QtCore.QRect(20, 130, 161, 20))
self.button_start_measurement.setObjectName("button_start_measurement")
self.button_perform_calibration = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_perform_calibration.setGeometry(QtCore.QRect(150, 230, 161, 21))
self.button_perform_calibration.setObjectName("button_perform_calibration")
self.comboBox_Fit_Interpolation = QtWidgets.QComboBox(parent=self.centralwidget)
self.comboBox_Fit_Interpolation.setGeometry(QtCore.QRect(20, 230, 111, 22))
self.comboBox_Fit_Interpolation.setObjectName("comboBox_Fit_Interpolation")
self.comboBox_Fit_Interpolation.addItem("")
self.comboBox_Fit_Interpolation.addItem("")
self.button_load_data = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_load_data.setGeometry(QtCore.QRect(20, 390, 221, 21))
self.button_load_data.setObjectName("button_load_data")
self.layoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget.setGeometry(QtCore.QRect(20, 270, 271, 24))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout_4 = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
self.gridLayout_4.setObjectName("gridLayout_4")
self.line_Interpolation_res = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_Interpolation_res.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Interpolation_res.sizePolicy().hasHeightForWidth())
self.line_Interpolation_res.setSizePolicy(sizePolicy)
self.line_Interpolation_res.setReadOnly(False)
self.line_Interpolation_res.setObjectName("line_Interpolation_res")
self.gridLayout_4.addWidget(self.line_Interpolation_res, 0, 1, 1, 1)
self.label_33 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_33.setObjectName("label_33")
self.gridLayout_4.addWidget(self.label_33, 0, 0, 1, 1)
self.checkBox_default_file_path = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_default_file_path.setGeometry(QtCore.QRect(20, 340, 131, 17))
self.checkBox_default_file_path.setChecked(True)
self.checkBox_default_file_path.setObjectName("checkBox_default_file_path")
self.button_load_rawdata = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_load_rawdata.setGeometry(QtCore.QRect(20, 420, 221, 21))
font = QtGui.QFont()
font.setPointSize(8)
font.setItalic(True)
self.button_load_rawdata.setFont(font)
self.button_load_rawdata.setObjectName("button_load_rawdata")
self.layoutWidget1 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget1.setGeometry(QtCore.QRect(600, 310, 81, 20))
self.layoutWidget1.setObjectName("layoutWidget1")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget1)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label_31 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_31.setObjectName("label_31")
self.gridLayout.addWidget(self.label_31, 0, 0, 1, 1)
self.line_Cernox = QtWidgets.QLabel(parent=self.layoutWidget1)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_Cernox.setPalette(palette)
self.line_Cernox.setAutoFillBackground(True)
self.line_Cernox.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_Cernox.setObjectName("line_Cernox")
self.gridLayout.addWidget(self.line_Cernox, 0, 1, 1, 1)
self.layoutWidget2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget2.setGeometry(QtCore.QRect(20, 100, 111, 24))
self.layoutWidget2.setObjectName("layoutWidget2")
self.gridLayout_3 = QtWidgets.QGridLayout(self.layoutWidget2)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.line_Tsteps = QtWidgets.QLineEdit(parent=self.layoutWidget2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Tsteps.sizePolicy().hasHeightForWidth())
self.line_Tsteps.setSizePolicy(sizePolicy)
self.line_Tsteps.setObjectName("line_Tsteps")
self.gridLayout_3.addWidget(self.line_Tsteps, 0, 1, 1, 1)
self.label_32 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_32.setObjectName("label_32")
self.gridLayout_3.addWidget(self.label_32, 0, 0, 1, 1)
self.button_connect = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_connect.setGeometry(QtCore.QRect(11, 22, 65, 20))
self.button_connect.setObjectName("button_connect")
self.layoutWidget3 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget3.setGeometry(QtCore.QRect(20, 360, 221, 24))
self.layoutWidget3.setObjectName("layoutWidget3")
self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget3)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_7 = QtWidgets.QLabel(parent=self.layoutWidget3)
self.label_7.setObjectName("label_7")
self.gridLayout_2.addWidget(self.label_7, 0, 0, 1, 1)
self.line_filePath = QtWidgets.QLineEdit(parent=self.layoutWidget3)
self.line_filePath.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_filePath.sizePolicy().hasHeightForWidth())
self.line_filePath.setSizePolicy(sizePolicy)
self.line_filePath.setObjectName("line_filePath")
self.gridLayout_2.addWidget(self.line_filePath, 0, 1, 1, 1)
self.layoutWidget_2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_2.setGeometry(QtCore.QRect(20, 170, 171, 24))
self.layoutWidget_2.setObjectName("layoutWidget_2")
self.gridLayout_5 = QtWidgets.QGridLayout(self.layoutWidget_2)
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
self.gridLayout_5.setObjectName("gridLayout_5")
self.line_Equilibr_time_imc_to_LS = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Equilibr_time_imc_to_LS.sizePolicy().hasHeightForWidth())
self.line_Equilibr_time_imc_to_LS.setSizePolicy(sizePolicy)
self.line_Equilibr_time_imc_to_LS.setObjectName("line_Equilibr_time_imc_to_LS")
self.gridLayout_5.addWidget(self.line_Equilibr_time_imc_to_LS, 0, 1, 1, 1)
self.label_34 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_34.setObjectName("label_34")
self.gridLayout_5.addWidget(self.label_34, 0, 0, 1, 1)
self.layoutWidget4 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget4.setGeometry(QtCore.QRect(20, 480, 198, 24))
self.layoutWidget4.setObjectName("layoutWidget4")
self.gridLayout_6 = QtWidgets.QGridLayout(self.layoutWidget4)
self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
self.gridLayout_6.setObjectName("gridLayout_6")
self.label_35 = QtWidgets.QLabel(parent=self.layoutWidget4)
self.label_35.setObjectName("label_35")
self.gridLayout_6.addWidget(self.label_35, 0, 0, 1, 1)
self.comboBox_LS_imc = QtWidgets.QComboBox(parent=self.layoutWidget4)
self.comboBox_LS_imc.setObjectName("comboBox_LS_imc")
self.comboBox_LS_imc.addItem("")
self.comboBox_LS_imc.addItem("")
self.gridLayout_6.addWidget(self.comboBox_LS_imc, 0, 1, 1, 1)
self.layoutWidget_3 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_3.setGeometry(QtCore.QRect(20, 200, 171, 24))
self.layoutWidget_3.setObjectName("layoutWidget_3")
self.gridLayout_7 = QtWidgets.QGridLayout(self.layoutWidget_3)
self.gridLayout_7.setContentsMargins(0, 0, 0, 0)
self.gridLayout_7.setObjectName("gridLayout_7")
self.line_Equilibr_time_LS_to_imc = QtWidgets.QLineEdit(parent=self.layoutWidget_3)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Equilibr_time_LS_to_imc.sizePolicy().hasHeightForWidth())
self.line_Equilibr_time_LS_to_imc.setSizePolicy(sizePolicy)
self.line_Equilibr_time_LS_to_imc.setObjectName("line_Equilibr_time_LS_to_imc")
self.gridLayout_7.addWidget(self.line_Equilibr_time_LS_to_imc, 0, 1, 1, 1)
self.label_36 = QtWidgets.QLabel(parent=self.layoutWidget_3)
self.label_36.setObjectName("label_36")
self.gridLayout_7.addWidget(self.label_36, 0, 0, 1, 1)
self.label_37 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_37.setGeometry(QtCore.QRect(200, 170, 131, 22))
font = QtGui.QFont()
font.setPointSize(8)
self.label_37.setFont(font)
self.label_37.setObjectName("label_37")
self.label_38 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_38.setGeometry(QtCore.QRect(200, 200, 131, 22))
font = QtGui.QFont()
font.setPointSize(8)
self.label_38.setFont(font)
self.label_38.setObjectName("label_38")
self.layoutWidget_4 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_4.setGeometry(QtCore.QRect(150, 100, 111, 21))
self.layoutWidget_4.setObjectName("layoutWidget_4")
self.gridLayout_8 = QtWidgets.QGridLayout(self.layoutWidget_4)
self.gridLayout_8.setContentsMargins(0, 0, 0, 0)
self.gridLayout_8.setObjectName("gridLayout_8")
self.line_Wait_time = QtWidgets.QLineEdit(parent=self.layoutWidget_4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Wait_time.sizePolicy().hasHeightForWidth())
self.line_Wait_time.setSizePolicy(sizePolicy)
self.line_Wait_time.setObjectName("line_Wait_time")
self.gridLayout_8.addWidget(self.line_Wait_time, 0, 1, 1, 1)
self.label_39 = QtWidgets.QLabel(parent=self.layoutWidget_4)
self.label_39.setObjectName("label_39")
self.gridLayout_8.addWidget(self.label_39, 0, 0, 1, 1)
self.layoutWidget_5 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_5.setGeometry(QtCore.QRect(20, 60, 111, 24))
self.layoutWidget_5.setObjectName("layoutWidget_5")
self.gridLayout_9 = QtWidgets.QGridLayout(self.layoutWidget_5)
self.gridLayout_9.setContentsMargins(0, 0, 0, 0)
self.gridLayout_9.setObjectName("gridLayout_9")
self.line_Tstart = QtWidgets.QLineEdit(parent=self.layoutWidget_5)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Tstart.sizePolicy().hasHeightForWidth())
self.line_Tstart.setSizePolicy(sizePolicy)
self.line_Tstart.setObjectName("line_Tstart")
self.gridLayout_9.addWidget(self.line_Tstart, 0, 1, 1, 1)
self.label_40 = QtWidgets.QLabel(parent=self.layoutWidget_5)
self.label_40.setObjectName("label_40")
self.gridLayout_9.addWidget(self.label_40, 0, 0, 1, 1)
self.layoutWidget_6 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_6.setGeometry(QtCore.QRect(150, 60, 111, 24))
self.layoutWidget_6.setObjectName("layoutWidget_6")
self.gridLayout_10 = QtWidgets.QGridLayout(self.layoutWidget_6)
self.gridLayout_10.setContentsMargins(0, 0, 0, 0)
self.gridLayout_10.setObjectName("gridLayout_10")
self.line_Tstop = QtWidgets.QLineEdit(parent=self.layoutWidget_6)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Tstop.sizePolicy().hasHeightForWidth())
self.line_Tstop.setSizePolicy(sizePolicy)
self.line_Tstop.setObjectName("line_Tstop")
self.gridLayout_10.addWidget(self.line_Tstop, 0, 1, 1, 1)
self.label_41 = QtWidgets.QLabel(parent=self.layoutWidget_6)
self.label_41.setObjectName("label_41")
self.gridLayout_10.addWidget(self.label_41, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 722, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "imc Cernox Calibration CRAFT"))
self.button_start_measurement.setText(_translate("MainWindow", "Start / Cancel Measurement"))
self.button_perform_calibration.setText(_translate("MainWindow", "Perform Fit"))
self.comboBox_Fit_Interpolation.setItemText(0, _translate("MainWindow", "Fit"))
self.comboBox_Fit_Interpolation.setItemText(1, _translate("MainWindow", "Interpolation"))
self.button_load_data.setText(_translate("MainWindow", "Load fit data from file path"))
self.label_33.setText(_translate("MainWindow", "Interpolation resolution (points / Kelvin)"))
self.checkBox_default_file_path.setText(_translate("MainWindow", "Use default file path"))
self.button_load_rawdata.setText(_translate("MainWindow", "Load only raw data from file path"))
self.label_31.setText(_translate("MainWindow", "#Cernox"))
self.line_Cernox.setText(_translate("MainWindow", "0"))
self.label_32.setText(_translate("MainWindow", "T Steps (K)"))
self.button_connect.setText(_translate("MainWindow", "Connect"))
self.label_7.setText(_translate("MainWindow", "File Path"))
self.label_34.setText(_translate("MainWindow", "Equilibr. time (s)"))
self.label_35.setText(_translate("MainWindow", "Forward data"))
self.comboBox_LS_imc.setItemText(0, _translate("MainWindow", "LS218"))
self.comboBox_LS_imc.setItemText(1, _translate("MainWindow", "Calibrated imc"))
self.label_36.setText(_translate("MainWindow", "Equilibr. time (s)"))
self.label_37.setText(_translate("MainWindow", "imc -> t -> LS218"))
self.label_38.setText(_translate("MainWindow", "LS218 -> t -> imc"))
self.label_39.setText(_translate("MainWindow", "Wait (s)"))
self.label_40.setText(_translate("MainWindow", "T Start (K)"))
self.label_41.setText(_translate("MainWindow", "T Stop (K)"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec())

View File

@ -0,0 +1,379 @@
# Form implementation generated from reading ui file 'imc_Cernox_calibr.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(722, 534)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.graphWidget = PlotWidget(parent=self.centralwidget)
self.graphWidget.setGeometry(QtCore.QRect(340, 10, 371, 281))
self.graphWidget.setObjectName("graphWidget")
self.Slider_select_cernox = QtWidgets.QSlider(parent=self.centralwidget)
self.Slider_select_cernox.setGeometry(QtCore.QRect(350, 310, 231, 16))
self.Slider_select_cernox.setMinimum(1)
self.Slider_select_cernox.setMaximum(8)
self.Slider_select_cernox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.Slider_select_cernox.setTickPosition(QtWidgets.QSlider.TickPosition.TicksBelow)
self.Slider_select_cernox.setTickInterval(1)
self.Slider_select_cernox.setObjectName("Slider_select_cernox")
self.button_start_measurement = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_start_measurement.setGeometry(QtCore.QRect(150, 70, 161, 20))
self.button_start_measurement.setObjectName("button_start_measurement")
self.button_perform_calibration = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_perform_calibration.setGeometry(QtCore.QRect(150, 200, 161, 21))
self.button_perform_calibration.setObjectName("button_perform_calibration")
self.comboBox_Fit_Interpolation = QtWidgets.QComboBox(parent=self.centralwidget)
self.comboBox_Fit_Interpolation.setGeometry(QtCore.QRect(20, 200, 111, 22))
self.comboBox_Fit_Interpolation.setObjectName("comboBox_Fit_Interpolation")
self.comboBox_Fit_Interpolation.addItem("")
self.comboBox_Fit_Interpolation.addItem("")
self.button_load_data = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_load_data.setGeometry(QtCore.QRect(20, 360, 221, 21))
self.button_load_data.setObjectName("button_load_data")
self.layoutWidget = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget.setGeometry(QtCore.QRect(20, 240, 271, 24))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout_4 = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
self.gridLayout_4.setObjectName("gridLayout_4")
self.line_Interpolation_res = QtWidgets.QLineEdit(parent=self.layoutWidget)
self.line_Interpolation_res.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Interpolation_res.sizePolicy().hasHeightForWidth())
self.line_Interpolation_res.setSizePolicy(sizePolicy)
self.line_Interpolation_res.setReadOnly(False)
self.line_Interpolation_res.setObjectName("line_Interpolation_res")
self.gridLayout_4.addWidget(self.line_Interpolation_res, 0, 1, 1, 1)
self.label_33 = QtWidgets.QLabel(parent=self.layoutWidget)
self.label_33.setObjectName("label_33")
self.gridLayout_4.addWidget(self.label_33, 0, 0, 1, 1)
self.checkBox_default_file_path = QtWidgets.QCheckBox(parent=self.centralwidget)
self.checkBox_default_file_path.setGeometry(QtCore.QRect(20, 310, 131, 17))
self.checkBox_default_file_path.setChecked(True)
self.checkBox_default_file_path.setObjectName("checkBox_default_file_path")
self.button_load_rawdata = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_load_rawdata.setGeometry(QtCore.QRect(20, 390, 221, 21))
font = QtGui.QFont()
font.setPointSize(8)
font.setItalic(True)
self.button_load_rawdata.setFont(font)
self.button_load_rawdata.setObjectName("button_load_rawdata")
self.layoutWidget1 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget1.setGeometry(QtCore.QRect(600, 310, 81, 20))
self.layoutWidget1.setObjectName("layoutWidget1")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget1)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label_31 = QtWidgets.QLabel(parent=self.layoutWidget1)
self.label_31.setObjectName("label_31")
self.gridLayout.addWidget(self.label_31, 0, 0, 1, 1)
self.line_Cernox = QtWidgets.QLabel(parent=self.layoutWidget1)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Active, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Light, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(170, 170, 170))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Mid, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.BrightText, brush)
brush = QtGui.QBrush(QtGui.QColor(127, 127, 127))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Window, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.Shadow, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.AlternateBase, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipBase, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
palette.setBrush(QtGui.QPalette.ColorGroup.Disabled, QtGui.QPalette.ColorRole.ToolTipText, brush)
self.line_Cernox.setPalette(palette)
self.line_Cernox.setAutoFillBackground(True)
self.line_Cernox.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.line_Cernox.setObjectName("line_Cernox")
self.gridLayout.addWidget(self.line_Cernox, 0, 1, 1, 1)
self.layoutWidget2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget2.setGeometry(QtCore.QRect(20, 70, 111, 24))
self.layoutWidget2.setObjectName("layoutWidget2")
self.gridLayout_3 = QtWidgets.QGridLayout(self.layoutWidget2)
self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
self.gridLayout_3.setObjectName("gridLayout_3")
self.line_Tsteps = QtWidgets.QLineEdit(parent=self.layoutWidget2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Tsteps.sizePolicy().hasHeightForWidth())
self.line_Tsteps.setSizePolicy(sizePolicy)
self.line_Tsteps.setObjectName("line_Tsteps")
self.gridLayout_3.addWidget(self.line_Tsteps, 0, 1, 1, 1)
self.label_32 = QtWidgets.QLabel(parent=self.layoutWidget2)
self.label_32.setObjectName("label_32")
self.gridLayout_3.addWidget(self.label_32, 0, 0, 1, 1)
self.button_connect = QtWidgets.QPushButton(parent=self.centralwidget)
self.button_connect.setGeometry(QtCore.QRect(11, 22, 65, 20))
self.button_connect.setObjectName("button_connect")
self.layoutWidget3 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget3.setGeometry(QtCore.QRect(20, 330, 221, 24))
self.layoutWidget3.setObjectName("layoutWidget3")
self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget3)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_7 = QtWidgets.QLabel(parent=self.layoutWidget3)
self.label_7.setObjectName("label_7")
self.gridLayout_2.addWidget(self.label_7, 0, 0, 1, 1)
self.line_filePath = QtWidgets.QLineEdit(parent=self.layoutWidget3)
self.line_filePath.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_filePath.sizePolicy().hasHeightForWidth())
self.line_filePath.setSizePolicy(sizePolicy)
self.line_filePath.setObjectName("line_filePath")
self.gridLayout_2.addWidget(self.line_filePath, 0, 1, 1, 1)
self.layoutWidget_2 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_2.setGeometry(QtCore.QRect(20, 110, 171, 24))
self.layoutWidget_2.setObjectName("layoutWidget_2")
self.gridLayout_5 = QtWidgets.QGridLayout(self.layoutWidget_2)
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
self.gridLayout_5.setObjectName("gridLayout_5")
self.line_Equilibr_time_imc_to_LS = QtWidgets.QLineEdit(parent=self.layoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Equilibr_time_imc_to_LS.sizePolicy().hasHeightForWidth())
self.line_Equilibr_time_imc_to_LS.setSizePolicy(sizePolicy)
self.line_Equilibr_time_imc_to_LS.setObjectName("line_Equilibr_time_imc_to_LS")
self.gridLayout_5.addWidget(self.line_Equilibr_time_imc_to_LS, 0, 1, 1, 1)
self.label_34 = QtWidgets.QLabel(parent=self.layoutWidget_2)
self.label_34.setObjectName("label_34")
self.gridLayout_5.addWidget(self.label_34, 0, 0, 1, 1)
self.layoutWidget4 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget4.setGeometry(QtCore.QRect(20, 450, 198, 24))
self.layoutWidget4.setObjectName("layoutWidget4")
self.gridLayout_6 = QtWidgets.QGridLayout(self.layoutWidget4)
self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
self.gridLayout_6.setObjectName("gridLayout_6")
self.label_35 = QtWidgets.QLabel(parent=self.layoutWidget4)
self.label_35.setObjectName("label_35")
self.gridLayout_6.addWidget(self.label_35, 0, 0, 1, 1)
self.comboBox_LS_imc = QtWidgets.QComboBox(parent=self.layoutWidget4)
self.comboBox_LS_imc.setObjectName("comboBox_LS_imc")
self.comboBox_LS_imc.addItem("")
self.comboBox_LS_imc.addItem("")
self.gridLayout_6.addWidget(self.comboBox_LS_imc, 0, 1, 1, 1)
self.layoutWidget_3 = QtWidgets.QWidget(parent=self.centralwidget)
self.layoutWidget_3.setGeometry(QtCore.QRect(20, 140, 171, 24))
self.layoutWidget_3.setObjectName("layoutWidget_3")
self.gridLayout_7 = QtWidgets.QGridLayout(self.layoutWidget_3)
self.gridLayout_7.setContentsMargins(0, 0, 0, 0)
self.gridLayout_7.setObjectName("gridLayout_7")
self.line_Equilibr_time_LS_to_imc = QtWidgets.QLineEdit(parent=self.layoutWidget_3)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line_Equilibr_time_LS_to_imc.sizePolicy().hasHeightForWidth())
self.line_Equilibr_time_LS_to_imc.setSizePolicy(sizePolicy)
self.line_Equilibr_time_LS_to_imc.setObjectName("line_Equilibr_time_LS_to_imc")
self.gridLayout_7.addWidget(self.line_Equilibr_time_LS_to_imc, 0, 1, 1, 1)
self.label_36 = QtWidgets.QLabel(parent=self.layoutWidget_3)
self.label_36.setObjectName("label_36")
self.gridLayout_7.addWidget(self.label_36, 0, 0, 1, 1)
self.label_37 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_37.setGeometry(QtCore.QRect(200, 110, 131, 22))
font = QtGui.QFont()
font.setPointSize(8)
self.label_37.setFont(font)
self.label_37.setObjectName("label_37")
self.label_38 = QtWidgets.QLabel(parent=self.centralwidget)
self.label_38.setGeometry(QtCore.QRect(200, 140, 131, 22))
font = QtGui.QFont()
font.setPointSize(8)
self.label_38.setFont(font)
self.label_38.setObjectName("label_38")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 722, 26))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(parent=self.menubar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionSet_default = QtGui.QAction(parent=MainWindow)
self.actionSet_default.setObjectName("actionSet_default")
self.actionReset_default = QtGui.QAction(parent=MainWindow)
self.actionReset_default.setObjectName("actionReset_default")
self.menuFile.addAction(self.actionSet_default)
self.menuFile.addAction(self.actionReset_default)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "imc Cernox Calibration"))
self.button_start_measurement.setText(_translate("MainWindow", "Start / Cancel Measurement"))
self.button_perform_calibration.setText(_translate("MainWindow", "Perform Fit"))
self.comboBox_Fit_Interpolation.setItemText(0, _translate("MainWindow", "Fit"))
self.comboBox_Fit_Interpolation.setItemText(1, _translate("MainWindow", "Interpolation"))
self.button_load_data.setText(_translate("MainWindow", "Load fit data from file path"))
self.label_33.setText(_translate("MainWindow", "Interpolation resolution (points / Kelvin)"))
self.checkBox_default_file_path.setText(_translate("MainWindow", "Use default file path"))
self.button_load_rawdata.setText(_translate("MainWindow", "Load only raw data from file path"))
self.label_31.setText(_translate("MainWindow", "#Cernox"))
self.line_Cernox.setText(_translate("MainWindow", "0"))
self.label_32.setText(_translate("MainWindow", "T Steps (K)"))
self.button_connect.setText(_translate("MainWindow", "Connect"))
self.label_7.setText(_translate("MainWindow", "File Path"))
self.label_34.setText(_translate("MainWindow", "Equilibr. time (s)"))
self.label_35.setText(_translate("MainWindow", "Forward data"))
self.comboBox_LS_imc.setItemText(0, _translate("MainWindow", "LS218"))
self.comboBox_LS_imc.setItemText(1, _translate("MainWindow", "Calibrated imc"))
self.label_36.setText(_translate("MainWindow", "Equilibr. time (s)"))
self.label_37.setText(_translate("MainWindow", "imc -> t -> LS218"))
self.label_38.setText(_translate("MainWindow", "LS218 -> t -> imc"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionSet_default.setText(_translate("MainWindow", "Make current values default"))
self.actionReset_default.setText(_translate("MainWindow", "Reset default values"))
from pyqtgraph import PlotWidget
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec())

View File

@ -0,0 +1,249 @@
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import *
import multiprocessing
import multiprocessing.managers
import time
from timeit import default_timer as timer
from datetime import datetime
import collections
from simple_pid import PID
import traceback, sys, os
import numpy as np
import pyqtgraph as pg
from design_files.evaporate_LN2_design import Ui_MainWindow
# Get the current script's directory
current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
parent_dir = os.path.dirname(current_dir)
# Add the parent directory to sys.path
sys.path.append(parent_dir)
from scripts import import_txt
class WorkerSignals(QObject):
'''
Defines the signals available from a running worker thread.
Supported signals are:
finished: No data
error: tuple (exctype, value, traceback.format_exc() )
result: object data returned from processing, anything
progress: int indicating % progress
'''
finished = pyqtSignal()
error = pyqtSignal(tuple)
result = pyqtSignal(object)
progress = pyqtSignal(list)
class Worker(QRunnable):
'''
Worker thread
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
:param callback: The function callback to run on this worker thread. Supplied args and
kwargs will be passed through to the runner.
:type callback: function
:param args: Arguments to pass to the callback function
:param kwargs: Keywords to pass to the callback function
'''
def __init__(self, fn, *args, **kwargs):
super(Worker, self).__init__()
# Store constructor arguments (re-used for processing)
self.fn = fn
self.args = args
self.kwargs = kwargs
self.signals = WorkerSignals()
# Add the callback to our kwargs
self.kwargs['progress_callback'] = self.signals.progress
@pyqtSlot()
def run(self):
'''
Initialise the runner function with passed args, kwargs.
'''
# Retrieve args/kwargs here; and fire processing using them
try:
result = self.fn(*self.args, **self.kwargs)
except:
traceback.print_exc()
exctype, value = sys.exc_info()[:2]
self.signals.error.emit((exctype, value, traceback.format_exc()))
else:
self.signals.result.emit(result) # Return the result of the processing
finally:
self.signals.finished.emit() # Done
def get_float(Qline,default = 0): #gets value from QLineEdit and converts it to float. If text is empty or cannot be converted, it returns "default" which is 0, if not specified
try:
out = float(Qline.text())
except:
out = default
return(out)
def update_single_entry(dict,name,ind,val):
'''updates a single value in global vars. To do so it gets the current value of "dict('name')", replaces "val" at indec "ind" and sends this back'''
data = dict.get(f"{name}") #get data
print(data)
data[ind] = val #replace entry
dict.update({f"{name}":data}) #send data back
def update_single_entry(dict,name,ind,val): #updates a single value in global vars. To do so it gets the current value of "dict('name')", replaces "val" at indec "ind" and sends this back
data = dict.get(f"{name}") #get data
data[ind] = val #replace entry
dict.update({f"{name}":data}) #send data back
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# Get the current script's directory
self.current_dir = os.path.dirname(os.path.abspath(__file__))
# Get the parent directory by going one level up
self.parent_dir = os.path.dirname(current_dir)
#establish connection to global variables}
try: #try to connect to global variables
manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
manager.connect()
manager.connect()
manager.register('sync_BK_9132B')
manager.register('sync_LS_336')
self.sync_BK_9132B = manager.sync_BK_9132B()
self.sync_LS_336 = manager.sync_LS_336()
except: #open global variables, if no connection can be made (i.e. it is not running). Then connect to it
# subprocess.call(['D:\\Python instrument drivers\\env\\Scripts\\python.exe', 'D:\\Python instrument drivers\\StandAlones\\global_variables.py'])
self.global_vars = QProcess()
self.global_vars.start(self.current_dir+"\\.venv\\Scripts\\python.exe", [self.current_dir+'\\global_variables_TF.py'])
manager.connect()
manager.register('sync_BK_9132B')
manager.register('sync_LS_336')
self.sync_BK_9132B = manager.sync_BK_9132B()
self.sync_LS_336 = manager.sync_LS_336()
print('!!!\nI opened global variables myself. If you close me, global variables will shut down too. Consider starting global variables in own instance for more security\n!!!')
#fill in variables, in case they are not defined in global variables
#import Gui from QT designer file
super(MainWindow, self).__init__(*args, **kwargs)
self.setupUi(self)
#setup plot
#define signals and slots
self.actionMake_current_values_default.triggered.connect(self.save_default)
self.actionReset_default_values.triggered.connect(self.load_default)
#define constants
self.running = True #true while app is running
self.timing_ = 1 #wait time in function "update_Data".
self.SB_all = [self.dSB_T_stop, self.dSB_P] #list of all Spinboxes, helps for saving and loading of default values
self.checkBoxes_all = [self.checkBox_PID]
#read default values from config and set values in gui
self.load_default()
#set up pyQT threadpool
self.threadpool = QThreadPool()
#start standard threads
worker = Worker(self.update_Data)
worker.signals.progress.connect(self.update_gui) #The values from update_Data must be transmitted via a signal, so that the gui is set in the main thread. If the plots are not updated in the main thread, they freeze.
self.threadpool.start(worker)
def update_Data(self, progress_callback):
'''gets data from global variables and triggers update_gui'''
#set small voltage to get a value of R
#['setU', 'setI', 'OutputOn']
update_single_entry(self.sync_BK_9132B,'setU',0,1)
update_single_entry(self.sync_BK_9132B,'setI',0,2)
update_single_entry(self.sync_BK_9132B,'OutputOn',0,True)
T_is = self.sync_LS_336.get('T')[3] #get value of PT-100
time.sleep(2)
R = 40
P = 0
while self.running == True:
if T_is < self.dSB_T_stop.value():
#turn heater on
T_is = self.sync_LS_336.get('T')[3] #get value of PT-100
U = self.sync_BK_9132B.get('U')[0] #get U
I = self.sync_BK_9132B.get('I')[0] #get I
P = self.sync_BK_9132B.get('P')[0]
try:
R = U/I #get R
set_U = np.sqrt(self.dSB_P.value()*R) #calculate U so that P max is reached
except ZeroDivisionError:
R = np.nan
set_U = 1 #set 1 V to measure R in next iteration
update_single_entry(self.sync_BK_9132B,'setU',0,set_U) #send new value to device
update_single_entry(self.sync_BK_9132B,'setI',0,2) #send new value to device
update_single_entry(self.sync_BK_9132B,'OutputOn',0,True)
else:
T_is = self.sync_LS_336.get('T')[3] #get value of PT-100
#turn off heater
update_single_entry(self.sync_BK_9132B,'setU',0,0)
update_single_entry(self.sync_BK_9132B,'setI',0,0)
update_single_entry(self.sync_BK_9132B,'OutputOn',0,False)
P = self.sync_BK_9132B.get('P')[0]
progress_callback.emit([T_is,R,P])
time.sleep(1)
#turn off heater when programm is closed
update_single_entry(self.sync_BK_9132B,'setU',0,0)
update_single_entry(self.sync_BK_9132B,'setI',0,0)
update_single_entry(self.sync_BK_9132B,'OutputOn',0,False)
def update_gui(self,data):#sets labels to new values
self.Label_T_is.setText(f"{data[0]}")
self.Label_R.setText(f"{data[1]}")
self.Label_P_is.setText(f"{data[2]}")
def save_default(self):
#saves current set values to txt file in subdirectory configs. Saves values from al spin boxes and text lines.
#Overwrites old values in config file.
path = self.current_dir+'\\configs\\evaporate_LN2_config.txt' #To make shure the config file is at the right place, independent from where the program is started the location of the file is retrieved
file = open(path,'w')
for SB in self.SB_all:
temp = f"{SB.value()}"
file.write(temp+'\t')
for c in self.checkBoxes_all:
file.write(str(c.isChecked())+'\t')
file.write('\n')
file.close
def load_default(self):
#reads default values from config file in subdirectory config and sets the values in gui. (If no config file exists, it does nothing.)
path = self.current_dir+'\\configs\\evaporate_LN2_config.txt' #To make shure the config file is read from the right place, independent from where the program is started the location of the file is retrieved
try: #exit function if config file does not exist
vals = import_txt.read_raw(path)
except:
return
for SB,v in zip(self.SB_all,vals[0]):
if type(SB) == QDoubleSpinBox:
v = float(v) #convert string in txt to float, so number can be set in dSB
else:
v = int(v) #convert string in txt to int, so number can be set in SB
SB.setValue(v)
for c,v in zip(self.checkBoxes_all,vals[0][len(self.SB_all):]):
c.setChecked(v == 'True')
def closeEvent(self,event): #when window is closed self.running and self.monitor are set to False, so all threads stop
self.running = False
time.sleep(2)
event.accept()
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

View File

@ -0,0 +1,97 @@
import multiprocessing
import multiprocessing.managers
#This starts a server (mulitprocessing basemanager) where all standalones store their current measurement values and set_parameters. This data can be accessed from
#all python instances running on this computer. It can be extended so it can be reached from other PCs aswell.
#The dictionarioes which store the values must be initialized and registered here. To register a new dictionary an (empty) dictionary must be created and a function
#must be defined which returns this dictionary. After that the dictionary must be registered in the manager. This is done with:
#MyListManager.register('syncdict',get_dict) where 'syncdict' is the name that other programs use to reach this dictionary and get_dict the function which return the
#dictionary.
#The values don't have to be stored in dictionaries. List or simple variables also work. But I haven't tested all posibillities.
#To access these dictionaries from other programs, a basemanager must be created in the program which is then connected to the manager created here. There the
#dictionary must also be registered. Finally a local variable is created which points at the dictionary on this server. The following example is from Keysigh_U2042XA_control
#manager = multiprocessing.managers.BaseManager(address=('localhost',5001), authkey=b'')
#manager.connect()
#manager.register('sync_K_U2042XA')
#self.sync_K_U2042XA = manager.sync_K_U2042XA() <- the local variable "self.sync_K_U2042XA" can have any name
class MyListManager(multiprocessing.managers.BaseManager):
pass
#!!!
#please use unambigous names
#!!!
syncdict = {} #dummy where everything can be stored
sync_K_U2042XA = {}
sync_K_34461A = {}
sync_T_LS6081B = {}
sync_LS_336 = {}
sync_LS_218 = {}
sync_BK_9131B = {}
sync_BK_9132B = {}
sync_BK_9132B_2 = {}
sync_BK_9174B = {}
sync_BK_9174B_2 = {}
sync_Keithley_2230G = {}
sync_imc = {}
sync_converted = {}
sync_main = {} #Sync dictionary for the control of Main.py (for the automation of measurements)
def get_dict():
return syncdict
def get_dict_sync_K_U2042XA():
return sync_K_U2042XA
def get_dict_sync_K_34461A():
return sync_K_34461A
def get_dict_sync_T_LS6081B():
return sync_T_LS6081B
def get_dict_sync_LS_336():
return sync_LS_336
def get_dict_sync_LS_218():
return sync_LS_218
def get_dict_sync_BK_9131B():
return sync_BK_9131B
def get_dict_sync_BK_9132B():
return sync_BK_9132B
def get_dict_sync_BK_9132B_2():
return sync_BK_9132B_2
def get_dict_sync_BK_9174B():
return sync_BK_9174B
def get_dict_sync_BK_9174B_2():
return sync_BK_9174B_2
def get_dict_sync_Keithley_2230G():
return sync_Keithley_2230G
def get_dict_sync_imc():
return sync_imc
def get_dict_sync_converted():
return sync_converted
def get_dict_main():
return sync_main
def main():
MyListManager.register('syncdict',get_dict)
MyListManager.register('sync_K_U2042XA',get_dict_sync_K_U2042XA)
MyListManager.register('sync_T_LS6081B',get_dict_sync_T_LS6081B)
MyListManager.register('sync_LS_336',get_dict_sync_LS_336)
MyListManager.register('sync_K_34461A',get_dict_sync_K_34461A)
MyListManager.register('sync_LS_218',get_dict_sync_LS_218)
MyListManager.register('sync_BK_9131B', get_dict_sync_BK_9131B)
MyListManager.register('sync_BK_9132B', get_dict_sync_BK_9132B)
MyListManager.register('sync_BK_9132B_2', get_dict_sync_BK_9132B_2)
MyListManager.register('sync_BK_9174B', get_dict_sync_BK_9174B)
MyListManager.register('sync_BK_9174B_2', get_dict_sync_BK_9174B_2)
MyListManager.register('sync_Keithley_2230G', get_dict_sync_Keithley_2230G)
MyListManager.register('sync_imc', get_dict_sync_imc)
MyListManager.register('sync_converted', get_dict_sync_converted)
MyListManager.register('sync_main', get_dict_main)
manager = MyListManager(address=('localhost',5001), authkey=b'')
manager.start()
input("Press Enter (Not Str+C) to exit. But kill client first".center(50,"-")) #keeps program running until enter is pressed
manager.shutdown()
if __name__ == '__main__':
main()

Some files were not shown because too many files have changed in this diff Show More