Commit 317730db authored by Martin Drechsler's avatar Martin Drechsler

Main changes: load and save functions added.

parent df3c91e6
......@@ -19,6 +19,9 @@ import telnetlib
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QLCDNumber
import myToolbar
#This creates the window for the gui
app = QtGui.QApplication([])
win = QtGui.QMainWindow()
......@@ -83,11 +86,12 @@ d423_scan.addWidget(layout423_scan)
############ creating the controls ########################
piezoA397 = anal_control_signal('piezoA397', 0)
piezoB397 = anal_control_signal('piezoB397', 1)
piezoA866 = anal_control_signal('piezoA866', 2)
piezoB866 = anal_control_signal('piezoB866', 3)
piezoA423 = anal_control_signal('piezoA423', 4)
piezoA397 = anal_control_signal('piezoA397', 13, out_minimum=0, out_maximum=4, out_step=0.01)
piezoB397 = anal_control_signal('piezoB397', 7)
piezoA866 = anal_control_signal('piezoA866', 14, out_minimum=0, out_maximum=4, out_step=0.01)
piezoB866 = anal_control_signal('piezoB866', 6)
piezoA423 = anal_control_signal('piezoA423', 1)
shutter397 = digital_control_signal('shutter397', 0)
......@@ -95,6 +99,8 @@ shutter866 = digital_control_signal('shutter866', 2)
shutter423 = digital_control_signal('shutter423', 1)
shutterLED = digital_control_signal('shutterLED', 3)
#Adding the controls:
######### 397 ###########
......@@ -103,7 +109,7 @@ layout397.addWidget(QtGui.QLabel(piezoA397.name), 1, 1), layout397.addWidget(pie
layout397.addWidget(QtGui.QLabel(piezoB397.name), 2, 1), layout397.addWidget(piezoB397.sb, 2, 2)
layout397.addWidget(QtGui.QLabel(shutter397.name), 3, 1), layout397.addWidget(shutter397.cb, 3, 2)
layout397_scan.addWidget(QtGui.QLabel('397 Scan'), 0, 0)
layout397_scan.addWidget(QtGui.QLabel('397 Scan piezo A'), 0, 0)
layout397_scan.addWidget(QtGui.QLabel('start'), 1, 1), layout397_scan.addWidget(piezoA397.scan_sb_start, 1, 2)
layout397_scan.addWidget(QtGui.QLabel('stop'), 2, 1), layout397_scan.addWidget(piezoA397.scan_sb_stop, 2, 2)
layout397_scan.addWidget(QtGui.QLabel('period'), 3, 1), layout397_scan.addWidget(piezoA397.scan_sb_period, 3, 2)
......@@ -118,11 +124,11 @@ layout866.addWidget(QtGui.QLabel(piezoA866.name), 1, 1), layout866.addWidget(pie
layout866.addWidget(QtGui.QLabel(piezoB866.name), 2, 1), layout866.addWidget(piezoB866.sb, 2, 2)
layout866.addWidget(QtGui.QLabel(shutter866.name), 3, 1), layout866.addWidget(shutter866.cb, 3, 2)
layout866_scan.addWidget(QtGui.QLabel('866 Scan'), 0, 0)
layout866_scan.addWidget(QtGui.QLabel('start'), 1, 1), layout866_scan.addWidget(piezoA866.scan_sb_start, 1, 2)
layout866_scan.addWidget(QtGui.QLabel('stop'), 2, 1), layout866_scan.addWidget(piezoA866.scan_sb_stop, 2, 2)
layout866_scan.addWidget(QtGui.QLabel('period'), 3, 1), layout866_scan.addWidget(piezoA866.scan_sb_period, 3, 2)
layout866_scan.addWidget(QtGui.QLabel('Scanning'), 4, 1), layout866_scan.addWidget(piezoA866.scan_button, 4, 2)
layout866_scan.addWidget(QtGui.QLabel('866 Scan piezo B'), 0, 0)
layout866_scan.addWidget(QtGui.QLabel('start'), 1, 1), layout866_scan.addWidget(piezoB866.scan_sb_start, 1, 2)
layout866_scan.addWidget(QtGui.QLabel('stop'), 2, 1), layout866_scan.addWidget(piezoB866.scan_sb_stop, 2, 2)
layout866_scan.addWidget(QtGui.QLabel('period'), 3, 1), layout866_scan.addWidget(piezoB866.scan_sb_period, 3, 2)
layout866_scan.addWidget(QtGui.QLabel('Scanning'), 4, 1), layout866_scan.addWidget(piezoB866.scan_button, 4, 2)
#########################
######### PI ###########
......@@ -131,7 +137,7 @@ layoutPI.addWidget(QtGui.QLabel(piezoA423.name), 1, 1), layoutPI.addWidget(piezo
layoutPI.addWidget(QtGui.QLabel(shutter423.name), 2, 1), layoutPI.addWidget(shutter423.cb, 2, 2)
layoutPI.addWidget(QtGui.QLabel(shutterLED.name), 3, 1), layoutPI.addWidget(shutterLED.cb, 3, 2)
layout423_scan.addWidget(QtGui.QLabel('423 Scan'), 0, 0)
layout423_scan.addWidget(QtGui.QLabel('423 Scan piezo A'), 0, 0)
layout423_scan.addWidget(QtGui.QLabel('start'), 1, 1), layout423_scan.addWidget(piezoA423.scan_sb_start, 1, 2)
layout423_scan.addWidget(QtGui.QLabel('stop'), 2, 1), layout423_scan.addWidget(piezoA423.scan_sb_stop, 2, 2)
layout423_scan.addWidget(QtGui.QLabel('period'), 3, 1), layout423_scan.addWidget(piezoA423.scan_sb_period, 3, 2)
......@@ -148,13 +154,13 @@ def whenChangeDigital(cb, daq):
daq.set_out(not cb.isChecked())
"""
piezoA397.sb.sigValueChanging.connect(lambda: whenChangeAnalog(piezoA397.sb, piezoA397.AO))
piezoB397.sb.sigValueChanging.connect(lambda: whenChangeAnalog(piezoB397.sb, piezoB397.AO))
piezoA866.sb.sigValueChanging.connect(lambda: whenChangeAnalog(piezoA866.sb, piezoA866.AO))
piezoB866.sb.sigValueChanging.connect(lambda: whenChangeAnalog(piezoB866.sb, piezoB866.AO))
piezoA423.sb.sigValueChanging.connect(lambda: whenChangeAnalog(piezoA423.sb, piezoA423.AO))
"""
shutter397.cb.stateChanged.connect(lambda: whenChangeDigital(shutter397.cb, shutter397.DO))
shutter866.cb.stateChanged.connect(lambda: whenChangeDigital(shutter866.cb, shutter866.DO))
......@@ -204,7 +210,8 @@ layoutWM.timer.start(1000) # every 10,000 milliseconds
layoutWM.addWidget(lcd)
dWM.addWidget(layoutWM)
###############################################################################
myToolbar.incorporate_toolbar(win, anal_control_signal._registry)
###############################################################################
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment