Standardize filter widths per mode; fix FM web filter/deviation

- LSB/USB: 5.0k–1.0k (unchanged)
- DSB: split into own group 16k–2.4k (was sharing AM filters)
- CWL/CWU: 1.0k 800 600 500 400 250 150 100 50 25 (removed 750, added 150)
- AM/SAM: 20k–5.0k (new wider range)
- Web FNP FM: now shows NFM/FM only (11k/16k), matching desktop
- Fix SyncWebFilter: FM array out-of-bounds; FFMDeviation now set on web filter select
- VfoOverlay: DSB separated from SSB with own quick-select values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 21:14:29 +03:00
co-authored by Claude Sonnet 4.6
parent 68d05657e6
commit 87f449c737
3 changed files with 56 additions and 26 deletions
+31 -10
View File
@@ -64,17 +64,24 @@ const
// CW: CWL/CWU
FILT_CW_NAMES: array[0..FILT_COUNT-1] of string =
('1.0k','800','750','600','500','400','250','100','50','25');
('1.0k','800','600','500','400','250','150','100','50','25');
FILT_CW_BW: array[0..FILT_COUNT-1] of Integer =
(1000, 800, 750, 600, 500, 400, 250, 100, 50, 25);
FILT_CW_DEF = 4; // 500
(1000, 800, 600, 500, 400, 250, 150, 100, 50, 25);
FILT_CW_DEF = 3; // 500
// AM/SAM/DSB
FILT_AM_NAMES: array[0..FILT_COUNT-1] of string =
('16k','12k','10k','8k','6.6k','5.2k','4.0k','3.1k','2.9k','2.4k');
FILT_AM_BW: array[0..FILT_COUNT-1] of Integer =
// DSB
FILT_DSB_NAMES: array[0..FILT_COUNT-1] of string =
('16k','12k','10k','8.0k','6.6k','5.2k','4.0k','3.1k','2.9k','2.4k');
FILT_DSB_BW: array[0..FILT_COUNT-1] of Integer =
(16000, 12000, 10000, 8000, 6600, 5200, 4000, 3100, 2900, 2400);
FILT_AM_DEF = 3; // 8k
FILT_DSB_DEF = 3; // 8.0k
// AM/SAM
FILT_AM_NAMES: array[0..FILT_COUNT-1] of string =
('20k','18k','16k','12k','10k','9.0k','8.0k','7.0k','6.0k','5.0k');
FILT_AM_BW: array[0..FILT_COUNT-1] of Integer =
(20000, 18000, 16000, 12000, 10000, 9000, 8000, 7000, 6000, 5000);
FILT_AM_DEF = 4; // 10k
// FM: NFM (2.5 kHz deviation / 11 kHz BW) and FM (5.0 kHz deviation / 16 kHz BW)
FILT_FM_COUNT = 2;
@@ -4079,6 +4086,10 @@ begin
for i := 0 to FILT_COUNT-1 do Names[i] := FILT_SSB_NAMES[i];
DefIdx := FILT_SSB_DEF;
end;
2: begin
for i := 0 to FILT_COUNT-1 do Names[i] := FILT_DSB_NAMES[i];
DefIdx := FILT_DSB_DEF;
end;
3, 4: begin
for i := 0 to FILT_COUNT-1 do Names[i] := FILT_CW_NAMES[i];
DefIdx := FILT_CW_DEF;
@@ -4092,6 +4103,7 @@ begin
FFilter := DefIdx;
case FMode of
0, 1: FFilterBW := FILT_SSB_BW[DefIdx];
2: FFilterBW := FILT_DSB_BW[DefIdx];
3, 4: FFilterBW := FILT_CW_BW[DefIdx];
else FFilterBW := FILT_AM_BW[DefIdx];
end;
@@ -4641,6 +4653,7 @@ begin
FFilter := N;
case FMode of
0, 1: FFilterBW := FILT_SSB_BW[N];
2: FFilterBW := FILT_DSB_BW[N];
3, 4: FFilterBW := FILT_CW_BW[N];
5: begin
FFilterBW := FILT_FM_BW[N];
@@ -5254,8 +5267,13 @@ begin
FFilter := Idx;
case FMode of
0,1: FFilterBW := FILT_SSB_BW[Idx];
2: FFilterBW := FILT_DSB_BW[Idx];
3,4: FFilterBW := FILT_CW_BW[Idx];
5: FFilterBW := FILT_FM_BW[Idx];
5: if Idx < FILT_FM_COUNT then
begin
FFilterBW := FILT_FM_BW[Idx];
FFMDeviation := FILT_FM_DEV[Idx];
end;
else FFilterBW := FILT_AM_BW[Idx];
end;
for j := 0 to FILT_COUNT-1 do StyleButton(BtnFilter[j], j = FFilter);
@@ -5267,10 +5285,12 @@ begin
end;
// Positive value = bandwidth in Hz, find closest filter
FFilterBW := FWebSyncInt;
for i := 0 to FILT_COUNT-1 do BW_arr[i] := MaxInt;
case FMode of
0,1: for i := 0 to FILT_COUNT-1 do BW_arr[i] := FILT_SSB_BW[i];
2: for i := 0 to FILT_COUNT-1 do BW_arr[i] := FILT_DSB_BW[i];
3,4: for i := 0 to FILT_COUNT-1 do BW_arr[i] := FILT_CW_BW[i];
5: for i := 0 to FILT_COUNT-1 do BW_arr[i] := FILT_FM_BW[i];
5: for i := 0 to FILT_FM_COUNT-1 do BW_arr[i] := FILT_FM_BW[i];
else for i := 0 to FILT_COUNT-1 do BW_arr[i] := FILT_AM_BW[i];
end;
best := 0; dist := MaxInt;
@@ -5281,6 +5301,7 @@ begin
best := i;
end;
FFilter := best;
if FMode = 5 then FFMDeviation := FILT_FM_DEV[best];
for j := 0 to FILT_COUNT-1 do StyleButton(BtnFilter[j], j = FFilter);
ApplyModeFilter;
SyncSpecViewFreq;