Skip to content

Commit 892ee9d

Browse files
authored
Merge pull request projecthorus#87 from darksidelemm/main
Fix low altitude APRS setting, add hide testing payloads setting
2 parents 2479fe6 + 1e0b00e commit 892ee9d

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

index.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,16 @@ <h4>Visibility</h4>
217217
</div>
218218
<div class="row option">
219219
<span><b>Show Low Altitude APRS</b></span>
220-
<div class="switch off" id="sw_hide_aprs">
220+
<div class="switch off" id="sw_show_aprs">
221221
<span class="thumb"></span>
222-
<input type="checkbox" id="opt_hide_aprs">
222+
<input type="checkbox" id="opt_show_aprs">
223+
</div>
224+
</div>
225+
<div class="row option">
226+
<span><b>Show Testing Payloads</b></span>
227+
<div class="switch on" id="sw_show_testing">
228+
<span class="thumb"></span>
229+
<input type="checkbox" id="opt_show_testing">
223230
</div>
224231
</div>
225232
<h4>Other</h4>

js/app.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,8 @@ $(window).ready(function() {
728728
'#sw_hide_horizon',
729729
'#sw_hide_titles',
730730
'#sw_selective_sidebar',
731-
'#sw_hide_aprs',
731+
'#sw_show_aprs',
732+
'#sw_show_testing',
732733
"#sw_nowelcome",
733734
"#sw_interpolate",
734735
"#sw_float_constrained"
@@ -826,7 +827,10 @@ $(window).ready(function() {
826827
case "opt_selective_sidebar":
827828
sidebar_update();
828829
break;
829-
case "opt_hide_aprs":
830+
case "opt_show_aprs":
831+
clean_refresh(wvar.mode, true, false);
832+
break;
833+
case "opt_show_testing":
830834
clean_refresh(wvar.mode, true, false);
831835
break;
832836
case "opt_interpolate":

js/format.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ var excludedFields = [
2727
"uploader_radio",
2828
"uploader_antenna",
2929
"raw",
30-
"aprs_tocall"
30+
"aprs_tocall",
31+
"telemetry_hidden"
3132
];
3233

3334
var uniqueKeys = {
@@ -37,7 +38,8 @@ var uniqueKeys = {
3738
}
3839

3940
function formatData(data) {
40-
var hideAprs = offline.get('opt_hide_aprs');
41+
var showAprs = offline.get('opt_show_aprs');
42+
var showTesting = offline.get("opt_show_testing");
4143
var response = {};
4244
response.positions = {};
4345
var dataTemp = [];
@@ -70,7 +72,8 @@ function formatData(data) {
7072
}
7173
}
7274
for (let entry in data[key][i].uploaders) {
73-
if (data[key][i].software_name == "aprs") {
75+
// This check should probably be done using a modulation field, but this still works I guess..
76+
if (data[key][i].software_name.includes("APRS")) {
7477
aprsflag = true;
7578
var stations = data[key][i].uploaders[entry].uploader_callsign.split(",");
7679
for (let uploader in stations) {
@@ -96,9 +99,15 @@ function formatData(data) {
9699
if (dataTempEntry.gps_alt > maximumAltitude) {
97100
maximumAltitude = dataTempEntry.gps_alt;
98101
}
99-
if (maximumAltitude < 1500 && aprsflag && !hideAprs) {
102+
// APRS Altitude filter.
103+
if (maximumAltitude < 1500 && aprsflag && !showAprs) {
100104
continue;
101105
}
106+
// Testing payload filter.
107+
if (data[key][i].telemetry_hidden && !showTesting){
108+
continue;
109+
}
110+
//
102111
dataTempEntry.gps_lat = parseFloat((data[key][i].lat).toPrecision(8));
103112
dataTempEntry.gps_lon = parseFloat((data[key][i].lon).toPrecision(8));
104113
if (dataTempEntry.gps_lat == 0 && dataTempEntry.gps_lon == 0) {

0 commit comments

Comments
 (0)