Commit 2871bc2a authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Generic Bliss account for Control Software
Browse files

[CLIENT] Add processing is_finished

parent b2a79dc4
Pipeline #75359 passed with stages
in 9 minutes and 23 seconds
......@@ -685,16 +685,10 @@ class Detector:
return [ data_array.decode_devencoded_image(dev.getFrame(frame_idx)) for dev in self.__devs ][0]
def isFinished(self, nb_frames):
"""" Returns True if all counters are equal to nb_frames """
# Finished when all counters are equal to nb_frames
def countersFinished(c):
return not self.__has_roi_counters or c.nb_frames_counters == nb_frames
def savingFinished(c):
not_finished = [n for n in self.__names
if n.endswith('saved') and getattr(c, n) != nb_frames]
return not not_finished
return all([ countersFinished(c) and savingFinished(c) for c in self.counters ])
def isFinished(self):
"""" Returns True if all processing instances are finished """
return all([dev.is_finished for dev in self.__devs])
def _eraseProcessing(self, uuid):
[ recv.erasePipeline(str(uuid)) for recv in self.__recvs ]
......@@ -952,7 +946,7 @@ def test_acquisition_states(device, args, config):
print(f'nb_frames_xferred={device.nb_frames_xferred}')
print(f'Counters={proc.counters}')
# Wait for the end of the processing
while not proc.isFinished(device.nb_frames_xferred):
while not proc.isFinished():
print(f'Counters={proc.counters}')
gevent.sleep(0.1)
print(f'Counters={proc.counters}')
......
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