From 50b7578c818336c6355694dc7170100606439c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Thu, 28 Nov 2024 00:40:31 -0800 Subject: [PATCH] Only use slewStop for kmirror devices --- src/gort/devices/telescope.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gort/devices/telescope.py b/src/gort/devices/telescope.py index bbe6dbc..bc4c0ec 100644 --- a/src/gort/devices/telescope.py +++ b/src/gort/devices/telescope.py @@ -36,6 +36,8 @@ class MoTanDevice(GortDevice): #: Artificial delay introduced to prevent all motors to slew at the same time. SLEW_DELAY: ClassVar[float | dict[str, float]] = 0 + device_type: ClassVar[str] + def __init__(self, gort: Gort, name: str, actor: str): super().__init__(gort, name, actor) @@ -101,7 +103,8 @@ async def stop(self): if await self.is_moving(): self.write_to_log("Stopping slew.") - await self.run_command("slewStop", timeout=self.timeouts["slewStop"]) + if self.device_type == "kmirror": + await self.run_command("slewStop", timeout=self.timeouts["slewStop"]) await self.run_command("stop", timeout=self.timeouts["slewStop"]) if await self.is_moving(): @@ -134,6 +137,8 @@ class KMirror(MoTanDevice): SLEW_DELAY = 0 + device_type = "kmirror" + async def home(self): """Homes the k-mirror.""" @@ -239,6 +244,8 @@ class Focuser(MoTanDevice): SLEW_DELAY = 0 + device_type = "focuser" + async def home(self): """Homes the focuser. @@ -293,6 +300,8 @@ class FibSel(MoTanDevice): # Rehome after this many seconds. HOME_AFTER: float | None = None + device_type = "fibsel" + def __init__(self, gort: Gort, name: str, actor: str): super().__init__(gort, name, actor)