Beispiel #1
0
 def test_position_without_timestamp_without_messaging(self):
     self.__check_parsed(
         'N6ZX-3>APN391:!3726.16NS12219.21W#PHG2436/A=002080',
         facts=[
             Messaging(False),
             Position((37 + 26.16 / 60), -(122 + 19.21 / 60)),
             Symbol('S#'),
             Altitude(2080, True)],
         errors=['PHG parsing not implemented'],
         comment='')
Beispiel #2
0
 def test_track(self):
     self.assertEqual(empty_track, self.s.get_track())
     self.s.receive(self.__message([
         Position(31, -42),
         Altitude(1000, True),
     ]))
     self.assertEqual(empty_track._replace(
         latitude=TelemetryItem(31, _dummy_receive_time),
         longitude=TelemetryItem(-42, _dummy_receive_time),
         altitude=TelemetryItem(304.8, _dummy_receive_time)
     ), self.s.get_track())
Beispiel #3
0
 def test_mic_e(self):
     self.__check_parsed(
         'KQ1N-7>SV2RYV,W6BXN-3*,N6ZX-3*,WIDE2*:`00krA4[/`"5U}_',
         facts=[
             # TODO: Check pos and vel against results from some other parser, in more cases
             Position(latitude=36.382666666666665, longitude=-120.3465),
             Velocity(speed_knots=63, course_degrees=31),
             Symbol('/['),
             Altitude(153, False),
         ],
         errors=[],
         # TODO: The _ is actually a manufacturer/version code or something but we don't support that yet
         comment='_')
Beispiel #4
0
 def test_compressed_position_example_altitude(self):
     """example from APRS 1.0.1 page 40"""
     # due to exponentiation being involved there is some FP error. TODO: Arrange to be able to assert the range, or duplicate the computation, instead of using exact constants
     self.__check_parsed('FOO>BAR:!/!!!!!!!!>S]S',
                         facts=[
                             Messaging(supported=False),
                             Position(90, -180),
                             Symbol(id=u'/>'),
                             Altitude(value=10004.52005070133,
                                      feet_not_meters=True)
                         ],
                         errors=[],
                         comment='')
Beispiel #5
0
 def test_position_ambiguity(self):
     # TODO the position ambiguity should be put in the facts
     # Note: This message was captured but has its ambiguity increased to test the left-of-the-dot ambiguity parsing.
     self.__check_parsed(
         'AG6WF-5>APDR13,TCPIP*,qAC,T2CSNGRAD:=341 .  N/1182 .  W$/A=000853',
         facts=[
             Messaging(supported=True),
             Position((34 + 10 / 60), -(118 + 20 / 60)),
             Symbol(id=u'/$'),
             Altitude(853, True),
         ],
         errors=[],
         comment='')
Beispiel #6
0
 def test_position_with_timestamp_without_messaging(self):
     self.__check_parsed(
         'KMEP1>APT311,N6ZX-3*,WIDE1*,WIDE2-1:/160257z3726.79N\\12220.18Wv077/000/A=001955/N6ZX, Kings Mt. Eme',
         facts=[
             Messaging(False),
             Timestamp(_dummy_receive_datetime.replace(day=16, hour=2, minute=57, second=0, microsecond=0)),
             Position((37 + 26.79 / 60), -(122 + 20.18 / 60)),
             Symbol(u'\\v'),
             Velocity(speed_knots=0, course_degrees=77),
             Altitude(1955, True),
         ],
         errors=[],
         comment='/N6ZX, Kings Mt. Eme')