def __check_dets(self,dets): try: if (type(dets[0]) is tuple): dets=dets[0] except: pass dd = [] for i in range(len(dets)): if (self.__monitor != dets[i]): dd.append(dets[i]) if (self.__dets is not None): for i in range(len(self.__dets)): if (self.__monitor != self.__dets[i]): dd.append(self.__dets[i]) if (self.__monitor is not None): try : dd.index(self.__monitor) except: dd.append(self.__monitor) if (self.__filter_det is not None): filter_aminame = self.__filter_det.aminame filter_str = "%f<%s<%f" % (self.__filter_min,filter_aminame,self.__filter_max) for i in range(len(dd)): dd[i].pyamiE = pyami.Entry(dd[i].aminame,"Scalar",filter_str) else: for i in range(len(dd)): dd[i].pyamiE = pyami.Entry(dd[i].aminame,"Scalar") return dd
def connect(self): if (self.pyamiE is not None): return try: self.pyamiE = pyami.Entry(self.aminame) except RuntimeError: s = "detector %s cannot be found" % self.name logprint(s, print_screen=True) self.pyamiE = None
def create_ami(self, type): try: if type == "Scalar": if self.__filter_string is None: self.pyamiE = pyami.Entry(self.aminame, "Scalar") else: self.pyamiE = pyami.Entry(self.aminame, "Scalar", self.__filter_string) elif type == "SingleImage": self.pyamiE = pyami.Entry(det_id=self.aminame, channel=self.channel, op='single') else: self.pyamiE = pyami.Entry(self.aminame, self.channel) except RuntimeError: s = "detector %s cannot be found" % self.name logprint(s, print_screen=True) self.pyamiE = None
def create_ami(self): try: if self.__filter_string is None: #print "MATT: about to create ami entry" self.pyamiE = pyami.Entry(self.aminame, "Scalar") #print "MATT: created ami entry" pass else: #print "MATT: about to create ami entry" self.pyamiE = pyami.Entry(self.aminame, "Scalar", self.__filter_string) #print "MATT: created ami entry" pass except RuntimeError: s = "detector %s cannot be found" % self.name logprint(s, print_screen=True) self.pyamiE = None pass pass
# # Wait for the user to declare 'ready' # Setting up monitoring displays for example # if options.wait: ready = raw_input('--Hit Enter when Ready-->') else: time.sleep(options.tsleep) # x = pyami.Entry('XppEnds_Ipm0:FEX:CH1','Scan','EventId',options.events) # x = pyami.Entry('XcsEndstation-0|Ipimb-1:CH1','Scan','EventId',options.events) # x = pyami.Entry('XppSb2_Ipm:FEX:SUM','Scalar') # x = pyami.Entry('ProcTime','Scalar') x = pyami.Entry('EventId', 'Scalar') for cycle in range(options.cycles): x.clear() daq.begin(controls=[('EXAMPLEPV1', cycle), ('EXAMPLEPV2', 100 - cycle)], labels=[('EXAMPLELABEL1', 'CYCLE%d' % cycle), ('EXAMPLELABEL2', 'LCYCLE%d' % options.cycles)]) # enable the EVR sequence, if necessary # wait for disabled, then disable the EVR sequence daq.end() v = x.get()
class AmiScalar(pyami.Entry): def __init__(self, name): pyami.Entry.__init__(self, name) class AmiAcqiris(pyami.Entry): def __init__(self, detid, channel): pyami.Entry.__init__(self, detid, channel) eth_lo = 0x7f000001 eth_mc = 0xefff63e5 CxiAcq = 0x18000200 AmoETof = 0x03000200 pyami.connect(eth_mc, eth_lo, eth_lo) x = pyami.Entry("ProcTime", "Scan", "EventId", 20) print x.get() name_list = [("ProcLatency", ), ("ProcTime", ), ("ProcTimeAcc", "Scan", "EventId", 20)] x = pyami.EntryList(name_list) print x.get() print 'Again' print x.get() x = AmiAcqiris(AmoETof, 1) x.get()