From 3b687098d0d1a53064fbcaaa2fe1f5f2c3a98f6c Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 8 May 2022 09:53:10 -0400 Subject: [PATCH] src address UI updates thx Trip --- .../www/www-static/index.html | 24 ++-- op25/gr-op25_repeater/www/www-static/main.js | 123 +++++++++++++----- 2 files changed, 106 insertions(+), 41 deletions(-) diff --git a/op25/gr-op25_repeater/www/www-static/index.html b/op25/gr-op25_repeater/www/www-static/index.html index 94b139b..0d7c559 100644 --- a/op25/gr-op25_repeater/www/www-static/index.html +++ b/op25/gr-op25_repeater/www/www-static/index.html @@ -1,6 +1,6 @@ @@ -124,7 +124,7 @@ - + @@ -324,7 +324,6 @@ - - + + + + - + '; // 7 html += ''; + + // Sloppy Source ID Tag Hack 04/2022 -- this displays the source ID tag in the Main Display better than previous implementations. + // RID display is problematic when using 0x02 opcode, which the Main Display is sometimes populated with. + + if (sf_srctag[slot].length == 1 && sf_srcaddr[slot] > 1 && cbState('showSourceId') ) { + sf_srctag[slot] = "ID: " + sf_srcaddr[slot]; + } + + if (sf_tgtag[slot] == $('#dTag').text()) { + if (sf_srcaddr[slot] == ' ') { + // something here to catch when no source address is present -- usually when a patch is used + // the display layout gets a little messed up when these vars are null. + sf_srcaddr[slot] = 'NO P25 ID'; + + } + $('#dSrcTag').text(sf_srctag[slot]); + $('#dSrc').text(sf_srcaddr[slot]); + } + + // end 'sloppy' + // if (!p2 || zt == " " ) break; if (!p2 || zt == " " || ( sf_la[slot] > 120 && cbState('colSlot2')) ) break; } // end for slot @@ -915,6 +970,12 @@ function trunk_update(d) { var html; if (summary_mode) { html = trunk_summary(d); // home screen + + // this is part of the 'sloppy' Source ID Tag display routine. + // Need trunk_detail to fire so the frequency table bits run even though they are not displayed. + // If trunk_detail() does not run, then the 'sloppy' implementation does not work on the RX tab. + trunk_detail(d); + } else { html = trunk_detail(d); // RX screen @@ -954,12 +1015,12 @@ function update_data(d) { // d json type = trunk_update var e_class = 'value'; - if (last_srcaddr[active_nac] != null) { - display_src = last_srcaddr[active_nac]; - var ele = document.getElementById('dSrc'); - if (ele != null) - ele.innerHTML = display_src; - } +// if (last_srcaddr[active_nac] != null) { +// display_src = last_srcaddr[active_nac]; +// var ele = document.getElementById('dSrc'); +// if (ele != null) +// ele.innerHTML = display_src; +// } if (last_srctag[active_nac] != null) { display_srctag = last_srctag[active_nac]; @@ -1193,7 +1254,7 @@ function dispatch_commands(txt) { if (d['srcaddr']) { source = (d.srcaddr.unit_id) ? d.srcaddr.unit_id : "— No ID"; // This condition is reached when there is traffic srctag = (d.srcaddr.tag) ? d.srcaddr.tag : " "; // but no source unit id is present. on ebrcs, this - // happens when an old u/vhf system is patched onto ebrcs. + // happens when a u/vhf system is patched onto ebrcs. } // handle manufacturer opcodes: @@ -1584,8 +1645,7 @@ function comma(x) { } document.onkeydown = function(evt) { - - console.log(evt.altKey); +// console.log(evt.altKey); // keyboard shortcuts evt = evt || window.event; var x = document.activeElement.tagName; @@ -1594,7 +1654,6 @@ document.onkeydown = function(evt) { switch (evt.keyCode) { - case 70: // 'f' key - show/hide frequency table $('#lastCommand').html('F - Freq Tbl

').show(); @@ -2296,7 +2355,9 @@ function saveDisplaySettings() { "oplogip", "oplogport", "showLast", - "colSlot2" ]; + "colSlot2", + "showEnc", + "showSourceId"]; for (r in s) { if ($('#' + s[r]).attr('type') == "checkbox") {
Copyright:© 2017‐2021 Max H. Parke KA1RBI© 2017‐2022 Max H. Parke KA1RBI
License:
Max Display String Length: - -
  + + +   +
+ +   @@ -460,8 +466,6 @@
- -

