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
1dc78886
Commit
1dc78886
authored
May 15, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blinking enabled
parent
0d88326f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
7 deletions
+35
-7
MCDAQcontrolsignals.py
MCDAQcontrolsignals.py
+3
-1
controlGui.py
controlGui.py
+1
-1
controllayouts.py
subclasses/controllayouts.py
+31
-5
No files found.
MCDAQcontrolsignals.py
View file @
1dc78886
...
@@ -124,4 +124,6 @@ class digital_control_signal(QtCore.QObject):
...
@@ -124,4 +124,6 @@ class digital_control_signal(QtCore.QObject):
if
state
==
QtCore
.
Qt
.
Checked
:
if
state
==
QtCore
.
Qt
.
Checked
:
self
.
DO
.
set_out
(
True
)
self
.
DO
.
set_out
(
True
)
else
:
else
:
self
.
DO
.
set_out
(
False
)
self
.
DO
.
set_out
(
False
)
\ No newline at end of file
\ No newline at end of file
controlGui.py
View file @
1dc78886
...
@@ -60,7 +60,7 @@ class ControlGui(QtGui.QFrame):
...
@@ -60,7 +60,7 @@ class ControlGui(QtGui.QFrame):
self
.
dock_397
.
addWidget
(
self
.
laser397_control_layout
,
0
,
0
)
self
.
dock_397
.
addWidget
(
self
.
laser397_control_layout
,
0
,
0
)
self
.
dock_397_scan
.
addWidget
(
self
.
laser397_scan_layout
,
0
,
1
)
self
.
dock_397_scan
.
addWidget
(
self
.
laser397_scan_layout
,
0
,
1
)
self
.
laser866_control_layout
=
LaserControlLayout
(
'866'
,
checkboxes
=
[
'shutter866'
,
'shuter866WM'
],
spinboxes
=
[
'piezoA866'
,
'piezoB866'
])
self
.
laser866_control_layout
=
LaserControlLayout
(
'866'
,
checkboxes
=
[
'shutter866'
,
'shuter866WM'
],
spinboxes
=
[
'piezoA866'
,
'piezoB866'
]
,
blinkCheckbox
=
[
'shutter866'
]
)
self
.
laser866_scan_layout
=
LaserScanLayout
(
name
=
'piezoA866'
,
signal_to_scan_layout
=
self
.
laser866_control_layout
)
self
.
laser866_scan_layout
=
LaserScanLayout
(
name
=
'piezoA866'
,
signal_to_scan_layout
=
self
.
laser866_control_layout
)
self
.
dock_866
.
addWidget
(
self
.
laser866_control_layout
)
self
.
dock_866
.
addWidget
(
self
.
laser866_control_layout
)
self
.
dock_866_scan
.
addWidget
(
self
.
laser866_scan_layout
)
self
.
dock_866_scan
.
addWidget
(
self
.
laser866_scan_layout
)
...
...
subclasses/controllayouts.py
View file @
1dc78886
...
@@ -39,7 +39,9 @@ class LaserControlLayout(pg.LayoutWidget):
...
@@ -39,7 +39,9 @@ class LaserControlLayout(pg.LayoutWidget):
A class for creating a layout with spinboxes and checkboxes to control a laser.
A class for creating a layout with spinboxes and checkboxes to control a laser.
"""
"""
_registry
=
[]
_registry
=
[]
def
__init__
(
self
,
name
,
spinboxes
=
[
'sbA'
,
'sbB'
],
checkboxes
=
[
'cbA'
,
'cbB'
],
custom_geometry
=
False
):
blinkSignal
=
QtCore
.
pyqtSignal
(
bool
,
float
)
def
__init__
(
self
,
name
,
spinboxes
=
[
'sbA'
,
'sbB'
],
checkboxes
=
[
'cbA'
,
'cbB'
],
custom_geometry
=
False
,
blinkCheckbox
=
[]):
super
()
.
__init__
()
super
()
.
__init__
()
self
.
_registry
.
append
(
self
)
self
.
_registry
.
append
(
self
)
self
.
name
=
name
self
.
name
=
name
...
@@ -50,7 +52,6 @@ class LaserControlLayout(pg.LayoutWidget):
...
@@ -50,7 +52,6 @@ class LaserControlLayout(pg.LayoutWidget):
self
.
spinboxes
=
{}
self
.
spinboxes
=
{}
self
.
checkboxes
=
{}
self
.
checkboxes
=
{}
for
i
,
sb_name
in
enumerate
(
spinboxes
,
start
=
1
):
for
i
,
sb_name
in
enumerate
(
spinboxes
,
start
=
1
):
self
.
spinboxes
[
sb_name
]
=
CustomSpinBox
(
siPrefix
=
True
,
suffix
=
'V'
)
self
.
spinboxes
[
sb_name
]
=
CustomSpinBox
(
siPrefix
=
True
,
suffix
=
'V'
)
if
custom_geometry
!=
True
:
if
custom_geometry
!=
True
:
...
@@ -64,10 +65,24 @@ class LaserControlLayout(pg.LayoutWidget):
...
@@ -64,10 +65,24 @@ class LaserControlLayout(pg.LayoutWidget):
self
.
addWidget
(
QtGui
.
QLabel
(
cb_name
),
row
,
2
*
i
)
self
.
addWidget
(
QtGui
.
QLabel
(
cb_name
),
row
,
2
*
i
)
self
.
addWidget
(
self
.
checkboxes
[
cb_name
],
row
,
2
*
i
+
1
)
self
.
addWidget
(
self
.
checkboxes
[
cb_name
],
row
,
2
*
i
+
1
)
self
.
blinkCheckboxes
=
{}
self
.
blinkSpinboxes
=
{}
self
.
blinkTimers
=
{}
for
i
,
cb_name
in
enumerate
(
blinkCheckbox
,
start
=
0
):
self
.
blinkCheckboxes
[
cb_name
]
=
QtGui
.
QCheckBox
()
self
.
blinkCheckboxes
[
cb_name
]
.
stateChanged
.
connect
(
lambda
:
self
.
blink
(
cb_name
))
self
.
blinkSpinboxes
[
cb_name
]
=
CustomSpinBox
(
siPrefix
=
True
,
suffix
=
's'
,
value
=
1
)
self
.
blinkSpinboxes
[
cb_name
]
.
setMinimum
(
0.01
)
self
.
blinkTimers
[
cb_name
]
=
QtCore
.
QTimer
()
self
.
blinkTimers
[
cb_name
]
.
timeout
.
connect
(
self
.
checkboxes
[
cb_name
]
.
toggle
)
if
custom_geometry
!=
True
:
row
=
2
+
len
(
self
.
spinboxes
)
self
.
addWidget
(
QtGui
.
QLabel
(
'blink '
+
cb_name
),
row
,
0
)
self
.
addWidget
(
self
.
blinkCheckboxes
[
cb_name
],
row
,
1
)
self
.
addWidget
(
self
.
blinkSpinboxes
[
cb_name
],
row
,
2
)
def
blink
(
self
,
cb
):
pass
def
freeze
(
self
):
def
freeze
(
self
):
for
sb
in
self
.
spinboxes
:
for
sb
in
self
.
spinboxes
:
self
.
spinboxes
[
sb
]
.
setEnabled
(
False
)
self
.
spinboxes
[
sb
]
.
setEnabled
(
False
)
...
@@ -81,6 +96,17 @@ class LaserControlLayout(pg.LayoutWidget):
...
@@ -81,6 +96,17 @@ class LaserControlLayout(pg.LayoutWidget):
self
.
checkboxes
[
cb
]
.
setEnabled
(
True
)
self
.
checkboxes
[
cb
]
.
setEnabled
(
True
)
def
blink
(
self
,
cb_name
):
T
=
self
.
blinkSpinboxes
[
cb_name
]
.
value
()
if
self
.
blinkCheckboxes
[
cb_name
]
.
isChecked
():
print
(
' '
.
join
((
cb_name
,
'blinking with period: '
)),
T
)
self
.
_initial_state
=
self
.
checkboxes
[
cb_name
]
.
isChecked
()
self
.
blinkTimers
[
cb_name
]
.
start
(
T
*
1e3
)
else
:
print
(
' '
.
join
((
cb_name
,
'blinking stopped'
)))
self
.
blinkTimers
[
cb_name
]
.
stop
()
self
.
checkboxes
[
cb_name
]
.
setChecked
(
self
.
_initial_state
)
class
LaserScanLayout
(
pg
.
LayoutWidget
):
class
LaserScanLayout
(
pg
.
LayoutWidget
):
"""
"""
A class for creating a layout for scanning a laser piezo.
A class for creating a layout for scanning a laser piezo.
...
@@ -89,7 +115,7 @@ class LaserScanLayout(pg.LayoutWidget):
...
@@ -89,7 +115,7 @@ class LaserScanLayout(pg.LayoutWidget):
_registry
=
[]
_registry
=
[]
scanActionSignal
=
QtCore
.
pyqtSignal
(
object
)
scanActionSignal
=
QtCore
.
pyqtSignal
(
object
)
def
__init__
(
self
,
name
,
signal_to_scan_layout
,
feedforward_enables
=
False
):
def
__init__
(
self
,
name
,
signal_to_scan_layout
):
super
()
.
__init__
()
super
()
.
__init__
()
self
.
_registry
.
append
(
self
)
self
.
_registry
.
append
(
self
)
self
.
name
=
name
self
.
name
=
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