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
54cf0bef3f
commit
ad11332d16
3 changed files with 69 additions and 54 deletions
|
@ -61,11 +61,7 @@ const gridWidgets = [
|
||||||
),
|
),
|
||||||
new gridWidget(s_meter, { x: 1, y: 1, w: 2, h: 4 }, "S-Meter"),
|
new gridWidget(s_meter, { x: 1, y: 1, w: 2, h: 4 }, "S-Meter"),
|
||||||
new gridWidget(dbfs_meter, { x: 1, y: 1, w: 2, h: 4 }, "Dbfs Meter"),
|
new gridWidget(dbfs_meter, { x: 1, y: 1, w: 2, h: 4 }, "Dbfs Meter"),
|
||||||
new gridWidget(
|
new gridWidget(grid_activities, { x: 1, y: 1, w: 3, h: 27 }, "Activities"),
|
||||||
grid_activities,
|
|
||||||
{ x: 1, y: 1, w: 3, h: 27 },
|
|
||||||
"Activities",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
grid = GridStack.init({
|
grid = GridStack.init({
|
||||||
|
@ -271,5 +267,5 @@ function quickfill() {
|
||||||
.grid-container {
|
.grid-container {
|
||||||
border: 1px solid blue;
|
border: 1px solid blue;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import { setActivePinia } from "pinia";
|
import { setActivePinia } from "pinia";
|
||||||
import pinia from "../store/index";
|
import pinia from "../store/index";
|
||||||
setActivePinia(pinia);
|
setActivePinia(pinia);
|
||||||
|
@ -24,16 +23,19 @@ function getDateTime(timestampRaw) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="card h-100" >
|
<div class="card h-100">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<strong>Activity</strong>
|
<strong>Activity</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body overflow-auto" style="align-items: start;">
|
<div class="card-body overflow-auto" style="align-items: start">
|
||||||
<div v-for="item in state.activities" :key="item[0]">
|
<div v-for="item in state.activities" :key="item[0]">
|
||||||
<h6 style="text-align: start;" >{{ item[1].origin }} - {{ getDateTime(item[1].timestamp) }}</h6>
|
<h6 style="text-align: start">
|
||||||
<p style="text-align: start;">{{item[1].activity_type}} - {{ item[1].direction }}</p>
|
{{ item[1].origin }} - {{ getDateTime(item[1].timestamp) }}
|
||||||
|
</h6>
|
||||||
|
<p style="text-align: start">
|
||||||
|
{{ item[1].activity_type }} - {{ item[1].direction }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -140,18 +140,27 @@ export function stateDispatcher(data) {
|
||||||
}
|
}
|
||||||
function build_HSL() {
|
function build_HSL() {
|
||||||
//Use data from activities to build HSL list
|
//Use data from activities to build HSL list
|
||||||
for (let i=0; i < stateStore.activities.length; i++) {
|
for (let i = 0; i < stateStore.activities.length; i++) {
|
||||||
if (stateStore.activities[i][1].direction != "received" || stateStore.activities[i][1].origin == undefined){
|
if (
|
||||||
|
stateStore.activities[i][1].direction != "received" ||
|
||||||
|
stateStore.activities[i][1].origin == undefined
|
||||||
|
) {
|
||||||
//Ignore stations without origin and not received type
|
//Ignore stations without origin and not received type
|
||||||
//console.warn("HSL: Ignoring " + stateStore.activities[i][0]);
|
//console.warn("HSL: Ignoring " + stateStore.activities[i][0]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let found = false;
|
let found = false;
|
||||||
for (let ii=0; ii < stateStore.heard_stations.length;ii++) {
|
for (let ii = 0; ii < stateStore.heard_stations.length; ii++) {
|
||||||
if (stateStore.heard_stations[ii].origin == stateStore.activities[i][1].origin) {
|
if (
|
||||||
|
stateStore.heard_stations[ii].origin ==
|
||||||
|
stateStore.activities[i][1].origin
|
||||||
|
) {
|
||||||
//Station already in HSL, check if newer than one in HSL
|
//Station already in HSL, check if newer than one in HSL
|
||||||
found=true;
|
found = true;
|
||||||
if (stateStore.heard_stations[ii].timestamp < stateStore.activities[i][1].timestamp) {
|
if (
|
||||||
|
stateStore.heard_stations[ii].timestamp <
|
||||||
|
stateStore.activities[i][1].timestamp
|
||||||
|
) {
|
||||||
//Update existing entry in HSL
|
//Update existing entry in HSL
|
||||||
stateStore.heard_stations[ii] = stateStore.activities[i][1];
|
stateStore.heard_stations[ii] = stateStore.activities[i][1];
|
||||||
}
|
}
|
||||||
|
@ -162,8 +171,8 @@ function build_HSL() {
|
||||||
stateStore.heard_stations.push(stateStore.activities[i][1]);
|
stateStore.heard_stations.push(stateStore.activities[i][1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stateStore.heard_stations.sort((a,b) => b.timestamp - a.timestamp); // b - a for reverse sort
|
stateStore.heard_stations.sort((a, b) => b.timestamp - a.timestamp); // b - a for reverse sort
|
||||||
}
|
}
|
||||||
|
|
||||||
export function eventDispatcher(data) {
|
export function eventDispatcher(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
@ -213,7 +222,15 @@ export function eventDispatcher(data) {
|
||||||
return;
|
return;
|
||||||
case "PING_ACK":
|
case "PING_ACK":
|
||||||
//Qrv received
|
//Qrv received
|
||||||
displayToast("success", "bi-arrow-left-right", "Received ping-ack from " + "callsignisbroken" + " | " + data["dxgrid"], 5000);
|
displayToast(
|
||||||
|
"success",
|
||||||
|
"bi-arrow-left-right",
|
||||||
|
"Received ping-ack from " +
|
||||||
|
"callsignisbroken" +
|
||||||
|
" | " +
|
||||||
|
data["dxgrid"],
|
||||||
|
5000,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue