diff --git a/src/tempus/Tempus.py b/src/tempus/Tempus.py index 389561a6577060069d78677730124d05f9e764da..fe998f387ae2bde9f540e8d36ccf65951ddae9f4 100644 --- a/src/tempus/Tempus.py +++ b/src/tempus/Tempus.py @@ -249,18 +249,31 @@ class Tempus(Device): @Slot( displayedName="Reset Fast-Links", - description="Reset fast-links. This can take about 30 s", + description="Reset fast-links. This will take about 30 s", allowedStates={State.ON, State.ACTIVE}) async def resetFastLinks(self): self.state = State.CHANGING - cmnd = [ - self.COMMAND, *self.ARGS, - f"{self.SCRIPT_DIR}/karabo_reset_fast_links.py"] self.commandLog = ( - f"Resetting fast-links:\n{' '.join(cmnd)}\nThis can take about 30 " - "s") - self.background_task = background( - self._execute_command(cmnd, State.INIT, "Fast links reset done")) + "Resetting fast-links:\nThis will take about 30 s") + self.background_task = background(self._reset_fast_links()) + + async def _reset_fast_links(self): # XXX test + try: + await self.send_command( + f"os.system('{self.APP_DIR}/sc_set_gwt_link_up.py -i 0x0 " + "-l 0x0 -s 0x2')", sleep_time=15) + await self.send_command( + f"os.system('{self.APP_DIR}/sc_set_gwt_link_up.py -i 0x1 " + "-l 0x0 -s 0x2')", sleep_time=15) + + self.status = "Fast-links reset done" + self.state = State.INIT + + except Exception as e: + self.logger.error(e) + self.state = State.ERROR + self.status = str(e) + self.commandLog = str(e) @Slot( displayedName="Configure",