diff --git a/dump1090.c b/dump1090.c index b3bef28..7a7addd 100644 --- a/dump1090.c +++ b/dump1090.c @@ -581,7 +581,7 @@ int main(int argc, char **argv) { if (!strcmp(argv[j],"--device-index") && more) { Modes.dev_index = verbose_device_search(argv[++j]); } else if (!strcmp(argv[j],"--gain") && more) { - Modes.gain = (int) atof(argv[++j])*10; // Gain is in tens of DBs + Modes.gain = (int) (atof(argv[++j])*10); // Gain is in tens of DBs } else if (!strcmp(argv[j],"--enable-agc")) { Modes.enable_agc++; } else if (!strcmp(argv[j],"--freq") && more) { @@ -710,7 +710,13 @@ int main(int argc, char **argv) { } else { if (Modes.filename[0] == '-' && Modes.filename[1] == '\0') { Modes.fd = STDIN_FILENO; - } else if ((Modes.fd = open(Modes.filename,O_RDONLY)) == -1) { + } else if ((Modes.fd = open(Modes.filename, +#ifdef _WIN32 + (O_RDONLY | O_BINARY) +#else + (O_RDONLY) +#endif + )) == -1) { perror("Opening data file"); exit(1); } diff --git a/mode_s.c b/mode_s.c index 34ddec1..3dc2806 100644 --- a/mode_s.c +++ b/mode_s.c @@ -2053,6 +2053,9 @@ void decodeCPR(struct aircraft *a, int fflag, int surface) { if (rlat1 >= 270) rlat1 -= 360; } + // Check to see that the latitude is in range: -90 .. +90 + if (rlat0 < -90 || rlat0 > 90 || rlat1 < -90 || rlat1 > 90) return; + // Check that both are in the same latitude zone, or abort. if (cprNLFunction(rlat0) != cprNLFunction(rlat1)) return; @@ -2129,6 +2132,12 @@ int decodeCPRrelative(struct aircraft *a, int fflag, int surface) { rlat = AirDlat * (j + lat/131072); if (rlat >= 270) rlat -= 360; + // Check to see that the latitude is in range: -90 .. +90 + if (rlat < -90 || rlat > 90) { + a->bFlags &= ~MODES_ACFLAGS_LATLON_REL_OK; // This will cause a quick exit next time if no global has been done + return (-1); // Time to give up - Latitude error + } + // Check to see that answer is reasonable - ie no more than 1/2 cell away if (fabs(rlat - a->lat) > (AirDlat/2)) { a->bFlags &= ~MODES_ACFLAGS_LATLON_REL_OK; // This will cause a quick exit next time if no global has been done diff --git a/net_io.c b/net_io.c index 7e15343..a1ccfda 100644 --- a/net_io.c +++ b/net_io.c @@ -347,8 +347,8 @@ void modesSendSBSOutput(struct modesMessage *mm) { // Fields 1 to 6 : SBS message type and ICAO address of the aircraft and some other stuff p += sprintf(p, "MSG,%d,111,11111,%06X,111111,", msgType, mm->addr); - // Fields 7 & 8 are the current time and date - if (mm->timestampMsg) { // Make sure the records' timestamp is valid before outputing it + // Fields 7 & 8 are the message reception time and date + if (mm->timestampMsg && !mm->remote) { // Make sure the records' timestamp is valid before outputing it epocTime = Modes.stSystemTimeBlk; // This is the time of the start of the Block we're processing offset = (int) (mm->timestampMsg - Modes.timestampBlk); // This is the time (in 12Mhz ticks) into the Block offset = offset / 12000; // convert to milliseconds diff --git a/public_html/gmap.html b/public_html/gmap.html index 80afe02..96f412a 100644 --- a/public_html/gmap.html +++ b/public_html/gmap.html @@ -3,7 +3,7 @@ - + diff --git a/public_html/script.js b/public_html/script.js index 05d29b7..ed2a4dc 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -135,8 +135,12 @@ function initialize() { center: new google.maps.LatLng(CenterLat, CenterLon), zoom: ZoomLvl, mapTypeId: google.maps.MapTypeId.ROADMAP, + mapTypeControl: true, + streetViewControl: false, mapTypeControlOptions: { - mapTypeIds: mapTypeIds + mapTypeIds: mapTypeIds, + position: google.maps.ControlPosition.TOP_LEFT, + style: google.maps.MapTypeControlStyle.DROPDOWN_MENU } }; @@ -304,7 +308,7 @@ function refreshSelected() { html += '