From 09cb43e2668890bc0983ba961c1ad05b31b752ba Mon Sep 17 00:00:00 2001 From: Jonathan Hudson Date: Sun, 15 Dec 2024 15:10:30 +0000 Subject: [PATCH] reword log damage message, revise ltm timeout --- src/mwp/mwp-bb_dialog.vala | 2 +- src/mwp/mwp-enums.vala | 4 ++-- src/mwp/mwp-handle_mspmsg.vala | 4 ---- src/mwp/mwp-handle_serial.vala | 17 +++++++++++------ src/mwp/mwp-ltm_message.vala | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/mwp/mwp-bb_dialog.vala b/src/mwp/mwp-bb_dialog.vala index 4545f903..04f0511f 100644 --- a/src/mwp/mwp-bb_dialog.vala +++ b/src/mwp/mwp-bb_dialog.vala @@ -528,7 +528,7 @@ namespace BBL { if (BBLError.warn) { BBLError.lines += "\u200b\n"; //zero-width space to force NL } - BBLError.lines += "NOTICE: Log segment #%d is corrupt\n".printf(nidx); + BBLError.lines += "NOTICE: Log segment #%d is damaged or ancient\n".printf(nidx); BBLError.warn = true; } else if (line.contains("Warning:") || line.contains("Error:")) { BBLError.lines += line; diff --git a/src/mwp/mwp-enums.vala b/src/mwp/mwp-enums.vala index 6a675f95..48328e98 100644 --- a/src/mwp/mwp-enums.vala +++ b/src/mwp/mwp-enums.vala @@ -29,8 +29,8 @@ namespace Mwp { const uint TIMINTVL = 100; // 100 milliseconds const uint STATINTVL = ( 1000/TIMINTVL); // 1 sec, status update - const uint MAVINTVL = ( 2000/TIMINTVL); // 2 sec, push telemetry t/o const uint USATINTVL = ( 2000/TIMINTVL); // 2 sec, change in sats message + const uint MAVINTVL = ( 2500/TIMINTVL); // 2.5 sec, push telemetry t/o const uint CRITINTVL = ( 3000/TIMINTVL); // 3 sec, GPS critical message const uint UUSATINTVL = ( 4000/TIMINTVL); // 4 sec, change in sats message const uint NODATAINTVL = ( 5000/TIMINTVL); // 5 sec, no data warning @@ -82,7 +82,7 @@ namespace Mwp { SET_WP, EXTRA_WP, MISC_BULK, - TELEM = 128, + TELEM, TELEM_SP, } diff --git a/src/mwp/mwp-handle_mspmsg.vala b/src/mwp/mwp-handle_mspmsg.vala index 03f9d7c6..04bc817f 100644 --- a/src/mwp/mwp-handle_mspmsg.vala +++ b/src/mwp/mwp-handle_mspmsg.vala @@ -1601,10 +1601,6 @@ namespace Mwp { want_special = 0; MWPLog.message("%s %s\n", Mwp.window.verlab.label, Mwp.window.typlab.label); - if(replayer == Player.NONE) { - MWPLog.message("switch val == %08x (%08x)\n", bxflag, lmask); - } - var reqsize = build_pollreqs(); var nreqs = requests.length; // data we send, response is structs + this diff --git a/src/mwp/mwp-handle_serial.vala b/src/mwp/mwp-handle_serial.vala index ecba41a4..16b6c698 100644 --- a/src/mwp/mwp-handle_serial.vala +++ b/src/mwp/mwp-handle_serial.vala @@ -303,15 +303,15 @@ namespace Mwp { msp.send_command((uint16)lastmsg.cmd, lastmsg.data, lastmsg.len); } else run_queue(); - } + } } void run_queue() { if((replayer & (Player.BBOX|Player.OTX|Player.RAW)) != 0) { mq.clear(); } else if(msp.available && !mq.is_empty()) { - lastmsg = mq.pop_head(); - msp.send_command((uint16)lastmsg.cmd, lastmsg.data, lastmsg.len); + lastmsg = mq.pop_head(); + msp.send_command((uint16)lastmsg.cmd, lastmsg.data, lastmsg.len); } } @@ -490,6 +490,7 @@ namespace Mwp { } private void reset_poller() { + MWPLog.message(":DBG: Reset Poller\n"); if(starttasks == 0) { lastok = nticks; if(serstate != SERSTATE.NONE && serstate != SERSTATE.TELEM) { @@ -571,12 +572,16 @@ namespace Mwp { } else { seenMSP = true; telem = false; + last_tm = 0; handled = Mwp.handle_msp(ser, cmd, raw, len, xflags, errs); } - if(telem && last_tm == 0) { - telem_init(cmd); + if(telem) { + if(last_tm == 0) { + telem_init(cmd); + } else { + last_tm = nticks; + } } - if(!handled) { show_unhandled(cmd, raw, len); } diff --git a/src/mwp/mwp-ltm_message.vala b/src/mwp/mwp-ltm_message.vala index cb858a12..7ea4ea08 100644 --- a/src/mwp/mwp-ltm_message.vala +++ b/src/mwp/mwp-ltm_message.vala @@ -16,11 +16,11 @@ */ namespace Mwp { + bool handle_ltm(MWSerial ser, Msp.Cmds cmd, uint8[]raw, uint len) { bool handled = true; lastrx = nticks; Mwp.window.mmode.label = "LTM"; - switch(cmd) { case Msp.Cmds.TO_FRAME: LTM_OFRAME of = LTM_OFRAME();