mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 19:45:09 +00:00
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:
+31
-10
@@ -64,17 +64,24 @@ const
|
|||||||
|
|
||||||
// CW: CWL/CWU
|
// CW: CWL/CWU
|
||||||
FILT_CW_NAMES: array[0..FILT_COUNT-1] of string =
|
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 =
|
FILT_CW_BW: array[0..FILT_COUNT-1] of Integer =
|
||||||
(1000, 800, 750, 600, 500, 400, 250, 100, 50, 25);
|
(1000, 800, 600, 500, 400, 250, 150, 100, 50, 25);
|
||||||
FILT_CW_DEF = 4; // 500
|
FILT_CW_DEF = 3; // 500
|
||||||
|
|
||||||
// AM/SAM/DSB
|
// DSB
|
||||||
FILT_AM_NAMES: array[0..FILT_COUNT-1] of string =
|
FILT_DSB_NAMES: array[0..FILT_COUNT-1] of string =
|
||||||
('16k','12k','10k','8k','6.6k','5.2k','4.0k','3.1k','2.9k','2.4k');
|
('16k','12k','10k','8.0k','6.6k','5.2k','4.0k','3.1k','2.9k','2.4k');
|
||||||
FILT_AM_BW: array[0..FILT_COUNT-1] of Integer =
|
FILT_DSB_BW: array[0..FILT_COUNT-1] of Integer =
|
||||||
(16000, 12000, 10000, 8000, 6600, 5200, 4000, 3100, 2900, 2400);
|
(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)
|
// FM: NFM (2.5 kHz deviation / 11 kHz BW) and FM (5.0 kHz deviation / 16 kHz BW)
|
||||||
FILT_FM_COUNT = 2;
|
FILT_FM_COUNT = 2;
|
||||||
@@ -4079,6 +4086,10 @@ begin
|
|||||||
for i := 0 to FILT_COUNT-1 do Names[i] := FILT_SSB_NAMES[i];
|
for i := 0 to FILT_COUNT-1 do Names[i] := FILT_SSB_NAMES[i];
|
||||||
DefIdx := FILT_SSB_DEF;
|
DefIdx := FILT_SSB_DEF;
|
||||||
end;
|
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
|
3, 4: begin
|
||||||
for i := 0 to FILT_COUNT-1 do Names[i] := FILT_CW_NAMES[i];
|
for i := 0 to FILT_COUNT-1 do Names[i] := FILT_CW_NAMES[i];
|
||||||
DefIdx := FILT_CW_DEF;
|
DefIdx := FILT_CW_DEF;
|
||||||
@@ -4092,6 +4103,7 @@ begin
|
|||||||
FFilter := DefIdx;
|
FFilter := DefIdx;
|
||||||
case FMode of
|
case FMode of
|
||||||
0, 1: FFilterBW := FILT_SSB_BW[DefIdx];
|
0, 1: FFilterBW := FILT_SSB_BW[DefIdx];
|
||||||
|
2: FFilterBW := FILT_DSB_BW[DefIdx];
|
||||||
3, 4: FFilterBW := FILT_CW_BW[DefIdx];
|
3, 4: FFilterBW := FILT_CW_BW[DefIdx];
|
||||||
else FFilterBW := FILT_AM_BW[DefIdx];
|
else FFilterBW := FILT_AM_BW[DefIdx];
|
||||||
end;
|
end;
|
||||||
@@ -4641,6 +4653,7 @@ begin
|
|||||||
FFilter := N;
|
FFilter := N;
|
||||||
case FMode of
|
case FMode of
|
||||||
0, 1: FFilterBW := FILT_SSB_BW[N];
|
0, 1: FFilterBW := FILT_SSB_BW[N];
|
||||||
|
2: FFilterBW := FILT_DSB_BW[N];
|
||||||
3, 4: FFilterBW := FILT_CW_BW[N];
|
3, 4: FFilterBW := FILT_CW_BW[N];
|
||||||
5: begin
|
5: begin
|
||||||
FFilterBW := FILT_FM_BW[N];
|
FFilterBW := FILT_FM_BW[N];
|
||||||
@@ -5254,8 +5267,13 @@ begin
|
|||||||
FFilter := Idx;
|
FFilter := Idx;
|
||||||
case FMode of
|
case FMode of
|
||||||
0,1: FFilterBW := FILT_SSB_BW[Idx];
|
0,1: FFilterBW := FILT_SSB_BW[Idx];
|
||||||
|
2: FFilterBW := FILT_DSB_BW[Idx];
|
||||||
3,4: FFilterBW := FILT_CW_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];
|
else FFilterBW := FILT_AM_BW[Idx];
|
||||||
end;
|
end;
|
||||||
for j := 0 to FILT_COUNT-1 do StyleButton(BtnFilter[j], j = FFilter);
|
for j := 0 to FILT_COUNT-1 do StyleButton(BtnFilter[j], j = FFilter);
|
||||||
@@ -5267,10 +5285,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
// Positive value = bandwidth in Hz, find closest filter
|
// Positive value = bandwidth in Hz, find closest filter
|
||||||
FFilterBW := FWebSyncInt;
|
FFilterBW := FWebSyncInt;
|
||||||
|
for i := 0 to FILT_COUNT-1 do BW_arr[i] := MaxInt;
|
||||||
case FMode of
|
case FMode of
|
||||||
0,1: for i := 0 to FILT_COUNT-1 do BW_arr[i] := FILT_SSB_BW[i];
|
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];
|
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];
|
else for i := 0 to FILT_COUNT-1 do BW_arr[i] := FILT_AM_BW[i];
|
||||||
end;
|
end;
|
||||||
best := 0; dist := MaxInt;
|
best := 0; dist := MaxInt;
|
||||||
@@ -5281,6 +5301,7 @@ begin
|
|||||||
best := i;
|
best := i;
|
||||||
end;
|
end;
|
||||||
FFilter := best;
|
FFilter := best;
|
||||||
|
if FMode = 5 then FFMDeviation := FILT_FM_DEV[best];
|
||||||
for j := 0 to FILT_COUNT-1 do StyleButton(BtnFilter[j], j = FFilter);
|
for j := 0 to FILT_COUNT-1 do StyleButton(BtnFilter[j], j = FFilter);
|
||||||
ApplyModeFilter;
|
ApplyModeFilter;
|
||||||
SyncSpecViewFreq;
|
SyncSpecViewFreq;
|
||||||
|
|||||||
+14
-8
@@ -73,21 +73,25 @@ const
|
|||||||
OVL_MODE_NAMES: array[0..7] of string = (
|
OVL_MODE_NAMES: array[0..7] of string = (
|
||||||
'LSB','USB','DSB','CWL','CWU','FM','AM','SAM');
|
'LSB','USB','DSB','CWL','CWU','FM','AM','SAM');
|
||||||
|
|
||||||
// Фильтры SSB (LSB=0, USB=1, DSB=2)
|
// Фильтры SSB (LSB=0, USB=1)
|
||||||
SSB_BW: array[0..5] of Integer = (1800,2100,2400,2700,3300,3800);
|
SSB_BW: array[0..5] of Integer = (1800,2100,2400,2700,3300,3800);
|
||||||
SSB_LBL: array[0..5] of string = ('1.8K','2.1K','2.4K','2.7K','3.3K','3.8K');
|
SSB_LBL: array[0..5] of string = ('1.8K','2.1K','2.4K','2.7K','3.3K','3.8K');
|
||||||
|
|
||||||
|
// Фильтры DSB (DSB=2)
|
||||||
|
DSB_BW: array[0..5] of Integer = (16000,12000,10000,8000,5200,4000);
|
||||||
|
DSB_LBL: array[0..5] of string = ('16K','12K','10K','8K','5.2K','4K');
|
||||||
|
|
||||||
// Фильтры CW (CWL=3, CWU=4)
|
// Фильтры CW (CWL=3, CWU=4)
|
||||||
CW_BW: array[0..5] of Integer = (500,250,100,50,750,1000);
|
CW_BW: array[0..5] of Integer = (500,250,150,100,50,1000);
|
||||||
CW_LBL: array[0..5] of string = ('500','250','100','50','750','1K');
|
CW_LBL: array[0..5] of string = ('500','250','150','100','50','1K');
|
||||||
|
|
||||||
// Фильтры FM (FM=5)
|
// Фильтры FM (FM=5)
|
||||||
FM_BW: array[0..5] of Integer = (20000,15000,12000,10000,8000,5000);
|
FM_BW: array[0..5] of Integer = (20000,15000,12000,10000,8000,5000);
|
||||||
FM_LBL: array[0..5] of string = ('20K','15K','12K','10K','8K','5K');
|
FM_LBL: array[0..5] of string = ('20K','15K','12K','10K','8K','5K');
|
||||||
|
|
||||||
// Фильтры AM/SAM (AM=6, SAM=7)
|
// Фильтры AM/SAM (AM=6, SAM=7)
|
||||||
AM_BW: array[0..5] of Integer = (8000,6600,5200,4000,3100,12000);
|
AM_BW: array[0..5] of Integer = (20000,16000,12000,10000,8000,6000);
|
||||||
AM_LBL: array[0..5] of string = ('8K','6.6K','5.2K','4K','3.1K','12K');
|
AM_LBL: array[0..5] of string = ('20K','16K','12K','10K','8K','6K');
|
||||||
|
|
||||||
// S-шкала: S1..S9
|
// S-шкала: S1..S9
|
||||||
DB_S: array[1..9] of Double = (-121,-115,-109,-103,-97,-91,-85,-79,-73);
|
DB_S: array[1..9] of Double = (-121,-115,-109,-103,-97,-91,-85,-79,-73);
|
||||||
@@ -95,7 +99,8 @@ const
|
|||||||
function TVfoOverlay.GetFilterBWForMode(ModeIdx, FilterIdx: Integer): Integer;
|
function TVfoOverlay.GetFilterBWForMode(ModeIdx, FilterIdx: Integer): Integer;
|
||||||
begin
|
begin
|
||||||
case ModeIdx of
|
case ModeIdx of
|
||||||
0,1,2: Result := SSB_BW[FilterIdx];
|
0,1: Result := SSB_BW[FilterIdx];
|
||||||
|
2: Result := DSB_BW[FilterIdx];
|
||||||
3,4: Result := CW_BW[FilterIdx];
|
3,4: Result := CW_BW[FilterIdx];
|
||||||
5: Result := FM_BW[FilterIdx];
|
5: Result := FM_BW[FilterIdx];
|
||||||
else Result := AM_BW[FilterIdx]; // 6=AM, 7=SAM
|
else Result := AM_BW[FilterIdx]; // 6=AM, 7=SAM
|
||||||
@@ -105,7 +110,8 @@ end;
|
|||||||
function TVfoOverlay.GetFilterLblForMode(ModeIdx, FilterIdx: Integer): string;
|
function TVfoOverlay.GetFilterLblForMode(ModeIdx, FilterIdx: Integer): string;
|
||||||
begin
|
begin
|
||||||
case ModeIdx of
|
case ModeIdx of
|
||||||
0,1,2: Result := SSB_LBL[FilterIdx];
|
0,1: Result := SSB_LBL[FilterIdx];
|
||||||
|
2: Result := DSB_LBL[FilterIdx];
|
||||||
3,4: Result := CW_LBL[FilterIdx];
|
3,4: Result := CW_LBL[FilterIdx];
|
||||||
5: Result := FM_LBL[FilterIdx];
|
5: Result := FM_LBL[FilterIdx];
|
||||||
else Result := AM_LBL[FilterIdx];
|
else Result := AM_LBL[FilterIdx];
|
||||||
@@ -157,7 +163,7 @@ begin
|
|||||||
// Дефолтные фильтры для каждого режима (запоминаются при переключении)
|
// Дефолтные фильтры для каждого режима (запоминаются при переключении)
|
||||||
FModeFilter[0] := 2700; // LSB
|
FModeFilter[0] := 2700; // LSB
|
||||||
FModeFilter[1] := 2700; // USB
|
FModeFilter[1] := 2700; // USB
|
||||||
FModeFilter[2] := 2700; // DSB
|
FModeFilter[2] := 8000; // DSB
|
||||||
FModeFilter[3] := 500; // CWL
|
FModeFilter[3] := 500; // CWL
|
||||||
FModeFilter[4] := 500; // CWU
|
FModeFilter[4] := 500; // CWU
|
||||||
FModeFilter[5] := 15000; // FM
|
FModeFilter[5] := 15000; // FM
|
||||||
|
|||||||
+11
-8
@@ -252,15 +252,17 @@ begin
|
|||||||
|
|
||||||
// FNP — фильтровый оверлей
|
// FNP — фильтровый оверлей
|
||||||
'var FNP_N={ssb:["5.0k","4.4k","3.8k","3.3k","2.9k","2.7k","2.4k","2.1k","1.8k","1.0k"],' +
|
'var FNP_N={ssb:["5.0k","4.4k","3.8k","3.3k","2.9k","2.7k","2.4k","2.1k","1.8k","1.0k"],' +
|
||||||
'cw:["1.0k","800","750","600","500","400","250","100","50","25"],' +
|
'dsb:["16k","12k","10k","8.0k","6.6k","5.2k","4.0k","3.1k","2.9k","2.4k"],' +
|
||||||
'am:["16k","12k","10k","8k","6.6k","5.2k","4.0k","3.1k","2.9k","2.4k"],' +
|
'cw:["1.0k","800","600","500","400","250","150","100","50","25"],' +
|
||||||
'fm:["20k","15k","12k","10k","8k","6k","5k","4k","3k","2k"]};' +
|
'am:["20k","18k","16k","12k","10k","9.0k","8.0k","7.0k","6.0k","5.0k"],' +
|
||||||
|
'fm:["NFM","FM"]};' +
|
||||||
'var FNP_BW={ssb:[5000,4400,3800,3300,2900,2700,2400,2100,1800,1000],' +
|
'var FNP_BW={ssb:[5000,4400,3800,3300,2900,2700,2400,2100,1800,1000],' +
|
||||||
'cw:[1000,800,750,600,500,400,250,100,50,25],' +
|
'dsb:[16000,12000,10000,8000,6600,5200,4000,3100,2900,2400],' +
|
||||||
'am:[16000,12000,10000,8000,6600,5200,4000,3100,2900,2400],' +
|
'cw:[1000,800,600,500,400,250,150,100,50,25],' +
|
||||||
'fm:[20000,15000,12000,10000,8000,6000,5000,4000,3000,2000]};' +
|
'am:[20000,18000,16000,12000,10000,9000,8000,7000,6000,5000],' +
|
||||||
|
'fm:[11000,16000]};' +
|
||||||
'var fnpOv=null;' +
|
'var fnpOv=null;' +
|
||||||
'function fnpGrp(){var m=cur.mode|0;return(m===3||m===4)?"cw":(m===5)?"fm":(m===2||m===6||m===7)?"am":"ssb";}' +
|
'function fnpGrp(){var m=cur.mode|0;return(m===3||m===4)?"cw":(m===5)?"fm":(m===2)?"dsb":(m===6||m===7)?"am":"ssb";}' +
|
||||||
'function closeFnp(){if(fnpOv){fnpOv.remove();fnpOv=null;}document.removeEventListener("click",fnpOutside);}' +
|
'function closeFnp(){if(fnpOv){fnpOv.remove();fnpOv=null;}document.removeEventListener("click",fnpOutside);}' +
|
||||||
'function fnpOutside(e){if(fnpOv&&!fnpOv.contains(e.target)&&e.target!==q("fnpBtn"))closeFnp();}' +
|
'function fnpOutside(e){if(fnpOv&&!fnpOv.contains(e.target)&&e.target!==q("fnpBtn"))closeFnp();}' +
|
||||||
'function showFnp(){' +
|
'function showFnp(){' +
|
||||||
@@ -283,7 +285,8 @@ begin
|
|||||||
'hd.appendChild(tl);hd.appendChild(xb);fnpOv.appendChild(hd);' +
|
'hd.appendChild(tl);hd.appendChild(xb);fnpOv.appendChild(hd);' +
|
||||||
// сетка кнопок
|
// сетка кнопок
|
||||||
'var gd=document.createElement("div");' +
|
'var gd=document.createElement("div");' +
|
||||||
'gd.style.cssText="display:grid;grid-template-columns:repeat(5,1fr);gap:5px;";' +
|
'var cols=(g==="fm")?2:5;' +
|
||||||
|
'gd.style.cssText="display:grid;grid-template-columns:repeat("+cols+",1fr);gap:5px;";' +
|
||||||
'ns.forEach(function(n,i){' +
|
'ns.forEach(function(n,i){' +
|
||||||
'var b=document.createElement("button"),act=bws[i]===cb;' +
|
'var b=document.createElement("button"),act=bws[i]===cb;' +
|
||||||
'b.textContent=n;' +
|
'b.textContent=n;' +
|
||||||
|
|||||||
Reference in New Issue
Block a user