本文整理汇总了Python中gda.epics.CAClient.isConfigured方法的典型用法代码示例。如果您正苦于以下问题:Python CAClient.isConfigured方法的具体用法?Python CAClient.isConfigured怎么用?Python CAClient.isConfigured使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gda.epics.CAClient
的用法示例。
在下文中一共展示了CAClient.isConfigured方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EpicsReadWritePVClass
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class EpicsReadWritePVClass(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())
output = self.getOutputFormat()[0] % output
return float(output)
except:
print "Error returning position"
return 0
def rawAsynchronousMoveTo(self,position):
self.new_position=position # need this attribute for some other classes
try:
if self.outcli.isConfigured():
self.outcli.caput(position)
else:
self.outcli.configure()
self.outcli.caput(position)
except:
print "error moving to position %f" % float(position)
def rawIsBusy(self):
return 0
示例2: DisplayEpicsPVClass
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class DisplayEpicsPVClass(ScannableBase):
"""Create PD to display single EPICS PV"""
def __init__(self, name, pvstring, unitstring, formatstring):
self.setName(name)
self.setInputNames([])
self.setExtraNames([name])
self.Units = [unitstring]
self.setOutputFormat([formatstring])
self.setLevel(3)
self.cli = CAClient(pvstring)
def atStart(self):
if not self.cli.isConfigured():
self.cli.configure()
def getPosition(self):
if self.cli.isConfigured():
return float(self.cli.caget())
else:
self.cli.configure()
return float(self.cli.caget())
self.cli.clearup()
def isBusy(self):
return 0
def atEnd(self):
if self.cli.isConfigured():
self.cli.clearup()
示例3: SingleEpicsPositionerClass
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class SingleEpicsPositionerClass(ScannableMotionBase):
'''Create PD for single EPICS positioner'''
def __init__(self, name, pvinstring, pvoutstring, pvstatestring, pvstopstring, 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)
self.statecli=CAClient(pvstatestring)
self.stopcli=CAClient(pvstopstring)
def rawGetPosition(self):
output=0.0
try:
if not self.outcli.isConfigured():
self.outcli.configure()
output=float(self.outcli.caget())
#self.outcli.clearup()
return float(output)
except:
print "Error returning position"
return 0
def rawAsynchronousMoveTo(self,new_position):
try:
if self.incli.isConfigured():
self.incli.caput(new_position)
else:
self.incli.configure()
self.incli.caput(new_position)
#self.incli.clearup()
except:
print "error moving to position"
def rawIsBusy(self):
try:
if self.statecli.isConfigured():
self.status = self.statecli.caget()
else:
self.statecli.configure()
self.status=self.statecli.caget()
#self.statecli.clearup()
return not int(self.status)
except:
print "problem with isMoving string: "+self.status+": Returning busy status"
return 1
def stop(self):
print "calling stop"
if self.stopcli.isConfigured():
self.stopcli.caput(1)
else:
self.stopcli.configure()
self.stopcli.caput(1)
示例4: DisplayEpicsPVClass
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
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
示例5: FunctionGenerator
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [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)
示例6: ADCChannel
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [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)
示例7: GasRigClass
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class GasRigClass(ScannableMotionBase):
'''Create a scannable for a gas injection rig'''
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)
def getState(self):
try:
if not self.statecli.isConfigured():
self.statecli.configure()
output=int(self.statecli.caget())
self.statecli.clearup()
else:
output=int(self.statecli.caget())
return sequence[output]
except:
print "Error returning current state"
return 0
def setSequence(self,new_position):
try:
if not self.setsequencecli.isConfigured():
self.setsequencecli.configure()
self.setsequencecli.caput(new_position)
self.setsequencecli.clearup()
else:
self.setsequencecli.caput(new_position)
except:
print "error setting sequence"
def atPressure(self):
try:
if not self.atpressurecli.isConfigured():
self.atpressurecli.configure()
self.atpressurecli.caput(1)
self.atpressurecli.clearup()
else:
self.atpressurecli.caput(1)
except:
print "error setting at_pressure"
示例8: SingleEpicsPositionerClass
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class SingleEpicsPositionerClass(ScannableBase):
"""Create PD for single EPICS positioner"""
def __init__(self, name, pvinstring, pvoutstring, pvstatestring, pvstopstring, unitstring, formatstring):
self.setName(name)
self.setInputNames([name])
self.setExtraNames([name])
self.Units = [unitstring]
self.setOutputFormat([formatstring])
self.setLevel(3)
self.incli = CAClient(pvinstring)
self.outcli = CAClient(pvoutstring)
self.statecli = CAClient(pvstatestring)
self.stopcli = CAClient(pvstopstring)
def atStart(self):
if not self.incli.isConfigured():
self.incli.configure()
if not self.outcli.isConfigured():
self.outcli.configure()
if not self.statecli.isConfigured():
self.statecli.configure()
if not self.stopcli.isConfigured():
self.stopcli.configure()
def getPosition(self):
output = 99
try:
if self.outcli.isConfigured():
# if not isinstance(self.outcli.caget(),type(None)):
# print self.outcli.caget()
return float(self.outcli.caget())
else:
self.outcli.configure()
output = self.outcli.caget()
if output == None:
raise Exception, "null pointer exception in getPosition"
self.outcli.clearup()
return float(output)
except Exception, e:
print "error in getPosition", e.getMessage(), e, output
raise e
示例9: HexapodAxis
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class HexapodAxis(PseudoDevice):
'''scannable or pseudo device for an individual, single Hexapod axis, it takes 8 inputs in the following order:
1. the name string of this object
2. the PV string for input target value
3. the PV string for read-back value
4. the PV string that control or start the motion
5. the positional tolerance within which the motor is treated as in-position
6. the unit string used for the measurement, keyworded as 'unitstring'
7. the format string for the return data, keyworded as 'formatstring'
8. the hexapod controller instance
for example,
hpx=HexapodAxis('hpx', 'ME02P-MO-BASE-01:UCS_X','ME02P-MO-BASE-01:UCSXR', 'ME02P-MO-BASE-01:START.PROC', 0.01, 'mm', '%9.4f', hexapodController)
'''
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
def atScanStart(self):
if not self.incli.isConfigured():
self.incli.configure()
if not self.outcli.isConfigured():
self.outcli.configure()
if not self.movecli.isConfigured():
self.movecli.configure()
def atScanEnd(self):
if self.incli.isConfigured():
self.incli.clearup()
if self.outcli.isConfigured():
self.outcli.clearup()
if self.movecli.isConfigured():
self.movecli.clearup()
def rawGetPosition(self):
try:
if self.outcli.isConfigured():
self.currentpos=float(self.outcli.caget())
else:
self.outcli.configure()
self.currentpos=float(self.outcli.caget())
self.outcli.clearup()
return self.currentpos
except Exception, err:
print "Error returning current position" + err
return 0
示例10: DataCapturer
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [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)
示例11: HexapodAxisStatus
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class HexapodAxisStatus(object):
'''Hexapod axis status class implementing position-compare algorithm with tolerance input. isBusy() method should be used to query the motion status of this axis.'''
def __init__(self, name, pvinstring, pvoutstring, tolerance=0.01):
self.name=name
self.incli=CAClient(pvinstring)
self.outcli=CAClient(pvoutstring)
self.currentpos=0.0
self.targetpos=0.0
self._tolerance=tolerance
def getCurrentPosition(self):
try:
if self.outcli.isConfigured():
self.currentpos=float(self.outcli.caget())
else:
self.outcli.configure()
self.currentpos=float(self.outcli.caget())
self.outcli.clearup()
return self.currentpos
except Exception, err:
print "Error returning current position of " + self.name + err
return 0
示例12: AdcControl
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [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)
示例13: EventReceiver
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [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)
示例14: AlicatMassFlowController
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class AlicatMassFlowController(ScannableMotionBase):
'''
scannable for set and get mass flow in a scannable way. It also provides method to query other mass flow properties.
'''
def __init__(self,name, rootPV, tolerance=0.01, formatstring="%.3f"):
'''
Constructor
'''
self.setName(name)
self.setInputNames([name])
self.setOutputFormat([formatstring])
self.setLevel(5)
self.currentflowcli=CAClient(rootPV+READ_MASS_FLOW)
self.setflowtargetcli=CAClient(rootPV+SET_MASS_FLOW_TARGET)
self.readflowtargetcli=CAClient(rootPV+READ_MASS_FLOW_TARGET)
self.currentgastypecli=CAClient(rootPV+READ_GAS_TYPE)
self.setfgastype1cli=CAClient(rootPV+SELECT_GAS_TYPE_1)
self.setfgastype2cli=CAClient(rootPV+SELECT_GAS_TYPE_2)
self.setgastypenumbercli=CAClient(rootPV+SET_GAS_TYPE_BY_NUMBER)
self.pressurecli=CAClient(rootPV+READ_PRESSURE_IN_BAR)
self.temperaturecli=CAClient(rootPV+READ_TEMPERATURE)
self.volumetricflowcli=CAClient(rootPV+READ_VOLUMETRIC_FLOW)
self.setproportionalgaincli=CAClient(rootPV+SET_PROPORTIONAL_GAIN)
self.readproportionalgaincli=CAClient(rootPV+READ_PROPORTIONAL_GAIN)
self.setderivativegaincli=CAClient(rootPV+SET_DERIVATIVE_GAIN)
self.readderivativegaincli=CAClient(rootPV+READ_DERIVATIVE_GAIN)
self.mytolerance=tolerance
def getTolerance(self):
return self.mytolerance
def setTolerance(self, value):
self.mytolerance=value
def getCurrentFlow(self):
try:
if not self.currentflowcli.isConfigured():
self.currentflowcli.configure()
output=float(self.currentflowcli.caget())
self.currentflowcli.clearup()
else:
output=float(self.currentflowcli.caget())
return output
except:
print "Error returning current flow value"
return 0
def setTarget(self, target):
try:
if not self.setflowtargetcli.isConfigured():
self.setflowtargetcli.configure()
self.setflowtargetcli.caput(target)
self.setflowtargetcli.clearup()
else:
self.setflowtargetcli.caput(target)
except:
print "error set to target flow value"
def getTarget(self):
try:
if not self.readflowtargetcli.isConfigured():
self.readflowtargetcli.configure()
output=float(self.currentflowcli.caget())
self.readflowtargetcli.clearup()
else:
output=float(self.readflowtargetcli.caget())
return output
except:
print "Error returning flow target value"
return 0
def getGasType(self):
#self.currentgastypecli does not work in EPICS
try:
if not self.setgastypenumbercli.isConfigured():
self.setgastypenumbercli.configure()
output=int(self.setgastypenumbercli.caget())
self.setgastypenumbercli.clearup()
else:
output=int(self.setgastypenumbercli.caget())
return gasTypes[output]
except:
print "Error returning current gas type"
return 0
def setGasType(self,name):
key=gasTypes.keys()[(gasTypes.values()).index(name)]
if int(key)>=0 or int(key) <16:
try:
if not self.setfgastype1cli.isConfigured():
self.setfgastype1cli.configure()
self.setfgastype1cli.caput(name)
self.setfgastype1cli.clearup()
else:
self.setfgastype1cli.caput(name)
except:
print "error set to gas type 1"
else:
try:
if not self.setfgastype2cli.isConfigured():
#.........这里部分代码省略.........
示例15: ScalerChannelEpicsPVClass
# 需要导入模块: from gda.epics import CAClient [as 别名]
# 或者: from gda.epics.CAClient import isConfigured [as 别名]
class ScalerChannelEpicsPVClass(ScannableBase):
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;
# self.setTimePreset(time)
def atStart(self):
if not self.chTP.isConfigured():
self.chTP.configure()
if not self.chCNT.isConfigured():
self.chCNT.configure()
if not self.chSn.isConfigured():
self.chSn.configure()
#Scannable Implementations
def getPosition(self):
return self.getCount();
def asynchronousMoveTo(self,newPos):
self.setCollectionTime(newPos);
self.collectData();
def isBusy(self):
return self.getStatus()
def atEnd(self):
if self.chTP.isConfigured():
self.chTP.clearup()
if self.chCNT.isConfigured():
self.chCNT.clearup()
if self.chSn.isConfigured():
self.chSn.clearup()
#Scaler 8512 implementations
def getTimePreset(self):
if self.chTP.isConfigured():
newtp = self.chTP.caget()
else:
self.chTP.configure()
newtp = float(self.chTP.caget())
self.chTP.clearup()
self.tp = newtp
return self.tp
#Set the Time Preset and start counting automatically
def setTimePreset(self, newTime):
self.tp = newTime
newtp = newTime;
if self.chTP.isConfigured():
tp = self.chTP.caput(newtp)
else:
self.chTP.configure()
tp = self.chTP.caput(newtp)
self.chTP.clearup()
# Thread.sleep(1000)
def getCount(self):
if self.chSn.isConfigured():
output = self.chSn.caget()
else:
self.chSn.configure()
output = self.chSn.caget()
self.chSn.clearup()
return float(output)
#Detector implementations
#Tells the detector to begin to collect a set of data, then returns immediately.
#public void collectData() throws DeviceException;
#Set the Time Preset and start counting automatically
def collectData(self):
#self.setTimePreset(self.tp)
if self.chCNT.isConfigured():
tp = self.chCNT.caput(1)
else:
self.chCNT.configure()
tp = self.chCNT.caput(1)
self.chCNT.clearup()
# Thread.sleep(1000)
#Tells the detector how long to collect for during a call of the collectData() method.
#public void setCollectionTime(double time) throws DeviceException;
def setCollectionTime(self, newTime):
self.setTimePreset(newTime)
#Returns the latest data collected.
#public Object readout() throws DeviceException;
def getCollectionTime(self):
nc=self.getTimePreset()
#.........这里部分代码省略.........