first swr attempt

This commit is contained in:
DJ2LS 2024-04-30 21:10:50 +02:00
parent fefab1b767
commit 1419035250
3 changed files with 74 additions and 7 deletions

View file

@ -33,6 +33,7 @@ import grid_beacon from "./grid/grid_beacon.vue";
import grid_mycall_small from "./grid/grid_mycall small.vue";
import grid_scatter from "./grid/grid_scatter.vue";
import grid_stats_chart from "./grid/grid_stats_chart.vue";
import grid_swr_meter from "./grid/grid_swr_meter.vue";
let count = ref(0);
let grid = null; // DO NOT use ref(null) as proxies GS will break all logic when comparing structures... see https://github.com/gridstack/gridstack.js/issues/2115
@ -155,6 +156,7 @@ new gridWidget(
"Rig",
6,
),
new gridWidget(
dbfs_meter,
{ x: 20, y: 0, w: 4, h: 8 },
@ -256,7 +258,16 @@ new gridWidget(
"Stats",
20,
),
//Next new widget ID should be 21
new gridWidget(
grid_swr_meter,
{ x: 16, y: 0, w: 4, h: 8 },
"SWR",
true,
true,
"Rig",
21,
),
//Next new widget ID should be 22
];
@ -278,11 +289,6 @@ function set_radio_parameter_rflevel(){
}
function savePreset()
{
settingsStore.local.grid_preset=settingsStore.local.grid_layout;

View file

@ -121,7 +121,7 @@ window.addEventListener(
role="switch"
id="flexSwitchAFK"
v-model="state.away_from_key"
@click="setAwayFromKey()"
@change="setAwayFromKey()"
/>
<label class="form-check-label" for="flexSwitchAFK"
>Away From Key</label

View file

@ -0,0 +1,61 @@
<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);
</script>
<template>
<div class="progress mb-0 rounded-0 rounded-top" style="height: 22px">
<div
class="progress-bar progress-bar-striped bg-primary force-gpu"
id="swr_level"
role="progressbar"
:style="{ width: state.swr + '%' }"
aria-valuenow="{{state.swr}}"
aria-valuemin="0"
aria-valuemax="5"
></div>
<p
class="justify-content-center d-flex position-absolute w-100"
id="swr_level_value"
>
SWR 1:{{ state.swr }}
</p>
</div>
<div class="progress mb-0 rounded-0 rounded-bottom" style="height: 8px">
<div
class="progress-bar progress-bar-striped bg-warning"
role="progressbar"
style="width: 1%"
aria-valuenow="1"
aria-valuemin="0"
aria-valuemax="100"
></div>
<div
class="progress-bar bg-success"
role="progressbar"
style="width: 89%"
aria-valuenow="50"
aria-valuemin="0"
aria-valuemax="100"
></div>
<div
class="progress-bar progress-bar-striped bg-warning"
role="progressbar"
style="width: 20%"
aria-valuenow="20"
aria-valuemin="0"
aria-valuemax="100"
></div>
<div
class="progress-bar progress-bar-striped bg-danger"
role="progressbar"
style="width: 29%"
aria-valuenow="29"
aria-valuemin="0"
aria-valuemax="100"
></div>
</div>
</template>