Change timeseq fox display

gambier2025
Mark Jessop 2025-04-06 14:14:35 +09:30
rodzic f2e6fe63b0
commit 02cd8cd6ac
5 zmienionych plików z 50 dodań i 14 usunięć

Wyświetl plik

@ -54,7 +54,7 @@ default_config = {
# TimeSync Hunting Settings (not in config file, but needs to be shared between clients) # TimeSync Hunting Settings (not in config file, but needs to be shared between clients)
"time_seq_enabled": False, "time_seq_enabled": False,
"time_seq_times": [0,0,0,0], "time_seq_times": [0,0,0,0],
"time_seq_active": 20, "time_seq_active": 25,
"time_seq_cycle": 120, "time_seq_cycle": 120,
# History # History

Wyświetl plik

@ -288,6 +288,7 @@ class DataStream(object):
except (ValueError, KeyError) as error: except (ValueError, KeyError) as error:
logging.error("GPSD Parser - Other Error - %s" % str(error)) logging.error("GPSD Parser - Other Error - %s" % str(error))
print(gpsd_socket_response)
return return
@ -426,8 +427,8 @@ if __name__ == "__main__":
format="%(asctime)s %(levelname)s:%(message)s", level=logging.DEBUG format="%(asctime)s %(levelname)s:%(message)s", level=logging.DEBUG
) )
_gpsd = GPSDAdaptor(callback=print_dict) _gpsd = GPSDAdaptor(callback=print_dict, hostname="172.17.0.3")
time.sleep(30) time.sleep(3000)
_gpsd.close() _gpsd.close()
# gpsd_socket = GPSDSocket() # gpsd_socket = GPSDSocket()

Wyświetl plik

@ -247,14 +247,16 @@ function handleTelemetry(data){
// Update Detailed GPS / Heading Info // Update Detailed GPS / Heading Info
if(data.hasOwnProperty('heading_status')){ 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")){ if(data.heading_status.includes("Ongoing")){
$('#car_warning').text("IMU Not Aligned") $('#car_warning').text("IMU Not Aligned")
$('#car_warning').removeClass(); $('#car_warning').removeClass();
$('#car_warning').addClass('dataAgeBad'); $('#car_warning').addClass('dataAgeBad');
} else { } else {
$('#car_warning').text("") $('#car_warning').text("")
}
} }
} }

Wyświetl plik

@ -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. // These values are set to a instantaneous time when a button is clicked.
var timeSeqEnabled = false; var timeSeqEnabled = false;
var timeSeqActive = 20; var timeSeqActive = 25;
var timeSeqCycle = 120; var timeSeqCycle = 120;
var timeSeqTimes = [0,0,0,0]; var timeSeqTimes = [0,0,0,0];
@ -500,10 +500,8 @@ function updateTimeSeqStatus(){
var _current_seq = getCurrentSeqNumber(); var _current_seq = getCurrentSeqNumber();
if(_current_seq >= 0 ){ if(_current_seq >= 0 ){
var _timeseqtext = "Current Active: " + _current_seq + "<br>"; var _timeseqtext = "Current Active: " + _current_seq + "<br>";
$('#time_to_landing').text("Fox Active: " + _current_seq);
} else { } else {
var _timeseqtext = "Current Active: None<br>"; var _timeseqtext = "Current Active: None<br>";
$('#time_to_landing').text("");
} }
for (var n=0; n<4; n++){ for (var n=0; n<4; n++){
if(timeSeqTimes[n] > 0){ if(timeSeqTimes[n] > 0){
@ -522,6 +520,25 @@ function updateTimeSeqStatus(){
$("#timeSeqStatus").html(_timeseqtext); $("#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){ function getCurrentSeqNumber(offset_seconds){
// Determine the current transmitter number, based on current time and the timeSeqTimes. // Determine the current transmitter number, based on current time and the timeSeqTimes.
// Optional offset_seconds argument, to enable testing times slightly into the future. // Optional offset_seconds argument, to enable testing times slightly into the future.

Wyświetl plik

@ -414,6 +414,20 @@
}) })
.addTo(map); .addTo(map);
// Time-to-landing display - shows the time until landing for the currently tracked payload.
L.control.custom({
position: 'bottomcenter',
content : "<div id='timeseq_notice' class='timeToLanding'></div>",
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({ L.control.custom({
position: 'bottomright', position: 'bottomright',
@ -675,6 +689,8 @@
}else{ }else{
$("#pred_age").text("Predictions: " + pred_data_age.toFixed(1)+"s"); $("#pred_age").text("Predictions: " + pred_data_age.toFixed(1)+"s");
} }
updateTimeSeqClock();
}, age_update_rate); }, age_update_rate);
// Start connection to Sondehub Websockets. // Start connection to Sondehub Websockets.
@ -1028,7 +1044,7 @@
</label> </label>
</div> </div>
<div class="paramRow"> <div class="paramRow">
<b>Active Time (s)</b><input type="text" class="paramEntry" id="timeSeqActiveTime" value="20"><br/> <b>Active Time (s)</b><input type="text" class="paramEntry" id="timeSeqActiveTime" value="25"><br/>
</div> </div>
<div class="paramRow"> <div class="paramRow">
<b>Cycle Time (s)</b><input type="text" class="paramEntry" id="timeSeqActiveTime" value="120"><br/> <b>Cycle Time (s)</b><input type="text" class="paramEntry" id="timeSeqActiveTime" value="120"><br/>