Skip to content

Commit 2479fe6

Browse files
authored
Merge pull request #85 from darksidelemm/main
Add constrained float prediction option, use WSPR dashboard for WSPR flights.
2 parents 228c5cb + 73182fa commit 2479fe6

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ <h4>Other</h4>
231231
<input type="checkbox" id="opt_hilight_vehicle">
232232
</div>
233233
</div>
234+
<div class="row option">
235+
<span><b>Constrain Float Predictions</b></span>
236+
<div class="switch off" id="sw_float_constrained">
237+
<span class="thumb"></span>
238+
<input type="checkbox" id="opt_float_constrained">
239+
</div>
240+
</div>
234241
<h4>Overlays</h4>
235242
<hr/>
236243
<div class="row option">

js/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ $(window).ready(function() {
731731
'#sw_hide_aprs',
732732
"#sw_nowelcome",
733733
"#sw_interpolate",
734+
"#sw_float_constrained"
734735
];
735736

736737
// applies functionality when switches are toggled

js/tracker.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ var receivers_url = "https://api.v2.sondehub.org/amateur/listeners/telemetry";
55
var predictions_url = "https://api.v2.sondehub.org/amateur/predictions?vehicles=";
66
// Grafana dashboard for most payloads
77
var grafana_url = "https://grafana.v2.sondehub.org/d/HJgOZLq7k/basic?";
8-
// Grafana dashboard for slower update-rate payloads (APRS, WSPR)
8+
// Grafana dashboard for slower update-rate payloads (APRS)
99
var grafana_aprs_url = "https://grafana.v2.sondehub.org/d/Lwvk1Hy4k/aprs-telemetry?";
10+
// Grafana dashboard for WSPR flight
11+
var grafana_wspr_url = "https://grafana.v2.sondehub.org/d/e4571f1f-b51e-4e02-b97a-dcd198b49560/wspr-balloon-telemetry?";
1012

1113
var livedata = "wss://ws-reader.v2.sondehub.org/";
1214
var clientID = "SondeHub-Tracker-" + Math.floor(Math.random() * 10000000000);
@@ -1516,9 +1518,18 @@ function updateVehicleInfo(vcallsign, newPosition) {
15161518

15171519
if(vehicle.vehicle_type != "car"){
15181520
if(vehicle.curr_position.data.hasOwnProperty('modulation')){
1519-
if(vehicle.curr_position.data.modulation.includes('APRS') || vehicle.curr_position.data.modulation.includes('WSPR')){
1521+
if(vehicle.curr_position.data.modulation.includes('APRS')){
15201522
grafana_base_url = grafana_aprs_url;
15211523
}
1524+
1525+
if(vehicle.curr_position.data.modulation.includes('WSPR')){
1526+
grafana_base_url = grafana_wspr_url;
1527+
}
1528+
}
1529+
if(vehicle.curr_position.data.hasOwnProperty('comment')){
1530+
if(vehicle.curr_position.data.comment.includes('WSPR')){
1531+
grafana_base_url = grafana_wspr_url;
1532+
}
15221533
}
15231534
}
15241535

@@ -1535,6 +1546,11 @@ function updateVehicleInfo(vcallsign, newPosition) {
15351546
float_button_enabled = true;
15361547
}
15371548
}
1549+
if(vehicle.curr_position.data.hasOwnProperty('comment')){
1550+
if(vehicle.curr_position.data.comment.includes('WSPR')){
1551+
float_button_enabled = true;
1552+
}
1553+
}
15381554
}
15391555

15401556

@@ -1658,8 +1674,14 @@ function generateHysplit(callsign) {
16581674
hideHysplit(callsign)
16591675
var vehicle = vehicles[callsign];
16601676
vehicle.prediction_hysplit_visible = true;
1661-
alt_max = 1000;
1662-
alt_step = 100;
1677+
// If requested, constrain the float prediction altitudes to a narrower range.
1678+
if(offline.get("opt_float_constrained")){
1679+
alt_max = 100;
1680+
alt_step = 20;
1681+
} else {
1682+
alt_max = 1000;
1683+
alt_step = 100;
1684+
}
16631685
alt_min = alt_max*-1;
16641686
for (var alt = alt_min; alt <= alt_max; alt+=alt_step) {
16651687
alt_norm = (alt+alt_max)/(alt_max*2.0);

0 commit comments

Comments
 (0)