@@ -3,6 +3,7 @@ var position_id = 0;
3
3
var newdata_url = "https://api.v2.sondehub.org/amateur/telemetry" ;
4
4
var receivers_url = "https://api.v2.sondehub.org/amateur/listeners/telemetry" ;
5
5
var predictions_url = "https://api.v2.sondehub.org/amateur/predictions?vehicles=" ;
6
+ var grafana_url = "https://grafana.v2.sondehub.org/d/HJgOZLq7k/basic?" ;
6
7
7
8
var livedata = "wss://ws-reader.v2.sondehub.org/" ;
8
9
var clientID = "SondeHub-Tracker-" + Math . floor ( Math . random ( ) * 10000000000 ) ;
@@ -1460,6 +1461,9 @@ function updateVehicleInfo(vcallsign, newPosition) {
1460
1461
timeChosen = timeSent ;
1461
1462
}
1462
1463
1464
+ // Generate Grafana Link
1465
+ var grafana_dashboard_url = grafana_url + "var-Payload=" + vcallsign + "&from=" + vehicle . positions_ts [ 0 ] + "&to=" + vehicle . positions_ts [ vehicle . positions_ts . length - 1 ] + "&orgId=1" ;
1466
+
1463
1467
//desktop
1464
1468
var a = '<div class="header">' +
1465
1469
'<span>' + sonde_type + vcallsign + ' <i class="icon-target"></i></span>' +
@@ -1816,7 +1820,7 @@ function redrawPrediction(vcallsign) {
1816
1820
vehicle . prediction_polyline . path_length = path_length ;
1817
1821
1818
1822
var image_src ;
1819
- if ( vcallsign != "wb8elk2" ) { // WhiteStar
1823
+ if ( vcallsign != "wb8elk2" ) { // WhiteStar - Not sure the reasons behind a check for this? Seems odd. May be from when WB8ELK was first doing floater flights?
1820
1824
var html = "" ;
1821
1825
if ( vehicle . prediction_target ) {
1822
1826
vehicle . prediction_target . setLatLng ( latlng ) ;
@@ -1836,7 +1840,13 @@ function redrawPrediction(vcallsign) {
1836
1840
} ) ;
1837
1841
}
1838
1842
vehicle . prediction_target . pdata = data [ data . length - 1 ] ;
1843
+ if ( vehicle . prediction . descent_rate == null ) {
1844
+ vehicle . prediction_target . pred_type = "Float Prediction" ;
1845
+ } else {
1846
+ vehicle . prediction_target . pred_type = "Standard, " + vehicle . prediction . descent_rate . toFixed ( 1 ) + " m/s descent rate." ;
1847
+ }
1839
1848
} else {
1849
+ // Suspect this will never be called?
1840
1850
if ( vehicle . prediction_target ) vehicle . prediction_target = null ;
1841
1851
}
1842
1852
@@ -1859,8 +1869,17 @@ function redrawPrediction(vcallsign) {
1859
1869
} ) ;
1860
1870
}
1861
1871
vehicle . prediction_burst . pdata = data [ burst_index ] ;
1872
+ if ( vehicle . prediction . descent_rate == null ) {
1873
+ vehicle . prediction_burst . pred_type = "Float Prediction" ;
1874
+ } else {
1875
+ vehicle . prediction_burst . pred_type = "Standard, " + vehicle . prediction . descent_rate . toFixed ( 1 ) + " m/s descent rate." ;
1876
+ }
1862
1877
} else {
1863
- if ( vehicle . prediction_burst ) vehicle . prediction_burst = null ;
1878
+ if ( vehicle . prediction_burst ) {
1879
+ // Remove burst icon from the map if no burst data in prediction.
1880
+ map . removeLayer ( vehicle . prediction_burst ) ;
1881
+ vehicle . prediction_burst = null ;
1882
+ }
1864
1883
}
1865
1884
}
1866
1885
@@ -2165,6 +2184,7 @@ function mapInfoBox_handle_prediction(event) {
2165
2184
"<b>Altitude:</b> " + altitude + "\n" +
2166
2185
"<b>Latitude:</b> " + data . lat + "\n" +
2167
2186
"<b>Longitude:</b> " + data . lon + "\n" +
2187
+ "<b>Prediction Type:</b> " + event . target . pred_type + "\n" +
2168
2188
"</pre>"
2169
2189
) ;
2170
2190
mapInfoBox . setLatLng ( event . latlng ) ;
0 commit comments