Show rights units in web interface

This commit is contained in:
Alberts Saulītis 2015-10-07 20:48:13 +03:00
parent 6f3f2e205b
commit f342094d16
2 changed files with 11 additions and 4 deletions

View File

@ -2154,9 +2154,9 @@ char *aircraftsToJson(int *len) {
l = snprintf(p,buflen,
"{\"hex\":\"%s\", \"flight\":\"%s\", \"lat\":%f, "
"\"lon\":%f, \"altitude\":%d, \"track\":%d, "
"\"speed\":%d},\n",
"\"speed\":%d, \"metric\":%d},\n",
a->hexaddr, a->flight, a->lat, a->lon, altitude, a->track,
speed);
speed, Modes.metric);
p += l; buflen -= l;
/* Resize if needed. */
if (buflen < 256) {

View File

@ -90,8 +90,14 @@
if (p.flight.length) {
html += '<b>'+p.flight+'</b><br>';
}
html += 'Altitude: '+p.altitude+' feet<br>';
html += 'Speed: '+p.speed+' knots<br>';
if (p.metric) {
html += 'Altitude: '+p.altitude+' meters<br>';
html += 'Speed: '+p.speed+' km/h<br>';
}
else {
html += 'Altitude: '+p.altitude+' feet<br>';
html += 'Speed: '+p.speed+' knots<br>';
}
html += 'Coordinates: '+p.lat+', '+p.lon+'<br>';
i.innerHTML = html;
}
@ -118,6 +124,7 @@
myplane.lon = plane.lon;
myplane.track = plane.track;
myplane.flight = plane.flight;
myplane.metric = plane.metric;
if (myplane.hex == Selected)
refreshSelectedInfo();
} else {