示例#1
0
    def _domainListCheck(self):
        newList = self._getMessagesForDomainListing('add')
        adds, removes = splitDictLists(newList, self._domainListMessages,
                                       RH_Message().keys())

        # Removals
        ids = [r['rhid'] for r in removes]
        indices = []
        if (0 < len(ids)):
            for i, d in enumerate(self._domains):
                if (d.getID in ids):
                    d.cleanUp()
                    indices.append(i)
            self._domains = [
                d for i, d in enumerate(self._domains) if i not in indices
            ]

        # Additions
        for a in adds:
            self._domains.append(
                Domain(
                    redhawk.attach(
                        a['rhname']),  # Return redhawk domain instance
                    '',  # No parent ID
                    self.outbox))  # Using the global outbox

        self._domainListMessages = newList
        self.domainTask = gevent.spawn_later(self._domainTaskWaitSec,
                                             self._domainListCheck)
示例#2
0
 def getMessage(self, change='update'):
     msg = RH_Message(change, 'property', self.getID, self.getName,
                      {'parentID': self._parent.getID})
     if ('remove' != change):
         msg['more'].update({
             'value': self._obj.queryValue(),
             'access': self._obj.mode
         })
     return msg
示例#3
0
 def getMessage(self, change='update'):
     msg = RH_Message(change, 'port', self.getID, self.getName, {'parentID': self._parent.getID})
     if ('remove' != change):
         try: 
             msg['more'].update({'storageType': 'keys',  # Could be 'value' if data is a value array.
                                 'direction': self._obj._direction,
                                 'nameSpace': self._obj._interface.nameSpace,
                                 'data': []})
         except:
             pass
     return msg
示例#4
0
    def _getMessagesForDomainListing(self, change='add'):
        msgs = []

        try:
            names = redhawk.scan()
            for name in names:
                d = redhawk.attach(name)
                id = d._get_identifier()
                msgs.append(
                    RH_Message(change=change,
                               rhtype='domain',
                               rhid=id,
                               rhname=name))
        except Exception as e:
            print("Caught exception while scanning REDHAWK CORE...never good.")
            print("---> Forcing a reset of the RH_Gateway.")
            sys.stdout.flush()
            self.close()

        finally:
            return msgs
示例#5
0
 def getMessage(self, change='update'):
     return RH_Message(change, 'service', self.getID, self._obj.name,
                       {'parentID': self._parent.getID})
示例#6
0
 def getMessage(self, change='update'):
     msg = RH_Message(change, string.lower(self.__class__.__name__),
                      self.getID, self.getName,
                      {'parentID': self._parent.getID})
     return msg
示例#7
0
 def getMessage(self, change='change'):
     return RH_Message(change, 'domain', self.getID, self.getName)
示例#8
0
 def getMessage(self, change='update'):
     message = RH_Message(change, 'application', self.getID, self.getName,
                          {'parentID': self._parent.getID})
     if ('remove' != change):
         message['more'].update({'running': self._obj._get_started()})
     return message
示例#9
0
 def getMessage(self, change='add'):
     return RH_Message(change, 'device_manager', self.getID, self.getName,
                       {'parentID': self._parent.getID})