当前位置: 首页>>代码示例>>Python>>正文


Python CAClient.getChannel方法代码示例

本文整理汇总了Python中gda.epics.CAClient.getChannel方法的典型用法代码示例。如果您正苦于以下问题:Python CAClient.getChannel方法的具体用法?Python CAClient.getChannel怎么用?Python CAClient.getChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gda.epics.CAClient的用法示例。


在下文中一共展示了CAClient.getChannel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ADCChannel

# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import getChannel [as 别名]
class ADCChannel(ScannableMotionBase, MonitorListener):
    
    def __init__(self, name, pv):
        self.setName(name)
        self.setInputNames([])
        self.pvcli=CAClient(pv)
        self.nordcli=CAClient(pv+".NORD")
        self.monitoradded=False
        self.counter=0
        self.numberofgates=0
        self.numberofframes=0
        self.filename=None
        self.filenames=[]
        self.collectionNumber=0 #0 means no collectionNumber
        self.voltagesmonitor=None
        self.firstMonitor = True
        self.voltages = {}
        
    def resetCounter(self):
        self.counter=0
        
    def resetRepetition(self):
        self.collectionNumber=0
        
    def setCollectionNumber(self, num):
        self.collectionNumber=num
        
    def setNumberOfGates(self, num):
        self.numberofgates=num
        
    def setNumberOfFrames(self, num):
        self.numberofframes=num
        
    def getNumberOfGates(self):
        return self.numberofgates
    
    def getNumberOfFrames(self):
        return self.numberofframes
    
    def setFilename(self, filename):
        self.filename=filename
        
    def getFilename(self):
        return self.filename
    
    def getFilenames(self):
        return self.filenames
    
    def getValues(self):
        try:
            if not self.pvcli.isConfigured():
                self.pvcli.configure()
            return self.pvcli.cagetArrayDouble()
        except FactoryException, e:
            print "create channel error (%s): %s" % (self.pvcli.getChannel().getName(),e)
        except CAException, e:
            print "caput Error (%s): %s" % (self.pvcli.getChannel().getName(),e)
开发者ID:fajinyuan,项目名称:gda-dls-beamline-i11,代码行数:59,代码来源:adcchannel.py

示例2: FunctionGenerator

# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import getChannel [as 别名]
class FunctionGenerator(ScannableMotionBase):
    
    def __init__(self, name):
        self.setName(name)
        num = int(name[-1])
        #EPICS PVs
        func="BL11I-EA-FGEN-0%d:FUNC" % num
        output="BL11I-EA-FGEN-0%d:OUT" % num
        freq="BL11I-EA-FGEN-0%d:FREQ" % num
        freqrbv="BL11I-EA-FGEN-0%d:FREQ:RBV" % num
        amp="BL11I-EA-FGEN-0%d:AMP" % num
        amprbv="BL11I-EA-FGEN-0%d:AMP:RBV" % num
        offset="BL11I-EA-FGEN-0%d:OFF" % num
        offsetrbv="BL11I-EA-FGEN-0%d:OFF:RBV" % num
        sym="BL11I-EA-FGEN-0%d:SYMM" % num
        symrbv="BL11I-EA-FGEN-0%d:SYMM:RBV" % num
        
        dutycyc="BL11I-EA-FGEN-0%d:DCYC" % num
        dutycycrbv="BL11I-EA-FGEN-0%d:DCYC:RBV" % num
        trigger="BL11I-EA-FGEN-0%d:TRIGSRC" % num
        burstmode="BL11I-EA-FGEN-0%d:BURSTMODE" % num
        burstncyc="BL11I-EA-FGEN-0%d:BURSTNCYC" % num
        burstncycrbv="BL11I-EA-FGEN-0%d:BURSTNCYC:RBV" % num
        burststate="BL11I-EA-FGEN-0%d:BURST" % num
        disable="BL11I-EA-FGEN-0%d:DISABLE" % num        
        
        self.setInputNames(["frequency","amplitude","shift","symmetry"])
        self.setExtraNames([])
        self.function=CAClient(func)
        self.output=CAClient(output)
        self.frequency=CAClient(freq)
        self.frequencyrbv=CAClient(freqrbv)
        self.amplitude=CAClient(amp)
        self.amplituderbv=CAClient(amprbv)
        self.shiftcli=CAClient(offset)
        self.shiftrbv=CAClient(offsetrbv)
        self.symmetry=CAClient(sym)
        self.symmetryrbv=CAClient(symrbv)
        self.dutycycle=CAClient(dutycyc)
        self.dutycyclerbv=CAClient(dutycycrbv)
        self.triggersrc=CAClient(trigger)
        self.burstmode=CAClient(burstmode)
        self.burstncyc=CAClient(burstncyc)
        self.burstncycrbv=CAClient(burstncycrbv)
        self.burststate=CAClient(burststate)
        self.disable=CAClient(disable)
        
    # function generator controls
    def setFunction(self, function):
        try:
            if not self.function.isConfigured():
                self.function.configure()
            self.function.caputWait(function)
        except FactoryException, e:
            print "create channel error (%s): %s" % (self.function.getChannel().getName(),e)
        except CAException, e:
            print "caput Error (%s): %s" % (self.function.getChannel().getName(),e)
