diff --git a/chasemapper/config.py b/chasemapper/config.py index d806fa2..6a49de3 100644 --- a/chasemapper/config.py +++ b/chasemapper/config.py @@ -54,7 +54,7 @@ default_config = { # TimeSync Hunting Settings (not in config file, but needs to be shared between clients) "time_seq_enabled": False, "time_seq_times": [0,0,0,0], - "time_seq_active": 20, + "time_seq_active": 25, "time_seq_cycle": 120, # History diff --git a/chasemapper/gpsd.py b/chasemapper/gpsd.py index 2ea4a2b..07493a9 100644 --- a/chasemapper/gpsd.py +++ b/chasemapper/gpsd.py @@ -288,6 +288,7 @@ class DataStream(object): except (ValueError, KeyError) as error: logging.error("GPSD Parser - Other Error - %s" % str(error)) + print(gpsd_socket_response) return @@ -426,8 +427,8 @@ if __name__ == "__main__": format="%(asctime)s %(levelname)s:%(message)s", level=logging.DEBUG ) - _gpsd = GPSDAdaptor(callback=print_dict) - time.sleep(30) + _gpsd = GPSDAdaptor(callback=print_dict, hostname="172.17.0.3") + time.sleep(3000) _gpsd.close() # gpsd_socket = GPSDSocket() diff --git a/static/js/balloon.js b/static/js/balloon.js index 9dfcbb7..04ede73 100644 --- a/static/js/balloon.js +++ b/static/js/balloon.js @@ -247,14 +247,16 @@ function handleTelemetry(data){ // Update Detailed GPS / Heading Info if(data.hasOwnProperty('heading_status')){ - $("#headingStatus").text(data.heading_status); + if(data.heading_status != null){ + $("#headingStatus").text(data.heading_status); - if(data.heading_status.includes("Ongoing")){ - $('#car_warning').text("IMU Not Aligned") - $('#car_warning').removeClass(); - $('#car_warning').addClass('dataAgeBad'); - } else { - $('#car_warning').text("") + if(data.heading_status.includes("Ongoing")){ + $('#car_warning').text("IMU Not Aligned") + $('#car_warning').removeClass(); + $('#car_warning').addClass('dataAgeBad'); + } else { + $('#car_warning').text("") + } } } diff --git a/static/js/bearings.js b/static/js/bearings.js index 9507e93..2b92214 100644 --- a/static/js/bearings.js +++ b/static/js/bearings.js @@ -42,7 +42,7 @@ var latest_server_timestamp = Date.now()/1000.0; // These values are set to a instantaneous time when a button is clicked. var timeSeqEnabled = false; -var timeSeqActive = 20; +var timeSeqActive = 25; var timeSeqCycle = 120; var timeSeqTimes = [0,0,0,0]; @@ -500,10 +500,8 @@ function updateTimeSeqStatus(){ var _current_seq = getCurrentSeqNumber(); if(_current_seq >= 0 ){ var _timeseqtext = "Current Active: " + _current_seq + "
"; - $('#time_to_landing').text("Fox Active: " + _current_seq); } else { var _timeseqtext = "Current Active: None
"; - $('#time_to_landing').text(""); } for (var n=0; n<4; n++){ if(timeSeqTimes[n] > 0){ @@ -522,6 +520,25 @@ function updateTimeSeqStatus(){ $("#timeSeqStatus").html(_timeseqtext); } +function updateTimeSeqClock(){ + if(timeSeqEnabled == true){ + var _current_seq = getCurrentSeqNumber(); + if( _current_seq >= 0 ){ + + var _current_time = Date.now(); + var _seqtime = timeSeqActive - ((_current_time - timeSeqTimes[_current_seq]) % (timeSeqCycle*1000))/1000.0; + + $('#timeseq_notice').text("Fox " + _current_seq + ": " + _seqtime.toFixed(1)); + + } else { + $('#timeseq_notice').text(""); + } + + } else { + $('#timeseq_notice').text(""); + } +} + function getCurrentSeqNumber(offset_seconds){ // Determine the current transmitter number, based on current time and the timeSeqTimes. // Optional offset_seconds argument, to enable testing times slightly into the future. diff --git a/templates/index.html b/templates/index.html index f97912e..e4a5845 100644 --- a/templates/index.html +++ b/templates/index.html @@ -414,6 +414,20 @@ }) .addTo(map); + // Time-to-landing display - shows the time until landing for the currently tracked payload. + L.control.custom({ + position: 'bottomcenter', + content : "
", + classes : 'btn-group-vertical btn-group-sm', + id: 'ttl_display', + style : + { + margin: '5px', + padding: '0px 0 0 0', + cursor: 'pointer', + } + }) + .addTo(map); L.control.custom({ position: 'bottomright', @@ -675,6 +689,8 @@ }else{ $("#pred_age").text("Predictions: " + pred_data_age.toFixed(1)+"s"); } + + updateTimeSeqClock(); }, age_update_rate); // Start connection to Sondehub Websockets. @@ -1028,7 +1044,7 @@
- Active Time (s)
+ Active Time (s)
Cycle Time (s)