";
+ html += "
"+data.serial+"("+date+")
";
+ html += "
";
+ html += "
"+roundNumber(data.lat, 5) + ', ' + roundNumber(data.lon, 5)+"
";
- var imp = offline.get('opt_imperial');
- var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(data.alt)) : parseInt(data.alt)).toLocaleString("us");
- text_alt += " " + ((imp) ? 'ft':'m');
+ var imp = offline.get('opt_imperial');
+ var text_alt = Number((imp) ? Math.floor(3.2808399 * parseInt(data.alt)) : parseInt(data.alt)).toLocaleString("us");
+ text_alt += " " + ((imp) ? 'ft':'m');
- html += "
Altitude: "+text_alt+"
";
- html += "
Time: "+formatDate(stringToDateUTC(date))+"
";
+ html += "
Altitude: "+text_alt+"
";
+ html += "
Time: "+formatDate(stringToDateUTC(date))+"
";
- var value = vehicle.path_length;
+ var value = vehicle.path_length;
- html += "
Distance: ";
+ html += "
Distance: ";
- if(offline.get('opt_imperial')) {
- html += Math.round(value*0.000621371192) + "mi";
- } else {
- html += Math.round(value/10)/100 + " km";
- }
+ if(offline.get('opt_imperial')) {
+ html += Math.round(value*0.000621371192) + " mi";
+ } else {
+ html += Math.round(value/10)/100 + " km";
+ }
- html += "
";
- html += "
Duration: " + format_time_friendly(vehicle.start_time, convert_time(vehicle.curr_position.gps_time)) + "
";
+ html += "
";
+ html += "
Duration: " + format_time_friendly(vehicle.start_time, convert_time(vehicle.curr_position.gps_time)) + "
";
- html += "
";
+ html += "
";
- if (data.hasOwnProperty("batt")) {
- html += "
Battery Voltage: " + data.batt + " V
";
- };
- if (data.hasOwnProperty("tx_frequency")) {
- html += "
TX Frequency: " + data.tx_frequency + " MHz
";
- } else if (data.hasOwnProperty("frequency")) {
- html += "
Frequency: " + data.frequency + " MHz
";
- };
- if (data.hasOwnProperty("humidity")) {
- html += "
Relative Humidity: " + data.humidity + " %
";
- };
- if (data.hasOwnProperty("manufacturer")) {
- html += "
Manufacturer: " + data.manufacturer + "
";
- };
- if (data.hasOwnProperty("sats")) {
- html += "
Satellites: " + data.sats + "
";
- };
- if (data.hasOwnProperty("temp")) {
- html += "
Temperature External: " + data.temp + "°C
";
- };
- if (data.hasOwnProperty("subtype")) {
- html += "
Sonde Type: " + data.subtype + "
";
- } else if (data.hasOwnProperty("type")) {
- html += "
Sonde Type: " + data.type + "
";
- };
- if (data.hasOwnProperty("pressure")) {
- html += "
Pressure: " + data.pressure + " Pa
";
- };
- if (data.hasOwnProperty("xdata")) {
- html += "
XDATA: " + data.xdata + "
";
- };
+ if (data.hasOwnProperty("batt")) {
+ html += "
Battery Voltage: " + data.batt + " V
";
+ };
+ if (data.hasOwnProperty("tx_frequency")) {
+ html += "
TX Frequency: " + data.tx_frequency + " MHz
";
+ } else if (data.hasOwnProperty("frequency")) {
+ html += "
Frequency: " + data.frequency + " MHz
";
+ };
+ if (data.hasOwnProperty("humidity")) {
+ html += "
Relative Humidity: " + data.humidity + " %
";
+ };
+ if (data.hasOwnProperty("manufacturer")) {
+ html += "
Manufacturer: " + data.manufacturer + "
";
+ };
+ if (data.hasOwnProperty("sats")) {
+ html += "
Satellites: " + data.sats + "
";
+ };
+ if (data.hasOwnProperty("temp")) {
+ html += "
Temperature External: " + data.temp + "°C
";
+ };
+ if (data.hasOwnProperty("subtype")) {
+ html += "
Sonde Type: " + data.subtype + "
";
+ } else if (data.hasOwnProperty("type")) {
+ html += "
Sonde Type: " + data.type + "
";
+ };
+ if (data.hasOwnProperty("pressure")) {
+ html += "
Pressure: " + data.pressure + " Pa
";
+ };
+ if (data.hasOwnProperty("xdata")) {
+ html += "
XDATA: " + data.xdata + "
";
+ };
- html += "
";
- html += "
"
+ html += "
";
+ html += "
"
- var callsign_list = [];
+ var callsign_list = [];
- for (var i = 0; i < data.uploaders.length; i++) {
- _new_call = data.uploaders[i].uploader_callsign;
- tempFields = [];
- if(data.uploaders[i].hasOwnProperty('snr')) {
- tempFields.push(data.uploaders[i].snr.toFixed(0) + " dB");
- }
- if(data.uploaders[i].hasOwnProperty('rssi')) {
- tempFields.push(data.uploaders[i].rssi.toFixed(0) + " dBm");
- }
- if(data.uploaders[i].hasOwnProperty('frequency')) {
- tempFields.push(data.uploaders[i].frequency + " MHz");
- }
- if(tempFields.length > 0) {
- _new_call += " (" + tempFields.join(", ") + ")";
- }
- callsign_list.push(_new_call); // catch cases where there are no fields
+ for (var i = 0; i < data.uploaders.length; i++) {
+ _new_call = data.uploaders[i].uploader_callsign;
+ tempFields = [];
+ if(data.uploaders[i].hasOwnProperty('snr')) {
+ tempFields.push(data.uploaders[i].snr.toFixed(0) + " dB");
+ }
+ if(data.uploaders[i].hasOwnProperty('rssi')) {
+ tempFields.push(data.uploaders[i].rssi.toFixed(0) + " dBm");
+ }
+ if(data.uploaders[i].hasOwnProperty('frequency')) {
+ tempFields.push(data.uploaders[i].frequency + " MHz");
}
+ if(tempFields.length > 0) {
+ _new_call += " (" + tempFields.join(", ") + ")";
+ }
+ callsign_list.push(_new_call); // catch cases where there are no fields
+ }
- callsign_list = callsign_list.join("
");
+ callsign_list = callsign_list.join("
");
- html += callsign_list + "
";
+ html += callsign_list + "
";
- div.innerHTML = html;
+ div.innerHTML = html;
- mapInfoBox.setContent(div);
- mapInfoBox.openOn(map);
+ mapInfoBox.setContent(div);
+ mapInfoBox.openOn(map);
- setTimeout(function() {
- div.parentElement.style.overflow = "";
- div.parentElement.style.overflowWrap = "break-word";
- }, 16);
- });
-};
+ setTimeout(function() {
+ div.parentElement.style.overflow = "";
+ div.parentElement.style.overflowWrap = "break-word";
+ }, 16);
+}
function mapInfoBox_handle_prediction(event) {
var data = event.target.pdata;
@@ -3464,7 +3611,17 @@ function formatData(data, live) {
if (data[i].temp) {
dataTempEntry.data.temperature_external = data[i].temp;
}
- if (data[i].type) {
+ if (data[i].type && data[i].type == "payload_telemetry") { // SondeHub V1 data
+ var comment = data[i].comment.split(" ");
+ if (v1types.hasOwnProperty(comment[0])) {
+ dataTempEntry.data.type = v1types[comment[0]];
+ dataTempEntry.type = v1types[comment[0]];
+ if (v1manufacturers.hasOwnProperty(dataTempEntry.type)) {
+ dataTempEntry.data.manufacturer = v1manufacturers[dataTempEntry.type];
+ }
+ }
+ dataTempEntry.data.frequency = comment[2];
+ } else if (data[i].type) {
dataTempEntry.data.type = data[i].type;
dataTempEntry.type = data[i].type;
}