Skip to content

Commit

Permalink
Don't crash on uca camera readout
Browse files Browse the repository at this point in the history
  • Loading branch information
tfarago committed Oct 25, 2013
1 parent bf07eee commit 5f4dfe5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion concert/devices/cameras/uca.py
Expand Up @@ -2,6 +2,7 @@
Cameras supported by the libuca library.
"""
import time
import logbook
import numpy as np
from concert.coroutines import null
from concert.helpers import async, inject
Expand All @@ -11,6 +12,9 @@
from concert.devices.cameras import base


LOG = logbook.Logger(__name__)


def _new_setter_wrapper(camera, name, unit=None):
def _wrapper(value):
if unit:
Expand Down Expand Up @@ -100,7 +104,12 @@ def readout(self, condition=lambda: True):
as long as it resolves to True the camera keeps grabbing.
"""
while condition():
image = self.grab()
image = None
try:
image = self.grab()
except Exception as exc:
LOG.debug("An error {} occured".format(exc) +
" during readout, stopping")
if image is None:
break
yield image
Expand Down

0 comments on commit 5f4dfe5

Please sign in to comment.