开发者ID:fajinyuan,项目名称:gda-dls-beamline-i11,代码行数:59,代码来源:functiongenerator.py

示例3: DataCapturer

# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import getChannel [as 别名]
class DataCapturer(ScannableMotionBase, MonitorListener):
    
    def __init__(self, name, adc, hv=adcppv, el=adcepv, gate=adcgatepv): 
        self.setName(name)
        self.setInputNames(["HV","Electrometer","gate"])
        self.hv=hv
        self.el=el
        self.gate=gate
        self.voltagecli=CAClient(hv)
        self.electrometercli=CAClient(el)
        self.gatecli=CAClient(gate)
        self.monitoradded=False
        self.filename=None
        self.voltagemonitor=None
        self.electrometermonitor=None
        self.gatemonitor=None
        self.firstMonitor = True
        self.data={hv:[],el:[],gate:[]}
        self.voltages = []      # for holding voltage data array
        self.electrometers=[]   # for holding electrometer data array
        self.gates=[]
        self.firstData = True
        self.updatecounter=0
        self.capturecounter=0
        self.adc=adc
    
    def reset(self):
        self.electrometers = []
        self.voltages = []
        self.gates=[]
        self.updatecounter=0
        self.capturecounter=0
        self.firstData = True
        self.adc.disable()
        self.data={self.hv:[],self.el:[],self.gate:[]}
        
    def setFilename(self, filename):
        self.filename=filename
        
    def getFilename(self):
        return self.filename
    
    def getElectrometer(self, num):
        ''' retrieve electrometer data from Keithley amplifier.
        '''
        try:
            if not self.electrometercli.isConfigured():
                self.electrometercli.configure()
            return self.electrometercli.cagetArrayDouble(num)
        except FactoryException, e:
            print "create channel error (%s): %s" % (self.electrometercli.getChannel().getName(),e)
        except CAException, e:
            print "caget Error (%s): %s" % (self.electrometercli.getChannel().getName(),e)
开发者ID:fajinyuan,项目名称:gda-dls-beamline-i11,代码行数:55,代码来源:pedatacapturer_continuous.py

示例4: AdcControl

# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import getChannel [as 别名]
class AdcControl(ScannableMotionBase):
    
    def __init__(self, name):
        self.setName(name)
        num = int(name[-1])
        #EPICS PVs
        mode="BL11I-EA-ADC-0%d:MODE" % num
        rate="BL11I-EA-ADC-0%d:CLOCKRATE" % num
        enable="BL11I-EA-ADC-0%d:ENABLE" % num
        samples="BL11I-EA-ADC-0%d:SAMPLES:OUT" % num
        clock="BL11I-EA-ADC-0%d:EXTCLOCK" % num
        reenable="BL11I-EA-ADC-0%d:REENABLE" % num
        offset="BL11I-EA-ADC-0%d:OFFSET:OUT" % num
        average="BL11I-EA-ADC-0%d:AVERAGE:OUT" % num
        softtrig="BL11I-EA-ADC-0%d:SOFTTRIGGER.VAL" % num

        self.setInputNames(["ADC Mode","Clock Rate","Enable","Samples"])
        self.setExtraNames([])
        self.setOutputFormat(["%s","%s","%s","%d"])
        self.mode=CAClient(mode)
        self.rate=CAClient(rate)
        self.enableField=CAClient(enable)
        self.samples=CAClient(samples)
        self.clock=CAClient(clock)
        self.reenable=CAClient(reenable)
        self.adcoffset=CAClient(offset)
        self.average=CAClient(average)
        self.softtrig=CAClient(softtrig)
        
    def continuousMode(self):
        try:
            if not self.mode.isConfigured():
                self.mode.configure()
            self.mode.caput(0)
        except FactoryException, e:
            print "create channel error (%s): %s" % (self.mode.getChannel().getName(),e)
        except CAException, e:
            print "caput Error (%s): %s" % (self.mode.getChannel().getName(),e)
