def __init__(self, manager, name): """ Default constructor @param manager Reference to PVSS ControlManager @param name Name of the Streaming Partition datapoint Note: This is the name of the slice - not the name of the detector partition @return reference to initialized object """ self.name = name self.manager = manager self.tasks = PVSS.DataPointVector() self.datapoints = PVSS.DataPointVector() self.datapoints.push_back(self.dp('Name')) self.datapoints.push_back(self.dp('InUse')) self.datapoints.push_back(self.dp('FSMSlice')) self.datapoints.push_back(self.dp('RecvNodes')) self.datapoints.push_back(self.dp('RecvSlices')) self.datapoints.push_back(self.dp('StreamNodes')) self.datapoints.push_back(self.dp('StreamSlices')) self.datapoints.push_back(self.dp('RunInfo')) self.tasks.push_back(self.dp('DataSenders')) self.tasks.push_back(self.dp('RecvInfrastructure')) self.tasks.push_back(self.dp('RecvReceivers')) self.tasks.push_back(self.dp('RecvSenders')) self.tasks.push_back(self.dp('StreamInfrastructure')) self.tasks.push_back(self.dp('StreamReceivers')) self.tasks.push_back(self.dp('StreamSenders'))
def _commitFSM_OLD(self, dpMap, action): dpv = PVSS.DataPointVector() count = 0 commit = 0 length = 0 while (len(dpMap) > 0): for i in dpMap.keys(): dpv.push_back(DataPoint(self.manager, DataPoint.original(i))) dpv.back().data = action + '/DEVICE(S)=' + dpMap[i][0].upper() #print 'Send command:',dpv.back().name(),'cmd:',dpv.back().data count = count + 1 if debug: log('%-12s %3d %3d %s' % (action, commit, count, dpv.back().data)) #log('%-12s %3d %3d %s'%(action, commit, count, dpv.back().data)) del dpMap[i][0] if len(dpMap[i]) == 0: del dpMap[i] self.writer.add(dpv) length = self.writer.length() if not self.writer.execute(): log(self.name + '> PVSS commit failed! [%d datapoints]' % (length, ), timestamp=1) return None commit = commit + 1 dpv.clear() return self
def runHLT(with_server=1): import Online.Streaming.DisplayServer as Srv upi.attach_terminal() Online.Utils.makePrint = upi.write_message mgr = PVSS.controlsMgr() servers = [Display(mgr, mgr.name() + '_FSMDisplay', target=targetHLT)] if with_server: servers.append(Srv.BaseDisplayServerManager(mgr)) else: cont = PVSS.DataPointVector() sensor = PVSS.DeviceSensor(mgr, cont) sensor.run(1) sleep(servers)
def _commitFSM(self, dpMap, action): dpv = PVSS.DataPointVector() length = 0 for i in dpMap.keys(): vals = '' for j in dpMap[i]: vals = vals + j.upper() + '|' if len(vals) > 0: dpv.push_back(DataPoint(self.manager, DataPoint.original(i))) dpv.back().data = action + '/DEVICES(S)=' + vals[:-1] if debug: log('%-12s %s' % (action, dpv.back().data)) #log('%s>>>>>>> %-12s %s'%(i,action,dpv.back().data)) self.writer.add(dpv) length = self.writer.length() if not self.writer.execute(): log(self.name + '> PVSS commit failed! [%d datapoints]' % (length, ), timestamp=1) return None return self
def _fsmLookup(self,dp,typ1,typ2): nam = self.matchName(self) obj = PVSS.DpVectorActor(self.manager) obj.lookupOriginal(nam+'_*.'+dp,typ2) obj.lookupOriginal(nam+'_*.'+dp,typ1) v = PVSS.DataPointVector() cfg = 'blabla' for i in obj.container: if i.name().find(nam+'_Config')>0: cfg = i.name() v.push_back(PVSS.DataPoint(self.manager,i.name())) break for i in obj.container: if i.name().find('_FWM') > 0: continue if i.name().find('_FWDM') > 0: continue if i.name().find('_FWCNM') > 0: continue if i.name() != cfg: v.push_back(PVSS.DataPoint(self.manager,i.name())) # print nam+'_*.'+dp,v.size() return v