[feat](trx-frontend-http): intercept freq/mode changes for virtual channels
When on a non-primary (virtual) channel, redirect freq and mode changes to the channel metadata API instead of the server: - vchan.js: add vchanIsOnVirtual(), vchanSetChannelFreq/Mode(); expose window.vchanInterceptMode() hook; wrap window.setRigFrequency so all callers (jog, freq input, bookmarks, spectrum click) are automatically redirected without modification - app.js: check vchanInterceptMode() in applyModeFromPicker() before posting /set_mode - bookmarks.js: check vchanInterceptMode() for mode in bmApply(); setRigFrequency() redirect is automatic via the vchan.js wrapper; bandwidth and decoder toggles still apply regardless of channel Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -3119,6 +3119,10 @@ async function applyModeFromPicker() {
|
||||
modeEl.disabled = true;
|
||||
showHint("Setting mode…");
|
||||
try {
|
||||
if (typeof vchanInterceptMode === "function" && await vchanInterceptMode(mode)) {
|
||||
showHint("Channel mode set", 1500);
|
||||
return;
|
||||
}
|
||||
await postPath(`/set_mode?mode=${encodeURIComponent(mode)}`);
|
||||
showHint("Mode set", 1500);
|
||||
if (mode.toUpperCase() === "WFM") {
|
||||
|
||||
Reference in New Issue
Block a user