mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
changed bandwith typo --> this could break some things..
This commit is contained in:
parent
2fa9aead44
commit
adf800b822
|
@ -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,
|
||||
|
|
|
@ -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,\
|
||||
|
|
|
@ -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') {
|
||||
|
|
|
@ -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'],
|
||||
|
|
|
@ -1054,7 +1054,7 @@
|
|||
<div class="input-group input-group-sm">
|
||||
<!--<span class="input-group-text" id="basic-addon1"><strong>Freq</strong></span>--> <span class="input-group-text" id="frequency">---</span>
|
||||
<!--<span class="input-group-text" id="basic-addon1"><strong>Mode</strong></span>--> <span class="input-group-text" id="mode">---</span>
|
||||
<!--<span class="input-group-text" id="basic-addon1"><strong>BW</strong></span>--> <span class="input-group-text" id="bandwith">---</span>
|
||||
<!--<span class="input-group-text" id="basic-addon1"><strong>BW</strong></span>--> <span class="input-group-text" id="bandwidth">---</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid p-0" style="width:12rem">
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
""" """
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class radio:
|
|||
""" """
|
||||
return None
|
||||
|
||||
def get_bandwith(self):
|
||||
def get_bandwidth(self):
|
||||
""" """
|
||||
return None
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue