def _initCrate(macro, ctrl_obj, crate_nr): # It initializes all axis found in the same crate # than the target motor given. # We could have decided to initialize all motors in the controller. # Define axes range to re-initialize after reset # These are the motors in the same crate than the given motor first = crate_nr * 10 last = first + 8 macro.info('Initializing Crate number %s:' % crate_nr) macro.info('axes range [%s,%s]' % (first, last)) # Get the alias for ALL motors for the controller motor_list = ctrl_obj.elementlist macro.debug("Element in controller: %s" % repr(motor_list)) # Crate a proxy to each element and # get the axis for each of them for alias in motor_list: m = DeviceProxy(alias) a = int(m.get_property('axis')['axis'][0]) # Execute init command for certain motors: if first <= a <= last: macro.debug('alias: %s' % alias) macro.debug('device name: %s' % m.name()) macro.debug('axis number: %s' % a) macro.info("Initializing %s..." % alias) try: m.command_inout('Init') # HOTFIX!!! only if offsets are lost 24/12/2016 # print 'IMPORTANT: OVERWRITTING centx/centy offsets!' # if alias == 'centx': # centx_offset = -4.065240223463690 # m['offset'] = centx_offset # print 'centx offset overwritten: %f' % centx_offset # if alias == 'centy': # centy_offset = -2.759407821229050 # m['offset'] = centy_offset # print 'centy offset overwritten: %f' % centy_offset except Exception: macro.error('axis %s cannot be initialized' % alias)
import os import time import sys import struct import numpy os.environ['QUB_SUBPATH'] = 'qt4' from PyQt4 import QtGui, QtCore from PyTango import DeviceProxy # better to use PyTango.gevent ? from bliss.data.routines.pixmaptools import qt4 as pixmaptools device = DeviceProxy("id13/limaccds/eh3-vlm1") print "tango device=", device.name() print "Exposure Time=", device.acq_expo_time print "camera_model=", device.camera_model print "camera_pixelsize=", device.camera_pixelsize print "camera_type=", device.camera_type print "image_height=", device.image_height print "image_width=", device.image_width # print " =", device. print "last_image_acquired =", device.last_image_acquired print "video_mode =", device.video_mode print "video_live =", device.video_live print "set video_live TRUE" device.video_live = True