File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ <h2>Settings</h2>
7777 < input type ="checkbox " id ="opt_imperial ">
7878 </ div >
7979 </ div >
80+ < div class ="row option ">
81+ < span > < b > Horizontal speed in hours</ b > </ span >
82+ < div class ="switch off " id ="sw_haxis_hours ">
83+ < span class ="thumb hourswitch "> </ span >
84+ < input type ="checkbox " id ="opt_haxis_hours ">
85+ </ div >
86+ </ div >
8087 < div class ="row option ">
8188 < span > < b > Availability offline</ b > </ span >
8289 < div class ="switch off " id ="sw_offline ">
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ $(window).ready(function() {
389389 if ( offline . get ( 'opt_daylight' ) ) $ ( '#sw_daylight' ) . removeClass ( 'off' ) . addClass ( 'on' ) ;
390390
391391 // offline and mobile
392- $ ( '#sw_offline, #sw_station, #sw_imperial' ) . click ( function ( ) {
392+ $ ( '#sw_offline, #sw_station, #sw_imperial, #sw_haxis_hours ' ) . click ( function ( ) {
393393 var e = $ ( this ) ;
394394 var name = e . attr ( 'id' ) . replace ( 'sw' , 'opt' ) ;
395395 var on ;
@@ -403,12 +403,13 @@ $(window).ready(function() {
403403 }
404404
405405 offline . set ( name , on ) ;
406- if ( name == "opt_imperial" ) refreshUI ( ) ;
406+ if ( name == "opt_imperial" || name == "opt_haxis_hours" ) refreshUI ( ) ;
407407 } ) ;
408408
409409 if ( offline . get ( 'opt_offline' ) ) $ ( '#sw_offline' ) . removeClass ( 'off' ) . addClass ( 'on' ) ;
410410 if ( offline . get ( 'opt_station' ) ) $ ( '#sw_station' ) . removeClass ( 'off' ) . addClass ( 'on' ) ;
411411 if ( offline . get ( 'opt_imperial' ) ) $ ( '#sw_imperial' ) . removeClass ( 'off' ) . addClass ( 'on' ) ;
412+ if ( offline . get ( 'opt_haxis_hours' ) ) $ ( '#sw_haxis_hours' ) . removeClass ( 'off' ) . addClass ( 'on' ) ;
412413
413414 // force re-cache
414415 $ ( '#sw_cache' ) . click ( function ( ) {
Original file line number Diff line number Diff line change @@ -358,7 +358,11 @@ function updateVehicleInfo(index, position) {
358358
359359 var imp = offline . get ( 'opt_imperial' ) ;
360360 var ascent_text = imp ? ( vehicles [ index ] . ascent_rate * 196.850394 ) . toFixed ( 1 ) + ' ft/min' : vehicles [ index ] . ascent_rate . toFixed ( 1 ) + ' m/s' ;
361- var hrate_text = imp ? ( vehicles [ index ] . horizontal_rate * 196.850394 ) . toFixed ( 1 ) + ' ft/min' : vehicles [ index ] . horizontal_rate . toFixed ( 1 ) + ' m/s' ;
361+ if ( offline . get ( 'opt_haxis_hours' ) ) {
362+ var hrate_text = imp ? ( vehicles [ index ] . horizontal_rate * 2.23693629 ) . toFixed ( 1 ) + ' mph' : ( vehicles [ index ] . horizontal_rate * 3.6 ) . toFixed ( 1 ) + ' km/h' ;
363+ } else {
364+ var hrate_text = imp ? ( vehicles [ index ] . horizontal_rate * 196.850394 ) . toFixed ( 1 ) + ' ft/min' : vehicles [ index ] . horizontal_rate . toFixed ( 1 ) + ' m/s' ;
365+ }
362366
363367 var coords_text ;
364368 var ua = navigator . userAgent . toLowerCase ( ) ;
@@ -816,7 +820,7 @@ function addPosition(position) {
816820 - convert_time ( vehicle . curr_position . gps_time ) ;
817821
818822 if ( dt != 0 ) {
819- // calcualte vertical rate
823+ // calculate vertical rate
820824 var rate = ( position . gps_alt - vehicle . curr_position . gps_alt ) / dt ;
821825 vehicle . ascent_rate = 0.7 * rate
822826 + 0.3 * vehicle . ascent_rate ;
You can’t perform that action at this time.
0 commit comments