Exemple #1
0
                if len(results) < 7:
                    # input file format problem
                    raise
                
                if results[1] != 'NULL':
                    channels.append(Channel((u'%s' %results[1]), 'vioc', properties=buildProps(results, results[1], 'readback')))
                    #name = u'%s' % result[1]
                    #channels.append(Channel(name, 'vioc', properties=buildProps(results, results[1], 'readback')))
                    #client.set(channel = Channel((u'%s' %results[1]), 'vioc', properties=buildProps(results, results[1], 'readback')))
                if results[2] != 'NULL':
                    channels.append(Channel((u'%s' %results[2]), 'vioc', properties=buildProps(results, results[2], 'setpoint')))
                    #name = u'%s' % result[2]
                    #channels.append(Channel(name, 'vioc', properties=buildProps(results, results[2], 'readback')))
                    #client.set(channel = Channel((u'%s' %results[2]), 'vioc', properties=buildProps(results, results[2], 'setpoint')))
        beg = time.time()
        client.set(channels=channels)
        end = time.time()
        print ('%.6f' % (end-beg))
    finally:
        f.close()
    
#    channels = client.getAllChannels()
    channels = client.find(name='SR*')
    print len(channels)
#    beg = time.time()
    for channel in channels:
        print channel.Name
#        client.remove(channelName=(u'%s' % channel.Name))
    end = time.time()
#    print ('%.6f' % (end-beg))
Exemple #2
0
from channelfinder.ChannelFinderClient import ChannelFinderClient
from channelfinder.Channel import Tag

if __name__ == '__main__':
    cf = ChannelFinderClient(BaseURL = 'http://channelfinder.nsls2.bnl.gov:8080/ChannelFinder', username='******', password='******')
    
    # set one tag
    tag = Tag('example1', 'vioc')
    cf.set(tag=tag)
    
    # set a set of tags
    tags = [Tag('example2', 'vioc'), Tag('example3', 'vioc'), Tag('example4', 'vioc'), Tag('example5', 'vioc')]
    cf.set(tags=tags)
    
    channels = cf.find(name='SR*')
    channelNames = [channel.Name for channel in channels]
    
    # set a tag to many channels
    cf.set(tag=tag, channelNames=channelNames)
    
    # set tags to many channels
    for tag in tags:
        cf.set(tag=tag, channelNames=channelNames)

    # retrieve channel, properties, and tags
#    channels = cf.find(name='SR*')
#    for channel in channels:
#        print channel.Name
#        # get tags for each channel
#        tmp_tags = channel.getTags()
Exemple #3
0
        password='******')

    # set one tag
    tag = Tag('example1', 'vioc')
    cf.set(tag=tag)

    # set a set of tags
    tags = [
        Tag('example2', 'vioc'),
        Tag('example3', 'vioc'),
        Tag('example4', 'vioc'),
        Tag('example5', 'vioc')
    ]
    cf.set(tags=tags)

    channels = cf.find(name='SR*')
    channelNames = [channel.Name for channel in channels]

    # set a tag to many channels
    cf.set(tag=tag, channelNames=channelNames)

    # set tags to many channels
    for tag in tags:
        cf.set(tag=tag, channelNames=channelNames)

    # retrieve channel, properties, and tags
#    channels = cf.find(name='SR*')
#    for channel in channels:
#        print channel.Name
#        # get tags for each channel
#        tmp_tags = channel.getTags()