feat(radio): answer the RTL-SDR card through the radio store

SdrCard calls LocalSdrControls through radio store actions instead of
DOM listeners, and renders its gain options from the receiver's own
R820T gain steps with page-language labels. The display and radio
stores share one owner list (createOwners): the newest connected owner
with an action answers it.
This commit is contained in:
Sameh Khamis committed 2026-11-01 10:52:50 -08:00
1 parent e5fa31d01e
commit 61d11ce369
12 files changed
+320 -206

No files matched your search

+8 -1
View File
@@ -1,5 +1,6 @@
import { defineStore } from 'pinia';
import { markRaw, shallowRef } from 'vue';
import { createOwners } from './owners.js';
/**
* The Radio panel as its view renders it. RadioControls presents the
@@ -7,7 +8,7 @@ import { markRaw, shallowRef } from 'vue';
* Cockpit's compact radio controls (`renderRadioState()`), which Cockpit
* utility popover is open, and the directory tuner, and publishes them here;
* it keeps its listeners. LocalSdrControls publishes the local RTL-SDR card
* beside it.
* beside it, and the card's controls reach it through act().
*/
export const useRadioStore = defineStore('gev-radio', () => {
/** The presented panel; null until the controls first render. */
@@ -42,6 +43,9 @@ export const useRadioStore = defineStore('gev-radio', () => {
tuner.value = markRaw(next);
}
// LocalSdrControls answers the RTL-SDR card's controls.
const { connect, detach, act } = createOwners();
return {
view,
publish,
@@ -51,5 +55,8 @@ export const useRadioStore = defineStore('gev-radio', () => {
publishUtility,
tuner,
publishTuner,
connect,
detach,
act,
};
});