diff --git a/op25/gr-op25_repeater/www/www-static/main.js b/op25/gr-op25_repeater/www/www-static/main.js index f59ede4..97eeec6 100644 --- a/op25/gr-op25_repeater/www/www-static/main.js +++ b/op25/gr-op25_repeater/www/www-static/main.js @@ -18,7 +18,7 @@ // Software Foundation, Inc., 51 Franklin Street, Boston, MA // 02110-1301, USA. -var lastUpdated = "09-Jan-2022"; +var lastUpdated = "04-Mar-2022"; var d_debug = 0; var http_req = new XMLHttpRequest(); @@ -115,7 +115,7 @@ function eventsource_listener(event) { dispatch_commands(event.data); } -// Babysitter - watches /stream, reacts when lost/restored +// Watchdog - watches /stream, reacts when lost/restored function setReconnect() { // readyState values: 0 = connecting, 1 = open, 2 = closed var reconnecting = false; @@ -249,7 +249,7 @@ function change_freq(d) { // d json_type = change_freq var display_src = '—'; var display_alg = '—'; var display_keyid = '—'; - var display_srctag = '—'; + var display_srctag = ''; var e_class = 'value'; var trunc = $('#valTruncate').val(); @@ -275,39 +275,62 @@ function change_freq(d) { // d json_type = change_freq } } - // main display - system, talkgroup, encryption, keyid, source addr display + // main display - system, talkgroup, encryption, keyid, source addr display var d_sys = 'system' in d ? d['system'].substring(0, trunc) : 'Undefined'; + var html = ''; // (3 columns, 3 or 4 rows) - var html = '
'; +// row 1 html += ''; - +//col 1 html += ''; +// col 2 + html += ''; +// col 3 html += ''; - html += ''; + +// row 2 html += ''; - +// col 1 html += ''; - html += ''; +// col 3 + html += ''; - html += ''; + +// row 3 html += ''; - - html += ''; +// col 1 + html += ''; +// col 2 html += ''; +// col 3 html += ''; - html += ''; + +// row 4 - encryption info block + if (cbState('showEnc')) { + html += ''; + // col 1 + html += ''; + // col 2 + html += ''; + // col 3 + html += ''; + html += ''; + } +// end encryption info block + html += '
' + d_sys + ' '; html += 'Frequency
' + freqDisplay(d['freq'] / 1000000) + '
' + displayTag + ''; - html += 'Talkgroup
' + displayTgid + ''; +// col 2 + html += '
Talkgroup
' + displayTgid + ''; html += '
'; - html += 'Encryption
' + display_alg + ''; - html += '
' + display_srctag + ''; - html += 'Key ID
' + display_keyid + ''; + html += ' '; html += '
'; - html += 'Source Addr
' + display_src + ''; + html += 'Source
' + display_src + ''; html += '
Encryption ' + display_alg + '' + html += ' Key ID' + display_keyid + ''; + html += '
'; $('#div_s2').html(html).show(); @@ -323,17 +346,26 @@ function change_freq(d) { // d json_type = change_freq var fontStyle = $('#valFontStyle').val(); var tgSize = parseInt($('#valTagFont').val()); var sysSize = parseInt($('#valSystemFont').val()); - var defColor = $('#sysColor').val(); + var defColor = $('#sysColor').val(); // default color var sysColor = ""; - var tagColor = ""; + var tagColor = ""; + var srcColor = ""; var clr = getProperty('.c' + d.tag_color, 'color', 'tgcolors'); + var srcClr = getProperty('.c' + d.srcaddr_color, 'color', 'tgcolors'); + var ani = getProperty('.c' + d.tag_color, 'animation', 'tgcolors'); var bg = getProperty('.c' + d.tag_color, 'backgroundColor', 'tgcolors'); sysColor = (cbState('color_main_sys') && d['tag_color']) ? clr : defColor; tagColor = (cbState('color_main_tag') && d['tag_color']) ? clr : defColor; + srcColor = (cbState('color_main_tag') && d['srcaddr_color']) ? srcClr : defColor; + $('#dSys').css({"color": sysColor, "font-size": sysSize, "font-weight": fontStyle}); $('#dTag').css({"color": tagColor, "font-size": tgSize, "font-weight": fontStyle, "animation": ani, "background-color": bg}); + + + $('#dSrcTag').css({"color": srcColor, "font-size": tgSize, "font-weight": fontStyle, "animation": ani, "background-color": bg}); +// console.log(display_srctag, 'srcColor=' + srcColor, 'defColor=' + defColor, d.srcaddr_color); } // end change_freq @@ -588,6 +620,8 @@ function trunk_detail(d) { // d json_type = trunk_update sf_timeout = 0; // delay before clearing the tg info + // 'sf' = system frequencies + // #frequency# //calls @@ -749,6 +783,27 @@ function trunk_detail(d) { // d json_type = trunk_update html += '
' + sc_src + sf_srctag[slot] + '