Skip to content

Commit 9738638

Browse files
committed
XimeaCamera._fetch_data (fixup 9fe1030)
Fix two issues introduced when removing code duplication: 1. When doing software trigger return None if we are acquiring but have not triggered yet otherwise it falls through to the error about unknown trigger type. This partially fixes issue #131. 2. return the acquire data when doing non-software trigger (fix indentation level of the return data statement)
1 parent d936aa9 commit 9738638

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

microscope/cameras/ximea.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ def _fetch_data(self):
4444
return
4545

4646
trigger_type = self._handle.get_trigger_source()
47-
if trigger_type == 'XI_TRG_SOFTWARE' and not self._triggered:
48-
return
47+
if trigger_type == 'XI_TRG_SOFTWARE':
48+
if not self._triggered:
49+
return
50+
# else, continue to fetch an image
4951
elif trigger_type != 'XI_TRG_EDGE_RISING':
5052
raise Exception('unhandled trigger type %s' % trigger_type)
5153

@@ -57,7 +59,7 @@ def _fetch_data(self):
5759
_logger.info('Sending image')
5860
if trigger_type == 'XI_TRG_SOFTWARE':
5961
self._triggered = False
60-
return self.img.get_image_data_numpy()
62+
return self.img.get_image_data_numpy()
6163
except Exception as err:
6264
if getattr(err, 'status', None) == 10:
6365
# This is a Timeout error

0 commit comments

Comments
 (0)