From 8feabda35b709a2ae156bf6fdb10cbcd80a0947c Mon Sep 17 00:00:00 2001 From: Malcolm Robb Date: Sun, 12 May 2013 00:57:30 +0100 Subject: [PATCH 1/2] BDAVENPORT : Adds a Table Implement improvements to the public_html stuff as supplied by bdavenport. No changes to the C code. --- public_html/gmap.html | 1 + public_html/script.js | 53 ++++++++++++++++++++++++++++++++++++++++--- public_html/style.css | 5 ++++ 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/public_html/gmap.html b/public_html/gmap.html index e7f2ffb..4f086d9 100644 --- a/public_html/gmap.html +++ b/public_html/gmap.html @@ -16,6 +16,7 @@

Dump1090 - 00:00:00 UTC

Click on a plane for info.

+

diff --git a/public_html/script.js b/public_html/script.js index 1666f64..4fdb03e 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -43,7 +43,7 @@ function selectPlane() { function refreshGeneralInfo() { var i = document.getElementById('geninfo'); - + i.innerHTML = PlanesOnGrid + ' planes on grid.
'; i.innerHTML += PlanesOnMap + ' planes on map.'; } @@ -65,8 +65,33 @@ function refreshSelectedInfo() { i.innerHTML = html; } +function refreshTableInfo() { + var i = document.getElementById('tabinfo'); + + var html = ''; + html += ''; + for (var p in Planes) { + if (p == Selected) { + html += ''; + } else { + html += ''; + } + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + } + html += '
FlightAltitudeSpeedTrackLatLongSeenMsgs
' + Planes[p].flight + '' + Planes[p].altitude + '' + Planes[p].speed + '' + Planes[p].track + '' + Planes[p].lat + '' + Planes[p].lon + '' + Planes[p].seen + '' + Planes[p].messages + '
'; + i.innerHTML = html; +} + function fetchData() { - $.getJSON('/data.json', function(data) { + $.getJSON('data.json', function(data) { var stillhere = {} PlanesOnMap = 0; @@ -130,6 +155,9 @@ function fetchData() { delete Planes[p]; } } + + refreshTableInfo() ; + }); } @@ -176,12 +204,31 @@ function resetMap() { } function initialize() { + var mapTypeIds = []; + for(var type in google.maps.MapTypeId) { + mapTypeIds.push(google.maps.MapTypeId[type]); + } + mapTypeIds.push("OSM"); + var mapOptions = { center: new google.maps.LatLng(CenterLat, CenterLon), zoom: ZoomLvl, - mapTypeId: google.maps.MapTypeId.ROADMAP + mapTypeId: google.maps.MapTypeId.ROADMAP, + mapTypeControlOptions: { + mapTypeIds: mapTypeIds, + } }; Map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); + + //Define OSM map type pointing at the OpenStreetMap tile server + Map.mapTypes.set("OSM", new google.maps.ImageMapType({ + getTileUrl: function(coord, zoom) { + return "http://tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png"; + }, + tileSize: new google.maps.Size(256, 256), + name: "OpenStreetMap", + maxZoom: 18 + })); // show footer at info-area $(function(){ diff --git a/public_html/style.css b/public_html/style.css index 8c58273..86c8576 100644 --- a/public_html/style.css +++ b/public_html/style.css @@ -32,3 +32,8 @@ text-align: center; padding:0px; margin:0px; } +#tableinfo { +font-size: x-small; +font-family: monospace; +} + From f56679a61d44d147713a8319e54b4d4ff5a6e325 Mon Sep 17 00:00:00 2001 From: Malcolm Robb Date: Sun, 12 May 2013 01:17:38 +0100 Subject: [PATCH 2/2] VK1ET : Bugfix pTimestamp printf() Change the type of pTimestamp from char* to unsigned char* to stop sign extension messing up the printf("%02X,pTimestamp stuff --- dump1090.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dump1090.c b/dump1090.c index c32e6b2..80226fd 100644 --- a/dump1090.c +++ b/dump1090.c @@ -56,7 +56,7 @@ // MinorVer changes when additional features are added, but not for bug fixes (range 00-99) // DayDate & Year changes for all changes, including for bug fixes. It represent the release date of the update // -#define MODES_DUMP1090_VERSION "1.05.1105.13" +#define MODES_DUMP1090_VERSION "1.05.1205.13" #define MODES_USER_LATITUDE_DFLT (0.0) #define MODES_USER_LONGITUDE_DFLT (0.0) @@ -1663,7 +1663,7 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) { // void displayModesMessage(struct modesMessage *mm) { int j; - char * pTimeStamp; + unsigned char * pTimeStamp; // Handle only addresses mode first. if (Modes.onlyaddr) { @@ -1674,7 +1674,7 @@ void displayModesMessage(struct modesMessage *mm) { // Show the raw message. if (Modes.mlat) { printf("@"); - pTimeStamp = (char *) &mm->timestampMsg; + pTimeStamp = (unsigned char *) &mm->timestampMsg; for (j=5; j>=0;j--) { printf("%02X",pTimeStamp[j]); } @@ -3052,11 +3052,11 @@ void modesSendRawOutput(struct modesMessage *mm) { char *p = &Modes.rawOut[Modes.rawOutUsed]; int msgLen = mm->msgbits / 8; int j; - char * pTimeStamp; + unsigned char * pTimeStamp; if (Modes.mlat) { *p++ = '@'; - pTimeStamp = (char *) &mm->timestampMsg; + pTimeStamp = (unsigned char *) &mm->timestampMsg; for (j = 5; j >= 0; j--) { sprintf(p, "%02X", pTimeStamp[j]); p += 2;