Skip to content

Commit

Permalink
Merge pull request #704 from DJ2LS/dev-datac14
Browse files Browse the repository at this point in the history
WIP: New speed levels & compression & signalling mode
  • Loading branch information
DJ2LS authored Apr 17, 2024
2 parents ff5fddc + 144b3ee commit eab145f
Show file tree
Hide file tree
Showing 52 changed files with 910 additions and 308 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
brew install portaudio
python -m pip install --upgrade pip
pip3 install pyaudio
export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/3.11/lib/:$PYTHONPATH
- name: Install Python dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "FreeDATA",
"description": "FreeDATA Client application for connecting to FreeDATA server",
"private": true,
"version": "0.14.5-alpha",
"version": "0.15.2-alpha",
"main": "dist-electron/main/index.js",
"scripts": {
"start": "vite",
Expand Down
8 changes: 7 additions & 1 deletion gui/src/assets/waterfall/spectrum.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ Spectrum.prototype.drawSpectrum = function () {
var linePositionHigh = 178.4; //150 + bandwidth/20
var linePositionLow2 = 65; //150 - bandwith/20
var linePositionHigh2 = 235; //150 + bandwith/20
var linePositionLow3 = 28.1; //150 - bandwith/20
var linePositionHigh3 = 271.9; //150 + bandwith/20
this.ctx_wf.beginPath();
this.ctx_wf.moveTo(linePositionLow, 0);
this.ctx_wf.lineTo(linePositionLow, height);
Expand All @@ -114,6 +116,10 @@ Spectrum.prototype.drawSpectrum = function () {
this.ctx_wf.lineTo(linePositionLow2, height);
this.ctx_wf.moveTo(linePositionHigh2, 0);
this.ctx_wf.lineTo(linePositionHigh2, height);
this.ctx_wf.moveTo(linePositionLow3, 0);
this.ctx_wf.lineTo(linePositionLow3, height);
this.ctx_wf.moveTo(linePositionHigh3, 0);
this.ctx_wf.lineTo(linePositionHigh3, height);
this.ctx_wf.lineWidth = 1;
this.ctx_wf.strokeStyle = "#C3C3C3";
this.ctx_wf.stroke();
Expand Down Expand Up @@ -454,7 +460,7 @@ export function Spectrum(id, options) {
this.centerHz = options && options.centerHz ? options.centerHz : 1500;
this.spanHz = options && options.spanHz ? options.spanHz : 0;
this.wf_size = options && options.wf_size ? options.wf_size : 0;
this.wf_rows = options && options.wf_rows ? options.wf_rows : 1024;
this.wf_rows = options && options.wf_rows ? options.wf_rows : 512;
this.spectrumPercent =
options && options.spectrumPercent ? options.spectrumPercent : 0;
this.spectrumPercentStep =
Expand Down
18 changes: 13 additions & 5 deletions gui/src/components/dynamic_components.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ import grid_freq from "./grid/grid_frequency.vue";
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 { stateDispatcher } from "../js/eventHandler";
import { Scatter } from "vue-chartjs";
import grid_stats_chart from "./grid/grid_stats_chart.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
Expand Down Expand Up @@ -63,7 +62,8 @@ class gridWidget {
this.id = id;
}
}
//Array of grid widgets, do not change array order as it'll affect saved configs
//Array of grid widgets
//Order can be changed so sorted correctly, but do not change ID as it'll affect saved configs
const gridWidgets = [
new gridWidget(
grid_activities,
Expand Down Expand Up @@ -247,8 +247,16 @@ new gridWidget(
"Stats",
19,
),
//New new widget ID should be 20
new gridWidget(
grid_stats_chart,
{ x: 0, y: 114, w: 6, h: 30 },
"Speed/SNR graph",
false,
true,
"Stats",
20,
),
//Next new widget ID should be 21
];
Expand Down
63 changes: 47 additions & 16 deletions gui/src/components/grid/grid_active_broadcasts_vert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@ function transmitPing() {
function startStopBeacon() {
if (state.beacon_state === true) {
setModemBeacon(false);
setModemBeacon(false, state.away_from_key);
} else {
setModemBeacon(true);
setModemBeacon(true, state.away_from_key);
}
}
function setAwayFromKey(){
if (state.away_from_key === true) {
setModemBeacon(state.beacon_state, false);
} else {
setModemBeacon(state.beacon_state, true);
}
}
var dxcallPing = ref("");
window.addEventListener(
"stationSelected",
Expand All @@ -39,7 +50,7 @@ window.addEventListener(
<div class="card-body overflow-auto p-0">
<div class="container text-center">
<div class="row mb-2 mt-2">
<div class="col-sm-8">
<div class="col">
<div class="input-group w-100">
<div class="form-floating">
<input
Expand All @@ -65,11 +76,28 @@ window.addEventListener(
title="Send a ping request to a remote station"
@click="transmitPing()"
>
<strong>Ping</strong>
<strong>PING Station</strong>
</button>
</div>
</div>
</div>

<div class="row">
<div class="col">
<button
class="btn btn-sm btn-outline-secondary w-100"
id="sendCQ"
type="button"
title="Send a CQ to the world"
@click="sendModemCQ()"
>
<h3>CQ CQ CQ</h3>
</button>
</div>
</div>

<div class="row">
<div class="col">
<div class="form-check form-switch">
<input
class="form-check-input"
Expand All @@ -80,25 +108,28 @@ window.addEventListener(
@click="startStopBeacon()"
/>
<label class="form-check-label" for="flexSwitchBeacon"
>Beacon</label
>Enable Beacon</label
>
</div>
</div>
</div>

<div class="row">
<div class="col">
<button
class="btn btn-sm btn-outline-secondary w-100"
id="sendCQ"
type="button"
title="Send a CQ to the world"
@click="sendModemCQ()"
>
<h3>CQ CQ CQ</h3>
</button>
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
role="switch"
id="flexSwitchAFK"
v-model="state.away_from_key"
@click="setAwayFromKey()"
/>
<label class="form-check-label" for="flexSwitchAFK"
>Away From Key</label
>
</div>
</div>
</div>

</div>
</div>
</div>
Expand Down
17 changes: 13 additions & 4 deletions gui/src/components/grid/grid_active_heard_stations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ function getMaidenheadDistance(dxGrid) {
//
}
}
function pushToPing(origin)
{
window.dispatchEvent(new CustomEvent("stationSelected", {bubbles:true, detail: origin }));
function pushToPing(origin) {
window.dispatchEvent(
new CustomEvent("stationSelected", { bubbles: true, detail: origin }),
);
}
</script>
<template>
Expand All @@ -61,11 +62,16 @@ function pushToPing(origin)
<th scope="col" id="thType">Type</th>
<th scope="col" id="thSnr">SNR</th>
<!--<th scope="col">Off</th>-->
<th scope="col" id="thSnr">AFK?</th>
</tr>
</thead>
<tbody id="gridHeardStations">
<!--https://vuejs.org/guide/essentials/list.html-->
<tr v-for="item in state.heard_stations" :key="item.origin" @click="pushToPing(item.origin)">
<tr
v-for="item in state.heard_stations"
:key="item.origin"
@click="pushToPing(item.origin)"
>
<td>
{{ getDateTime(item.timestamp) }}
</td>
Expand All @@ -83,6 +89,9 @@ function pushToPing(origin)
<td>
{{ item.snr }}
</td>
<td>
{{ item.away_from_key }}
</td>
</tr>
</tbody>
</table>
Expand Down
6 changes: 3 additions & 3 deletions gui/src/components/grid/grid_active_stats.vue
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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: {
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions gui/src/components/grid/grid_dbfs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useStateStore } from "../../store/stateStore.js";
const state = useStateStore(pinia);
</script>
<template>
<div class="progress mb-0 me-4 rounded-0 rounded-top" style="height: 22px">
<div class="progress mb-0 rounded-0 rounded-top" style="height: 22px">
<div
class="progress-bar progress-bar-striped bg-primary force-gpu"
id="dbfs_level"
Expand All @@ -24,7 +24,7 @@ const state = useStateStore(pinia);
{{ state.dbfs_level }} dBFS
</p>
</div>
<div class="progress mb-0 me-4 rounded-0 rounded-bottom" style="height: 8px">
<div class="progress mb-0 rounded-0 rounded-bottom" style="height: 8px">
<div
class="progress-bar progress-bar-striped bg-warning"
role="progressbar"
Expand Down
4 changes: 2 additions & 2 deletions gui/src/components/grid/grid_s-meter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useStateStore } from "../../store/stateStore.js";
const state = useStateStore(pinia);
</script>
<template>
<div class="progress mb-0 me-4 rounded-0 rounded-top" style="height: 22px">
<div class="progress mb-0 rounded-0 rounded-top" style="height: 22px">
<div
class="progress-bar progress-bar-striped bg-primary force-gpu"
id="noise_level"
Expand All @@ -24,7 +24,7 @@ const state = useStateStore(pinia);
S-Meter(dB): {{ state.s_meter_strength_raw }}
</p>
</div>
<div class="progress mb-0 me-4 rounded-0 rounded-bottom" style="height: 8px">
<div class="progress mb-0 rounded-0 rounded-bottom" style="height: 8px">
<div
class="progress-bar progress-bar-striped bg-warning"
role="progressbar"
Expand Down
Loading

0 comments on commit eab145f

Please sign in to comment.