Skip to content
Snippets Groups Projects
Commit 5a12097f authored by Sebastien Petitdemange's avatar Sebastien Petitdemange
Browse files

xia: unsure to send the last pixel acquired.

parent 3efa892b
No related branches found
No related tags found
No related merge requests found
......@@ -852,13 +852,18 @@ def _raw_read(acquisition_number, queue):
send_pixel_task = None
try:
current_pixel_event = gevent.event.Event()
current_pixel_dict = {"current": -1}
current_pixel_dict = {"current": -1, "continue": True}
def send_current_pixel():
while True:
current_pixel = -1
while (
current_pixel_dict["continue"]
or current_pixel != current_pixel_dict["current"]
):
current_pixel_event.wait()
current_pixel_event.clear()
event.send(module, "current_pixel", current_pixel_dict["current"])
current_pixel = current_pixel_dict["current"]
event.send(module, "current_pixel", current_pixel)
def poll_data(sent):
current, data, statistics = synchronized_poll_data()
......@@ -886,6 +891,9 @@ def _raw_read(acquisition_number, queue):
sent = poll_data(sent)
# get last points
poll_data(sent)
current_pixel_dict["continue"] = False
current_pixel_event.set()
except StopIteration:
pass
except Exception as e:
......@@ -893,8 +901,8 @@ def _raw_read(acquisition_number, queue):
raise
finally:
queue.put(StopIteration)
if send_pixel_task is not None:
send_pixel_task.kill()
if send_pixel_task:
send_pixel_task.join()
# Not exposed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment