Skip to content

Commit 0b75378

Browse files
committed
Added more fields to Clarity status, and some comments.
1 parent 12a0be4 commit 0b75378

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

microscope/filterwheels/aurox.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,40 @@ def get_status(self):
192192
result = self._send_command(__FULLSTAT)
193193
if result is None:
194194
return
195+
# A status dict to populate and return
195196
status = {}
197+
# A list to track states, any one of which mean the device is busy.
198+
busy = []
199+
# Disk running
196200
status['on'] = result[3] == __RUN
197-
status['shutter'] = result[4]
201+
# Door open
202+
# Note - it appears that the __DOOROPEN and __DOORCLOSED status states
203+
# are switched, or that the DOOR is in fact an internal shutter. I'll
204+
# interpret 'door' as the external door here, as that is what the user
205+
# can see. When the external door is open, result[4] == __DOORCLOSED
206+
door = result[4] == __DOORCLOSED
207+
status['door open'] = door
208+
busy.append(door)
209+
# Slide position
198210
slide = result[5]
199211
if slide == __SLDMID:
212+
# Slide is moving
200213
status['slide'] = (None, 'moving')
214+
busy.append(True)
201215
else:
202216
status['slide'] = (slide, self._slide_to_sectioning.get(slide, None))
217+
# Filter position
203218
filter = result[6]
204219
if filter == __FLTMID:
220+
# Filter is moving
205221
status['filter'] = (None, 'moving')
222+
busy.append(True)
206223
else:
207224
status['filter'] = (result[6], self._filters.get(result[6], None))
225+
# Calibration LED on
208226
status['calibration'] = result[7] == __CALON
227+
# Slide or filter moving
228+
status['busy'] = any(busy)
209229
return status
210230

211231
# Implemented by FilterWheelBase

0 commit comments

Comments
 (0)