refactor: fix format sgalil

This commit is contained in:
e21206
2023-08-17 18:03:56 +02:00
parent 0d74b34121
commit b267284e97

View File

@ -298,15 +298,13 @@ class GalilController(Controller):
# threading.Thread(target=_while_in_motion(3, n_samples), daemon=True).start() # threading.Thread(target=_while_in_motion(3, n_samples), daemon=True).start()
# self._while_in_motion(3, n_samples) # self._while_in_motion(3, n_samples)
def _while_in_motion(self, thread_id: int, n_samples: int) -> tuple: def _while_in_motion(self, thread_id: int, n_samples: int) -> tuple:
last_readout = 0 last_readout = 0
val_axis2 = [] # y axis val_axis2 = [] # y axis
val_axis4 = [] # x axis val_axis4 = [] # x axis
while self.is_thread_active(thread_id): while self.is_thread_active(thread_id):
posct = int(self.socket_put_and_receive(f'MGposct').strip().split(".")[0]) posct = int(self.socket_put_and_receive(f"MGposct").strip().split(".")[0])
logger.info(f'SGalil is scanning - latest enconder position {posct+1} from {n_samples}') logger.info(f"SGalil is scanning - latest enconder position {posct+1} from {n_samples}")
time.sleep(1) time.sleep(1)
if posct > last_readout: if posct > last_readout:
positions = self.read_encoder_position(last_readout, posct) positions = self.read_encoder_position(last_readout, posct)
@ -316,8 +314,8 @@ class GalilController(Controller):
logger.info(len(val_axis2)) logger.info(len(val_axis2))
time.sleep(1) time.sleep(1)
# Readout of last positions after scan finished # Readout of last positions after scan finished
posct = int(self.socket_put_and_receive(f'MGposct').strip().split(".")[0]) posct = int(self.socket_put_and_receive(f"MGposct").strip().split(".")[0])
logger.info(f'SGalil is scanning - latest enconder position {posct} from {n_samples}') logger.info(f"SGalil is scanning - latest enconder position {posct} from {n_samples}")
if posct > last_readout: if posct > last_readout:
positions = self.read_encoder_position(last_readout, posct) positions = self.read_encoder_position(last_readout, posct)
val_axis4.extend(positions[0]) val_axis4.extend(positions[0])
@ -325,7 +323,6 @@ class GalilController(Controller):
return val_axis4, val_axis2 return val_axis4, val_axis2
def read_encoder_position(self, fromval: int, toval: int) -> tuple: def read_encoder_position(self, fromval: int, toval: int) -> tuple:
val_axis2 = [] # y axis val_axis2 = [] # y axis
val_axis4 = [] # x axis val_axis4 = [] # x axis