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
f636b3b3
Commit
f636b3b3
authored
Jul 16, 2018
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More minor cahnges, timeout for the wavemeter and activation button.
parent
d298911c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
40 deletions
+48
-40
ADoutputs.py
ADoutputs.py
+2
-2
myGUI.py
myGUI.py
+22
-35
myWidgets.py
myWidgets.py
+24
-3
snuffles1.png
snuffles1.png
+0
-0
No files found.
ADoutputs.py
View file @
f636b3b3
...
...
@@ -18,7 +18,7 @@ try:
ao_range
=
ULRange
.
BIP10VOLTS
except
ModuleNotFoundError
:
except
:
print
(
'import error: mcculw not installed. In linux this might not be available. '
)
#%%
...
...
myGUI.py
View file @
f636b3b3
...
...
@@ -6,11 +6,11 @@ Created on Thu May 31 14:22:48 2018
"""
import
sys
sys
.
setrecursionlimit
(
50000
)
from
pyqtgraph.Qt
import
QtCore
,
QtGui
from
myWidgets
import
anal_control_signal
,
digital_control_signal
from
myWidgets
import
anal_control_signal
,
digital_control_signal
,
activation_button
from
pyqtgraph
import
dockarea
import
pyqtgraph
as
pg
...
...
@@ -50,11 +50,11 @@ layout397_scan = pg.LayoutWidget()
layout866_scan
=
pg
.
LayoutWidget
()
layout423_scan
=
pg
.
LayoutWidget
()
layout_trap_electrodes
=
pg
.
LayoutWidget
()
layout_activate
=
pg
.
LayoutWidget
()
# Here I create the docks
s1
=
1
s2
=
1
s1
=
1
00
s2
=
1
00
d397
=
dockarea
.
Dock
(
"Dock397"
,
size
=
(
s1
,
s2
))
d866
=
dockarea
.
Dock
(
"Dock866"
,
size
=
(
s1
,
s2
))
dPI
=
dockarea
.
Dock
(
"DockPI"
,
size
=
(
s1
,
s2
))
...
...
@@ -63,6 +63,8 @@ d397_scan = dockarea.Dock("Dock 397 scan", size=(s1, s2))
d866_scan
=
dockarea
.
Dock
(
"Dock 866 scan"
,
size
=
(
s1
,
s2
))
d423_scan
=
dockarea
.
Dock
(
"Dock 423 scan"
,
size
=
(
s1
,
s2
))
dtrap_electrodes
=
dockarea
.
Dock
(
"Dock Trap Electrodes"
,
size
=
(
s1
,
s2
))
dactivate
=
dockarea
.
Dock
(
" "
,
hideTitle
=
False
,
size
=
(
s1
/
4
,
s2
))
dactivate
.
hideTitleBar
()
# Here I add the docks
area
.
addDock
(
dtrap_electrodes
)
...
...
@@ -73,7 +75,7 @@ area.addDock(dWM, 'bottom', dPI)
area
.
addDock
(
d397_scan
,
'right'
,
d397
)
area
.
addDock
(
d423_scan
,
'right'
,
dPI
)
area
.
addDock
(
d866_scan
,
'right'
,
d866
)
area
.
addDock
(
dactivate
,
'right'
,
dtrap_electrodes
)
# Here I add the layouts to the corresponding dock
...
...
@@ -85,6 +87,8 @@ d397_scan.addWidget(layout397_scan)
d866_scan
.
addWidget
(
layout866_scan
)
d423_scan
.
addWidget
(
layout423_scan
)
dtrap_electrodes
.
addWidget
(
layout_trap_electrodes
)
dactivate
.
addWidget
(
layout_activate
)
############ creating the controls ########################
...
...
@@ -162,30 +166,6 @@ layout_trap_electrodes.addWidget(QtGui.QLabel(trapCompD.name), 2, 3), layout_tra
######### Here I define the connect functions ###########
def
whenChangeAnalog
(
sb
,
daq
):
daq
.
set_out
(
sb
.
value
())
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
))
shutter423
.
cb
.
stateChanged
.
connect
(
lambda
:
whenChangeDigital
(
shutter423
.
cb
,
shutter423
.
DO
))
shutterLED
.
cb
.
stateChanged
.
connect
(
lambda
:
whenChangeDigital
(
shutterLED
.
cb
,
shutterLED
.
DO
))
...
...
@@ -198,16 +178,16 @@ try:
sh
.
DO
.
set_out
(
True
)
except
:
pass
###########################################################
#read wavemeter
wavemeter_ok
=
False
try
:
tn
=
telnetlib
.
Telnet
(
host
=
"wannanosaurus"
,
port
=
1234
)
tn
=
telnetlib
.
Telnet
(
host
=
"wannanosaurus"
,
port
=
1234
,
timeout
=
1
)
wavemeter_ok
=
True
except
:
print
(
'w
m
not connected'
)
print
(
'w
annanosaurus
not connected'
)
if
wavemeter_ok
:
tn
.
write
(
b
'++eos 1
\n
'
)
...
...
@@ -240,6 +220,13 @@ if wavemeter_ok:
###############################################################################
myToolbar
.
incorporate_toolbar
(
win
,
anal_control_signal
.
_registry
)
###############################################################################
import
sys
#activate button
actB
=
activation_button
()
layout_activate
.
addWidget
(
actB
.
button
)
###############################################################################
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
()
.
exec_
()
myWidgets.py
View file @
f636b3b3
...
...
@@ -7,9 +7,9 @@ This is a temporary script file.
import
pyqtgraph
as
pg
from
ADoutputs
import
daq_AO
,
daq_DO
from
pyqtgraph.Qt
import
QtGui
from
pyqtgraph.Qt
import
QtGui
,
QtCore
from
PyQt5.QtCore
import
QBasicTimer
from
PyQt5.QtWidgets
import
(
QPushButton
,
QWidget
)
from
PyQt5.QtWidgets
import
(
QPushButton
,
QWidget
,
QVBoxLayout
)
#An example of a class
...
...
@@ -109,6 +109,8 @@ class anal_control_signal(QWidget):
class
digital_control_signal
(
QWidget
):
def
__init__
(
self
,
name
,
channel
):
super
()
.
__init__
()
self
.
name
=
name
self
.
ch
=
channel
...
...
@@ -119,9 +121,28 @@ class digital_control_signal(QWidget):
print
(
'Digital output
%
i not found. Daq might not be connected'
%
self
.
ch
)
self
.
cb
=
QtGui
.
QCheckBox
()
self
.
cb
.
stateChanged
.
connect
(
self
.
whenChangeDigital
)
def
set_name
(
self
,
name
):
self
.
name
=
name
def
set_initial_value
(
self
,
value
):
self
.
initial_value
=
value
def
whenChangeDigital
(
self
):
self
.
set_out
(
not
self
.
cb
.
isChecked
())
class
activation_button
(
QWidget
):
def
__init__
(
self
):
QWidget
.
__init__
(
self
)
self
.
button
=
QPushButton
(
''
,
self
)
self
.
button
.
clicked
.
connect
(
self
.
handleButton
)
self
.
button
.
setIcon
(
QtGui
.
QIcon
(
'snuffles1.png'
))
self
.
button
.
setIconSize
(
QtCore
.
QSize
(
48
,
48
))
layout
=
QVBoxLayout
(
self
)
layout
.
addWidget
(
self
.
button
)
def
handleButton
(
self
):
self
.
button
.
setIcon
(
QtGui
.
QIcon
(
'snuffles.png'
))
\ No newline at end of file
snuffles1.png
0 → 100644
View file @
f636b3b3
207 KB
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