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
LimaGroup
Lima2
Commits
5148f6c6
Commit
5148f6c6
authored
Mar 04, 2022
by
Alejandro Homs Puron
Committed by
Samuel Debionne
Apr 08, 2022
Browse files
[CLIENT] Add stop_after_nb_frames option
parent
abecab00
Pipeline
#71812
passed with stages
in 13 minutes and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tango/py/Lima2/Client/Detector.py
View file @
5148f6c6
...
...
@@ -872,7 +872,7 @@ def test_proc_params_schema(d):
print
(
f
'recv_dev.proc_params=
{
recv_dev
.
proc_params
}
'
)
def
test_acquisition_states
(
device
,
config
):
def
test_acquisition_states
(
device
,
args
,
config
):
print
(
'*** Testing states & acquisition ***'
)
print
(
f
'State=
{
device
.
getState
()
}
'
)
...
...
@@ -903,9 +903,8 @@ def test_acquisition_states(device, config):
# only if nb_frames > 5
def
ready_for_stop
():
ok
=
False
nb_frames
=
device
.
acq_params
.
acq
.
nb_frames
if
nb_frames
>
5
:
ok
=
device
.
nb_frames_xferred
>=
nb_frames
/
2
if
args
.
stop_after_nb_frames
:
ok
=
device
.
nb_frames_xferred
>=
args
.
stop_after_nb_frames
return
event
.
ready
()
or
ok
while
not
ready_for_stop
():
print
(
f
'nb_frames_xferred=
{
device
.
nb_frames_xferred
}
'
)
...
...
@@ -957,6 +956,8 @@ def main():
help
=
'JSON string with proc_params'
)
parser
.
add_argument
(
'--proc_params_file'
,
help
=
'file containg JSON string with proc_params'
)
parser
.
add_argument
(
'--stop_after_nb_frames'
,
type
=
int
,
help
=
'Stop after a number of frames have been xferred'
)
args
=
parser
.
parse_args
()
...
...
@@ -984,7 +985,7 @@ def main():
if
klass
:
config
[
name
]
=
klass
(
par_json
)
test_acquisition_states
(
device
,
config
)
test_acquisition_states
(
device
,
args
,
config
)
if
__name__
==
'__main__'
:
...
...
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