Redid mesh enablement and add support for passing --mesh to tnc

This commit is contained in:
Mashintime 2023-07-03 00:31:48 -04:00
parent 139ea334fc
commit ebee998e25
6 changed files with 18 additions and 9 deletions

View file

@ -227,7 +227,8 @@ exports.startTNC = function (
auto_tune, auto_tune,
tx_delay, tx_delay,
tci_ip, tci_ip,
tci_port tci_port,
enable_mesh
) { ) {
var json_command = JSON.stringify({ var json_command = JSON.stringify({
type: "set", type: "set",
@ -264,6 +265,7 @@ exports.startTNC = function (
tx_delay: tx_delay, tx_delay: tx_delay,
tci_ip: tci_ip, tci_ip: tci_ip,
tci_port: tci_port, tci_port: tci_port,
enable_mesh: enable_mesh
}, },
], ],
}); });

View file

@ -35,3 +35,8 @@ exports.atob_FD = function (data) {
exports.atob = function (data) { exports.atob = function (data) {
return window.btoa(Buffer.from(data, "base64").toString("utf8")); return window.btoa(Buffer.from(data, "base64").toString("utf8"));
}; };
//**Global mesh setting, to enable mesh return true, otherwise false. Set to false for release builds */
exports.enable_mesh = function () {
return true;
//return false;
};

View file

@ -128,7 +128,7 @@ for (key in parsedConfig) {
} }
} }
sysInfo.info("------------------------------------------ "); sysInfo.info("------------------------------------------ ");
config.enable_mesh_features = FD.enable_mesh();
/* /*
var chatDB = path.join(configFolder, 'chatDB.json') var chatDB = path.join(configFolder, 'chatDB.json')
// create chat database file if not exists // create chat database file if not exists

View file

@ -15,6 +15,7 @@ var appDataFolder =
var configFolder = path.join(appDataFolder, "FreeDATA"); var configFolder = path.join(appDataFolder, "FreeDATA");
var configPath = path.join(configFolder, "config.json"); var configPath = path.join(configFolder, "config.json");
var config = require(configPath); var config = require(configPath);
config.enable_mesh_features = FD.enable_mesh();
// set date format // set date format
const dateFormat = new Intl.DateTimeFormat(navigator.language, { const dateFormat = new Intl.DateTimeFormat(navigator.language, {
timeStyle: "long", timeStyle: "long",

View file

@ -28,6 +28,7 @@ var appDataFolder =
var configFolder = path.join(appDataFolder, "FreeDATA"); var configFolder = path.join(appDataFolder, "FreeDATA");
var configPath = path.join(configFolder, "config.json"); var configPath = path.join(configFolder, "config.json");
var config = require(configPath); var config = require(configPath);
config.enable_mesh_features = FD.enable_mesh();
const contrib = [ const contrib = [
"DK5SM", "DK5SM",
"DL4IAZ", "DL4IAZ",
@ -1429,7 +1430,10 @@ window.addEventListener("DOMContentLoaded", () => {
var stop_bits = document.getElementById("hamlib_stop_bits").value; var stop_bits = document.getElementById("hamlib_stop_bits").value;
var handshake = document.getElementById("hamlib_handshake").value; var handshake = document.getElementById("hamlib_handshake").value;
var tx_delay = document.getElementById("tx_delay").value; var tx_delay = document.getElementById("tx_delay").value;
var enable_mesh = "False"
if (config.enable_mesh_features == true) {
enable_mesh = "True";
}
if (document.getElementById("scatterSwitch").checked == true) { if (document.getElementById("scatterSwitch").checked == true) {
var enable_scatter = "True"; var enable_scatter = "True";
} else { } else {
@ -1593,7 +1597,8 @@ window.addEventListener("DOMContentLoaded", () => {
auto_tune, auto_tune,
tx_delay, tx_delay,
tci_ip, tci_ip,
tci_port tci_port,
enable_mesh
); );
}); });
@ -1761,10 +1766,6 @@ window.addEventListener("DOMContentLoaded", () => {
autostart_rigctld(); autostart_rigctld();
//Enable mesh features by setting to 1, should be changed for releases
config.enable_mesh_features =1;
//config.enable_mesh_features =0;
if (! config.enable_mesh_features == 1) { if (! config.enable_mesh_features == 1) {
document.getElementById("liMeshTable").style.visibility = "hidden"; document.getElementById("liMeshTable").style.visibility = "hidden";
document.getElementById("liMeshTable").style.display = "none"; document.getElementById("liMeshTable").style.display = "none";

View file

@ -26,7 +26,7 @@
class="btn-check" class="btn-check"
id="enable_mesh" id="enable_mesh"
autocomplete="off" autocomplete="off"
checked="true"
/> />
<label class="btn btn-outline-info" for="enable_mesh" <label class="btn btn-outline-info" for="enable_mesh"
>Enable / Disable Mesh</label >Enable / Disable Mesh</label