diff --git a/gui/package.json b/gui/package.json index 824f6c73..59e24b2a 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,6 +1,6 @@ { "name": "FreeDATA", - "version": "0.3.3-alpha.2", + "version": "0.3.3-alpha.3", "description": "FreeDATA ", "main": "main.js", "scripts": { diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 96a91900..da3a228f 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -473,19 +473,43 @@ update_chat = function(obj) { var filename = Object.keys(obj._attachments)[0] var filetype = filename.split('.')[1] var filesize = obj._attachments[filename]["length"] + " Bytes"; + var fileheader = ` -
+

- - ${filename} - ${filesize} - + ${filename} + ${filesize} +

+
`; + + var controlarea_transmit = ` +
+ + +
+ + `; + + var controlarea_receive = ` + +
+ +
+ + `; + } else { var filename = ''; var fileheader = ''; + var controlarea_transmit = ` +
+ +
+ `; + var controlarea_receive = ''; } } catch { console.log("error with database parsing...") @@ -503,8 +527,6 @@ update_chat = function(obj) { var new_callsign = ` - -
@@ -556,23 +578,24 @@ update_chat = function(obj) { if (!(document.getElementById('msg-' + obj._id))) { if (obj.type == 'ping') { var new_message = ` -
-

snr: ${obj.snr} - ${timestamp}

+
+

snr: ${obj.snr} - ${timestamp}

+
`; } if (obj.type == 'beacon') { var new_message = ` -
-

snr: ${obj.snr} - ${timestamp}

+
+

snr: ${obj.snr} - ${timestamp}

`; } if (obj.type == 'newchat') { var new_message = ` -
-

new chat openend - ${timestamp}

+
+

new chat openend - ${timestamp}

`; } @@ -584,7 +607,9 @@ update_chat = function(obj) { if (obj.type == 'received') { var new_message = ` -
+
+ +
${fileheader} @@ -597,6 +622,13 @@ update_chat = function(obj) {

+
+ + + + ${controlarea_receive} + +
`; } @@ -607,29 +639,38 @@ update_chat = function(obj) { console.log('msg-' + obj._id + '-status') var new_message = ` -
+ +
+ + ${controlarea_transmit} + +
+ -
+
${fileheader}
-

${message_html}

+

${message_html}

${timestamp} - - ${obj.bytesperminute} Bytes/min + ${get_icon_for_state(obj.status)} - +

-
${obj.percent} %
+
${obj.percent} % - ${obj.bytesperminute} Bpm
+ +
+ `; } // CHECK CHECK CHECK --> This could be done better @@ -640,6 +681,8 @@ update_chat = function(obj) { console.log(element.scrollHeight) + + } else if (document.getElementById('msg-' + obj._id)) { console.log("element already exists......") console.log(obj) @@ -650,7 +693,8 @@ update_chat = function(obj) { document.getElementById('msg-' + obj._id + '-progress').setAttribute("aria-valuenow", obj.percent); document.getElementById('msg-' + obj._id + '-progress').setAttribute("style", "width:" + obj.percent + "%;"); - document.getElementById('msg-' + obj._id + '-progress').innerHTML = obj.percent + "%"; + document.getElementById('msg-' + obj._id + '-progress').innerHTML = obj.percent + "% - " + obj.bytesperminute + " Bpm"; + if (obj.percent >= 100){ @@ -671,6 +715,10 @@ update_chat = function(obj) { //document.getElementById(id).className = message_class; } + + + + // CREATE SAVE TO FOLDER EVENT LISTENER if (document.getElementById('save-file-msg-' + obj._id) && !document.getElementById('save-file-msg-' + obj._id).hasAttribute('listenerOnClick')) { @@ -680,12 +728,8 @@ update_chat = function(obj) { document.getElementById('save-file-msg-' + obj._id).addEventListener("click", () => { saveFileToFolder(obj._id) }); - document.getElementById('save-file-msg-' + obj._id).addEventListener("mouseover", () => { - document.getElementById('save-file-msg-' + obj._id).style.backgroundColor = "rgba(0,0,0,.1)"; - }); - document.getElementById('save-file-msg-' + obj._id).addEventListener("mouseleave", () => { - document.getElementById('save-file-msg-' + obj._id).style.backgroundColor = "rgba(0,0,0,.03)"; - }); + + } // CREATE RESEND MSG EVENT LISTENER diff --git a/gui/src/chat-module.html b/gui/src/chat-module.html index a0221322..48680cd3 100644 --- a/gui/src/chat-module.html +++ b/gui/src/chat-module.html @@ -28,7 +28,7 @@
-
+
@@ -41,7 +41,7 @@
-
+
diff --git a/gui/src/index.html b/gui/src/index.html index ca57f359..6dc1f331 100644 --- a/gui/src/index.html +++ b/gui/src/index.html @@ -773,7 +773,7 @@
- +
diff --git a/tnc/audio.py b/tnc/audio.py index c16c0bf2..380f3c81 100644 --- a/tnc/audio.py +++ b/tnc/audio.py @@ -3,8 +3,9 @@ import json import sys import multiprocessing import sounddevice as sd +import atexit - +atexit.register(sd._terminate) def get_audio_devices(): diff --git a/tnc/daemon.py b/tnc/daemon.py index 66dc8cb0..f51a22d3 100755 --- a/tnc/daemon.py +++ b/tnc/daemon.py @@ -216,8 +216,9 @@ class DAEMON(): options.append('--tuning_range_fmax') options.append(data[20]) - if data[21] == 'True': - options.append('--fsk') + # overriding FSK mode + #if data[21] == 'True': + # options.append('--fsk') options.append('--tx-audio-level') options.append(data[22]) diff --git a/tnc/helpers.py b/tnc/helpers.py index 04651f07..15f20ed1 100644 --- a/tnc/helpers.py +++ b/tnc/helpers.py @@ -227,7 +227,7 @@ def check_callsign(callsign:bytes, crc_to_check:bytes): [True, Callsign + SSID] False """ - + crc_algorithm = crcengine.new('crc16-ccitt-false') # load crc16 library try: @@ -236,8 +236,12 @@ def check_callsign(callsign:bytes, crc_to_check:bytes): except: callsign = callsign - + + print(static.SSID_LIST) for ssid in static.SSID_LIST: + print(ssid) + for ssid in static.SSID_LIST: + #for ssid in range(0,254): call_with_ssid = bytearray(callsign) call_with_ssid.extend('-'.encode('utf-8')) call_with_ssid.extend(str(ssid).encode('utf-8')) diff --git a/tnc/main.py b/tnc/main.py index c6acf545..2d153029 100755 --- a/tnc/main.py +++ b/tnc/main.py @@ -50,7 +50,7 @@ if __name__ == '__main__': # --------------------------------------------GET PARAMETER INPUTS PARSER = argparse.ArgumentParser(description='FreeDATA TNC') PARSER.add_argument('--mycall', dest="mycall", default="AA0AA", help="My callsign", type=str) - PARSER.add_argument('--ssid', dest="ssid_list", nargs='*', default=[0,5], help="SSID list we are responding to", type=str) + PARSER.add_argument('--ssid', dest="ssid_list", nargs='*', default=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], help="SSID list we are responding to", type=str) PARSER.add_argument('--mygrid', dest="mygrid", default="JN12AA", help="My gridsquare", type=str) PARSER.add_argument('--rx', dest="audio_input_device", default=0, help="listening sound card", type=int) PARSER.add_argument('--tx', dest="audio_output_device", default=0, help="transmitting sound card", type=int)