[CodeFactor] Apply fixes to commit 783c47f

This commit is contained in:
codefactor-io 2023-10-22 13:24:34 +00:00
parent 783c47f9ef
commit fee05653c1
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
14 changed files with 9 additions and 34 deletions

View file

@ -1,7 +1,4 @@
<script setup lang="ts">
import chat_navbar from "./chat_navbar.vue";
import chat_conversations from "./chat_conversations.vue";
import chat_messages from "./chat_messages.vue";

View file

@ -1,10 +1,8 @@
<script setup lang="ts">
import { setActivePinia } from "pinia";
import pinia from "../store/index";
setActivePinia(pinia);
import { useChatStore } from "../store/chatStore.js";
const chat = useChatStore(pinia);
@ -13,7 +11,6 @@ import {
resetIsNewMessage,
} from "../js/chatHandler";
function chatSelected(callsign) {
chat.selectedCallsign = callsign.toUpperCase();

View file

@ -1,11 +1,8 @@
<script setup lang="ts">
import { setActivePinia } from "pinia";
import pinia from "../store/index";
setActivePinia(pinia);
import { useChatStore } from "../store/chatStore.js";
const chat = useChatStore(pinia);

View file

@ -101,7 +101,6 @@ try {
chat.beaconDataArray = Object.values(chat.sorted_beacon_list["DJ2LS-0"].snr);
} catch (e) {
console.log(e);
}
const beaconHistogramData = computed(() => ({

View file

@ -1,5 +1,4 @@
<script setup lang="ts">
import { setActivePinia } from "pinia";
import pinia from "../store/index";
setActivePinia(pinia);

View file

@ -1,5 +1,4 @@
<script setup lang="ts">
import { setActivePinia } from "pinia";
import pinia from "../store/index";
setActivePinia(pinia);

View file

@ -1,8 +1,6 @@
<script setup lang="ts">
// @ts-nocheck
const {
distance,
} = require("qth-locator");
const { distance } = require("qth-locator");
import { saveSettingsToFile } from "../js/settingsHandler";

View file

@ -1,10 +1,8 @@
<script setup lang="ts">
import { setActivePinia } from "pinia";
import pinia from "../store/index";
setActivePinia(pinia);
import { useStateStore } from "../store/stateStore.js";
const state = useStateStore(pinia);

View file

@ -23,7 +23,7 @@ import {
Legend,
} from "chart.js";
import { Line, Scatter } from "vue-chartjs";
import { computed } from "vue";
import { computed } from "vue";
function selectStatsControl(obj) {
switch (obj.delegateTarget.id) {

View file

@ -29,7 +29,6 @@ function deleteChat() {
deleteChatByCallsign(chat.selectedCallsign);
}
import {
Chart as ChartJS,
CategoryScale,

View file

@ -46,12 +46,11 @@ daemon.on("error", function (err) {
console.log("daemon connection error");
console.log("Make sure the daemon is started.");
console.log('Run "python daemon.py" in the modem directory.');
console.log(err)
console.log(err);
daemonShowConnectStateError = 0;
}
setTimeout(connectDAEMON, 500);
daemon.destroy();
});
/*
@ -67,10 +66,9 @@ client.on('close', function(data) {
daemon.on("end", function (data) {
console.log("daemon connection ended");
console.log(data)
console.log(data);
daemon.destroy();
setTimeout(connectDAEMON, 500);
});
//exports.writeDaemonCommand = function(command){
@ -90,7 +88,6 @@ function writeDaemonCommand(command) {
if (daemon.readyState == "opening") {
//uiMain.setDAEMONconnection('opening')
}
}
// "https://stackoverflow.com/questions/9070700/nodejs-net-createserver-large-amount-of-data-coming-in"
@ -149,7 +146,7 @@ daemon.on("data", function (socketdata) {
}
if (data["command"] == "test_hamlib") {
//
//
}
}
@ -158,7 +155,6 @@ daemon.on("data", function (socketdata) {
}
});
// START Modem
// ` `== multi line string
export function startModem() {
@ -283,4 +279,4 @@ export function startRigctld() {
export function stopRigctld() {
let command = '{"type" : "set", "command": "stop_rigctld"}';
writeDaemonCommand(command);
}
}

View file

@ -1,4 +1,3 @@
/**
* Binary to ASCII replacement
* @param {string} data in normal/usual utf-8 format

View file

@ -1,4 +1,3 @@
import path from "node:path";
import fs from "fs";

View file

@ -28,7 +28,6 @@ var socketchunk = ""; // Current message, per connection.
//const split_char = "\0;\1;";
const split_char = "0;1;";
// global to keep track of Modem connection error emissions
var modemShowConnectStateError = 1;
@ -62,7 +61,7 @@ client.on("connect", function () {
client.on("error", function (err) {
if (modemShowConnectStateError == 1) {
console.log("Modem connection error");
console.log(err)
console.log(err);
modemShowConnectStateError = 0;
}
setTimeout(connectModem, 500);
@ -85,7 +84,7 @@ client.on('close', function(data) {
client.on("end", function (data) {
console.log("Modem connection ended");
console.log(data)
console.log(data);
stateStore.busy_state = "-";
stateStore.arq_state = "-";
stateStore.frequency = "-";
@ -492,7 +491,6 @@ client.on("data", function (socketdata) {
}
});
// Send Ping
//exports.sendPing = function (dxcallsign) {
export function sendPing(dxcallsign) {
@ -831,7 +829,7 @@ function prepareStatsDataForStore(data) {
// dummy data
//state.arq_speed_list = [{"snr":0.0,"bpm":104,"timestamp":1696189769},{"snr":0.0,"bpm":80,"timestamp":1696189778},{"snr":0.0,"bpm":70,"timestamp":1696189783},{"snr":0.0,"bpm":58,"timestamp":1696189792},{"snr":0.0,"bpm":52,"timestamp":1696189797},{"snr":"NaN","bpm":42,"timestamp":1696189811},{"snr":0.0,"bpm":22,"timestamp":1696189875},{"snr":0.0,"bpm":21,"timestamp":1696189881},{"snr":0.0,"bpm":17,"timestamp":1696189913},{"snr":0.0,"bpm":15,"timestamp":1696189932},{"snr":0.0,"bpm":15,"timestamp":1696189937},{"snr":0.0,"bpm":14,"timestamp":1696189946},{"snr":-6.1,"bpm":14,"timestamp":1696189954},{"snr":-6.1,"bpm":14,"timestamp":1696189955},{"snr":-5.5,"bpm":28,"timestamp":1696189963},{"snr":-5.5,"bpm":27,"timestamp":1696189963}]
var speed_listSize = 0;
var speed_listSize = 0;
if (typeof data == "undefined") {
speed_listSize = 0;
} else {