kopia lustrzana https://github.com/glidernet/python-ogn-client
IDs must be hexadecimal
rodzic
9a90c347fa
commit
1607738b12
|
@ -11,7 +11,7 @@ PATTERN_NAVITER_BEACON = re.compile("""
|
|||
""", re.VERBOSE | re.MULTILINE)
|
||||
|
||||
PATTERN_TRACKER_BEACON_POSITION = re.compile("""
|
||||
id(?P<details>\w{2})(?P<id>\w{6}?)\s?
|
||||
id(?P<details>[0-9A-F]{2})(?P<id>[0-9A-F]{6}?)\s?
|
||||
(?:(?P<climb_rate>[+-]\d+?)fpm\s)?
|
||||
(?:(?P<turn_rate>[+-][\d.]+?)rot\s)?
|
||||
(?:FL(?P<flight_level>[\d.]+)\s)?
|
||||
|
@ -114,7 +114,7 @@ PATTERN_RECEIVER_BEACON = re.compile(r"""
|
|||
|
||||
|
||||
PATTERN_AIRCRAFT_BEACON = re.compile(r"""
|
||||
id(?P<details>\w{2})(?P<id>\w{6}?)\s?
|
||||
id(?P<details>[0-9A-F]{2})(?P<id>[0-9A-F]{6}?)\s?
|
||||
(?:(?P<climb_rate>[+-]\d+?)fpm\s)?
|
||||
(?:(?P<turn_rate>[+-][\d.]+?)rot\s)?
|
||||
(?:FL(?P<flight_level>[\d.]+)\s)?
|
||||
|
|
|
@ -65,7 +65,7 @@ class TestStringMethods(unittest.TestCase):
|
|||
|
||||
def test_fail_bad_dstcall(self):
|
||||
with self.assertRaises(OgnParseError):
|
||||
parse("EPZR>WTFDSTCALL,TCPIP*,qAC,GLIDERN1:>093456h this is a comment")
|
||||
parse("EPZR>WTFDSTCALL,TCPIP*,qAC,GLIDERN1:>093456h this is a comment", reference_date=datetime(2015, 1, 1))
|
||||
|
||||
def test_v026_chile(self):
|
||||
# receiver beacons from chile have a APRS position message with a pure user comment
|
||||
|
@ -73,6 +73,10 @@ class TestStringMethods(unittest.TestCase):
|
|||
|
||||
self.assertEqual(message['user_comment'], "Vitacura Municipal Aerodrome, Club de Planeadores Vitacura")
|
||||
|
||||
message_with_id = parse("ALFALFAL>APRS,TCPIP*,qAC,GLIDERN4:/221830h3330.40SI07007.88W&/A=008659 Alfalfal Hidroelectric Plant, Club de Planeadores Vitacurs", reference_date=datetime(2015, 1, 1))
|
||||
|
||||
self.assertEqual(message_with_id['user_comment'], "Alfalfal Hidroelectric Plant, Club de Planeadores Vitacurs")
|
||||
|
||||
@mock.patch('ogn.parser.parse_module.createTimestamp')
|
||||
def test_default_reference_date(self, createTimestamp_mock):
|
||||
valid_aprs_string = "Lachens>APRS,TCPIP*,qAC,GLIDERN2:/165334h4344.70NI00639.19E&/A=005435 v0.2.1 CPU:0.3 RAM:1764.4/2121.4MB NTP:2.8ms/+4.9ppm +47.0C RF:+0.70dB"
|
||||
|
|
|
@ -25,3 +25,6 @@ VITACURA2>APRS,TCPIP*,qAC,GLIDERN3:>042136h v0.2.5.ARM CPU:0.3 RAM:695.0/970.5MB
|
|||
# since 0.2.6 the ogn comment of a receiver beacon is just optional, it also can be a user comment
|
||||
Ulrichamn>APRS,TCPIP*,qAC,GLIDERN1:/085616h5747.30NI01324.77E&/A=001322
|
||||
ROBLE3>APRS,TCPIP*,qAC,GLIDERN4:/200022h3258.58SI07100.78W&/A=007229 Contact: achanes@manquehue.net, brito.felipe@gmail.com
|
||||
#
|
||||
# ... and user comment can include a 'id'
|
||||
ALFALFAL>APRS,TCPIP*,qAC,GLIDERN4:/221830h3330.40SI07007.88W&/A=008659 Alfalfal Hidroelectric Plant, Club de Planeadores Vitacurs
|
Ładowanie…
Reference in New Issue