Attempt at stats fix

This commit is contained in:
Mashintime 2024-04-11 20:29:01 -04:00
parent 93a9cba781
commit 2ed9b4bc1e
2 changed files with 27 additions and 16 deletions

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
// @ts-nocheck
// reason for no check is, that we have some mixing of typescript and chart js which seems to be not to be fixed that easy
import { ref, computed, onMounted, nextTick } from "vue";
import { ref, computed, onMounted, nextTick, toRaw } from "vue";
import { initWaterfall, setColormap } from "../../js/waterfallHandler.js";
import { setActivePinia } from "pinia";
import pinia from "../../store/index";
@ -89,7 +89,7 @@ const transmissionSpeedChartData = computed(() => ({
{
type: "line",
label: "SNR[dB]",
data: state.arq_speed_list_snr,
data: state.arq_speed_list_snr.value,
borderColor: "rgb(75, 192, 192, 1.0)",
pointRadius: 1,
segment: {
@ -106,7 +106,7 @@ const transmissionSpeedChartData = computed(() => ({
{
type: "bar",
label: "Speed[bpm]",
data: state.arq_speed_list_bpm,
data: state.arq_speed_list_bpm.value,
borderColor: "rgb(120, 100, 120, 1.0)",
backgroundColor: "rgba(120, 100, 120, 0.2)",
order: 0,

View file

@ -7,6 +7,7 @@ import {
setStateFailed,
} from "./chatHandler";
*/
import { toRaw } from "vue";
import { displayToast } from "./popupHandler";
import { getFreedataMessages, getModemState, getAudioDevices } from "./api";
import { processFreedataMessages } from "./messagesHandler.ts";
@ -178,12 +179,13 @@ export function eventDispatcher(data) {
100;
stateStore.arq_total_bytes =
data["arq-transfer-outbound"].received_bytes;
stateStore.arq_speed_list_timestamp =
data["arq-transfer-outbound"].statistics.time_histogram;
stateStore.arq_speed_list_bpm =
data["arq-transfer-outbound"].statistics.bpm_histogram;
stateStore.arq_speed_list_snr =
data["arq-transfer-outbound"].statistics.snr_histogram;
stateStore.arq_speed_list_timestamp.value =
toRaw(data["arq-transfer-outbound"].statistics.time_histogram);
stateStore.arq_speed_list_bpm.value =
toRaw(data["arq-transfer-outbound"].statistics.bpm_histogram);
stateStore.arq_speed_list_snr.value =
toRaw(data["arq-transfer-outbound"].statistics.snr_histogram);
//console.log(toRaw(stateStore.arq_speed_list_timestamp.value));
return;
case "ABORTING":
@ -226,13 +228,12 @@ export function eventDispatcher(data) {
stateStore.dxcallsign = data["arq-transfer-inbound"].dxcall;
stateStore.arq_transmission_percent = 0;
stateStore.arq_total_bytes = 0;
stateStore.arq_speed_list_timestamp =
data["arq-transfer-inbound"].statistics.time_histogram;
stateStore.arq_speed_list_bpm =
data["arq-transfer-inbound"].statistics.bpm_histogram;
stateStore.arq_speed_list_snr =
data["arq-transfer-inbound"].statistics.snr_histogram;
//stateStore.arq_speed_list_timestamp =
// [];
//stateStore.arq_speed_list_bpm =
// [];
//stateStore.arq_speed_list_snr =
// [];
return;
case "OPEN_ACK_SENT":
@ -266,6 +267,16 @@ export function eventDispatcher(data) {
100;
stateStore.arq_total_bytes =
data["arq-transfer-inbound"].received_bytes;
//console.log(data["arq-transfer-inbound"].statistics.time_histogram);
stateStore.arq_speed_list_timestamp.value =
toRaw(data["arq-transfer-inbound"].statistics.time_histogram);
stateStore.arq_speed_list_bpm.value =
toRaw(data["arq-transfer-inbound"].statistics.bpm_histogram);
stateStore.arq_speed_list_snr.value =
toRaw(data["arq-transfer-inbound"].statistics.snr_histogram);
console.log((stateStore.arq_speed_list_timestamp.value));
console.log((stateStore.arq_speed_list_bpm.value));
console.log((stateStore.arq_speed_list_snr.value));
return;
case "ENDED":