home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / aprs72a.zip / GPSTOHST.BAS < prev    next >
BASIC Source File  |  1995-03-20  |  1KB  |  39 lines

  1. PRINT "This program takes a RAW PROCOMM download file from a GPS receiver"
  2. PRINT "in NMEA-0183 format and formats it to look like an APRS packet beacon"
  3. PRINT "It looks for the GGA and VTG sentences."
  4. PRINT
  5. PRINT "For LORAN or other sentences GLL or RMC, you will have to rewrite"
  6. PRINT "Several lines in the program..."
  7. PRINT
  8. INPUT "Enter file name of raw GPS data"; FI$
  9. INPUT "Enter name of OUTPUT file for APRS compatible TRACK HISTORY"; FO$
  10. INPUT "Enter callsign to be used with the raw data"; CALL$
  11. INPUT "Enter two digit DAY of data"; Day
  12. INPUT "Enter symbol for character (Car >, Air ', Boat ~)"; Sym$
  13. IF LEN(Sym$) <> 1 THEN Sym$ = ">"
  14. LET CALL$ = LEFT$(CALL$ + "         ", 10)
  15. OPEN FI$ FOR INPUT AS #1
  16. OPEN FO$ FOR OUTPUT AS #2
  17. DTG$ = MID$(DATE$, 4, 2) + LEFT$(TIME$, 2) + MID$(TIME$, 4, 2)
  18. DO WHILE NOT EOF(1)
  19. LINE INPUT #1, a$
  20. IF LEFT$(a$, 6) = "$GPGGA" AND MID$(a$, 36, 1) = "1" THEN
  21.    lat$ = MID$(a$, 15, 7)
  22.    lon$ = MID$(a$, 25, 8)
  23.    EST = VAL(MID$(a$, 8, 4)) - 500
  24.    IF EST < 0 THEN Tim = EST + 2400: Standby = 1 ELSE Tim = EST
  25.    IF EST > 0 AND Standby = 1 THEN Standby = 0: Day = Day + 1
  26.    UTC$ = RIGHT$("0" + MID$(STR$(Day), 2), 2) + RIGHT$("000" + MID$(STR$(Tim), 2), 4)
  27.    Pos$ = "/" + lat$ + "N/" + lon$ + "W"
  28.    END IF
  29. IF LEFT$(a$, 6) = "$GPVTG" THEN
  30.    CSE$ = Sym$ + MID$(a$, 8, 3)
  31.    SPD$ = "/" + MID$(a$, 26, 3)
  32.    END IF
  33. Pkt$ = CALL$ + UTC$ + " @" + UTC$ + Pos$ + CSE$ + SPD$ + "/comments"
  34. PRINT #2, Pkt$
  35. LOOP
  36. CLOSE
  37. END
  38.  
  39.