projector version

This commit is contained in:
awe
2026-09-15 19:06:05 +03:00
parent 62c0266a6b
commit b3339d101c
33 changed files with 2605 additions and 51 deletions
@@ -68,6 +68,24 @@ class PortNotFoundError(CommunicationError):
super().__init__(message)
class PortBusyError(CommunicationError):
"""Raised when the serial port is already held by another program.
A laser controller is a single half-duplex request/response bus: only one
process may own it at a time. When the port is opened exclusively
(``exclusive=True``), a second exclusive open fails with this error instead
of silently sharing the bus and corrupting both sides' traffic.
"""
def __init__(self, port: str = None):
target = f"'{port}'" if port else "the laser controller port"
super().__init__(
f"Serial port {target} is busy — another program is already using "
f"the laser controller. Close it first (only one program may own the "
f"port at a time)."
)
class DeviceNotRespondingError(CommunicationError):
"""Exception raised when device doesn't respond to commands."""