stepper: fix whitespace error

This commit is contained in:
Romain Bazile 2020-12-15 19:10:08 +01:00
parent f8dc86db88
commit b3703388c7

View file

@ -348,23 +348,21 @@ class StepperProcess(multiprocessing.Process):
def treat_command(self): def treat_command(self):
command = "" command = ""
logger.info("We received a new message") logger.info("We received a new message")
last_message = self.actuator_client.msg["payload"] last_message = self.actuator_client.msg["payload"]
logger.debug(last_message) logger.debug(last_message)
command = self.actuator_client.msg["topic"].split("/", 1)[1] command = self.actuator_client.msg["topic"].split("/", 1)[1]
logger.debug(command) logger.debug(command)
self.actuator_client.read_message() self.actuator_client.read_message()
# If the command is "pump" if command == "pump":
if command == "pump": self.__message_pump(last_message)
self.__message_pump(last_message) elif command == "focus":
# If the command is "focus" self.__message_focus(last_message)
elif command == "focus": elif command != "":
self.__message_focus(last_message) logger.warning(
elif command != "": f"We did not understand the received request {command} - {last_message}"
logger.warning( )
f"We did not understand the received request {command} - {last_message}"
)
def focus(self, direction, distance, speed=focus_max_speed): def focus(self, direction, distance, speed=focus_max_speed):
"""moves the focus stepper """moves the focus stepper
@ -508,7 +506,7 @@ class StepperProcess(multiprocessing.Process):
delay = 0.001 delay = 0.001
while not self.stop_event.is_set(): while not self.stop_event.is_set():
if self.actuator_client.new_message_received(): if self.actuator_client.new_message_received():
self.treat_command() self.treat_command()
if self.pump_stepper.move(): if self.pump_stepper.move():
delay = 0.0001 delay = 0.0001
planktoscope.light.ready() planktoscope.light.ready()