Skip to content

Commit 7f9ff8a

Browse files
authored
Merge pull request projecthorus#83 from darksidelemm/main
Enable float button all the time if modulation contains WSPR
2 parents be4a331 + cad4b96 commit 7f9ff8a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

js/tracker.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,11 @@ function updateVehicleInfo(vcallsign, newPosition) {
15251525
// Finally generate the URL to use for the 'Plots' button.
15261526
var grafana_dashboard_url = grafana_base_url + "var-Payload=" + vcallsign + "&from=" + vehicle.positions_ts[0] + "&to=" + grafana_to_time + "&orgId=1" + grafana_refresh;
15271527

1528+
// Decide if we should enable the 'Float' button.
1529+
// Enable this based on either a very low ascent rate, or if the payload is using WSPR (in which case it's likely a picoballoon)
1530+
var float_button_enabled = (newPosition.gps_alt > 3000 && vehicle.ascent_rate < 1 && vehicle.ascent_rate > -1) || (vehicle.curr_position.data.modulation.includes('WSPR'));
1531+
1532+
15281533
//desktop
15291534
var a = '<div class="header">' +
15301535
'<span>' + sonde_type + vcallsign + ' <i class="icon-target"></i></span>' +
@@ -1535,7 +1540,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
15351540
'<span class="vbutton path '+((vehicle.polyline_visible) ? 'active' : '')+'" data-vcallsign="'+vcallsign+'"' + ' style="top:'+(vehicle.image_src_size[1]+55)+'px">Path</span>' +
15361541
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:'+(vehicle.image_src_size[1]+85)+'px">Share</span>' : '') +
15371542
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="openURL(\'' + grafana_dashboard_url + '\')" style="top:'+(vehicle.image_src_size[1]+115)+'px">Plots</span>' : '') +
1538-
((vehicle.vehicle_type!="car" && newPosition.gps_alt > 3000 && vehicle.ascent_rate < 1 && vehicle.ascent_rate > -1) ? '<span class="sbutton hysplit '+((vehicle.prediction_hysplit_visible) ? 'active' : '')+'" data-vcallsign="' + vcallsign + '" style="top:'+(vehicle.image_src_size[1]+145)+'px">Float</span>' : '') +
1543+
((vehicle.vehicle_type!="car" && float_button_enabled) ? '<span class="sbutton hysplit '+((vehicle.prediction_hysplit_visible) ? 'active' : '')+'" data-vcallsign="' + vcallsign + '" style="top:'+(vehicle.image_src_size[1]+145)+'px">Float</span>' : '') +
15391544
'<div class="left">' +
15401545
'<dl>';
15411546
//mobile
@@ -1548,7 +1553,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
15481553
'<span class="vbutton path '+((vehicle.polyline_visible) ? 'active' : '')+'" data-vcallsign="'+vcallsign+'"' + ' style="top:55px">Path</span>' +
15491554
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:85px">Share</span>' : '') +
15501555
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="openURL(\'' + grafana_dashboard_url + '\')" style="top:115px">Plots</span>' : '') +
1551-
((vehicle.vehicle_type!="car" && newPosition.gps_alt > 3000 && vehicle.ascent_rate < 1 && vehicle.ascent_rate > -1) ? '<span class="sbutton hysplit '+((vehicle.prediction_hysplit_visible) ? 'active' : '')+'" data-vcallsign="' + vcallsign + '" style="top:145px">Float</span>' : '') +
1556+
((vehicle.vehicle_type!="car" && float_button_enabled) ? '<span class="sbutton hysplit '+((vehicle.prediction_hysplit_visible) ? 'active' : '')+'" data-vcallsign="' + vcallsign + '" style="top:145px">Float</span>' : '') +
15521557
'<div class="left">' +
15531558
'<dl>';
15541559
var b = '</dl>' +

0 commit comments

Comments
 (0)