コード例 #1
0
            tmp = re.match(r'.*(C\d{1,2}).*(G\d{1,2})(.).*', channame)
            properties.append(Property('cell', 'vioc', tmp.groups()[0]))
            properties.append(Property('girder', 'vioc', tmp.groups()[1]))
            properties.append(Property('symmetry', 'vioc', tmp.groups()[2]))
#        properties.append(Property('cell', 'vioc', tmp.groups()[0]))
#        properties.append(Property('girder', 'vioc', tmp.groups()[1]))
#        properties.append(Property('symmetry', 'vioc', tmp.groups()[2]))
        except:
            raise

    properties.append(Property('handle', 'vioc', chtype))
    return properties

if __name__ == '__main__':
    baseurl = 'http://channelfinder.nsls2.bnl.gov:8080/ChannelFinder'
    client = ChannelFinderClient(BaseURL=baseurl, username='******', password='******')
    # you can use browser to view results
    # http://channelfinder.nsls2.bnl.gov:8080/ChannelFinder/resources/channels?~name=SR*
    
    addProps(client)

    try:
        # the file has the following attributes:
        #index, read back, set point, phys name, len[m], s[m], type
        f = open('lat_conf_table.txt', 'r')
        lines = f.readlines()
        channels = []
        for line in lines:
            if not (line.startswith('#') or line.startswith('!') or not line.strip()):
                results = line.split()
                if len(results) < 7:
コード例 #2
0
ファイル: demo.py プロジェクト: dylan171/pyCFClient
    
  

Created on Mar 14, 2011
         National Synchrotron Radiation Facility II
         Brookhaven National Laboratory
         PO Box 5000, Upton, New York, 11973-5000

@author: G. Shen
"""

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)
    
コード例 #3
0
ファイル: demo.py プロジェクト: archman/pyCFClient
  

Created on Mar 14, 2011
         National Synchrotron Radiation Facility II
         Brookhaven National Laboratory
         PO Box 5000, Upton, New York, 11973-5000

@author: G. Shen
"""

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)