Commit 5148f6c6 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Samuel Debionne
Browse files

[CLIENT] Add stop_after_nb_frames option

parent abecab00
Pipeline #71812 passed with stages
in 13 minutes and 34 seconds
......@@ -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__':
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment