Add configurable VFO frequency range with GHz support

- Settings > Display: new "VFO Display" control to select max frequency
  range (999 MHz / 9.999 GHz / 99.999 GHz), persisted as freq_mhz_digits
- FreqDisplay: extend digit map [0..10] to support up to 11 digit positions;
  keyboard navigation adapts to MinMhzDigits dynamically
- MainForm/LayoutTopVfoBlock: VFO panel width scales automatically with
  selected digit count using dynamic text measurement
- Web VFO: fix broken HTML (class attr not closed before data-s — wheel and
  hover were completely non-functional); rewrite fmtVfo to use variable MHz
  digit count synced from server state; fix missing </span> for .vfo-hz
- WebServer: publish freq_mhz_digits in state JSON; updated from
  ApplyFreqMhzDigits so desktop and web stay in sync
- Fix Int32 overflow on frequencies above ~2.15 GHz: CATEngine.Pad V param
  Int64, FormatFreq/FormatFreqSV Mhz var Int64 (Mhz*1000000 overflowed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 13:13:52 +03:00
co-authored by Claude Sonnet 4.6
parent 5ac7ddc976
commit efc21b92e6
8 changed files with 105 additions and 35 deletions
+9 -9
View File
@@ -36,8 +36,8 @@ type
FCenterText: Boolean;
FOnChange: TFreqChangeEvent;
FHoverDigit: Integer; // 0=единицы .. 8=100МГц, -1=нет
FDigitX: array[0..8] of Integer; // X левого края каждой цифры
FHoverDigit: Integer; // 0=единицы .. 10=10ГГц, -1=нет
FDigitX: array[0..10] of Integer; // X левого края каждой цифры
FDigitW: Integer;
FCharH: Integer;
@@ -125,7 +125,7 @@ var
begin
Result := -1;
if FDigitW = 0 then Exit;
for i := 0 to 8 do
for i := 0 to 10 do
if (X >= FDigitX[i]) and (X < FDigitX[i] + FDigitW) then
begin
Result := i;
@@ -137,14 +137,14 @@ end;
// Цифры нумеруются справа налево: digit0=единицы, digit8=сотни млн
procedure TFreqDisplay.BuildDigitMap(const S: string; StartX: Integer);
var
Xs: array[0..11] of Integer; // X каждого символа строки (макс 12 симв)
Xs: array[0..13] of Integer; // X каждого символа строки (макс 14 симв)
ci: Integer;
xi: Integer;
dIdx: Integer;
len: Integer;
begin
len := Length(S);
if len > 12 then len := 12;
if len > 13 then len := 13;
xi := StartX;
for ci := 0 to len - 1 do
@@ -159,7 +159,7 @@ begin
begin
if S[ci + 1] <> '.' then
begin
if dIdx <= 8 then
if dIdx <= 10 then
FDigitX[dIdx] := Xs[ci];
Inc(dIdx);
end;
@@ -185,7 +185,7 @@ var
ch: Char;
dIdx: Integer;
col: TColor;
DiChar: array[0..11] of Integer;
DiChar: array[0..13] of Integer;
tmpIdx: Integer;
len: Integer;
begin
@@ -234,7 +234,7 @@ begin
// Строим обратную карту символ → digit index
len := Length(S);
if len > 12 then len := 12;
if len > 13 then len := 13;
tmpIdx := 0;
for ci := len - 1 downto 0 do
begin
@@ -385,7 +385,7 @@ begin
VK_DOWN: begin ChangeByDigit(d, -1); Key := 0; end;
VK_LEFT: begin
if FHoverDigit < 0 then FHoverDigit := 3;
if FHoverDigit < 8 then Inc(FHoverDigit);
if FHoverDigit < FMinMhzDigits + 5 then Inc(FHoverDigit);
Invalidate; Key := 0;
end;
VK_RIGHT: begin