...
 
This diff is collapsed.
This diff is collapsed.
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#=============================================================================
#
# file : Basler.py
#
# description : Python source for the Basler and its commands.
# The class is derived from Device. It represents the
# CORBA servant object which will be accessed from the
# network. All commands which can be executed on the
# Pilatus are implemented in this file.
#
# project : TANGO Device Server
#
# copyleft : European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
#=============================================================================
# (c) - Bliss - ESRF
#=============================================================================
#
import PyTango
from Lima import Core
from Lima import Basler as BaslerAcq
from Lima.Server import AttrHelper
class Basler(PyTango.Device_4Impl):
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
self.init_device()
self.__Attribute2FunctionBase = {
}
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
#------------------------------------------------------------------
# getAttrStringValueList command:
#
# Description: return a list of authorized values if any
# argout: DevVarStringArray
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
#use AttrHelper
return AttrHelper.get_attr_string_value_list(self, attr_name)
#==================================================================
#
# Basler read/write attribute methods
#
#==================================================================
def __getattr__(self,name) :
#use AttrHelper
return AttrHelper.get_attr_4u(self,name,_BaslerCam)
def read_AcquisitionFrameRateEnable(self, attr):
attr.set_value(_BaslerCam.getAcquisitionFrameRateEnable())
def write_AcquisitionFrameRateEnable(self, attr):
data=attr.get_write_value()
_BaslerCam.setAcquisitionFrameRateEnable(data)
def read_AcquisitionFrameRateAbs(self, attr):
attr.set_value(_BaslerCam.getAcquisitionFrameRateAbs())
def write_AcquisitionFrameRateAbs(self, attr):
data=attr.get_write_value()
_BaslerCam.setAcquisitionFrameRateAbs(data)
#==================================================================
#
# BaslerClass class definition
#
#==================================================================
class BaslerClass(PyTango.DeviceClass):
class_property_list = {}
device_property_list = {
# define one and only one of the following 4 properties:
'camera_id':
[PyTango.DevString,
"Camera ID", None],
'cam_ip_address':
[PyTango.DevString,
"Camera ip address",[]],
'serial_number':
[PyTango.DevString,
"Camera serial number", None],
'user_name':
[PyTango.DevString,
"Camera user name", None],
'inter_packet_delay':
[PyTango.DevLong,
"Inter Packet Delay",0],
'frame_transmission_delay':
[PyTango.DevLong,
"Frame Transmission Delay",0],
'packet_size':
[PyTango.DevLong,
"Network packet size (MTU)",8000],
}
cmd_list = {
'getAttrStringValueList':
[[PyTango.DevString, "Attribute name"],
[PyTango.DevVarStringArray, "Authorized String value list"]],
}
attr_list = {
'AcquisitionFrameRateEnable':
[[PyTango.DevBoolean,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'AcquisitionFrameRateAbs':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ_WRITE]],
}
def __init__(self,name) :
PyTango.DeviceClass.__init__(self,name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
_BaslerCam = None
_BaslerInterface = None
# packet_size = 8000 suppose the eth MTU is set at least to 8192 (Jumbo mode !)
# otherwise frame transfer can failed, the package size must but
# correspond to the MTU, see README file under Pylon-3.2.2 installation
# directory for for details about network optimization.
def get_control(frame_transmission_delay = 0, inter_packet_delay = 0,
packet_size = 8000,**keys) :
global _BaslerCam
global _BaslerInterface
if 'camera_id' in keys:
camera_id = keys['camera_id']
elif 'serial_number' in keys:
camera_id = 'sn://' + keys['serial_number']
elif 'cam_ip_address' in keys:
camera_id = 'ip://' + keys['cam_ip_address']
elif 'user_name' in keys:
camera_id = 'uname://' + keys['user_name']
else:
# if no property is present it uses the server personal name
# as Basler user name to identify the camera
util = PyTango.Util.instance()
camera_id = 'uname://' + util.get_ds_inst_name()
print ("basler camera_id:", camera_id)
if _BaslerCam is None:
_BaslerCam = BaslerAcq.Camera(camera_id, int(packet_size))
_BaslerCam.setInterPacketDelay(int(inter_packet_delay))
_BaslerCam.setFrameTransmissionDelay(int(frame_transmission_delay))
_BaslerInterface = BaslerAcq.Interface(_BaslerCam)
return Core.CtControl(_BaslerInterface)
def get_tango_specific_class_n_device():
return BaslerClass,Basler
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#=============================================================================
#
# file : Dexela.py
#
# description : Python source for the Dexela and its commands.
# The class is derived from Device. It represents the
# CORBA servant object which will be accessed from the
# network. All commands which can be executed on the
# Pilatus are implemented in this file.
#
# project : TANGO Device Server
#
# copyleft : European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
#=============================================================================
# (c) - Bliss - ESRF
#=============================================================================
#
import os
import PyTango
from Lima import Core
from Lima import Dexela as DexelaAcq
from Lima.Server import AttrHelper
class Dexela(PyTango.Device_4Impl):
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
self.init_device()
self.__Attribute2FunctionBase = {
}
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
#Full well mode
self.__FullWellMode = {'HIGH' : _DexelaInterface.High,
'LOW' : _DexelaInterface.Low}
self.__SkipFirstFrame = {'YES' : True,
'NO' : False}
#------------------------------------------------------------------
# getAttrStringValueList command:
#
# Description: return a list of authorized values if any
# argout: DevVarStringArray
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
#use AttrHelper
return AttrHelper.get_attr_string_value_list(self, attr_name)
#==================================================================
#
# Dexela read/write attribute methods
#
#==================================================================
def __getattr__(self,name) :
#use AttrHelper
return AttrHelper.get_attr_4u(self,name,_DexelaInterface)
#==================================================================
#
# DexelaClass class definition
#
#==================================================================
class DexelaClass(PyTango.DeviceClass):
class_property_list = {}
device_property_list = {
'format_file':
[PyTango.DevString,
"Format file",[]],
}
cmd_list = {
'getAttrStringValueList':
[[PyTango.DevString, "Attribute name"],
[PyTango.DevVarStringArray, "Authorized String value list"]],
}
attr_list = {}
def __init__(self,name) :
PyTango.DeviceClass.__init__(self,name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
_DexelaInterface = None
def get_control(format_file) :
global _DexelaInterface
if _DexelaInterface is None:
_DexelaInterface = DexelaAcq.Interface(format_file)
return Core.CtControl(_DexelaInterface)
def get_tango_specific_class_n_device():
return DexelaClass,Dexela
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#=============================================================================
#
# file : Eiger.py
#
# description : Python source for the Eiger and its commands.
# The class is derived from Device. It represents the
# CORBA servant object which will be accessed from the
# network. All commands which can be executed on the
# Eiger are implemented in this file.
#
# project : TANGO Device Server
#
# copyleft : European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
#=============================================================================
# This file is generated by POGO
# (Program Obviously used to Generate tango Object)
#
# (c) - Software Engineering Group - ESRF
#=============================================================================
#
import PyTango
import sys
from Lima import Core
from Lima.Server import AttrHelper
#==================================================================
# Eiger Class Description:
#
#
#==================================================================
class Eiger(PyTango.Device_4Impl):
#--------- Add you global variables here --------------------------
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,cl, name):
PyTango.Device_4Impl.__init__(self,cl,name)
self.init_device()
self.__CountrateCorrection = {'ON':True,
'OFF':False}
self.__FlatfieldCorrection = {'ON':True,
'OFF':False}
self.__AutoSummation = {'ON':True,
'OFF':False}
self.__EfficiencyCorrection = {'ON':True,
'OFF':False}
self.__VirtualPixelCorrection = {'ON':True,
'OFF':False}
self.__PixelMask = {'ON':True,
'OFF':False}
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
#------------------------------------------------------------------
# getAttrStringValueList command:
#
# Description: return a list of authorized values if any
# argout: DevVarStringArray
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
return AttrHelper.get_attr_string_value_list(self,attr_name)
#----------------------------------------------------------------------------
# delete all memory files
#----------------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def deleteMemoryFiles(self):
_EigerCamera.deleteMemoryFiles()
#==================================================================
#
# Eiger read/write attribute methods
#
#==================================================================
def __getattr__(self,name) :
return AttrHelper.get_attr_4u(self,name,_EigerCamera)
#==================================================================
#
# Eiger command methods
#
#==================================================================
#==================================================================
#
# EigerClass class definition
#
#==================================================================
class EigerClass(PyTango.DeviceClass):
# Class Properties
class_property_list = {
}
# Device Properties
device_property_list = {
'detector_ip_address':
[PyTango.DevString,
"Detector ip address",[]],
}
# Command definitions
cmd_list = {
'getAttrStringValueList':
[[PyTango.DevString, "Attribute name"],
[PyTango.DevVarStringArray, "Authorized String value list"]],
'deleteMemoryFiles':
[[PyTango.DevVoid, ""],
[PyTango.DevVoid, ""]],
}
# Attribute definitions
attr_list = {
'temperature':
[[PyTango.DevFloat,
PyTango.SCALAR,
PyTango.READ]],
'humidity':
[[PyTango.DevFloat,
PyTango.SCALAR,
PyTango.READ]],
'countrate_correction':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'flatfield_correction':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'auto_summation':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'efficiency_correction':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'virtual_pixel_correction':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'pixel_mask':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'threshold_energy':
[[PyTango.DevFloat,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'photon_energy':
[[PyTango.DevFloat,
PyTango.SCALAR,
PyTango.READ_WRITE]],
}
#------------------------------------------------------------------
# EigerClass Constructor
#------------------------------------------------------------------
def __init__(self, name):
PyTango.DeviceClass.__init__(self, name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
from Lima import Eiger as EigerAcq
_EigerIterface = None
_EigerCamera = None
def get_control(detector_ip_address = "0",**keys) :
global _EigerIterface
global _EigerCamera
if _EigerIterface is None:
_EigerCamera = EigerAcq.Camera(detector_ip_address)
_EigerIterface = EigerAcq.Interface(_EigerCamera)
return Core.CtControl(_EigerIterface)
def get_tango_specific_class_n_device() :
return EigerClass,Eiger
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#=============================================================================
#
# file : Fli.py
#
# description : Python source for the Fli and its commands.
# The class is derived from Device. It represents the
# CORBA servant object which will be accessed from the
# network. All commands which can be executed on the
# Pilatus are implemented in this file.
#
# project : TANGO Device Server
#
# copyleft : European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
#=============================================================================
# (c) - Bliss - ESRF
#=============================================================================
#
import PyTango
from Lima import Core
from Lima import Fli as FliAcq
from Lima.Server import AttrHelper
class Fli(PyTango.Device_4Impl):
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
self.__ExtTriggerLevel = {'LOW':0,
'HIGH':1}
self.__Attribute2FunctionBase = {
'temperature_sp': 'TemperatureSP',
'temperature_ccd': 'TemperatureCCD',
'temperature_base': 'TemperatureBase',
}
self.init_device()
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
if self.temperature_sp:
_FliInterface.setTemperatureSP(self.temperature_sp)
if self.ext_trigger_level:
_FliInterface.setExtTriggerLevel(self.__ExtTriggerLevel[self.ext_trigger_level])
#------------------------------------------------------------------
# getAttrStringValueList command:
#
# Description: return a list of authorized values if any
# argout: DevVarStringArray
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
#use AttrHelper
return AttrHelper.get_attr_string_value_list(self, attr_name)
#==================================================================
#
# Fli read/write attribute methods
#
#==================================================================
def __getattr__(self,name) :
#use AttrHelper
return AttrHelper.get_attr_4u(self,name,_FliInterface)
#==================================================================
#
# FliClass class definition
#
#==================================================================
class FliClass(PyTango.DeviceClass):
class_property_list = {}
device_property_list = {
# define one and only one of the following 4 properties:
'camera_path':
[PyTango.DevString,
"Camera device path", []],
'temperature_sp':
[PyTango.DevDouble,
'Temperature set point in Celsius', []],
'ext_trigger_level':
[PyTango.DevString,
'level of external trigger input ("LOW"/"HIGH")', []],
}
cmd_list = {
'getAttrStringValueList':
[[PyTango.DevString, "Attribute name"],
[PyTango.DevVarStringArray, "Authorized String value list"]],
}
attr_list = {
'cooler_power':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ],
{
'unit': '%',
'format': '%1f',
'description': 'cooler power (%)',
}],
'ext_trigger_level':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': 'N/A',
'format': '',
'description': 'external trigger input level, see manual for usage LOW or HIGH',
}],
'temperature_sp':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': 'C',
'format': '%1f',
'description': 'temperature set-point (C)',
}],
'temperature_ccd':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ],
{
'unit': 'C',
'format': '%1f',
'description': 'sensor temperature (C)',
}],
'temperature_base':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ],
{
'unit': 'C',
'format': '%1f',
'description': 'base (external) temperature (C)',
}],
}
def __init__(self,name) :
PyTango.DeviceClass.__init__(self,name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
_FliCam = None
_FliInterface = None
def get_control(camera_path='/dev/fliusb0',**keys) :
global _FliCam
global _FliInterface
print ("FLI camera path: ", camera_path)
if _FliCam is None:
_FliCam = FliAcq.Camera(camera_path)
_FliInterface = FliAcq.Interface(_FliCam)
return Core.CtControl(_FliInterface)
def get_tango_specific_class_n_device():
return FliClass,Fli
This diff is collapsed.
This diff is collapsed.
1.1.0
\ No newline at end of file
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#=============================================================================
#
# file : Lambda.py
#
# description : Python source for the Roper Scientific and its commands.
# The class is derived from Device. It represents the
# CORBA servant object which will be accessed from the
# network. All commands which can be executed on the
# Pilatus are implemented in this file.
#
# project : TANGO Device Server
#
# copyleft : European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
#=============================================================================
# (c) - Bliss - ESRF
#=============================================================================
#
import PyTango
from Lima import Core
from Lima import Lambda as LambdaAcq
from AttrHelper import get_attr_4u, get_attr_string_value_list
import AttrHelper
class Lambda(PyTango.Device_4Impl):
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
#self.__Attribute2FunctionBase = {'distortion_correction': 'DistortionCorrection',
# }
self.init_device()
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
return get_attr_string_value_list(self, attr_name)
def __getattr__(self,name) :
return get_attr_4u(self, name, _LambdaCam)
class LambdaClass(PyTango.DeviceClass):
class_property_list = {}
device_property_list = {
'config_path':
[PyTango.DevString,
"Path of the configuration file",[]],
}
cmd_list = {}
attr_list = {
'distortion_correction':
[[PyTango.DevUShort,
PyTango.SCALAR,
PyTango.READ]],
}
def __init__(self,name) :
PyTango.DeviceClass.__init__(self,name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
_LambdaCam = None
_LambdaInterface = None
def get_control(config_path = "",**keys) :
global _LambdaCam
global _LambdaInterface
if _LambdaCam is None:
_LambdaCam = LambdaAcq.Camera(config_path)
_LambdaInterface = LambdaAcq.Interface(_LambdaCam)
return Core.CtControl(_LambdaInterface)
def get_tango_specific_class_n_device():
return LambdaClass,Lambda
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
import PyTango
import sys
from Lima import Core
from Lima import PerkinElmer as PerkinElmerModule
from Lima.Server import AttrHelper
#==================================================================
# PerkinElmer Class Description:
#
#
#==================================================================
class PerkinElmer(PyTango.Device_4Impl):
#--------- Add you global variables here --------------------------
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,cl, name):
PyTango.Device_4Impl.__init__(self,cl,name)
self.init_device()
self.__CorrectionMode = {'NO' : _PerkinElmerIterface.No,
'OFFSET ONLY' : _PerkinElmerIterface.OffsetOnly,
'OFFSET AND GAIN' : _PerkinElmerIterface.OffsetAndGain}
self.__KeepFirstImage = {'YES' : True,
'NO' : False}
self.__Attribute2FunctionBase = {'gain': 'Gain',
'correction_mode': 'CorrectionMode',
'keep_first_image': 'KeepFirstImage',
}
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
#==================================================================
#
# PerkinElmer read/write attribute methods
#
#==================================================================
def __getattr__(self,name) :
return AttrHelper.get_attr_4u(self,name,_PerkinElmerIterface)
#==================================================================
#
# PerkinElmer command methods
#
#==================================================================
#------------------------------------------------------------------
# getAttrStringValueList command:
#
# Description: return a list of authorized values if any
# argout: DevVarStringArray
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
return AttrHelper.get_attr_string_value_list(self, attr_name)
@Core.DEB_MEMBER_FUNCT
def startAcqOffsetImage(self,nbImageNtime) :
nbImage = int(nbImageNtime[0])
expTime = nbImageNtime[1]
_PerkinElmerIterface.startAcqOffsetImage(nbImage,expTime)
@Core.DEB_MEMBER_FUNCT
def startAcqGainImage(self,nbImageNtime) :
nbImage = int(nbImageNtime[0])
expTime = nbImageNtime[1]
_PerkinElmerIterface.startAcqGainImage(nbImage,expTime)
#==================================================================
#
# PerkinElmerClass class definition
#
#==================================================================
class PerkinElmerClass(PyTango.DeviceClass):
# Class Properties
class_property_list = {
}
# Device Properties
device_property_list = {
}
# Command definitions
cmd_list = {
'getAttrStringValueList':
[[PyTango.DevString, "Attribute name"],
[PyTango.DevVarStringArray, "Authorized String value list"]],
'startAcqOffsetImage':
[[PyTango.DevVarDoubleArray, "nb frames,exposure time"],
[PyTango.DevVoid]],
'startAcqGainImage':
[[PyTango.DevVarDoubleArray, "nb frames,exposure time"],
[PyTango.DevVoid]],
}
# Attribute definitions
attr_list = {
'correction_mode':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'gain':
[[PyTango.DevLong,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'keep_first_image':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE]],
}
#------------------------------------------------------------------
# PerkinElmerClass Constructor
#------------------------------------------------------------------
def __init__(self, name):
PyTango.DeviceClass.__init__(self, name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
_PerkinElmerIterface = None
def get_control(**keys) :
global _PerkinElmerIterface
if _PerkinElmerIterface is None:
_PerkinElmerIterface = PerkinElmerModule.Interface()
return Core.CtControl(_PerkinElmerIterface)
def get_tango_specific_class_n_device() :
return PerkinElmerClass,PerkinElmer
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#=============================================================================
#
# file : PhotonicScience.py
#
# description : Python source for the Roper Scientific and its commands.
# The class is derived from Device. It represents the
# CORBA servant object which will be accessed from the
# network. All commands which can be executed on the
# Pilatus are implemented in this file.
#
# project : TANGO Device Server
#
# copyleft : European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
#=============================================================================
# (c) - Bliss - ESRF
#=============================================================================
#
import PyTango
from Lima import Core
from Lima import PhotonicScience as PhotonicScienceAcq
from Lima.Server import AttrHelper
class PhotonicScience(PyTango.Device_4Impl):
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
self.__Attribute2FunctionBase = {}
self.init_device()
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
return AttrHelper.get_attr_string_value_list(self, attr_name)
def __getattr__(self,name) :
return AttrHelper.get_attr_4u(self, name, PhotonicScienceAcq)
class PhotonicScienceClass(PyTango.DeviceClass):
class_property_list = {}
device_property_list = {
'camera_library_path':
[PyTango.DevString,
"Camera library path",[]],
}
cmd_list = {
'getAttrStringValueList':
[[PyTango.DevString, "Attribute name"],
[PyTango.DevVarStringArray, "Authorized String value list"]],
}
attr_list = {
}
def __init__(self,name) :
PyTango.DeviceClass.__init__(self,name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
_PhotonicScienceCam = None
_PhotonicScienceInterface = None
def get_control(camera_library_path = "",**keys) :
global _PhotonicScienceCam
global _PhotonicScienceInterface
if _PhotonicScienceCam is None:
_PhotonicScienceCam = PhotonicScienceAcq.Camera(camera_library_path)
_PhotonicScienceInterface = PhotonicScienceAcq.Interface(_PhotonicScienceCam)
return Core.CtControl(_PhotonicScienceInterface)
def get_tango_specific_class_n_device():
return PhotonicScienceClass,PhotonicScience
This diff is collapsed.
This diff is collapsed.
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
#=============================================================================
#
# file : PointGrey.py
#
# description : Python source for the PointGrey and its commands.
# The class is derived from Device. It represents the
# CORBA servant object which will be accessed from the
# network. All commands which can be executed on the
# Pilatus are implemented in this file.
#
# project : TANGO Device Server
#
# copyleft : MAX IV Laboratory
# Lund, Sweden
#
#=============================================================================
# (c) - Bliss - ESRF
#=============================================================================
#
import PyTango
from Lima import Core
from Lima import PointGrey as PointGreyAcq
from Lima.Server import AttrHelper
class PointGrey(PyTango.Device_4Impl):
Core.DEB_CLASS(Core.DebModApplication, 'LimaCCDs')
#------------------------------------------------------------------
# Device constructor
#------------------------------------------------------------------
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
self.init_device()
self.__Attribute2FunctionBase = { 'gain' : 'Gain'
, 'auto_gain' : 'AutoGain'
, 'exp_time' : 'ExpTime'
, 'auto_exp_time' : 'AutoExpTime'
, 'frame_rate' : 'FrameRate'
, 'auto_frame_rate' : 'AutoFrameRate'
, 'packet_size' : 'PacketSize'
, 'packet_delay' : 'PacketDelay'
}
#------------------------------------------------------------------
# Device destructor
#------------------------------------------------------------------
def delete_device(self):
pass
#------------------------------------------------------------------
# Device initialization
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def init_device(self):
self.set_state(PyTango.DevState.ON)
self.get_device_properties(self.get_device_class())
#------------------------------------------------------------------
# getAttrStringValueList command:
#
# Description: return a list of authorized values if any
# argout: DevVarStringArray
#------------------------------------------------------------------
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
#use AttrHelper
return AttrHelper.get_attr_string_value_list(self, attr_name)
#==================================================================
#
# PointGrey read/write attribute methods
#
#==================================================================
def __getattr__(self,name) :
#use AttrHelper
return AttrHelper.get_attr_4u(self, name, _PointGreyInterface)
def read_exp_time_range(self, attr):
min_, max_ = _PointGreyInterface.getExpTimeRange()
attr.set_value([min_, max_])
def read_gain_range(self, attr):
min_, max_ = _PointGreyInterface.getGainRange()
attr.set_value([min_, max_])
def read_frame_rate_range(self, attr):
min_, max_ = _PointGreyInterface.getFrameRateRange()
attr.set_value([min_, max_])
#==================================================================
#
# PointGreyClass class definition
#
#==================================================================
class PointGreyClass(PyTango.DeviceClass):
class_property_list = {}
device_property_list = {
'camera_serial':
[PyTango.DevLong,
"Camera serial number", []],
'packet_size':
[PyTango.DevLong,
"GigE packet size", [-1]],
'packet_delay':
[PyTango.DevLong,
"GigE packet delay", [-1]],
}
cmd_list = {
'getAttrStringValueList':
[[PyTango.DevString, "Attribute name"],
[PyTango.DevVarStringArray, "Authorized String value list"]],
}
attr_list = {
'gain':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': "dB",
}],
'auto_gain':
[[PyTango.DevBoolean,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'exp_time':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': "ms",
}],
'auto_exp_time':
[[PyTango.DevBoolean,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'frame_rate':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': "fps",
}],
'auto_frame_rate':
[[PyTango.DevBoolean,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'packet_size':
[[PyTango.DevLong,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'packet_delay':
[[PyTango.DevLong,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'exp_time_range':
[[PyTango.DevDouble,
PyTango.SPECTRUM,
PyTango.READ,2],
{
'unit': "ms",
'description':"min exposure, max exposure",
}],
'gain_range':
[[PyTango.DevDouble,
PyTango.SPECTRUM,
PyTango.READ,2],
{
'unit': "dB",
'description':"min gain, max gain",
}],
'frame_rate_range':
[[PyTango.DevDouble,
PyTango.SPECTRUM,
PyTango.READ,2],
{
'unit': "fps",
'description':"min frame rate, max frame rate",
}],
}
def __init__(self,name) :
PyTango.DeviceClass.__init__(self,name)
self.set_type(name)
#----------------------------------------------------------------------------
# Plugins
#----------------------------------------------------------------------------
_PointGreyCam = None
_PointGreyInterface = None
def get_control(camera_serial, packet_size, packet_delay):
global _PointGreyCam, _PointGreyInterface
if _PointGreyCam is None:
_PointGreyCam = PointGreyAcq.Camera(int(camera_serial),
int(packet_size),
int(packet_delay))
_PointGreyInterface = PointGreyAcq.Interface(_PointGreyCam)
return Core.CtControl(_PointGreyInterface)
def get_tango_specific_class_n_device():
return PointGreyClass, PointGrey
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.