Example #1
0
  def testNMEARecordsFormat2(self):
    date = datetime.date(2004, 2, 29)
    golden = ('$GPGGA,211003.000,5419.6219,N,00951.4118,E,1,00,,0086.1,M,0.0,M,,0000*78\r\n'
              '$GPRMC,211003.000,A,5419.6219,N,00951.4118,E,000.89,15.15,290204,,,E*53\r\n')

    wp = rgm3800.RGM3800Waypoint(2)
    wp.Parse(self.DATA2)
    wp.SetDate(date)

    self.assertEqual(golden, wp.GetNMEARecords())
Example #2
0
  def testNMEARecordsFormat1(self):
    date = datetime.date(1978, 2, 20)
    golden = ('$GPGGA,211023.000,5419.6249,N,00951.4069,E,1,00,,0078.4,M,0.0,M,,0000*7C\r\n'
              '$GPRMC,211023.000,A,5419.6249,N,00951.4069,E,000.00,15.15,200278,,,E*50\r\n')

    wp = rgm3800.RGM3800Waypoint(1)
    wp.Parse(self.DATA1)
    wp.SetDate(date)

    self.assertEqual(golden, wp.GetNMEARecords())
Example #3
0
  def testNMEARecordsFormat0(self):
    date = datetime.date(2008, 1, 1)
    golden = ('$GPGGA,113436.000,5419.6637,N,00951.3958,E,1,00,,0000.0,M,0.0,M,,0000*77\r\n'
              '$GPRMC,113436.000,A,5419.6637,N,00951.3958,E,000.00,15.15,010108,,,E*57\r\n')

    wp = rgm3800.RGM3800Waypoint(0)
    wp.Parse(self.DATA0)
    wp.SetDate(date)

    self.assertEqual(golden, wp.GetNMEARecords())
Example #4
0
  def testNMEARecordsFormat3(self):
    date = datetime.date(2000, 5, 1)
    golden = ('$GPGGA,223236.000,5422.1975,N,00953.8767,E,1,00,,0056.5,M,0.0,M,,0000*7A\r\n'
              '$GPRMC,223236.000,A,5422.1975,N,00953.8767,E,002.19,15.15,010500,,,E*5A\r\n'
              '$RTDIST,A,3,,,,105*4A\r\n')

    wp = rgm3800.RGM3800Waypoint(3)
    wp.Parse(self.DATA3)
    wp.SetDate(date)

    self.assertEqual(golden, wp.GetNMEARecords())
Example #5
0
  def testGPXTrackPTFormat0(self):
    date = datetime.date(2008, 1, 1)
    golden = ('<trkpt lat="54.327728" lon="9.856596">'
              '<time>2008-01-01T11:34:36Z</time>'
              '</trkpt>')

    wp = rgm3800.RGM3800Waypoint(0)
    wp.Parse(self.DATA0)
    wp.SetDate(date)

    gpxdoc = minidom.getDOMImplementation().createDocument(None, 'gpx', None)
    result = wp.GetGPXTrackPT(gpxdoc)
    self.assertEqual(golden, result.toxml())
Example #6
0
  def testGPXTrackPTFormat1(self):
    date = datetime.date(1978, 2, 20)
    golden = ('<trkpt lat="54.327082" lon="9.856781">'
              '<time>1978-02-20T21:10:23Z</time>'
              '<ele>78.4</ele>'
              '</trkpt>')

    wp = rgm3800.RGM3800Waypoint(1)
    wp.Parse(self.DATA1)
    wp.SetDate(date)

    gpxdoc = minidom.getDOMImplementation().createDocument(None, 'gpx', None)
    result = wp.GetGPXTrackPT(gpxdoc)
    self.assertEqual(golden, result.toxml())
Example #7
0
  def testNMEARecordsFormat4(self):
    date = datetime.date(2008, 7, 31)
    golden = ('$GPGGA,223641.000,5422.1973,N,00953.8785,E,1,12,0.8,0056.1,M,0.0,M,,0000*55\r\n'
              '$GPGSV,3,1,12,03,45,000,42,06,45,030,40,22,45,060,36,19,45,090,39*74\r\n'
              '$GPGSV,3,2,12,18,45,120,36,21,45,150,33,16,45,180,21,08,45,210,29*7E\r\n'
              '$GPGSV,3,3,12,15,45,240,33,07,45,270,27,27,45,300,30,26,45,330,23*7F\r\n'
              '$GPRMC,223641.000,A,5422.1973,N,00953.8785,E,002.42,15.15,310708,,,E*53\r\n'
              '$RTDIST,A,3,1.4,0.8,1.1,131*6E\r\n')

    wp = rgm3800.RGM3800Waypoint(4)
    wp.Parse(self.DATA4)
    wp.SetDate(date)

    self.assertEqual(golden, wp.GetNMEARecords())
Example #8
0
  def testGPXTrackPTFormat4(self):
    date = datetime.date(2008, 7, 31)
    golden = ('<trkpt lat="54.369955" lon="9.897975">'
              '<time>2008-07-31T22:36:41Z</time>'
              '<ele>56.1</ele>'
              '<speed>1.244383</speed>'
              '<hdop>0.8</hdop>'
              '<vdop>1.1</vdop>'
              '<pdop>1.4</pdop>'
              '</trkpt>')

    wp = rgm3800.RGM3800Waypoint(4)
    wp.Parse(self.DATA4)
    wp.SetDate(date)

    gpxdoc = minidom.getDOMImplementation().createDocument(None, 'gpx', None)
    result = wp.GetGPXTrackPT(gpxdoc)
    self.assertEqual(golden, result.toxml())