Skip to content
Snippets Groups Projects
Commit 3750f821 authored by Andrea Parenti's avatar Andrea Parenti Committed by Jonathan Correa Magdalena
Browse files

Refactor / 4

parent 8b1de211
No related branches found
No related tags found
2 merge requests!2Draft: Feat/p8003,!1First version
...@@ -249,18 +249,31 @@ class Tempus(Device): ...@@ -249,18 +249,31 @@ class Tempus(Device):
@Slot( @Slot(
displayedName="Reset Fast-Links", 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}) allowedStates={State.ON, State.ACTIVE})
async def resetFastLinks(self): async def resetFastLinks(self):
self.state = State.CHANGING self.state = State.CHANGING
cmnd = [
self.COMMAND, *self.ARGS,
f"{self.SCRIPT_DIR}/karabo_reset_fast_links.py"]
self.commandLog = ( self.commandLog = (
f"Resetting fast-links:\n{' '.join(cmnd)}\nThis can take about 30 " "Resetting fast-links:\nThis will take about 30 s")
"s") self.background_task = background(self._reset_fast_links())
self.background_task = background(
self._execute_command(cmnd, State.INIT, "Fast links reset done")) 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( @Slot(
displayedName="Configure", displayedName="Configure",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment