Skip to content

Commit afaf078

Browse files
committed
XimeaCamera: handle more errors when checking for temperature sensors (#239)
1 parent 2239c83 commit afaf078

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

microscope/cameras/ximea.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
# code so we can use while handling exceptions.
7878
_XI_TIMEOUT = 10
7979
_XI_NOT_SUPPORTED = 12
80+
_XI_NOT_IMPLEMENTED = 26
8081
_XI_ACQUISITION_STOPED = 45
8182
_XI_UNKNOWN_PARAM = 100
8283

@@ -312,7 +313,15 @@ def initialize(self) -> None:
312313
try:
313314
get_temp_method()
314315
except xiapi.Xi_error as err:
315-
if err.status != _XI_NOT_SUPPORTED:
316+
# Depending on XiAPI version, camera model, and
317+
# selected sensor, we might get any of these errors as
318+
# meaning that it's not available. See
319+
# https://github.com/python-microscope/vendor-issues/issues/6
320+
if err.status not in [
321+
_XI_NOT_SUPPORTED,
322+
_XI_NOT_IMPLEMENTED,
323+
_XI_UNKNOWN_PARAM,
324+
]:
316325
raise
317326
else:
318327
self.add_setting(

0 commit comments

Comments
 (0)