Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
total_control_app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Drechsler
total_control_app
Commits
5ce84bcd
Commit
5ce84bcd
authored
Jun 13, 2018
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some minor changes
parent
5d3a7e89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
7 deletions
+44
-7
myGUI.py
myGUI.py
+44
-7
No files found.
myGUI.py
View file @
5ce84bcd
...
...
@@ -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
(
Fals
e
)
sh
.
DO
.
set_out
(
Tru
e
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment