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
317730db
Commit
317730db
authored
Jul 11, 2018
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Main changes: load and save functions added.
parent
df3c91e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
myGUI.py
myGUI.py
+22
-15
No files found.
myGUI.py
View file @
317730db
...
...
@@ -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
(
piezo
A
866
.
scan_sb_start
,
1
,
2
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'stop'
),
2
,
1
),
layout866_scan
.
addWidget
(
piezo
A
866
.
scan_sb_stop
,
2
,
2
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'period'
),
3
,
1
),
layout866_scan
.
addWidget
(
piezo
A
866
.
scan_sb_period
,
3
,
2
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'Scanning'
),
4
,
1
),
layout866_scan
.
addWidget
(
piezo
A
866
.
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
(
piezo
B
866
.
scan_sb_start
,
1
,
2
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'stop'
),
2
,
1
),
layout866_scan
.
addWidget
(
piezo
B
866
.
scan_sb_stop
,
2
,
2
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'period'
),
3
,
1
),
layout866_scan
.
addWidget
(
piezo
B
866
.
scan_sb_period
,
3
,
2
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'Scanning'
),
4
,
1
),
layout866_scan
.
addWidget
(
piezo
B
866
.
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'
):
...
...
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