Exemple #1
0
 def __init__(self, manager, dp):
     self.manager = manager
     self.do_sleep = 1
     self.control = dp
     PVSS.PyDeviceListener.__init__(self, self, manager)
     self.sensor = PVSS.DeviceSensor(manager, self.control)
     print '--> Successfully created device listener for ', self.control.name(
     )
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 __init__(self,manager):
   self.manager = manager
   typ = self.manager.typeMgr().type('StreamPartition')
   self.slices = PVSS.DpVectorActor(self.manager)
   self.slices.lookupOriginal('*_Slice??.InUse',typ)
   self.sensor = PVSS.DeviceSensor(self.manager,self.slices.container)
   PVSS.PyDeviceListener.__init__(self,self,manager)
   log('Starting display server on system:'+self.manager.name(),timestamp=1)
   self.servers = {}
   for i in self.slices.container:
     self.servers[i.name()] = None
   rdr = self.manager.devReader()
   rdr.add(self.slices.container)
   rdr.execute()
   self.handleDevices()
  def _init(self):
    typ1          = self.manager.typeMgr().type('_FwFsmDevice')
    typ2          = self.manager.typeMgr().type('_FwFsmObject')
    self.actions  = self._fsmLookup('fsm.executingAction',typ1,typ2)
    self.states   = self._fsmLookup('fsm.currentState',typ1,typ2)
    self.commands = self._fsmLookup('fsm.sendCommand',typ1,typ2)
    self.enabled  = self._fsmLookup('mode.enabled',typ1,typ2)
    self.labels   = self._fsmLookup('ui.label',typ1,typ2)
    self.tnodes   = self._fsmLookup('tnode',typ1,typ2)
    self.fsmtypes = self._fsmLookup('type',typ1,typ2)

    self.writer = self.manager.devWriter()
    nam = self.targetName(self)
    self.taskData = PVSS.DataPoint(self.manager,PVSS.DataPoint.original(nam))
    self.writer.add(self.taskData)
    self.sensor = PVSS.DeviceSensor(self.manager,self.actions)
    self.taskData.data = PVSS.StringVector()
 def __init__(self, manager):
     self.manager = manager
     self.do_sleep = 1
     typ = self.manager.typeMgr().type('StreamPartition')
     self.slices = PVSS.DpVectorActor(self.manager)
     self.slices.lookupOriginal('*_Slice??.InUse', typ)
     self.sensor = PVSS.DeviceSensor(self.manager, self.slices.container)
     PVSS.PyDeviceListener.__init__(self, self, manager)
     log('Starting display server on system:' + self.manager.name(),
         timestamp=mk_timestamps)
     self.servers = {}
     for i in self.slices.container:
         self.servers[i.name()] = None
     rdr = self.manager.devReader()
     rdr.add(self.slices.container)
     rdr.execute()
     upi.attach_terminal()
     Online.Utils.makePrint = upi.write_message
     self.menu = ManagerMenu(self.manager, self)
 def run(self):
     mgr = self.manager
     actor = PVSS.DpVectorActor(mgr)
     typ = self.manager.typeMgr().type('FSM_DimTask')
     actor.lookup(self.name + '*', typ)
     #actor.lookup(DataPoint.original(self.name+'_Slice*.Name'),typ)
     print typ.name(), actor.container.size()
     for i in actor.container:
         print i.name()
         item = []
         cmd = DataPoint.original(i.name() + '.Command')
         item.append(i.name())
         item.append(DataPoint(mgr,
                               DataPoint.original(i.name() + '.State')))
         item.append(DataPoint(mgr, cmd))
         item.append(PVSS.DeviceSensor(mgr, item[2]))
         item[3].addListener(self)
         item[3].run(1)
         self.tasks[cmd] = item
Exemple #7
0
  def __init__(self, manager, name, postfix, objects=[]):
    """ Object constructor
    
        @param  manager       Reference to PVSS ControlManager
        @param  name          Name of the Streaming control datapoint
        @param  postfix       Modifier for reply datapoint name
        @param  objects       List of clients to be managed

        @return reference to initialized object
    """
    self.objects = objects
    self.manager = manager
    self.name    = name
    self.postfix = postfix
    self.do_sleep= 1
    PVSS.PyDeviceListener.__init__(self,self,manager)
    self.writer  = manager.devWriter()
    self.control = self.objects[0].get('Command')
    self.state   = self.objects[0].get('State')
    Online.Utils.openFMC()
    PVSS.info(name+': Listen to '+self.control.name(),timestamp=1,type=PVSS.CONNECTED)
    PVSS.info(name+': Answer to '+self.state.name(),timestamp=1,type=PVSS.CONNECTED)
    self.sensor = PVSS.DeviceSensor(manager,self.control)