def create_device(ctrl, addr, axis): db = Database() new_device_info_mcc = DbDevInfo() new_device_info_mcc._class = "PhytronMcc2" new_device_info_mcc.server = "PhytronMcc2/raspi14" new_device = NAME + ctrl + '_' + addr + '_' + axis print("Creating device: %s" % new_device) new_device_info_mcc.name = new_device db.add_device(new_device_info_mcc) return (new_device)
d = DeviceProxy(args[dev]) except DevFailed: pass if d: print 'Device aleady exist, skipping' exit() db = Database() print 'Creating LimaCCDs device' lima = DbDevInfo() lima._class = 'LimaCCDs' lima.server = 'LimaCCDs/{instance}'.format(instance=args['name']) lima.name = args['lima'] db.add_device(lima) print 'Creating Xspress3 device' x3 = DbDevInfo() x3._class = 'Xspress3' x3.server = 'LimaCCDs/{instance}'.format(instance=args['name']) x3.name = args['xspress3'] db.add_device(x3) print 'Setting Properties' lima = DeviceProxy(args['lima']) lima.put_property({'LimaCameraType': 'Xspress3'}) x3 = DeviceProxy(args['xspress3']) x3.put_property({ 'baseIPaddress': '192.168.0.1',
from PyTango import Database, DbDevInfo # A reference on the DataBase db = Database() # The devices name we want to create new_device_name = "PIStageTango/ktof/pi_stage/test/c413test" # Define the Tango Class served by this DServer new_device_info_stage = DbDevInfo() new_device_info_stage._class = "linear Stage" new_device_info_stage.server = "TangoTest" # add the device print("Creating device: %s" % new_device_name) new_device_info_stage.name = new_device_name db.add_device(new_device_info_stage)
from PyTango import Database, DbDevInfo # A reference on the DataBase db = Database() new_device_name1 = "test/powersupply/1" # Define the Tango Class served by this DServer new_device_info_mouse = DbDevInfo() new_device_info_mouse._class = "PowerSupply" new_device_info_mouse.server = "PowerSupplyDS/test" #servername/instance # add the first device print("Creating device: %s" % new_device_name1) new_device_info_mouse.name = new_device_name1 db.add_device(new_device_info_mouse)
"""Created Receiving device server class""" class Receiving(Device): __metaclass__ = DeviceMeta def init_device(self): Device.init_device(self) self.set_state(DevState.STANDBY) self.debug_stream("Init Receiving Device.") @command(dtype_in='DevVarStringArray', dtype_out=None) def log(self, details): message = details[3] # print(message) self.debug_stream(message) """This part is needed to start device server from command line""" if '--register' in sys.argv: reg_ind = sys.argv.index('--register') sys.argv.pop(reg_ind) name = sys.argv.pop(reg_ind) db = Database() dev_info = DbDevInfo() dev_info._class = 'Receiving' dev_info.server = 'ReceivingDS/logdev' dev_info.name = name db.add_device(dev_info) print("In registration") else: print("Running DS") run([Receiving])
# A reference on the Database db = Database() # Define device name new_device_name = "test/tpm_board/1" # Define the Tango Class served by this DServer dev_info = DbDevInfo() dev_info._class = "TPM_DS" dev_info.server = "TPM_DS/test" # add the device dev_info.name = new_device_name print("Creating device: %s" % new_device_name) db.add_device(dev_info) # SECOND DEVICE # Define device name new_device_name = "test/tpm_board/2" # Define the Tango Class served by this DServer dev_info = DbDevInfo() dev_info._class = "TPM_DS" dev_info.server = "TPM_DS/test" # add the device dev_info.name = new_device_name print("Creating device: %s" % new_device_name)
from PyTango import Database, DbDevInfo # A reference on the DataBase db = Database() new_device_name1 = "C3/unity/eras1" # Define the Tango Class served by this DServer new_device_info_mouse = DbDevInfo() new_device_info_mouse._class = "PyTracker" new_device_info_mouse.server = "tango_pygame/eras1" #servername/instance # add the first device print("Creating device: %s" % new_device_name1) new_device_info_mouse.name = new_device_name1 db.add_device(new_device_info_mouse)