示例#1
0
    def _communicate_tracking_info(self):
        """
        Runs as a daemon thread, communicating tracking info to remote socket.
        Uses observer and satellite objects set by trackobject().
        Will exit when observation_end timestamp is reached.
        """
        sock = Commsocket(self._IP, self._PORT)
        sock.connect()

        # track satellite
        while self.is_alive:

            # check if we need to exit
            self.check_observation_end_reached()

            p = pinpoint(self.observer_dict, self.satellite_dict)
            if p['ok']:
                dict = {
                    'azimuth': p['az'].conjugate() * 180 / math.pi,
                    'altitude': p['alt'].conjugate() * 180 / math.pi,
                    'frequency':
                    self._frequency * (1 - (p['rng_vlct'] / ephem.c)),
                    'tle0': self.satellite_dict['tle0'],
                    'tle1': self.satellite_dict['tle1'],
                    'tle2': self.satellite_dict['tle2']
                }
                socketio.emit('update_rotator',
                              dict,
                              namespace='/update_status')
                self.send_to_socket(p, sock)
                time.sleep(self.SLEEP_TIME)

        sock.disconnect()
示例#2
0
    def _communicate_tracking_info(self):
        """
        Runs as a daemon thread, communicating tracking info to remote socket.
        Uses observer and satellite objects set by trackobject().
        Will exit when observation_end timestamp is reached.
        """
        sock = Commsocket(self._IP, self._PORT)
        sock.connect()

        # track satellite
        while self.is_alive:

            # check if we need to exit
            self.check_observation_end_reached()

            p = pinpoint(self.observer_dict, self.satellite_dict)
            if p['ok']:
                self.send_to_socket(p, sock)
                time.sleep(self._sleep_time)

        sock.disconnect()
示例#3
0
    def _communicate_tracking_info(self):
        """
        Runs as a daemon thread, communicating tracking info to remote socket.
        Uses observer and satellite objects set by trackobject().
        Will exit when observation_end timestamp is reached.
        """
        sock = Commsocket(self._IP, self._PORT)
        sock.connect()

        # track satellite
        while self.is_alive:

            # check if we need to exit
            self.check_observation_end_reached()

            p = pinpoint(self.observer_dict, self.satellite_dict)
            if p['ok']:
                self.send_to_socket(p, sock)
                time.sleep(self.SLEEP_TIME)

        sock.disconnect()