开发者ID:fajinyuan,项目名称:gda-dls-beamline-i11,代码行数:40,代码来源:adccontrol.py

示例5: EventReceiver

# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import getChannel [as 别名]
class EventReceiver(ScannableMotionBase):
    
    def __init__(self, name, delay=evrdelaypv, delayrbv=evrdelayrbv, width=evrwidthpv, widthrbv=evrwidthrbv, enable=evrenablepv, polarity=evrpolaritypv):
        self.setName(name)
        self.setInputNames(["delay", "width"])
        self.setExtraNames([])
        self.delay=CAClient(delay)
        self.delayrbv=CAClient(delayrbv)
        self.width=CAClient(width)
        self.widthrbv=CAClient(widthrbv)
        self._enable=CAClient(enable)
        self.polarity=CAClient(polarity)
    
    # function generator controls
    def enableField(self):
        try:
            if not self._enable.isConfigured():
                self._enable.configure()
            self._enable.caput(1)
        except FactoryException, e:
            print "create channel error (%s): %s" % (self._enable.getChannel().getName(),e)
        except CAException, e:
            print "caput Error (%s): %s" % (self._enable.getChannel().getName(),e)
开发者ID:fajinyuan,项目名称:gda-dls-beamline-i11,代码行数:25,代码来源:eventreceiver.py

示例6: ADC

# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import getChannel [as 别名]
class ADC(ScannableMotionBase, MonitorListener):
    
    def __init__(self, name, hv=adcppv, el=adcepv, gate=adcgatepv):
        self.setName(name)
        self.setInputNames([])
        self.hv=hv
        self.el=el
        self.gate=gate
        self.voltagecli=CAClient(hv)
        self.electrometercli=CAClient(el)
        self.gatecli=CAClient(gate)
        self.voltagenordcli=CAClient(hv+".NORD")
        self.electrometernordcli=CAClient(el+".NORD")
        self.monitoradded=False
        self.filename=None
        self.voltagemonitor=None
        self.electrometermonitor=None
        self.gatemonitor=None
        self.firstMonitor = True
        self.data={hv:[],el:[],gate:[]}
        self.voltages = []      # for holding voltage data array
        self.electrometers=[]   # for holding electrometer data array
        self.gates=[]
        self.firstData = True
        self.fastmode = False
        self.numberofgate=0
        self.fastMode=True
        self.updatecounter=0
        self.collectionNumber=1
               
    def setNumberOfGates(self, ng):
        self.numberofgate=ng
        
    def getNumberOfGates(self):
        return self.numberofgate
    
    def getCollectionNumber(self):
        return self.collectionNumber
    
    def setCollectionNumber(self, num):
        self.collectionNumber=num
    
    def isFastMode(self):
        return self.fastMode
    
    def setFastMode(self, mode):
        self.fastMode=mode
        
    def reset(self):
        self.electrometers = []
        self.voltages = []
        self.updatecounter=0
        self.collectionNumber=1
        
    def setFilename(self, filename):
        self.filename=filename
        
    def getFilename(self):
        return self.filename
    
    def getElectrometer(self, num):
        try:
            if not self.electrometercli.isConfigured():
                self.electrometercli.configure()
            return self.electrometercli.cagetArrayDouble(num)
        except FactoryException, e:
            print "create channel error (%s): %s" % (self.electrometercli.getChannel().getName(),e)
        except CAException, e:
            print "caget Error (%s): %s" % (self.electrometercli.getChannel().getName(),e)
开发者ID:fajinyuan,项目名称:gda-dls-beamline-i11,代码行数:71,代码来源:adc.py


注:本文中的gda.epics.CAClient.getChannel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。