Phase 3 (batch 6): route FM squelch + CTCSS through controller commands

The user plans to expose FM over web/CAT later, so FM controls get the
same controller treatment now — future web/CAT FM commands plug straight
into these.

- Relocate CTCSS_COUNT/CTCSS_TONES from MainForm to FMRepeater (a shared
  FM unit MainForm already uses) so TRadioController can drive CTCSS on the
  DSP. CTCSS_NAMES stays in MainForm (UI dropdown labels). MODE_FM is
  already visible to the controller via WDSPEngine.
- SetFMSquelch/SetFMSquelchLevel apply FM squelch (mode-gated) to the DSP;
  SetFMCTCSS/SetFMCTCSSTone clamp and apply CTCSS. All fire OnStateChanged.
- OnControllerState restyles the SQ/CTCSS buttons, syncs the squelch slider
  + label, and the CTCSS tone dropdown. Handlers/SetFMCTCSSTone call the
  commands (manual CTCSS still clears the auto-active flag in the handler).

FM repeater stays for the heavy batch — it needs XvtrTranslate/
ActiveTXFreqHz moved into the controller. ApplyFMSquelch remains for
band/mode re-apply paths (RestoreBand, XVTR).

Builds clean (cocoa).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Uladzimir Karpenka
2026-06-04 15:15:46 +03:00
co-authored by Claude Opus 4.8
parent 7d3570346f
commit fd145b28f6
3 changed files with 63 additions and 27 deletions
+10
View File
@@ -22,6 +22,16 @@ const
RPT_AUTO_MINUS_LO = 145600000.0; // 145.600 MHz
RPT_AUTO_MINUS_HI = 145787500.0; // 145.7875 MHz
// CTCSS tones (38 standard tones). Здесь (а не в MainForm), чтобы таблица
// была доступна TRadioController для FDSPEngine.SetTXCTCSS. Имена тонов
// (CTCSS_NAMES) остаются в MainForm — это UI-метки выпадающего списка.
CTCSS_COUNT = 38;
CTCSS_TONES: array[0..CTCSS_COUNT-1] of Double = (
67.0, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4, 88.5, 91.5, 94.8,
97.4, 100.0, 103.5, 107.2, 110.9, 114.8, 118.8, 123.0, 127.3, 131.8,
136.5, 141.3, 146.2, 151.4, 156.7, 162.2, 167.9, 173.8, 179.9, 186.2,
192.8, 203.5, 210.7, 218.1, 225.7, 233.6, 241.8, 250.3);
{ Returns default offset (Hz) for the given visible frequency.
70 cm band → 7.600 MHz; everything else → 0.600 MHz. }
function RptDefaultOffsetHz(FreqHz: Double): Double;