本文整理汇总了Python中gda.epics.CAClient类的典型用法代码示例。如果您正苦于以下问题:Python CAClient类的具体用法?Python CAClient怎么用?Python CAClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CAClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DisplayEpicsPVClass
class DisplayEpicsPVClass(ScannableMotionBase):
'''Create PD to display single EPICS PV'''
def __init__(self, name, pvstring, unitstring, formatstring):
self.setName(name);
self.setInputNames([name])
self.Units=[unitstring]
self.setOutputFormat([formatstring])
self.setLevel(8)
self.outcli=CAClient(pvstring)
def rawGetPosition(self):
output=0.0
try:
if not self.outcli.isConfigured():
self.outcli.configure()
output=float(self.outcli.caget())
#print output
#sleep(10)
#self.outcli.clearup()
output = self.getOutputFormat()[0] % output
return float(output)
except:
print "Error returning position"
return 0
def rawAsynchronousMoveTo(self,position):
return
def rawIsBusy(self):
return 0
示例2: __init__
def __init__(self, name, rootPV):
self.setName(name);
self.setInputNames([name])
self.setLevel(3)
self.setsequencecli=CAClient(rootPV+SEQUENCE_CONTROL)
self.statecli=CAClient(rootPV+SEQUENCE_STATUS)
self.atpressurecli=CAClient(rootPV+AT_PRESSURE_PROC)
示例3: __init__
def __init__(self, name, pvinstring, pvoutstring, unitstring, formatstring):
self.setName(name)
self.setInputNames([name])
self.Units = [unitstring]
self.setOutputFormat([formatstring])
self.setLevel(3)
self.incli = CAClient(pvinstring)
self.outcli = CAClient(pvoutstring)
示例4: __init__
def __init__(self, name, rootPV):
self.setName(name);
self.setInputNames([name])
self.setLevel(5)
self.setsequencecli=CAClient(rootPV+SEQUENCE_CONTROL)
self.statecli=CAClient(rootPV+SEQUENCE_STATUS)
self.systemincli=CAClient(SystemTargetPressure)
self.sampleincli=CAClient(SampleTargetPressure)
示例5: __init__
def __init__(self, name, rootPV):
self.setName(name);
self.setInputNames([name])
self.setLevel(5)
self.controlcli=CAClient(rootPV+VALVE_CONTROL)
self.statecli=CAClient(rootPV+VALVE_STATUS)
self.modecli=CAClient(rootPV+VALVE_MODE)
self.interlockscli=CAClient(rootPV+VALVE_INTERLOCKS)
self.operationscli=CAClient(rootPV+VALVE_OPERATIONS)
示例6: ADCChannel
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)
示例7: dark_current
def dark_current(self):
#offsets not persistent - do dark current with beam off
[A1,A2,B1,B2,C1,C2,D1,D2,GX,GY]=self.get_params()
self.configcli=CAClient(self.pvrootstring+':PHD4:I_R');self.configcli.configure(); A2=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':PHD2:I_R');self.configcli.configure(); B2=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':PHD1:I_R');self.configcli.configure(); C2=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':PHD3:I_R');self.configcli.configure(); D2=float(self.configcli.caget()); self.configcli.clearup()
self.set_params([A1,A2,B1,B2,C1,C2,D1,D2,GX,GY])
print 'new dark currents (i4,i2,i1,i3):', [A2, B2, C2, D2]
示例8: __init__
def __init__(self, name, strChTP, strChCNT, strChSn):
self.setName(name);
self.setInputNames([]);
self.setExtraNames([name]);
# self.Units=[strUnit];
#self.setLevel(5);
self.setOutputFormat(["%20.12f"]);
self.chTP=CAClient(strChTP);
self.chCNT=CAClient(strChCNT);
self.chSn=CAClient(strChSn);
self.tp = -1;
示例9: DataCapturer
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)
示例10: get_params
def get_params(self):
self.configcli=CAClient(self.pvrootstring+':A1_SP');self.configcli.configure(); A1=float(self.configcli.caget());self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':A2_SP');self.configcli.configure(); A2=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':B1_SP');self.configcli.configure(); B1=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':B2_SP');self.configcli.configure(); B2=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':C1_SP');self.configcli.configure(); C1=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':C2_SP');self.configcli.configure(); C2=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':D1_SP');self.configcli.configure(); D1=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':D2_SP');self.configcli.configure(); D2=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':GX_SP');self.configcli.configure(); GX=float(self.configcli.caget()); self.configcli.clearup()
self.configcli=CAClient(self.pvrootstring+':GY_SP');self.configcli.configure(); GY=float(self.configcli.caget()); self.configcli.clearup()
return [A1,A2,B1,B2,C1,C2,D1,D2,GX,GY]
示例11: set_params
def set_params(self,params):
[A1,A2,B1,B2,C1,C2,D1,D2,GX,GY]=params
self.configcli=CAClient(self.pvrootstring+':A1_SP');self.configcli.configure(); self.configcli.caput(A1); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':A2_SP');self.configcli.configure(); self.configcli.caput(A2); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':B1_SP');self.configcli.configure(); self.configcli.caput(B1); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':B2_SP');self.configcli.configure(); self.configcli.caput(B2); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':C1_SP');self.configcli.configure(); self.configcli.caput(C1); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':C2_SP');self.configcli.configure(); self.configcli.caput(C2); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':D1_SP');self.configcli.configure(); self.configcli.caput(D1); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':D2_SP');self.configcli.configure(); self.configcli.caput(D2); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':GX_SP');self.configcli.configure(); self.configcli.caput(GX); self.configcli.clearup();
self.configcli=CAClient(self.pvrootstring+':GY_SP');self.configcli.configure(); self.configcli.caput(GY); self.configcli.clearup();
示例12: __init__
def __init__(self, name, pvinstring, pvoutstring, pvstopstring, tolerance, unitstring, formatstring, upperlimit, lowerlimit):
self.setName(name);
self.setInputNames([name])
self.Units=[unitstring]
self.setOutputFormat([formatstring])
self.setLevel(5)
self.incli=CAClient(pvinstring)
self.outcli=CAClient(pvoutstring)
self.stopcli=CAClient(pvstopstring)
self._tolerance=tolerance
self.setUpperGdaLimits(upperlimit)
self.setLowerGdaLimits(lowerlimit)
示例13: __init__
def __init__(self, name, pv_set, pv_read, timeout, tolerance = 0.0005): #BL16B-EA-PSU-01
self.name = name
self.inputNames = [name]
self.outputFormat = ['%6.4f']
self.timeout = timeout
self.tol = tolerance
self._time_triggered = None
self._last_target = None
self._pv_set = CAClient(pv_set)
self._pv_read = CAClient(pv_read)
self._pv_set.configure()
self._pv_read.configure()
示例14: __init__
def __init__(self, name, pvinstring, pvoutstring, pvctrlstring, tolerance=0.01, unitstring='mm', formatstring='%9.4f', controller=None):
self.setName(name);
self.setInputNames([name])
self.Units=[unitstring]
self.setOutputFormat([formatstring])
self.setLevel(3)
self.incli=CAClient(pvinstring)
self.outcli=CAClient(pvoutstring)
self.movecli=CAClient(pvctrlstring)
self.lastpos=0.0
self.currentpos=0.0
self.targetpos=0.0
self._tolerance=tolerance
self.controller=controller
示例15: __init__
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