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
a2d3bda1
Commit
a2d3bda1
authored
Jul 15, 2018
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The Gui now should run even if the daq or wavemeter are not connected.
parent
adb5eb68
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
38 deletions
+49
-38
ADoutputs.py
ADoutputs.py
+11
-7
ADoutputs.cpython-36.pyc
__pycache__/ADoutputs.cpython-36.pyc
+0
-0
myToolbar.cpython-36.pyc
__pycache__/myToolbar.cpython-36.pyc
+0
-0
myWidgets.cpython-36.pyc
__pycache__/myWidgets.cpython-36.pyc
+0
-0
myGUI.py
myGUI.py
+26
-24
myToolbar.py
myToolbar.py
+2
-2
myWidgets.py
myWidgets.py
+10
-5
No files found.
ADoutputs.py
View file @
a2d3bda1
...
...
@@ -8,16 +8,20 @@ Created on Wed May 30 15:27:17 2018
from
__future__
import
absolute_import
,
division
,
print_function
try
:
from
mcculw
import
ul
from
mcculw.enums
import
DigitalIODirection
,
ULRange
from
examples.props.digital
import
DigitalProps
from
examples.props.ao
import
AnalogOutputProps
from
mcculw
import
ul
from
mcculw.enums
import
DigitalIODirection
,
ULRange
from
examples.props.digital
import
DigitalProps
from
examples.props.ao
import
AnalogOutputProps
from
mcculw.ul
import
ULError
from
mcculw.ul
import
ULError
ao_range
=
ULRange
.
BIP10VOLTS
ao_range
=
ULRange
.
BIP10VOLTS
except
ModuleNotFoundError
:
print
(
'import error: mcculw not installed. In linux this might not be available. '
)
#%%
class
daq_DO
(
object
):
def
__init__
(
self
,
out_num
):
...
...
__pycache__/ADoutputs.cpython-36.pyc
0 → 100644
View file @
a2d3bda1
File added
__pycache__/myToolbar.cpython-36.pyc
0 → 100644
View file @
a2d3bda1
File added
__pycache__/myWidgets.cpython-36.pyc
0 → 100644
View file @
a2d3bda1
File added
myGUI.py
View file @
a2d3bda1
...
...
@@ -112,43 +112,43 @@ shutterLED = digital_control_signal('shutterLED', 3)
######### 397 ###########
layout397
.
addWidget
(
QtGui
.
QLabel
(
'397'
),
0
,
0
)
layout397
.
addWidget
(
QtGui
.
QLabel
(
piezoA397
.
name
),
1
,
1
),
layout397
.
addWidget
(
piezoA397
.
sb
,
1
,
2
)
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
.
addWidget
(
QtGui
.
QLabel
(
piezoA397
.
name
),
1
,
0
),
layout397
.
addWidget
(
piezoA397
.
sb
,
1
,
1
)
layout397
.
addWidget
(
QtGui
.
QLabel
(
piezoB397
.
name
),
2
,
0
),
layout397
.
addWidget
(
piezoB397
.
sb
,
2
,
1
)
layout397
.
addWidget
(
QtGui
.
QLabel
(
shutter397
.
name
),
3
,
0
),
layout397
.
addWidget
(
shutter397
.
cb
,
3
,
1
)
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
)
layout397_scan
.
addWidget
(
QtGui
.
QLabel
(
'Scanning'
),
4
,
1
),
layout397_scan
.
addWidget
(
piezoA397
.
scan_button
,
4
,
2
)
layout397_scan
.
addWidget
(
QtGui
.
QLabel
(
'start'
),
1
,
0
),
layout397_scan
.
addWidget
(
piezoA397
.
scan_sb_start
,
1
,
1
)
layout397_scan
.
addWidget
(
QtGui
.
QLabel
(
'stop'
),
2
,
0
),
layout397_scan
.
addWidget
(
piezoA397
.
scan_sb_stop
,
2
,
1
)
layout397_scan
.
addWidget
(
QtGui
.
QLabel
(
'period'
),
3
,
0
),
layout397_scan
.
addWidget
(
piezoA397
.
scan_sb_period
,
3
,
1
)
layout397_scan
.
addWidget
(
QtGui
.
QLabel
(
'Scanning'
),
4
,
0
),
layout397_scan
.
addWidget
(
piezoA397
.
scan_button
,
4
,
1
)
#########################
######### 866 ###########
layout866
.
addWidget
(
QtGui
.
QLabel
(
'866'
),
0
,
0
)
layout866
.
addWidget
(
QtGui
.
QLabel
(
piezoA866
.
name
),
1
,
1
),
layout866
.
addWidget
(
piezoA866
.
sb
,
1
,
2
)
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
.
addWidget
(
QtGui
.
QLabel
(
piezoA866
.
name
),
1
,
0
),
layout866
.
addWidget
(
piezoA866
.
sb
,
1
,
1
)
layout866
.
addWidget
(
QtGui
.
QLabel
(
piezoB866
.
name
),
2
,
0
),
layout866
.
addWidget
(
piezoB866
.
sb
,
2
,
1
)
layout866
.
addWidget
(
QtGui
.
QLabel
(
shutter866
.
name
),
3
,
0
),
layout866
.
addWidget
(
shutter866
.
cb
,
3
,
1
)
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
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'start'
),
1
,
0
),
layout866_scan
.
addWidget
(
piezoB866
.
scan_sb_start
,
1
,
1
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'stop'
),
2
,
0
),
layout866_scan
.
addWidget
(
piezoB866
.
scan_sb_stop
,
2
,
1
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'period'
),
3
,
0
),
layout866_scan
.
addWidget
(
piezoB866
.
scan_sb_period
,
3
,
1
)
layout866_scan
.
addWidget
(
QtGui
.
QLabel
(
'Scanning'
),
4
,
0
),
layout866_scan
.
addWidget
(
piezoB866
.
scan_button
,
4
,
1
)
#########################
######### PI ###########
layoutPI
.
addWidget
(
QtGui
.
QLabel
(
'Photoion'
),
0
,
0
)
layoutPI
.
addWidget
(
QtGui
.
QLabel
(
piezoA423
.
name
),
1
,
1
),
layoutPI
.
addWidget
(
piezoA423
.
sb
,
1
,
2
)
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
)
layoutPI
.
addWidget
(
QtGui
.
QLabel
(
piezoA423
.
name
),
1
,
0
),
layoutPI
.
addWidget
(
piezoA423
.
sb
,
1
,
1
)
layoutPI
.
addWidget
(
QtGui
.
QLabel
(
shutter423
.
name
),
2
,
0
),
layoutPI
.
addWidget
(
shutter423
.
cb
,
2
,
1
)
layoutPI
.
addWidget
(
QtGui
.
QLabel
(
shutterLED
.
name
),
3
,
0
),
layoutPI
.
addWidget
(
shutterLED
.
cb
,
3
,
1
)
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
)
layout423_scan
.
addWidget
(
QtGui
.
QLabel
(
'Scanning'
),
4
,
1
),
layout423_scan
.
addWidget
(
piezoA423
.
scan_button
,
4
,
2
)
layout423_scan
.
addWidget
(
QtGui
.
QLabel
(
'start'
),
1
,
0
),
layout423_scan
.
addWidget
(
piezoA423
.
scan_sb_start
,
1
,
1
)
layout423_scan
.
addWidget
(
QtGui
.
QLabel
(
'stop'
),
2
,
0
),
layout423_scan
.
addWidget
(
piezoA423
.
scan_sb_stop
,
2
,
1
)
layout423_scan
.
addWidget
(
QtGui
.
QLabel
(
'period'
),
3
,
0
),
layout423_scan
.
addWidget
(
piezoA423
.
scan_sb_period
,
3
,
1
)
layout423_scan
.
addWidget
(
QtGui
.
QLabel
(
'Scanning'
),
4
,
0
),
layout423_scan
.
addWidget
(
piezoA423
.
scan_button
,
4
,
1
)
#########################
######### trap electrodes ###########
...
...
@@ -193,9 +193,11 @@ shutterLED.cb.stateChanged.connect(lambda: whenChangeDigital(shutterLED.cb, shut
###########################################################
#all shutter start in False:
shutters
=
[
shutter397
,
shutter866
,
shutter423
,
shutterLED
]
for
sh
in
shutters
:
sh
.
DO
.
set_out
(
True
)
try
:
for
sh
in
shutters
:
sh
.
DO
.
set_out
(
True
)
except
:
pass
#read wavemeter
...
...
myToolbar.py
View file @
a2d3bda1
...
...
@@ -9,7 +9,7 @@ Created on Thu Jul 5 12:17:30 2018
from
PyQt5.QtCore
import
QSettings
from
PyQt5.QtWidgets
import
QAction
from
threading
import
Thread
#%%
def
save
(
aos
):
settings
=
QSettings
(
'C:
\\
Users
\\
Usuario
\\
Documents
\\
control_app
\\
config.ini'
,
QSettings
.
IniFormat
)
...
...
@@ -59,7 +59,7 @@ def incorporate_toolbar(win, analog_control_signals):
fileMenu
.
addAction
(
loadAct
)
viewMenu
=
menubar
.
addMenu
(
'Monitor'
)
viewWebcams
=
QAction
(
'View webcams'
,
checkable
=
True
)
viewWebcams
=
QAction
(
'View webcams'
,
win
,
checkable
=
True
)
viewWebcams
.
setChecked
(
False
)
viewMenu
.
addAction
(
viewWebcams
)
...
...
myWidgets.py
View file @
a2d3bda1
...
...
@@ -32,9 +32,12 @@ class anal_control_signal(QWidget):
self
.
suffix
=
'V'
self
.
sb
=
pg
.
SpinBox
(
value
=
self
.
initial_value
,
bounds
=
[
self
.
min
,
self
.
max
],
step
=
self
.
step
,
siPrefix
=
self
.
siPrefix
,
suffix
=
self
.
suffix
)
try
:
self
.
AO
=
daq_AO
(
self
.
ch
)
except
:
print
(
'Analog output
%
i not found. Daq might not be connected'
%
self
.
ch
)
self
.
sb
.
sigValueChanging
.
connect
(
self
.
sb_analog_change
)
self
.
AO
=
daq_AO
(
self
.
ch
)
self
.
scan_button
=
QPushButton
(
'Start scan'
)
self
.
timer
=
QBasicTimer
()
...
...
@@ -47,7 +50,6 @@ class anal_control_signal(QWidget):
self
.
scan_direction
=
0
self
.
scan_button
.
clicked
.
connect
(
self
.
doAction
)
self
.
sb
.
sigValueChanging
.
connect
(
self
.
sb_analog_change
)
self
.
spin_boxes
=
[(
'sb'
,
self
.
sb
),
(
'scan_sb_start'
,
self
.
scan_sb_start
),
(
'scan_sb_stop'
,
self
.
scan_sb_stop
),
(
'scan_sb_period'
,
self
.
scan_sb_period
)]
...
...
@@ -111,8 +113,11 @@ class digital_control_signal(QWidget):
self
.
ch
=
channel
self
.
initial_value
=
0
self
.
DO
=
daq_DO
(
self
.
ch
)
try
:
self
.
DO
=
daq_DO
(
self
.
ch
)
except
:
print
(
'Digital output
%
i not found. Daq might not be connected'
%
self
.
ch
)
self
.
cb
=
QtGui
.
QCheckBox
()
def
set_name
(
self
,
name
):
...
...
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