mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
[CodeFactor] Apply fixes
This commit is contained in:
parent
6e16a1bc07
commit
ee41286ff7
3 changed files with 19 additions and 28 deletions
|
@ -179,11 +179,6 @@ export default {
|
||||||
|
|
||||||
// init waterfall
|
// init waterfall
|
||||||
localSpectrum = initWaterfall("waterfall-main");
|
localSpectrum = initWaterfall("waterfall-main");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function initWaterfall(id) {
|
||||||
|
|
||||||
export function addDataToWaterfall(data) {
|
export function addDataToWaterfall(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
spectrums.forEach(element => {
|
spectrums.forEach((element) => {
|
||||||
//console.log(element);
|
//console.log(element);
|
||||||
element.addData(data);
|
element.addData(data);
|
||||||
});
|
});
|
||||||
|
@ -32,13 +32,11 @@ export function addDataToWaterfall(data) {
|
||||||
* @param {number} index colormap index to use
|
* @param {number} index colormap index to use
|
||||||
*/
|
*/
|
||||||
export function setColormap() {
|
export function setColormap() {
|
||||||
|
|
||||||
let index = settings.local.wf_theme;
|
let index = settings.local.wf_theme;
|
||||||
if (isNaN(index)) index = 0;
|
if (isNaN(index)) index = 0;
|
||||||
console.log("Setting waterfall colormap to " + index)
|
console.log("Setting waterfall colormap to " + index);
|
||||||
spectrums.forEach(element => {
|
spectrums.forEach((element) => {
|
||||||
//console.log(element);
|
//console.log(element);
|
||||||
element.setColorMap(index);
|
element.setColorMap(index);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,7 @@ import { reactive, ref, watch } from "vue";
|
||||||
import { getConfig, setConfig } from "../js/api";
|
import { getConfig, setConfig } from "../js/api";
|
||||||
|
|
||||||
var nconf = require("nconf");
|
var nconf = require("nconf");
|
||||||
nconf.file({file: 'config/config.json'});
|
nconf.file({ file: "config/config.json" });
|
||||||
|
|
||||||
|
|
||||||
// +++
|
// +++
|
||||||
//GUI DEFAULT SETTINGS........
|
//GUI DEFAULT SETTINGS........
|
||||||
|
@ -23,10 +22,10 @@ nconf.defaults({
|
||||||
high_graphics: true,
|
high_graphics: true,
|
||||||
update_channel: "alpha",
|
update_channel: "alpha",
|
||||||
enable_sys_notification: false,
|
enable_sys_notification: false,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
nconf.required(['local:host','local:port']);
|
nconf.required(["local:host", "local:port"]);
|
||||||
|
|
||||||
export const settingsStore = reactive({
|
export const settingsStore = reactive({
|
||||||
local: {
|
local: {
|
||||||
|
@ -100,7 +99,7 @@ export const settingsStore = reactive({
|
||||||
});
|
});
|
||||||
|
|
||||||
//Save settings for GUI to config file
|
//Save settings for GUI to config file
|
||||||
settingsStore.local = nconf.get('local');
|
settingsStore.local = nconf.get("local");
|
||||||
saveSettingsToConfig();
|
saveSettingsToConfig();
|
||||||
|
|
||||||
export function onChange() {
|
export function onChange() {
|
||||||
|
@ -121,8 +120,7 @@ watch(settingsStore.local, (oldValue, newValue) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function saveSettingsToConfig() {
|
function saveSettingsToConfig() {
|
||||||
nconf.set('local',settingsStore.local);
|
nconf.set("local", settingsStore.local);
|
||||||
nconf.save();
|
nconf.save();
|
||||||
console.log("Settings saved!");
|
console.log("Settings saved!");
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue