Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
Project
Project
Details
Activity
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
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Trigger Distribution
Commits
d0c8ca97
Commit
d0c8ca97
authored
Sep 21, 2022
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pytest: working adc acquisitions with adc-lib
parent
3c548276
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
WrtdTestHelper.py
pytest/tests/WrtdTestHelper.py
+9
-1
test_WrtdRefDesigns.py
pytest/tests/test_WrtdRefDesigns.py
+5
-1
No files found.
pytest/tests/WrtdTestHelper.py
View file @
d0c8ca97
...
...
@@ -39,12 +39,20 @@ class FmcAdc100m(PyFmcAdc100m14b4ch):
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_TRG_THR_ENABLE
,
1
)
self
.
apply_config
(
conf
,
0
)
def
config_acquisition
(
self
,
pre
,
post
,
nshot
):
def
start_acquisition
(
self
,
pre
,
post
,
nshot
=
1
):
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_ACQ
,
0
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_ACQ_PRE_SAMP
,
pre
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_ACQ_POST_SAMP
,
post
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_ACQ_N_SHOTS
,
nshot
)
self
.
apply_config
(
conf
,
0
)
self
.
acq_start
(
PyFmcAdc100m14b4ch
.
ADC_F_FLUSH
,
timeval
(
0
,
0
))
def
acquisition_complete
(
self
):
try
:
self
.
acq_poll
(
0
,
timeval
(
1
,
0
))
return
True
except
OSError
:
return
False
class
WrtdTestNode
(
PyWrtd
):
def
__init__
(
self
,
node_id
):
...
...
pytest/tests/test_WrtdRefDesigns.py
View file @
d0c8ca97
...
...
@@ -10,7 +10,7 @@ def fmc_adc():
fmc_adc_list
=
[
FmcAdc100m
(
pytest
.
fmc_adc1
),
FmcAdc100m
(
pytest
.
fmc_adc2
)]
yield
fmc_adc_list
for
dev
in
fmc_adc_list
:
dev
.
stop
(
)
dev
.
acq_stop
(
0
)
dev
.
disable_triggers
()
@
pytest
.
fixture
()
...
...
@@ -139,6 +139,8 @@ class TestWrtdRefDesigns(object):
rule_name
=
f
'rule.{adc_channel}'
adc
.
add_rule_enabled
(
rule_name
,
f
'net{tdc_channel}'
,
adc_channel
)
fmc_adc
[
fmc
]
.
start_acquisition
(
pre
=
1
,
post
=
2
)
fdelay
.
add_alarm
(
'alarm1'
)
fd_channel
=
f
'LC-O{4*fmc+1}'
...
...
@@ -190,3 +192,5 @@ class TestWrtdRefDesigns(object):
adc_channel
=
f
'LC-O{fmc+1}'
adc
.
check_log_entry
({
'id'
:
adc_channel
,
'log_type'
:
'CONSUMED'
,
'log_reason'
:
'START'
})
adc
.
check_log_entry
({
'id'
:
adc_channel
,
'log_type'
:
'CONSUMED'
,
'log_reason'
:
'DONE'
})
assert
fmc_adc
[
fmc
]
.
acquisition_complete
(),
"acquisition timeout"
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