def __engine__(self, *args, **kwargs): if self.is_enabled(): ca.threads_init() with self.beamline.lock: self.set_state(busy=True, message=self.description) self.output = self.run() logger.info('Script `{}` terminated successfully'.format( self.name)) self.set_state(done=self.output, busy=False, message='Done.') self.on_complete(*args, **kwargs) else: logger.warning('Script "{}" disabled or busy.'.format(self, ))
def count(device, exposure, i): ca.threads_init() counts[i] = device.count(exposure)
def __engine__(self): """ Proxy for calling run method inside a thread """ ca.threads_init() self.run()
def _f(*args, **kwargs): threads_init() return f(*args, **kwargs)
def new_f(*args, **kwargs): threads_init() # enable epics environment to be active within thread return f(*args, **kwargs)