diff --git a/gui/daemon.js b/gui/daemon.js index 23d04534..77c2cec4 100644 --- a/gui/daemon.js +++ b/gui/daemon.js @@ -227,7 +227,8 @@ exports.startTNC = function ( auto_tune, tx_delay, tci_ip, - tci_port + tci_port, + enable_mesh ) { var json_command = JSON.stringify({ type: "set", @@ -264,6 +265,7 @@ exports.startTNC = function ( tx_delay: tx_delay, tci_ip: tci_ip, tci_port: tci_port, + enable_mesh: enable_mesh }, ], }); diff --git a/gui/freedata.js b/gui/freedata.js index 6b02a8d2..51b67459 100644 --- a/gui/freedata.js +++ b/gui/freedata.js @@ -35,3 +35,8 @@ exports.atob_FD = function (data) { exports.atob = function (data) { 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; +}; diff --git a/gui/main.js b/gui/main.js index cb647953..d998aacc 100644 --- a/gui/main.js +++ b/gui/main.js @@ -128,7 +128,7 @@ for (key in parsedConfig) { } } sysInfo.info("------------------------------------------ "); - +config.enable_mesh_features = FD.enable_mesh(); /* var chatDB = path.join(configFolder, 'chatDB.json') // create chat database file if not exists diff --git a/gui/preload-chat.js b/gui/preload-chat.js index f437f5cd..2939f0af 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -15,6 +15,7 @@ var appDataFolder = var configFolder = path.join(appDataFolder, "FreeDATA"); var configPath = path.join(configFolder, "config.json"); var config = require(configPath); +config.enable_mesh_features = FD.enable_mesh(); // set date format const dateFormat = new Intl.DateTimeFormat(navigator.language, { timeStyle: "long", diff --git a/gui/preload-main.js b/gui/preload-main.js index bf94e2fd..b0231032 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -28,6 +28,7 @@ var appDataFolder = var configFolder = path.join(appDataFolder, "FreeDATA"); var configPath = path.join(configFolder, "config.json"); var config = require(configPath); +config.enable_mesh_features = FD.enable_mesh(); const contrib = [ "DK5SM", "DL4IAZ", @@ -1429,7 +1430,10 @@ window.addEventListener("DOMContentLoaded", () => { var stop_bits = document.getElementById("hamlib_stop_bits").value; var handshake = document.getElementById("hamlib_handshake").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) { var enable_scatter = "True"; } else { @@ -1593,7 +1597,8 @@ window.addEventListener("DOMContentLoaded", () => { auto_tune, tx_delay, tci_ip, - tci_port + tci_port, + enable_mesh ); }); @@ -1761,10 +1766,6 @@ window.addEventListener("DOMContentLoaded", () => { 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) { document.getElementById("liMeshTable").style.visibility = "hidden"; document.getElementById("liMeshTable").style.display = "none"; diff --git a/gui/src/mesh-module.html b/gui/src/mesh-module.html index ffea72d9..bf7acbe5 100644 --- a/gui/src/mesh-module.html +++ b/gui/src/mesh-module.html @@ -26,7 +26,7 @@ class="btn-check" id="enable_mesh" autocomplete="off" - + checked="true" />