Web TX meter: show power/SWR in S-meter canvas during transmit

- WebServer: add fwd_w, swr, pa_max_power to state JSON and PushSpectrum
- MainForm: pass FLastFwdW, FLastSWR, FPAMaxPower to PushSpectrum
- Web UI: paintSM switches to paintTXMeter when transmitting/tuning;
  same layout as desktop — two sub-bars at 44-58% height, power ticks
  above, SWR ticks below, SWR>2.5 turns red with "SWR High" label

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 14:14:52 +03:00
co-authored by Claude Sonnet 4.6
parent 96b0ccb2c7
commit 76e5c5514a
3 changed files with 86 additions and 5 deletions
+18 -4
View File
@@ -247,6 +247,10 @@ type
FCurrentXvtr: Integer; // -1 = HF, иначе индекс активного XVTR
FOnXvtrBand: TWebCmdXvtrBand;
FFwdW: Double;
FSWR: Double;
FPAMaxPower: Double;
FWebClientActive: Boolean;
// ── Внутренние методы ──
@@ -290,7 +294,8 @@ type
CenterHz: Double; FilterIdx: Integer;
VfoB: Double; ActiveVfo: Integer;
Transmitting: Boolean; DriveLevel: Integer;
AttnIdx: Integer; Tuning: Boolean; Duplex: Boolean);
AttnIdx: Integer; Tuning: Boolean; Duplex: Boolean;
FwdW, SWRV, PAMaxPower: Double);
property WebClientActive: Boolean read FWebClientActive;
property FreqMhzDigits: Integer read FFreqMhzDigits write FFreqMhzDigits;
@@ -419,8 +424,11 @@ begin
FAGCTop := 90;
FSpanHz := 192000;
FVolume := 70;
FSMeter := -120;
FBandIdx := 5;
FSMeter := -120;
FFwdW := 0;
FSWR := 1.0;
FPAMaxPower := 100.0;
FBandIdx := 5;
FCurrentXvtr := -1;
FFreqMhzDigits := 3;
SetLength(FXvtrBands, 0);
@@ -1236,6 +1244,7 @@ begin
'"running":%s,"mute":%s,"ctun":%s,' +
'"nr_mode":%d,"nr":%s,"nb_mode":%d,"nb":%s,"snb":%s,"anf":%s,"connected":%s,' +
'"transmitting":%s,"drive":%d,"attn_idx":%d,"tuning":%s,"dup":%s,' +
'"fwd_w":%.1f,"swr":%.2f,"pa_max_power":%.0f,' +
'"xvtr_current":%d,"xvtr_bands":%s,"freq_mhz_digits":%d}',
[FFreq, FVfoB, FActiveVfo,
FMode, MODE_N[FMode mod 8],
@@ -1260,6 +1269,7 @@ begin
FAttnIdx,
BoolToStr(FTuning, 'true', 'false'),
BoolToStr(FDuplex, 'true', 'false'),
FFwdW, FSWR, FPAMaxPower,
FCurrentXvtr, XvtrJson, FFreqMhzDigits
], FS);
finally
@@ -1327,7 +1337,8 @@ procedure TWebServer.PushSpectrum(
CenterHz: Double; FilterIdx: Integer;
VfoB: Double; ActiveVfo: Integer;
Transmitting: Boolean; DriveLevel: Integer;
AttnIdx: Integer; Tuning: Boolean; Duplex: Boolean);
AttnIdx: Integer; Tuning: Boolean; Duplex: Boolean;
FwdW, SWRV, PAMaxPower: Double);
var N, i: Integer;
begin
if not FRunning then Exit;
@@ -1364,6 +1375,9 @@ begin
FAttnIdx := AttnIdx;
FTuning := Tuning;
FDuplex := Duplex;
FFwdW := FwdW;
FSWR := SWRV;
FPAMaxPower := PAMaxPower;
finally
FStateLock.Leave;
end;