11 File::fscanf(in, "%c %x %x %x\n",
12 &r.type, &r.time, &r.a, &r.b);
28 real combine_gps_pos(gps_pos p, bool flag)
30 real sign = flag ? -1 : 1;
31 return sign * (p.degrees + (p.minutes +
32 p.minutes_fraction / 10000)
36 void read_gps(file in)
43 while (!File::end(in)) {
44 flight_record r = read_record(in);
47 time.hour = r.a & 0xff;
48 time.minute = r.a >> 8;
49 time.second = r.b & 0xff;
53 lat.degrees = r.a & 0xff;
54 lat.minutes = r.a >> 8;
55 lat.minutes_fraction = r.b;
58 lon.degrees = r.a & 0xff;
59 lon.minutes = r.a >> 8;
60 lon.minutes_fraction = r.b;
64 printf ("%5d %d sat ", r.time, flags & 0xf);
65 if ((flags & (1 << 4)) != 0) {
66 printf ("%02d:%02d:%02d ",
67 time.hour, time.minute, time.second);
68 printf ("%4d°%02d.%04d'%c %2d°%02d.%04d'%c %5dm ",
69 lat.degrees, lat.minutes,
71 (flags & (1 << 6)) != 0 ? 'S' : 'N',
72 lon.degrees, lon.minutes,
74 (flags & (1 << 5)) != 0 ? 'W' : 'E',
76 printf ("%11.6f %11.6f %5d\n",
85 printf ("unlocked\n");