[feat](trx-rs): expose WFM stereo denoise toggle in UI
Wire the StereoDenoise processor through the full stack: - Add SetWfmDenoise command variant and RigCat trait method (trx-core) - Add wfm_denoise field to RigFilterState with default true - Add protocol command and bidirectional mapping (trx-protocol) - Add rig_task command handler (trx-server) - Implement set_wfm_denoise in SoapySdrRig backend - Add /set_wfm_denoise API endpoint (trx-frontend-http) - Add denoise checkbox in WFM controls with SSE sync and localStorage persistence Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -1373,6 +1373,12 @@ function render(update) {
|
||||
saveSetting("wfmAudioMode", nextMode);
|
||||
}
|
||||
}
|
||||
if (wfmDenoiseEl && typeof update.filter.wfm_denoise === "boolean") {
|
||||
if (wfmDenoiseEl.checked !== update.filter.wfm_denoise) {
|
||||
wfmDenoiseEl.checked = update.filter.wfm_denoise;
|
||||
saveSetting("wfmDenoise", update.filter.wfm_denoise ? "true" : "false");
|
||||
}
|
||||
}
|
||||
if (wfmStFlagEl && typeof update.filter.wfm_stereo_detected === "boolean") {
|
||||
const detected = update.filter.wfm_stereo_detected;
|
||||
wfmStFlagEl.textContent = detected ? "ST" : "MO";
|
||||
@@ -2680,6 +2686,7 @@ const audioRow = document.getElementById("audio-row");
|
||||
const wfmControlsCol = document.getElementById("wfm-controls-col");
|
||||
const wfmDeemphasisEl = document.getElementById("wfm-deemphasis");
|
||||
const wfmAudioModeEl = document.getElementById("wfm-audio-mode");
|
||||
const wfmDenoiseEl = document.getElementById("wfm-denoise");
|
||||
const sdrGainControlsEl = document.getElementById("sdr-gain-controls");
|
||||
const sdrGainEl = document.getElementById("sdr-gain-db");
|
||||
const sdrGainSetBtn = document.getElementById("sdr-gain-set");
|
||||
@@ -2748,6 +2755,14 @@ if (wfmAudioModeEl) {
|
||||
postPath(`/set_wfm_stereo?enabled=${enabled ? "true" : "false"}`).catch(() => {});
|
||||
});
|
||||
}
|
||||
if (wfmDenoiseEl) {
|
||||
wfmDenoiseEl.checked = loadSetting("wfmDenoise", "true") === "true";
|
||||
wfmDenoiseEl.addEventListener("change", () => {
|
||||
const enabled = wfmDenoiseEl.checked;
|
||||
saveSetting("wfmDenoise", enabled ? "true" : "false");
|
||||
postPath(`/set_wfm_denoise?enabled=${enabled ? "true" : "false"}`).catch(() => {});
|
||||
});
|
||||
}
|
||||
if (wfmDeemphasisEl) {
|
||||
wfmDeemphasisEl.addEventListener("change", () => {
|
||||
postPath(`/set_wfm_deemphasis?us=${encodeURIComponent(wfmDeemphasisEl.value)}`).catch(() => {});
|
||||
|
||||
@@ -172,6 +172,10 @@
|
||||
<option value="mono">Mono</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="wfm-control">
|
||||
<span class="wfm-control-label">Denoise</span>
|
||||
<input type="checkbox" id="wfm-denoise" checked />
|
||||
</label>
|
||||
<div class="wfm-gain-group" id="sdr-gain-controls">
|
||||
<label class="wfm-control">
|
||||
<span class="wfm-control-label">RF Gain</span>
|
||||
|
||||
@@ -522,6 +522,19 @@ pub async fn set_wfm_stereo(
|
||||
send_command(&rig_tx, RigCommand::SetWfmStereo(query.enabled)).await
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct WfmDenoiseQuery {
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
#[post("/set_wfm_denoise")]
|
||||
pub async fn set_wfm_denoise(
|
||||
query: web::Query<WfmDenoiseQuery>,
|
||||
rig_tx: web::Data<mpsc::Sender<RigRequest>>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
send_command(&rig_tx, RigCommand::SetWfmDenoise(query.enabled)).await
|
||||
}
|
||||
|
||||
#[post("/toggle_aprs_decode")]
|
||||
pub async fn toggle_aprs_decode(
|
||||
state: web::Data<watch::Receiver<RigState>>,
|
||||
@@ -736,6 +749,7 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
|
||||
.service(set_sdr_gain)
|
||||
.service(set_wfm_deemphasis)
|
||||
.service(set_wfm_stereo)
|
||||
.service(set_wfm_denoise)
|
||||
.service(toggle_aprs_decode)
|
||||
.service(toggle_cw_decode)
|
||||
.service(set_cw_auto)
|
||||
|
||||
Reference in New Issue
Block a user