daemon/core/emane/emane.py
def handlelocationeventtoxyz(self, nemid, lat, long, alt):
        ''' Convert the (NEM ID, lat, long, alt) from a received location event
        into a node and x,y,z coordinate values, sending a Node Message.
        Returns True if successfully parsed and a Node Message was sent.
        '''
        # convert nemid to node number
        (emanenode, netif) = self.nemlookup(nemid)
        if netif is None:
            if self.verbose:
                self.info("location event for unknown NEM %s" % nemid)
            return False
        n = netif.node.objid
        # convert from lat/long/alt to x,y,z coordinates
        (x, y, z) = self.session.location.getxyz(lat, long, alt)
        x = int(x)
        y = int(y)
        z = int(z)
        if self.verbose:
            self.info("location event NEM %s (%s, %s, %s) -> (%s, %s, %s)" \
                      % (nemid, lat, long, alt, x, y, z))
        try:
            if (x.bit_length() > 16) or (y.bit_length() > 16) or \
               (z.bit_length() > 16) or (x < 0) or (y < 0) or (z < 0):
                warntxt = "Unable to build node location message since " \
                          "received lat/long/alt exceeds coordinate " \
                          "space: NEM %s (%d, %d, %d)" % (nemid, x, y, z)
                self.info(warntxt)
                self.session.exception(coreapi.CORE_EXCP_LEVEL_ERROR,
                                       "emane", None, warntxt)
                return False
        except AttributeError:
            # int.bit_length() not present on Python 2.6
            pass

        # generate a node message for this location update
        try:
            node = self.session.obj(n)
        except KeyError:
            self.warn("location event NEM %s has no corresponding node %s" \
                     % (nemid, n))
            return False
        # don't use node.setposition(x,y,z) which generates an event
        node.position.set(x,y,z)
        msg = node.tonodemsg(flags=0)
        self.session.broadcastraw(None, msg)
        self.session.sdt.updatenodegeo(node.objid, lat, long, alt)
        return True
 Convert the (NEM ID, lat, long, alt) from a received location event
        into a node and x,y,z coordinate values, sending a Node Message.
        Returns True if successfully parsed and a Node Message was sent.
        
Convert the (NEM ID, lat, long, alt) from a received location event
into a node and x,y,z coordinate values, sending a Node Message.
Returns True if successfully parsed and a Node Message was sent.
Convert the ( NEM ID lat long alt ) from a received location event into a node and x y z coordinate values sending a Node Message . Returns True if successfully parsed and a Node Message was sent .
def handlelocationeventtoxyz(self, nemid, lat, long, alt):
        (emanenode, netif) = self.nemlookup(nemid)
        if netif is None:
            if self.verbose:
                self.info("location event for unknown NEM %s" % nemid)
            return False
        n = netif.node.objid
        (x, y, z) = self.session.location.getxyz(lat, long, alt)
        x = int(x)
        y = int(y)
        z = int(z)
        if self.verbose:
            self.info("location event NEM %s (%s, %s, %s) -> (%s, %s, %s)" \
                      % (nemid, lat, long, alt, x, y, z))
        try:
            if (x.bit_length() > 16) or (y.bit_length() > 16) or \
               (z.bit_length() > 16) or (x < 0) or (y < 0) or (z < 0):
                warntxt = "Unable to build node location message since " \
                          "received lat/long/alt exceeds coordinate " \
                          "space: NEM %s (%d, %d, %d)" % (nemid, x, y, z)
                self.info(warntxt)
                self.session.exception(coreapi.CORE_EXCP_LEVEL_ERROR,
                                       "emane", None, warntxt)
                return False
        except AttributeError:
            pass
        try:
            node = self.session.obj(n)
        except KeyError:
            self.warn("location event NEM %s has no corresponding node %s" \
                     % (nemid, n))
            return False
        node.position.set(x,y,z)
        msg = node.tonodemsg(flags=0)
        self.session.broadcastraw(None, msg)
        self.session.sdt.updatenodegeo(node.objid, lat, long, alt)
        return True
def handlelocationeventtoxyz ( self , nemid , lat , long , alt ) : ( emanenode , netif ) = self . nemlookup ( nemid ) if netif is None : if self . verbose : self . info ( "location event for unknown NEM %s" % nemid ) return False n = netif . node . objid ( x , y , z ) = self . session . location . getxyz ( lat , long , alt ) x = int ( x ) y = int ( y ) z = int ( z ) if self . verbose : self . info ( "location event NEM %s (%s, %s, %s) -> (%s, %s, %s)" % ( nemid , lat , long , alt , x , y , z ) ) try : if ( x . bit_length ( ) > 16 ) or ( y . bit_length ( ) > 16 ) or ( z . bit_length ( ) > 16 ) or ( x < 0 ) or ( y < 0 ) or ( z < 0 ) : warntxt = "Unable to build node location message since " "received lat/long/alt exceeds coordinate " "space: NEM %s (%d, %d, %d)" % ( nemid , x , y , z ) self . info ( warntxt ) self . session . exception ( coreapi . CORE_EXCP_LEVEL_ERROR , "emane" , None , warntxt ) return False except AttributeError : pass try : node = self . session . obj ( n ) except KeyError : self . warn ( "location event NEM %s has no corresponding node %s" % ( nemid , n ) ) return False node . position . set ( x , y , z ) msg = node . tonodemsg ( flags = 0 ) self . session . broadcastraw ( None , msg ) self . session . sdt . updatenodegeo ( node . objid , lat , long , alt ) return True
Convert the (NEM ID, lat, long, alt) from a received location event
into a node and x,y,z coordinate values, sending a Node Message.
Convert the ( NEM ID lat long alt ) from a received location event into a node and x y z coordinate values sending a Node Message .
''' Convert the (NEM ID, lat, long, alt) from a received location event
        into a node and x,y,z coordinate values, sending a Node Message.
        Returns True if successfully parsed and a Node Message was sent.
        ''' # convert nemid to node number # convert from lat/long/alt to x,y,z coordinates # int.bit_length() not present on Python 2.6 # generate a node message for this location update # don't use node.setposition(x,y,z) which generates an event
self
nemid
lat
long
alt