imager: fix capture loop

This commit is contained in:
Romain Bazile 2021-07-06 13:15:31 +02:00
parent 44c3fd1f5e
commit 88f2f72b65

View file

@ -238,7 +238,7 @@ class ImagerProcess(multiprocessing.Process):
planktoscope.light.interrupted() planktoscope.light.interrupted()
self.__imager.change(planktoscope.imager_state_machine.Stop) self.__imager.change(planktoscope.imager.state_machine.Stop)
def __message_update(self, last_message): def __message_update(self, last_message):
if self.__imager.state.name == "stop": if self.__imager.state.name == "stop":
@ -505,7 +505,7 @@ class ImagerProcess(multiprocessing.Process):
# Reset the counter to 0 # Reset the counter to 0
self.__img_done = 0 self.__img_done = 0
# Change state towards stop # Change state towards stop
self.__imager.change(planktoscope.imager_state_machine.Stop) self.__imager.change(planktoscope.imager.state_machine.Stop)
planktoscope.light.error() planktoscope.light.error()
return return
@ -526,7 +526,7 @@ class ImagerProcess(multiprocessing.Process):
) )
# Reset the counter to 0 # Reset the counter to 0
self.__img_done = 0 self.__img_done = 0
self.__imager.change(planktoscope.imager_state_machine.Stop) self.__imager.change(planktoscope.imager.state_machine.Stop)
planktoscope.light.error() planktoscope.light.error()
return return
else: else:
@ -612,7 +612,7 @@ class ImagerProcess(multiprocessing.Process):
self.imager_client.client.publish("status/imager", '{"status":"Done"}') self.imager_client.client.publish("status/imager", '{"status":"Done"}')
self.__imager.change(planktoscope.imager_state_machine.Stop) self.__imager.change(planktoscope.imager.state_machine.Stop)
planktoscope.light.ready() planktoscope.light.ready()
else: else:
# We have not reached the final stage, let's keep imaging # We have not reached the final stage, let's keep imaging