Loading noctua/devices/mercury.py +17 −7 Original line number Diff line number Diff line Loading @@ -126,11 +126,18 @@ class Mercury(BaseDevice): """ pidevice = self._check_connection() method = getattr(pidevice, f"q{command}") method = getattr(pidevice, f"q{command.upper()}") try: if (command == "ERR"): return method() else: return method(self.axis)[self.axis] except GCSError as e: log.error(f"Error: {e}") return None except AttributeError as e: log.error(f"Command not found: {e}") return None def put(self, command, *args): Loading @@ -144,11 +151,14 @@ class Mercury(BaseDevice): """ pidevice = self._check_connection() method = getattr(pidevice, command) method = getattr(pidevice, command.upper()) try: return method(self.axis, *args) except GCSError as e: log.error(f"Device not initialized: {e}") log.error(f"Error: {e}") return None except AttributeError as e: log.error(f"Command not found: {e}") return None def wait(self): Loading Loading
noctua/devices/mercury.py +17 −7 Original line number Diff line number Diff line Loading @@ -126,11 +126,18 @@ class Mercury(BaseDevice): """ pidevice = self._check_connection() method = getattr(pidevice, f"q{command}") method = getattr(pidevice, f"q{command.upper()}") try: if (command == "ERR"): return method() else: return method(self.axis)[self.axis] except GCSError as e: log.error(f"Error: {e}") return None except AttributeError as e: log.error(f"Command not found: {e}") return None def put(self, command, *args): Loading @@ -144,11 +151,14 @@ class Mercury(BaseDevice): """ pidevice = self._check_connection() method = getattr(pidevice, command) method = getattr(pidevice, command.upper()) try: return method(self.axis, *args) except GCSError as e: log.error(f"Device not initialized: {e}") log.error(f"Error: {e}") return None except AttributeError as e: log.error(f"Command not found: {e}") return None def wait(self): Loading