Commit 5ce84bcd authored by Martin Drechsler's avatar Martin Drechsler

some minor changes

parent 5d3a7e89
......@@ -7,6 +7,7 @@ Created on Thu May 31 14:22:48 2018
from pyqtgraph.Qt import QtGui
from myWidgets import anal_control_signal, digital_control_signal
from pyqtgraph.Qt import QtWidgets
#This creates the window for the gui
app = QtGui.QApplication([])
......@@ -20,17 +21,18 @@ win.setCentralWidget(cw)
win.show()
layout397 = QtGui.QGridLayout()
layout866 = QtGui.QGridLayout()
layoutPI = QtGui.QGridLayout()
layoutIMG = QtGui.QGridLayout()
layout397_scan = QtGui.QGridLayout()
layout.addLayout(layout397, 1, 1)
layout.addLayout(layout866, 2, 1)
layout.addLayout(layoutPI, 3, 1)
layout.addLayout(layoutIMG, 4, 1)
layout.addLayout(layout397_scan, 1, 2)
l1 = QtGui.QLabel()
l1.setGeometry(50, 50, 25, 25)
......@@ -49,11 +51,12 @@ piezoB866 = anal_control_signal('piezoB866', 3)
piezoA423 = anal_control_signal('piezoA423', 4)
shutter397 = digital_control_signal('shutter397', 0)
shutter866 = digital_control_signal('shutter866', 1)
shutter423 = digital_control_signal('shutter423', 2)
shutter866 = digital_control_signal('shutter866', 2)
shutter423 = digital_control_signal('shutter423', 1)
shutterLED = digital_control_signal('shutterLED', 3)
button = QtWidgets.QPushButton('Touch me, babe')
######### 397 ###########
layout397.addWidget(QtGui.QLabel('397'), 0, 0)
......@@ -61,7 +64,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(button, 1, 3)
#layout397.addWidget(QtGui.QLabel('shutter'), 3, 1), layout397.addWidget(shutter397, 3, 2)
#########################
......@@ -86,7 +89,7 @@ def whenChangeAnalog(sb, daq):
daq.set_out(sb.value())
def whenChangeDigital(cb, daq):
daq.set_out(cb.isChecked())
daq.set_out(not cb.isChecked())
......@@ -102,8 +105,42 @@ shutter866.cb.stateChanged.connect(lambda: whenChangeDigital(shutter866.cb, shut
shutter423.cb.stateChanged.connect(lambda: whenChangeDigital(shutter423.cb, shutter423.DO))
shutterLED.cb.stateChanged.connect(lambda: whenChangeDigital(shutterLED.cb, shutterLED.DO))
#%%
import time
i = 0
t = 1.5
time.sleep(1)
while(i<10):
shutter397.DO.set_out(0)
shutter423.DO.set_out(1)
shutter866.DO.set_out(1)
time.sleep(t)
shutter397.DO.set_out(1)
shutter423.DO.set_out(0)
shutter866.DO.set_out(1)
time.sleep(t)
shutter397.DO.set_out(1)
shutter423.DO.set_out(1)
shutter866.DO.set_out(0)
time.sleep(t)
i = i + 1
print('iteration finished')
#%%
###########################################################
#all shutter start in False:
shutters = [shutter397, shutter866, shutter423, shutterLED]
for sh in shutters:
sh.DO.set_out(False)
sh.DO.set_out(True)
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