update dependencies
This commit is contained in:
parent
81d7cef6e8
commit
28a6e53d49
@ -72,13 +72,15 @@ To install the latest version development from the GitHub:
|
|||||||
pip install git+https://github.com/junzis/pyModeS
|
pip install git+https://github.com/junzis/pyModeS
|
||||||
|
|
||||||
|
|
||||||
To install the stable version (2.0) from pip:
|
To install the latest stable version from pip:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
pip install pyModeS
|
pip install pyModeS
|
||||||
|
|
||||||
|
|
||||||
|
The library requires several dependencies (``numpy``, ``pyzmq``, ``pyrtlsdr``), which will be installed automatically when you install pyModeS using ``pip``.
|
||||||
|
|
||||||
|
|
||||||
View live traffic (modeslive)
|
View live traffic (modeslive)
|
||||||
----------------------------------------------------
|
----------------------------------------------------
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
"""
|
"""Stream beast raw data from a TCP server, convert to mode-s messages."""
|
||||||
Stream beast raw data from a TCP server, convert to mode-s messages
|
|
||||||
"""
|
|
||||||
from __future__ import print_function, division
|
from __future__ import print_function, division
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import socket
|
|
||||||
import time
|
import time
|
||||||
import pyModeS as pms
|
import pyModeS as pms
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
@ -32,7 +30,7 @@ class BaseClient(Thread):
|
|||||||
def connect(self):
|
def connect(self):
|
||||||
self.socket = zmq.Context().socket(zmq.STREAM)
|
self.socket = zmq.Context().socket(zmq.STREAM)
|
||||||
self.socket.setsockopt(zmq.LINGER, 0)
|
self.socket.setsockopt(zmq.LINGER, 0)
|
||||||
self.socket.setsockopt(zmq.RCVTIMEO, 2000)
|
self.socket.setsockopt(zmq.RCVTIMEO, 10000)
|
||||||
self.socket.connect("tcp://%s:%s" % (self.host, self.port))
|
self.socket.connect("tcp://%s:%s" % (self.host, self.port))
|
||||||
|
|
||||||
def read_raw_buffer(self):
|
def read_raw_buffer(self):
|
||||||
|
2
setup.py
2
setup.py
@ -74,7 +74,7 @@ setup(
|
|||||||
# your project is installed. For an analysis of "install_requires" vs pip's
|
# your project is installed. For an analysis of "install_requires" vs pip's
|
||||||
# requirements files see:
|
# requirements files see:
|
||||||
# https://packaging.python.org/en/latest/requirements.html
|
# https://packaging.python.org/en/latest/requirements.html
|
||||||
install_requires=["numpy", "argparse"],
|
install_requires=["numpy", "argparse", "pyzmq", "pyrtlsdr"],
|
||||||
# List additional groups of dependencies here (e.g. development
|
# List additional groups of dependencies here (e.g. development
|
||||||
# dependencies). You can install these using the following syntax,
|
# dependencies). You can install these using the following syntax,
|
||||||
# for example:
|
# for example:
|
||||||
|
@ -2,12 +2,13 @@ from pyModeS import adsb
|
|||||||
|
|
||||||
# === TEST ADS-B package ===
|
# === TEST ADS-B package ===
|
||||||
|
|
||||||
|
|
||||||
def test_adsb_icao():
|
def test_adsb_icao():
|
||||||
assert adsb.icao("8D406B902015A678D4D220AA4BDA") == "406B90"
|
assert adsb.icao("8D406B902015A678D4D220AA4BDA") == "406B90"
|
||||||
|
|
||||||
|
|
||||||
def test_adsb_category():
|
def test_adsb_category():
|
||||||
assert adsb.category("8D406B902015A678D4D220AA4BDA") == 5
|
assert adsb.category("8D406B902015A678D4D220AA4BDA") == 0
|
||||||
|
|
||||||
|
|
||||||
def test_adsb_callsign():
|
def test_adsb_callsign():
|
||||||
@ -15,9 +16,12 @@ def test_adsb_callsign():
|
|||||||
|
|
||||||
|
|
||||||
def test_adsb_position():
|
def test_adsb_position():
|
||||||
pos = adsb.position("8D40058B58C901375147EFD09357",
|
pos = adsb.position(
|
||||||
"8D40058B58C904A87F402D3B8C59",
|
"8D40058B58C901375147EFD09357",
|
||||||
1446332400, 1446332405)
|
"8D40058B58C904A87F402D3B8C59",
|
||||||
|
1446332400,
|
||||||
|
1446332405,
|
||||||
|
)
|
||||||
assert pos == (49.81755, 6.08442)
|
assert pos == (49.81755, 6.08442)
|
||||||
|
|
||||||
|
|
||||||
@ -29,27 +33,35 @@ def test_adsb_position_with_ref():
|
|||||||
|
|
||||||
|
|
||||||
def test_adsb_airborne_position_with_ref():
|
def test_adsb_airborne_position_with_ref():
|
||||||
pos = adsb.airborne_position_with_ref("8D40058B58C901375147EFD09357",
|
pos = adsb.airborne_position_with_ref(
|
||||||
49.0, 6.0)
|
"8D40058B58C901375147EFD09357", 49.0, 6.0
|
||||||
|
)
|
||||||
assert pos == (49.82410, 6.06785)
|
assert pos == (49.82410, 6.06785)
|
||||||
pos = adsb.airborne_position_with_ref("8D40058B58C904A87F402D3B8C59",
|
pos = adsb.airborne_position_with_ref(
|
||||||
49.0, 6.0)
|
"8D40058B58C904A87F402D3B8C59", 49.0, 6.0
|
||||||
|
)
|
||||||
assert pos == (49.81755, 6.08442)
|
assert pos == (49.81755, 6.08442)
|
||||||
|
|
||||||
|
|
||||||
def test_adsb_surface_position_with_ref():
|
def test_adsb_surface_position_with_ref():
|
||||||
pos = adsb.surface_position_with_ref("8FC8200A3AB8F5F893096B000000",
|
pos = adsb.surface_position_with_ref(
|
||||||
-43.5, 172.5)
|
"8FC8200A3AB8F5F893096B000000", -43.5, 172.5
|
||||||
|
)
|
||||||
assert pos == (-43.48564, 172.53942)
|
assert pos == (-43.48564, 172.53942)
|
||||||
|
|
||||||
|
|
||||||
def test_adsb_surface_position():
|
def test_adsb_surface_position():
|
||||||
pos = adsb.surface_position("8CC8200A3AC8F009BCDEF2000000",
|
pos = adsb.surface_position(
|
||||||
"8FC8200A3AB8F5F893096B000000",
|
"8CC8200A3AC8F009BCDEF2000000",
|
||||||
0, 2,
|
"8FC8200A3AB8F5F893096B000000",
|
||||||
-43.496, 172.558)
|
0,
|
||||||
|
2,
|
||||||
|
-43.496,
|
||||||
|
172.558,
|
||||||
|
)
|
||||||
assert pos == (-43.48564, 172.53942)
|
assert pos == (-43.48564, 172.53942)
|
||||||
|
|
||||||
|
|
||||||
def test_adsb_alt():
|
def test_adsb_alt():
|
||||||
assert adsb.altitude("8D40058B58C901375147EFD09357") == 39000
|
assert adsb.altitude("8D40058B58C901375147EFD09357") == 39000
|
||||||
|
|
||||||
@ -58,10 +70,10 @@ def test_adsb_velocity():
|
|||||||
vgs = adsb.velocity("8D485020994409940838175B284F")
|
vgs = adsb.velocity("8D485020994409940838175B284F")
|
||||||
vas = adsb.velocity("8DA05F219B06B6AF189400CBC33F")
|
vas = adsb.velocity("8DA05F219B06B6AF189400CBC33F")
|
||||||
vgs_surface = adsb.velocity("8FC8200A3AB8F5F893096B000000")
|
vgs_surface = adsb.velocity("8FC8200A3AB8F5F893096B000000")
|
||||||
assert vgs == (159, 182.88, -832, 'GS')
|
assert vgs == (159, 182.88, -832, "GS")
|
||||||
assert vas == (375, 243.98, -2304, 'TAS')
|
assert vas == (375, 243.98, -2304, "TAS")
|
||||||
assert vgs_surface == (19.0, 42.2, 0 , 'GS')
|
assert vgs_surface == (19.0, 42.2, 0, "GS")
|
||||||
assert adsb.altitude_diff('8D485020994409940838175B284F') == 550
|
assert adsb.altitude_diff("8D485020994409940838175B284F") == 550
|
||||||
|
|
||||||
|
|
||||||
# def test_nic():
|
# def test_nic():
|
||||||
|
Loading…
Reference in New Issue
Block a user