Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Rousselle
bliss
Commits
29a6f8ae
Commit
29a6f8ae
authored
Oct 20, 2017
by
Alejandro Homs Puron
Committed by
bliss administrator
Oct 20, 2017
Browse files
CT2: better checking in ext. sync. modes and code refactoring
parent
714b9e1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
bliss/controllers/ct2/device.py
View file @
29a6f8ae
...
...
@@ -235,16 +235,10 @@ class CT2Device(BaseCT2Device):
AcqMode
.
ExtTrigMulti
,
]
ExtStartModes
=
[
AcqMode
.
ExtTrigSingle
,
AcqMode
.
ExtTrigMulti
,
AcqMode
.
ExtGate
,
AcqMode
.
ExtTrigReadout
,
]
ExtTrigModes
=
[
AcqMode
.
ExtTrigMulti
,
AcqMode
.
ExtGate
,
AcqMode
.
ExtTrigReadout
,
]
ExtExpModes
=
[
...
...
@@ -643,7 +637,7 @@ class CT2Device(BaseCT2Device):
return
self
.
acq_mode
in
self
.
IntExpModes
def
__has_ext_start
(
self
):
return
self
.
acq_mode
in
self
.
ExtStartModes
return
not
self
.
__has_soft_start
()
def
__has_ext_trig
(
self
):
return
self
.
acq_mode
in
self
.
ExtTrigModes
...
...
@@ -651,6 +645,10 @@ class CT2Device(BaseCT2Device):
def
__has_ext_exp
(
self
):
return
self
.
acq_mode
in
self
.
ExtExpModes
def
__has_ext_sync
(
self
):
return
(
self
.
__has_ext_start
()
or
self
.
__has_ext_trig
()
or
self
.
__has_ext_exp
())
def
__in_ext_trig_readout
(
self
):
return
self
.
acq_mode
==
AcqMode
.
ExtTrigReadout
...
...
@@ -669,7 +667,7 @@ class CT2Device(BaseCT2Device):
raise
ValueError
(
'Acq. point period must be greater than expo.'
)
elif
has_period
:
raise
ValueError
(
'Acq. point period only allowed in %s'
%
mode_str
)
if
self
.
__has_ext_
trig
()
and
not
self
.
in_channel
:
if
self
.
__has_ext_
sync
()
and
not
self
.
in_channel
:
raise
ValueError
(
'Must provide in_config in ext-trig modes'
)
self
.
stop_acq
()
...
...
Write
Preview
Supports
Markdown
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