From adf800b8229fe61b3550f16a5249813bd3a59b2e Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Sat, 28 May 2022 14:08:33 +0200 Subject: [PATCH] changed bandwith typo --> this could break some things.. --- gui/daemon.js | 4 ++-- gui/main.js | 2 +- gui/preload-main.js | 20 ++++++++++---------- gui/sock.js | 6 +++--- gui/src/index.html | 2 +- tnc/daemon.py | 2 +- tnc/data_handler.py | 30 +++++++++++++++--------------- tnc/main.py | 4 ++-- tnc/modem.py | 4 ++-- tnc/rig.py | 2 +- tnc/rigctl.py | 6 +++--- tnc/rigctld.py | 6 +++--- tnc/rigdummy.py | 2 +- tnc/sock.py | 6 +++--- tnc/static.py | 4 ++-- 15 files changed, 50 insertions(+), 50 deletions(-) diff --git a/gui/daemon.js b/gui/daemon.js index 1e334c23..c22ec79c 100644 --- a/gui/daemon.js +++ b/gui/daemon.js @@ -217,7 +217,7 @@ exports.getDaemonState = function() { // START TNC // ` `== multi line string -exports.startTNC = function(mycall, mygrid, rx_audio, tx_audio, radiocontrol, devicename, deviceport, pttprotocol, pttport, serialspeed, data_bits, stop_bits, handshake, rigctld_ip, rigctld_port, enable_fft, enable_scatter, low_bandwith_mode, tuning_range_fmin, tuning_range_fmax, enable_fsk, tx_audio_level, respond_to_cq) { +exports.startTNC = function(mycall, mygrid, rx_audio, tx_audio, radiocontrol, devicename, deviceport, pttprotocol, pttport, serialspeed, data_bits, stop_bits, handshake, rigctld_ip, rigctld_port, enable_fft, enable_scatter, low_bandwidth_mode, tuning_range_fmin, tuning_range_fmax, enable_fsk, tx_audio_level, respond_to_cq) { var json_command = JSON.stringify({ type: 'set', command: 'start_tnc', @@ -240,7 +240,7 @@ exports.startTNC = function(mycall, mygrid, rx_audio, tx_audio, radiocontrol, de enable_scatter: enable_scatter, enable_fft: enable_fft, enable_fsk: enable_fsk, - low_bandwith_mode : low_bandwith_mode, + low_bandwidth_mode : low_bandwidth_mode, tuning_range_fmin : tuning_range_fmin, tuning_range_fmax : tuning_range_fmax, tx_audio_level : tx_audio_level, diff --git a/gui/main.js b/gui/main.js index 7c63954e..504beec7 100644 --- a/gui/main.js +++ b/gui/main.js @@ -68,7 +68,7 @@ const configDefaultSettings = '{\ "enable_scatter" : "False",\ "enable_fft" : "False",\ "enable_fsk" : "False",\ - "low_bandwith_mode" : "False",\ + "low_bandwidth_mode" : "False",\ "theme" : "default",\ "screen_height" : 430,\ "screen_width" : 1050,\ diff --git a/gui/preload-main.js b/gui/preload-main.js index 8f65b84b..cbd134cb 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -112,7 +112,7 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () document.getElementById("scatterSwitch").value = config.enable_scatter; document.getElementById("fftSwitch").value = config.enable_fft; - //document.getElementById("500HzModeSwitch").value = config.low_bandwith_mode; + //document.getElementById("500HzModeSwitch").value = config.low_bandwidth_mode; //document.getElementById("fskModeSwitch").value = config.enable_fsk; //document.getElementById("respondCQSwitch").value = config.respond_to_cq; @@ -132,7 +132,7 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () document.getElementById("fftSwitch").checked = false; } - if(config.low_bandwith_mode == 'True'){ + if(config.low_bandwidth_mode == 'True'){ document.getElementById("500HzModeSwitch").checked = true; } else { document.getElementById("500HzModeSwitch").checked = false; @@ -522,9 +522,9 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () // enable 500z Switch clicked document.getElementById("500HzModeSwitch").addEventListener("click", () => { if(document.getElementById("500HzModeSwitch").checked == true){ - config.low_bandwith_mode = "True"; + config.low_bandwidth_mode = "True"; } else { - config.low_bandwith_mode = "False"; + config.low_bandwidth_mode = "False"; } fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); }); @@ -650,9 +650,9 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () } if (document.getElementById("500HzModeSwitch").checked == true){ - var low_bandwith_mode = "True"; + var low_bandwidth_mode = "True"; } else { - var low_bandwith_mode = "False"; + var low_bandwidth_mode = "False"; } if (document.getElementById("fskModeSwitch").checked == true){ @@ -732,7 +732,7 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () config.enable_scatter = enable_scatter; config.enable_fft = enable_fft; config.enable_fsk = enable_fsk; - config.low_bandwith_mode = low_bandwith_mode; + config.low_bandwidth_mode = low_bandwidth_mode; config.tx_audio_level = tx_audio_level; config.respond_to_cq = respond_to_cq; @@ -753,7 +753,7 @@ document.getElementById('openReceivedFilesFolder').addEventListener('click', () */ - daemon.startTNC(callsign_ssid, mygrid, rx_audio, tx_audio, radiocontrol, deviceid, deviceport, pttprotocol, pttport, serialspeed, data_bits, stop_bits, handshake, rigctld_ip, rigctld_port, enable_fft, enable_scatter, low_bandwith_mode, tuning_range_fmin, tuning_range_fmax, enable_fsk, tx_audio_level, respond_to_cq); + daemon.startTNC(callsign_ssid, mygrid, rx_audio, tx_audio, radiocontrol, deviceid, deviceport, pttprotocol, pttport, serialspeed, data_bits, stop_bits, handshake, rigctld_ip, rigctld_port, enable_fft, enable_scatter, low_bandwidth_mode, tuning_range_fmin, tuning_range_fmax, enable_fsk, tx_audio_level, respond_to_cq); }) @@ -1152,8 +1152,8 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => { // SET MODE document.getElementById("mode").innerHTML = arg.mode; - // SET BANDWITH - document.getElementById("bandwith").innerHTML = arg.bandwith; + // SET bandwidth + document.getElementById("bandwidth").innerHTML = arg.bandwidth; // SET BYTES PER MINUTE if (typeof(arg.arq_bytes_per_minute) == 'undefined') { diff --git a/gui/sock.js b/gui/sock.js index 96205302..2e449c81 100644 --- a/gui/sock.js +++ b/gui/sock.js @@ -55,7 +55,7 @@ client.on('connect', function(data) { //channel_state: "-", frequency: "-", mode: "-", - bandwith: "-", + bandwidth: "-", rms_level: 0 }; ipcRenderer.send('request-update-tnc-state', Data); @@ -84,7 +84,7 @@ client.on('error', function(data) { //channel_state: "-", frequency: "-", mode: "-", - bandwith: "-", + bandwidth: "-", rms_level: 0 }; @@ -199,7 +199,7 @@ client.on('data', function(socketdata) { frequency: data['frequency'], speed_level: data['speed_level'], mode: data['mode'], - bandwith: data['bandwith'], + bandwidth: data['bandwidth'], rms_level: data['audio_rms'], fft: data['fft'], channel_busy: data['channel_busy'], diff --git a/gui/src/index.html b/gui/src/index.html index 38be56ef..a4d9830b 100644 --- a/gui/src/index.html +++ b/gui/src/index.html @@ -1054,7 +1054,7 @@
--- --- - --- + ---
diff --git a/tnc/daemon.py b/tnc/daemon.py index 63551b81..7636f81e 100755 --- a/tnc/daemon.py +++ b/tnc/daemon.py @@ -131,7 +131,7 @@ class DAEMON: # data[15] rigctld_port # data[16] send_scatter # data[17] send_fft - # data[18] low_bandwith_mode + # data[18] low_bandwidth_mode # data[19] tuning_range_fmin # data[20] tuning_range_fmax # data[21] enable FSK diff --git a/tnc/data_handler.py b/tnc/data_handler.py index d4e37bea..95abbb3c 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -67,7 +67,7 @@ class DATA: self.rx_n_max_retries_per_burst = 50 self.n_retries_per_burst = 0 - self.received_low_bandwith_mode = False # indicator if we recevied a low bandwith mode channel opener + self.received_LOW_BANDWIDTH_MODE = False # indicator if we recevied a low bandwidth mode channel opener self.data_channel_max_retries = 5 self.datachannel_timeout = False @@ -79,7 +79,7 @@ class DATA: self.time_list_high_bw = [3, 7, 8, 30] # list for time to wait for corresponding mode in seconds # mode list for selecting between low bandwidth ( 500Hz ) and normal modes with higher bandwidth - if static.LOW_BANDWITH_MODE: + if static.LOW_BANDWIDTH_MODE: self.mode_list = self.mode_list_low_bw # mode list of available modes, each mode will be used 2times per speed level self.time_list = self.time_list_low_bw # list for time to wait for corresponding mode in seconds @@ -1238,7 +1238,7 @@ class DATA: self.is_IRS = False self.data_channel_last_received = int(time.time()) - if static.LOW_BANDWITH_MODE and mode == 255: + if static.LOW_BANDWIDTH_MODE and mode == 255: frametype = bytes([227]) self.log.debug("[TNC] Requesting low bandwidth mode") @@ -1319,13 +1319,13 @@ class DATA: n_frames_per_burst = int.from_bytes(bytes(data_in[13:14]), "big") frametype = int.from_bytes(bytes(data_in[:1]), "big") - # check if we received low bandwith mode + # check if we received low bandwidth mode if frametype == 225: - self.received_low_bandwith_mode = False + self.received_LOW_BANDWIDTH_MODE = False self.mode_list = self.mode_list_high_bw self.time_list = self.time_list_high_bw else: - self.received_low_bandwith_mode = True + self.received_LOW_BANDWIDTH_MODE = True self.mode_list = self.mode_list_low_bw self.time_list = self.time_list_low_bw self.speed_level = len(self.mode_list) - 1 @@ -1350,7 +1350,7 @@ class DATA: self.log.info( "[TNC] ARQ | DATA | RX | [" + str(mycallsign, "utf-8") + "]>> <<[" + str(static.DXCALLSIGN, "utf-8") + "]", - bandwith="wide") + bandwidth="wide") static.ARQ_STATE = True static.TNC_STATE = "BUSY" @@ -1358,8 +1358,8 @@ class DATA: self.reset_statistics() self.data_channel_last_received = int(time.time()) - # check if we are in low bandwith mode - if static.LOW_BANDWITH_MODE or self.received_low_bandwith_mode: + # check if we are in low bandwidth mode + if static.LOW_BANDWIDTH_MODE or self.received_LOW_BANDWIDTH_MODE: frametype = bytes([228]) self.log.debug("[TNC] Responding with low bandwidth mode") else: @@ -1377,7 +1377,7 @@ class DATA: self.log.info( "[TNC] ARQ | DATA | RX | [" + str(mycallsign, "utf-8") + "]>>|<<[" + str(static.DXCALLSIGN, "utf-8") + "]", - bandwith="wide", snr=static.SNR) + bandwidth="wide", snr=static.SNR) # set start of transmission for our statistics self.rx_start_of_transmission = time.time() @@ -1400,13 +1400,13 @@ class DATA: frametype = int.from_bytes(bytes(data_in[:1]), "big") if frametype == 228: - self.received_low_bandwith_mode = True + self.received_LOW_BANDWIDTH_MODE = True self.mode_list = self.mode_list_low_bw self.time_list = self.time_list_low_bw self.speed_level = len(self.mode_list) - 1 self.log.debug("[TNC] low bandwidth mode", modes=self.mode_list) else: - self.received_low_bandwith_mode = False + self.received_LOW_BANDWIDTH_MODE = False self.mode_list = self.mode_list_high_bw self.time_list = self.time_list_high_bw self.speed_level = len(self.mode_list) - 1 @@ -1848,8 +1848,8 @@ class DATA: self.speed_level = len(self.mode_list) - 1 static.ARQ_SPEED_LEVEL = self.speed_level - # low bandwith mode indicator - self.received_low_bandwith_mode = False + # low bandwidth mode indicator + self.received_LOW_BANDWIDTH_MODE = False # reset retry counter for rx channel / burst self.n_retries_per_burst = 0 @@ -1999,7 +1999,7 @@ class DATA: def heartbeat(self): """ - heartbeat thread which auto resumes the heartbeat signal within a arq session + heartbeat thread which auto resumes the heartbeat signal within an arq session """ while True: time.sleep(0.01) diff --git a/tnc/main.py b/tnc/main.py index a3acb0d1..dabeecde 100755 --- a/tnc/main.py +++ b/tnc/main.py @@ -65,7 +65,7 @@ if __name__ == "__main__": PARSER.add_argument("--rigctld_ip", dest="rigctld_ip", default="localhost", help="Set rigctld ip") PARSER.add_argument("--scatter", dest="send_scatter", action="store_true", help="Send scatter information via network") PARSER.add_argument("--fft", dest="send_fft", action="store_true", help="Send fft information via network") - PARSER.add_argument("--500hz", dest="low_bandwith_mode", action="store_true", help="Enable low bandwith mode ( 500 Hz only )") + PARSER.add_argument("--500hz", dest="low_bandwidth_mode", action="store_true", help="Enable low bandwidth mode ( 500 Hz only )") PARSER.add_argument("--fsk", dest="enable_fsk", action="store_true", help="Enable FSK mode for ping, beacon and CQ") PARSER.add_argument("--qrv", dest="enable_respond_to_cq", action="store_true", help="Enable sending a QRV frame if CQ received") PARSER.add_argument("--tuning_range_fmin", dest="tuning_range_fmin", choices=[-50.0, -100.0, -150.0, -200.0, -250.0], default=-50.0, help="Tuning range fmin", type=float) @@ -102,7 +102,7 @@ if __name__ == "__main__": static.ENABLE_SCATTER = ARGS.send_scatter static.ENABLE_FFT = ARGS.send_fft static.ENABLE_FSK = ARGS.enable_fsk - static.LOW_BANDWITH_MODE = ARGS.low_bandwith_mode + static.LOW_BANDWIDTH_MODE = ARGS.low_bandwidth_mode static.TUNING_RANGE_FMIN = ARGS.tuning_range_fmin static.TUNING_RANGE_FMAX = ARGS.tuning_range_fmax static.TX_AUDIO_LEVEL = ARGS.tx_audio_level diff --git a/tnc/modem.py b/tnc/modem.py index 52aad102..50b1b3f1 100644 --- a/tnc/modem.py +++ b/tnc/modem.py @@ -646,10 +646,10 @@ class RF: while True: # time.sleep(1.5) threading.Event().wait(0.5) - # (static.HAMLIB_FREQUENCY, static.HAMLIB_MODE, static.HAMLIB_BANDWITH, static.PTT_STATE) = self.hamlib.get_rig_data() + # (static.HAMLIB_FREQUENCY, static.HAMLIB_MODE, static.HAMLIB_BANDWIDTH, static.PTT_STATE) = self.hamlib.get_rig_data() static.HAMLIB_FREQUENCY = self.hamlib.get_frequency() static.HAMLIB_MODE = self.hamlib.get_mode() - static.HAMLIB_BANDWITH = self.hamlib.get_bandwith() + static.HAMLIB_BANDWIDTH = self.hamlib.get_bandwidth() def calculate_fft(self): """ """ diff --git a/tnc/rig.py b/tnc/rig.py index 23e24701..fdf31513 100644 --- a/tnc/rig.py +++ b/tnc/rig.py @@ -212,7 +212,7 @@ class radio: (hamlib_mode, bandwidth) = self.my_rig.get_mode() return Hamlib.rig_strrmode(hamlib_mode) - def get_bandwith(self): + def get_bandwidth(self): """ """ (hamlib_mode, bandwidth) = self.my_rig.get_mode() return bandwidth diff --git a/tnc/rigctl.py b/tnc/rigctl.py index 13efef56..802aa07d 100644 --- a/tnc/rigctl.py +++ b/tnc/rigctl.py @@ -114,16 +114,16 @@ class radio: def get_mode(self): """ """ - # (hamlib_mode, bandwith) = self.my_rig.get_mode() + # (hamlib_mode, bandwidth) = self.my_rig.get_mode() # return Hamlib.rig_strrmode(hamlib_mode) try: return "PKTUSB" except Exception: return False - def get_bandwith(self): + def get_bandwidth(self): """ """ - # (hamlib_mode, bandwith) = self.my_rig.get_mode() + # (hamlib_mode, bandwidth) = self.my_rig.get_mode() bandwidth = 2700 try: diff --git a/tnc/rigctld.py b/tnc/rigctld.py index 46b4c142..177b61f7 100644 --- a/tnc/rigctld.py +++ b/tnc/rigctld.py @@ -115,13 +115,13 @@ class radio(): except Exception: return 0 - def get_bandwith(self): + def get_bandwidth(self): """ """ try: data = self.send_command(b"m") data = data.split(b"\n") - bandwith = data[1] - return bandwith.decode("utf-8") + bandwidth = data[1] + return bandwidth.decode("utf-8") except Exception: return 0 diff --git a/tnc/rigdummy.py b/tnc/rigdummy.py index 35b98b3f..e3836d94 100644 --- a/tnc/rigdummy.py +++ b/tnc/rigdummy.py @@ -28,7 +28,7 @@ class radio: """ """ return None - def get_bandwith(self): + def get_bandwidth(self): """ """ return None diff --git a/tnc/sock.py b/tnc/sock.py index 94cf1c8f..d8b15e24 100644 --- a/tnc/sock.py +++ b/tnc/sock.py @@ -394,7 +394,7 @@ def send_tnc_state(): "frequency": str(static.HAMLIB_FREQUENCY), "speed_level": str(static.ARQ_SPEED_LEVEL), "mode": str(static.HAMLIB_MODE), - "bandwith": str(static.HAMLIB_BANDWITH), + "bandwidth": str(static.HAMLIB_BANDWIDTH), "fft": str(static.FFT), "channel_busy": str(static.CHANNEL_BUSY), "scatter": static.SCATTER, @@ -495,7 +495,7 @@ def process_daemon_commands(data): enable_scatter = str(received_json["parameter"][0]["enable_scatter"]) enable_fft = str(received_json["parameter"][0]["enable_fft"]) enable_fsk = str(received_json["parameter"][0]["enable_fsk"]) - low_bandwith_mode = str(received_json["parameter"][0]["low_bandwith_mode"]) + low_bandwidth_mode = str(received_json["parameter"][0]["low_bandwidth_mode"]) tuning_range_fmin = str(received_json["parameter"][0]["tuning_range_fmin"]) tuning_range_fmax = str(received_json["parameter"][0]["tuning_range_fmax"]) tx_audio_level = str(received_json["parameter"][0]["tx_audio_level"]) @@ -523,7 +523,7 @@ def process_daemon_commands(data): rigctld_port, enable_scatter, enable_fft, - low_bandwith_mode, + low_bandwidth_mode, tuning_range_fmin, tuning_range_fmax, enable_fsk, diff --git a/tnc/static.py b/tnc/static.py index 10a17a50..75edb3d9 100644 --- a/tnc/static.py +++ b/tnc/static.py @@ -29,7 +29,7 @@ DXGRID: bytes = b"" SSID_LIST: list = [] # ssid list we are responding to -LOW_BANDWITH_MODE: bool = False +LOW_BANDWIDTH_MODE: bool = False # --------------------------------- # Server Defaults @@ -58,7 +58,7 @@ HAMLIB_RIGCTLD_PORT: str = "4532" HAMLIB_FREQUENCY: int = 0 HAMLIB_MODE: str = "" -HAMLIB_BANDWITH: int = 0 +HAMLIB_BANDWIDTH: int = 0 # ------------------------- # FreeDV Defaults