Wraps a Zaber reply to easily index its multiple fields.
Definition at line 61 of file zaber.py.
◆ __init__()
| None microscope.controllers.zaber._ZaberReply.__init__ |
( |
| self, |
|
|
bytes | data ) |
Definition at line 64 of file zaber.py.
64 def __init__(self, data: bytes) -> None:
65 self._data = data
66 if (
67 data[0] != _AT_CODE
68 or data[-2:] != b"\r\n"
69 or any([data[i] != _SPACE_CODE for i in (3, 5, 8, 13, 16)])
70 ):
71 raise ValueError("Not a valid reply from a Zaber device")
72
◆ address()
| bytes microscope.controllers.zaber._ZaberReply.address |
( |
| self | ) |
|
The start of reply with device address and space.
Definition at line 74 of file zaber.py.
74 def address(self) -> bytes:
75 """The start of reply with device address and space."""
76 return self._data[1:3]
77
◆ flag()
| bytes microscope.controllers.zaber._ZaberReply.flag |
( |
| self | ) |
|
The reply flag indicates if the message was accepted or rejected.
Can be `b"OK"` (accepted) or `b"RJ"` (rejected). If rejected,
the response property will be one word with the reason why.
Definition at line 79 of file zaber.py.
79 def flag(self) -> bytes:
80 """The reply flag indicates if the message was accepted or rejected.
81
82 Can be `b"OK"` (accepted) or `b"RJ"` (rejected). If rejected,
83 the response property will be one word with the reason why.
84 """
85 return self._data[6:8]
86
◆ response()
| bytes microscope.controllers.zaber._ZaberReply.response |
( |
| self | ) |
|
Definition at line 107 of file zaber.py.
107 def response(self) -> bytes:
108
109 return self._data[17:-2]
110
111
◆ status()
| bytes microscope.controllers.zaber._ZaberReply.status |
( |
| self | ) |
|
``b"BUSY"`` when the axis is moving and ``b"IDLE"`` otherwise.
If the reply message applies to the whole device, the status
is `b"BUSY"` if any axis is busy and `b"IDLE"` if all axes are
idle.
Definition at line 88 of file zaber.py.
88 def status(self) -> bytes:
89 """``b"BUSY"`` when the axis is moving and ``b"IDLE"`` otherwise.
90
91 If the reply message applies to the whole device, the status
92 is `b"BUSY"` if any axis is busy and `b"IDLE"` if all axes are
93 idle.
94 """
95 return self._data[9:13]
96
◆ warning()
| bytes microscope.controllers.zaber._ZaberReply.warning |
( |
| self | ) |
|
The highest priority warning currently active.
This will be `b'--'` under normal conditions. Anything else
is a warning.
Definition at line 98 of file zaber.py.
98 def warning(self) -> bytes:
99 """The highest priority warning currently active.
100
101 This will be `b'--'` under normal conditions. Anything else
102 is a warning.
103 """
104 return self._data[14:16]
105
◆ _data
| microscope.controllers.zaber._ZaberReply._data = data |
|
protected |
The documentation for this class was generated from the following file:
- BioImager/PythonMicroscope/microscope/controllers/zaber.py