[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:
2026-03-01 13:29:02 +01:00
parent 46bc96ddf2
commit 64bb9a0d42
12 changed files with 83 additions and 0 deletions
+1
View File
@@ -36,5 +36,6 @@ pub enum RigCommand {
SetSdrGain(f64),
SetWfmDeemphasis(u32),
SetWfmStereo(bool),
SetWfmDenoise(bool),
GetSpectrum,
}
@@ -519,6 +519,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
| RigCommand::SetSdrGain(_)
| RigCommand::SetWfmDeemphasis(_)
| RigCommand::SetWfmStereo(_)
| RigCommand::SetWfmDenoise(_)
| RigCommand::GetSpectrum => Box::new(GetSnapshotCommand),
}
}
+10
View File
@@ -185,6 +185,16 @@ pub trait RigCat: Rig + Send {
)))
}
fn set_wfm_denoise<'a>(
&'a mut self,
_enabled: bool,
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_wfm_denoise"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
/// Return the current filter state if this backend supports filter controls.
fn filter_state(&self) -> Option<state::RigFilterState> {
None
+6
View File
@@ -277,6 +277,8 @@ pub struct RigFilterState {
pub wfm_stereo: bool,
#[serde(default)]
pub wfm_stereo_detected: bool,
#[serde(default = "default_wfm_denoise")]
pub wfm_denoise: bool,
}
fn default_wfm_deemphasis_us() -> u32 {
@@ -287,6 +289,10 @@ fn default_wfm_stereo() -> bool {
true
}
fn default_wfm_denoise() -> bool {
true
}
/// Spectrum data from SDR backends (FFT magnitude over the full capture bandwidth).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SpectrumData {