From e1afec4e5d3f8646127e6f6f67f2a57df9968b5c Mon Sep 17 00:00:00 2001 From: Luke Prior <22492406+LukePrior@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:12:31 +1100 Subject: [PATCH 1/5] Test to try & fix predictions --- js/tracker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/tracker.js b/js/tracker.js index 1045406..272bde8 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -814,11 +814,14 @@ function plotPrediction (data, dates, marker, properties) { } function showPrediction(url) { + var delayInMilliseconds = Math.random() * (50 - 20) + 20; + setTimeout(function() { return $.ajax({ type: "GET", url: url, dataType: "json", }); + }, delayInMilliseconds); } function deletePredictions(marker) { From 02f7205ba29c9ad6197ccbad932ce269bbcd7376 Mon Sep 17 00:00:00 2001 From: Luke Prior <22492406+LukePrior@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:20:55 +1100 Subject: [PATCH 2/5] Attempt 2 at fixing predictions --- js/tracker.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/js/tracker.js b/js/tracker.js index 272bde8..2bba7d0 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -720,7 +720,10 @@ function launchSitePredictions(times, station, properties, marker) { var lon = ((360 + (position[1] % 360)) % 360) //var url = "https://predict.cusf.co.uk/api/v1/?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; var url = "https://api.v2.sondehub.org/tawhiri?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; - showPrediction(url).done(handleData).fail(handleError); + var delayInMilliseconds = 50; + setTimeout(function() { + showPrediction(url).done(handleData).fail(handleError); + }, delayInMilliseconds); } function handleData(data) { completed += 1; @@ -814,14 +817,11 @@ function plotPrediction (data, dates, marker, properties) { } function showPrediction(url) { - var delayInMilliseconds = Math.random() * (50 - 20) + 20; - setTimeout(function() { - return $.ajax({ - type: "GET", - url: url, - dataType: "json", - }); - }, delayInMilliseconds); + return $.ajax({ + type: "GET", + url: url, + dataType: "json", + }); } function deletePredictions(marker) { From 161301b5de6b3c35cfbd99e2a813b27d6e9336cb Mon Sep 17 00:00:00 2001 From: Luke Prior <22492406+LukePrior@users.noreply.github.com> Date: Sat, 30 Oct 2021 12:09:53 +1100 Subject: [PATCH 3/5] Update tracker.js --- js/tracker.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/js/tracker.js b/js/tracker.js index 2bba7d0..1fc2365 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -718,12 +718,9 @@ function launchSitePredictions(times, station, properties, marker) { var completed = 0; for (var i = 0; i < dates.length; i++) { var lon = ((360 + (position[1] % 360)) % 360) - //var url = "https://predict.cusf.co.uk/api/v1/?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; - var url = "https://api.v2.sondehub.org/tawhiri?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; - var delayInMilliseconds = 50; - setTimeout(function() { - showPrediction(url).done(handleData).fail(handleError); - }, delayInMilliseconds); + var url = "https://predict.cusf.co.uk/api/v1/?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; + //var url = "https://api.v2.sondehub.org/tawhiri?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; + showPrediction(url).done(handleData).fail(handleError); } function handleData(data) { completed += 1; From f70a4b42826d62020a32e8979cb6087f4752ee90 Mon Sep 17 00:00:00 2001 From: Luke Prior <22492406+LukePrior@users.noreply.github.com> Date: Sat, 30 Oct 2021 12:24:34 +1100 Subject: [PATCH 4/5] Update tracker.js --- js/tracker.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/tracker.js b/js/tracker.js index 1fc2365..8ea4a74 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -720,7 +720,7 @@ function launchSitePredictions(times, station, properties, marker) { var lon = ((360 + (position[1] % 360)) % 360) var url = "https://predict.cusf.co.uk/api/v1/?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; //var url = "https://api.v2.sondehub.org/tawhiri?launch_latitude=" + position[0] + "&launch_longitude=" + lon + "&launch_datetime=" + dates[i] + "&ascent_rate=" + properties[0] + "&burst_altitude=" + properties[2] + "&descent_rate=" + properties[1]; - showPrediction(url).done(handleData).fail(handleError); + showPrediction(url).done(handleData).fail(handleError); } function handleData(data) { completed += 1; @@ -814,11 +814,11 @@ function plotPrediction (data, dates, marker, properties) { } function showPrediction(url) { - return $.ajax({ - type: "GET", - url: url, - dataType: "json", - }); + return $.ajax({ + type: "GET", + url: url, + dataType: "json", + }); } function deletePredictions(marker) { From 41f34cb7503f83ffa9fa29356c0764d769b9aa70 Mon Sep 17 00:00:00 2001 From: Uskompuf <22492406+Uskompuf@users.noreply.github.com> Date: Sat, 30 Oct 2021 14:04:28 +1100 Subject: [PATCH 5/5] show frequency --- js/tracker.js | 87 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 18 deletions(-) diff --git a/js/tracker.js b/js/tracker.js index 8ea4a74..0231d8c 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -1051,7 +1051,8 @@ function habitat_data(jsondata, alternative) { "sats": "GNSS SVs Used", "humidity": "Relative Humidity", "subtype": "Sonde Sub-type", - "frequency": "TX Frequency", + "frequency": "Frequency", + "frequency_tx": "TX Frequency", "manufacturer": "Manufacturer", "type": "Sonde Type", "burst_timer": "Burst Timer", @@ -1092,6 +1093,7 @@ function habitat_data(jsondata, alternative) { "light_intensity": " lx", "humidity": " %", "frequency": " MHz", + "frequency_tx": " MHz", "spam": "" }; @@ -1102,11 +1104,18 @@ function habitat_data(jsondata, alternative) { var data = (typeof jsondata === "string") ? $.parseJSON(jsondata) : jsondata; var array = []; var output = ""; + var txFreq = false if(Object.keys(data).length === 0) return ""; + if ("frequency_tx" in data) { + txFreq = true + } + for(var key in data) { - array.push([key, data[key]]); + if (key === "frequency" && txFreq) {} else { + array.push([key, data[key]]); + } } array.sort(function(a, b) { @@ -1580,21 +1589,26 @@ function updateVehicleInfo(vcallsign, newPosition) { for(var rxcall in newPosition.callsign){ if(newPosition.callsign.hasOwnProperty(rxcall)) { _new_call = rxcall; + tempFields = []; if(newPosition.callsign[rxcall].hasOwnProperty('snr')){ if(newPosition.callsign[rxcall].snr){ - _new_call += " (" + newPosition.callsign[rxcall].snr.toFixed(0) + " dB)"; - callsign_list.push(_new_call) - continue; + tempFields.push(newPosition.callsign[rxcall].snr.toFixed(0) + " dB"); } } if(newPosition.callsign[rxcall].hasOwnProperty('rssi')){ if(newPosition.callsign[rxcall].rssi){ - _new_call += " (" + newPosition.callsign[rxcall].rssi.toFixed(0) + " dBm)"; - callsign_list.push(_new_call) - continue; + tempFields.push(newPosition.callsign[rxcall].rssi.toFixed(0) + " dBm"); } } - callsign_list.push(_new_call); // catch cases where there is no SNR or RSSI + if(newPosition.callsign[rxcall].hasOwnProperty('frequency')){ + if(newPosition.callsign[rxcall].frequency){ + tempFields.push(newPosition.callsign[rxcall].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(", "); @@ -2087,8 +2101,10 @@ function mapInfoBox_handle_path_fetch(id,vehicle) { if (data.hasOwnProperty("batt")) { html += "