Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
python-handel
Commits
67da624c
Commit
67da624c
authored
Oct 20, 2017
by
Vincent Michel
Browse files
Add get_trigger_channels to API
parent
ff329ed5
Pipeline
#1236
passed with stages
in 1 minute and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
handel/interface.py
View file @
67da624c
...
...
@@ -194,7 +194,7 @@ def get_module_statistics(module):
# Parse raw data
return
{
channel
:
stats_from_normal_mode
(
array
[
index
*
9
:])
for
index
,
channel
in
enumerate
(
channels
)
if
channel
!
=
-
1
}
if
channel
>
=
0
}
def
get_statistics
():
...
...
@@ -538,7 +538,7 @@ def get_channels():
channel
for
channels
in
get_grouped_channels
()
for
channel
in
channels
if
channel
!
=
-
1
))
if
channel
>
=
0
))
def
get_master_channels
():
...
...
@@ -548,6 +548,14 @@ def get_master_channels():
for
groups
in
get_grouped_channels
())
def
get_trigger_channels
():
"""Return the list of channels that can be used
as gate master or sync master."""
return
tuple
(
groups
[
0
]
for
groups
in
get_grouped_channels
()
if
groups
and
groups
[
0
]
>=
0
)
# Not exposed
# int xiaNewModule(char *alias);
...
...
tests/test_interface.py
View file @
67da624c
...
...
@@ -934,6 +934,13 @@ def test_get_master_channels(interface):
m
.
assert_called_once_with
()
def
test_get_trigger_channels
(
interface
):
with
mock
.
patch
(
'handel.interface.get_grouped_channels'
)
as
m
:
m
.
return_value
=
[(
0
,
1
,
2
,
3
),
(
-
1
,
5
,
6
,
7
)]
assert
interface
.
get_trigger_channels
()
==
(
0
,)
m
.
assert_called_once_with
()
# Parameters
def
test_get_acquistion_value
(
interface
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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