mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
TX meter: show power and SWR in S-meter panel during transmit
- S-meter panel switches to TX mode when transmitting: single bar splits into two sub-bars (power top, SWR bottom) at the same position/size - Power bar: 0..PAMaxPower W, green; SWR bar: 1..10, amber/red past 2.5 - SWR > 2.5: red border, red label, "SWR High" warning text - Remove PWR/SWR bars and labels from TX panel (left column) - Remove FWD/SWR from status bar; remove frequency from RUNNING status Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+14
-51
@@ -353,10 +353,6 @@ type
|
||||
TrkDrive: TFlatSlider;
|
||||
BtnMOX: TFlatButton;
|
||||
BtnTUN: TFlatButton;
|
||||
PbFwdPower: TPaintBox;
|
||||
PbSWR: TPaintBox;
|
||||
LblFwdPwr: TLabel;
|
||||
LblSWRVal: TLabel;
|
||||
|
||||
// ---- Right panel ----
|
||||
PanelRight: TPanel;
|
||||
@@ -1207,8 +1203,9 @@ begin
|
||||
FSpecView.SpecRange := FSpecRange;
|
||||
FSpecView.SpecGridStep := FSpecGridStep;
|
||||
// TX overlay: ширина окна = TX_SAMPLE_RATE из движка (фикс 192k)
|
||||
FSpecView.TXSpanHz := WDSPEngine.TX_SAMPLE_RATE;
|
||||
FSpecView.TXSpanHz := WDSPEngine.TX_SAMPLE_RATE;
|
||||
FSpecView.WfFrameInterval := FWaterfallFrameInterval;
|
||||
FSpecView.PAMaxPower := FPAMaxPower;
|
||||
|
||||
FNetwork := THPSDRNetwork.Create;
|
||||
FNetwork.OnDeviceFound := OnDeviceFound;
|
||||
@@ -1415,7 +1412,7 @@ begin
|
||||
begin
|
||||
Add; Items[0].Width := 150; Items[0].Text := 'IP: --';
|
||||
Add; Items[1].Width := 120; Items[1].Text := 'Board: --';
|
||||
Add; Items[2].Width := 320; Items[2].Text := 'Supply: -- | FWD: -- | SWR: --';
|
||||
Add; Items[2].Width := 200; Items[2].Text := 'Supply: --';
|
||||
Add; Items[3].Width := 250; Items[3].Text := 'RX: waiting...';
|
||||
Add; Items[4].Width := 200; Items[4].Text := 'Not connected';
|
||||
Add; Items[5].Width := 280; Items[5].Text := 'TX: --';
|
||||
@@ -1707,7 +1704,7 @@ begin
|
||||
// TX controls
|
||||
PanelTX := TPanel.Create(Self);
|
||||
PanelTX.Parent := PanelLeft;
|
||||
PanelTX.SetBounds(0, Y, LEFT_W, 104);
|
||||
PanelTX.SetBounds(0, Y, LEFT_W, 74);
|
||||
PanelTX.BevelOuter := bvNone;
|
||||
MakeLbl(PanelTX, 'TX', 4, 2);
|
||||
|
||||
@@ -1728,27 +1725,6 @@ begin
|
||||
BtnTUN := MakeBtn(PanelTX, 'TUN', 56, 38, 50, 32, BtnTUNClick);
|
||||
BtnTUN.Font.Size := 12; BtnTUN.Font.Bold := True;
|
||||
|
||||
LblFwdPwr := TLabel.Create(Self);
|
||||
LblFwdPwr.Parent := PanelTX; LblFwdPwr.Left := 112; LblFwdPwr.Top := 42;
|
||||
LblFwdPwr.Caption := '0W'; LblFwdPwr.Font.Color := CLR_METER_ON;
|
||||
LblFwdPwr.Font.Name := 'Courier New'; LblFwdPwr.Font.Size := 8;
|
||||
|
||||
LblSWRVal := TLabel.Create(Self);
|
||||
LblSWRVal.Parent := PanelTX; LblSWRVal.Left := 156; LblSWRVal.Top := 42;
|
||||
LblSWRVal.Caption := 'SWR:1.0'; LblSWRVal.Font.Color := CLR_TEXTDIM;
|
||||
LblSWRVal.Font.Name := 'Courier New'; LblSWRVal.Font.Size := 8;
|
||||
|
||||
MakeLbl(PanelTX, 'PWR', 4, 76);
|
||||
PbFwdPower := TPaintBox.Create(Self);
|
||||
PbFwdPower.Parent := PanelTX;
|
||||
PbFwdPower.SetBounds(34, 74, LEFT_W - 38, 12);
|
||||
PbFwdPower.OnPaint := FSpecView.PaintFwdPower;
|
||||
|
||||
MakeLbl(PanelTX, 'SWR', 4, 92);
|
||||
PbSWR := TPaintBox.Create(Self);
|
||||
PbSWR.Parent := PanelTX;
|
||||
PbSWR.SetBounds(34, 90, LEFT_W - 38, 12);
|
||||
PbSWR.OnPaint := FSpecView.PaintSWR;
|
||||
|
||||
// ---- Right panel ----
|
||||
PanelRight := TPanel.Create(Self);
|
||||
@@ -2288,14 +2264,10 @@ begin
|
||||
PbWaterfall.Color := T.BG;
|
||||
if PanelSMeterRight <> nil then PanelSMeterRight.Color := T.Panel;
|
||||
if PbSMeterRight <> nil then PbSMeterRight.Color := T.Panel;
|
||||
PbFwdPower.Color := T.BG;
|
||||
PbSWR.Color := T.BG;
|
||||
|
||||
// Метки
|
||||
DL(LblAGCTop, False);
|
||||
DL(LblDrv); DL(LblSpan);
|
||||
LblFwdPwr.Font.Color := T.MeterOn;
|
||||
LblSWRVal.Font.Color := T.TextDim;
|
||||
|
||||
// Кнопки тулбара
|
||||
BtnDiscover.ClrNorm := T.TbDiscoverNorm;
|
||||
@@ -2656,11 +2628,12 @@ begin
|
||||
FSMeterPeak := FSMeterPeak + PeakAlpha * (PeakTarget - FSMeterPeak);
|
||||
FSMeterMin := FSMeterMin + MinAlpha * (MinTarget - FSMeterMin);
|
||||
|
||||
FSpecView.LastSMeter := FLastSMeter;
|
||||
FSpecView.SMeterPeak := FSMeterPeak;
|
||||
FSpecView.SMeterMin := FSMeterMin;
|
||||
FSpecView.LastFwdW := FLastFwdW;
|
||||
FSpecView.LastSWR := FLastSWR;
|
||||
FSpecView.LastSMeter := FLastSMeter;
|
||||
FSpecView.SMeterPeak := FSMeterPeak;
|
||||
FSpecView.SMeterMin := FSMeterMin;
|
||||
FSpecView.LastFwdW := FLastFwdW;
|
||||
FSpecView.LastSWR := FLastSWR;
|
||||
FSpecView.Transmitting := FTransmitting;
|
||||
|
||||
if PbSMeterRight <> nil then PbSMeterRight.Invalidate;
|
||||
// PWR/SWR метки и бары обновляем здесь (10 Гц), а не в DoUpdateStatus —
|
||||
@@ -2991,22 +2964,11 @@ procedure TMainForm.UpdateTXMeters;
|
||||
var
|
||||
PLLStr: string;
|
||||
begin
|
||||
if LblFwdPwr <> nil then
|
||||
LblFwdPwr.Caption := Format('%.0fW', [FLastFwdW]);
|
||||
if LblSWRVal <> nil then
|
||||
LblSWRVal.Caption := Format('SWR:%.1f', [FLastSWR]);
|
||||
if PbFwdPower <> nil then PbFwdPower.Invalidate;
|
||||
if PbSWR <> nil then PbSWR.Invalidate;
|
||||
|
||||
if FLastPLLLock then PLLStr := 'PLL OK' else PLLStr := 'PLL?';
|
||||
if FLastSupplyV >= 0 then
|
||||
StatusBar1.Panels[2].Text :=
|
||||
Format('Supply: %.1fV | FWD: %.0fW | SWR: %.1f | %s',
|
||||
[FLastSupplyV, FLastFwdW, FLastSWR, PLLStr])
|
||||
StatusBar1.Panels[2].Text := Format('Supply: %.1fV | %s', [FLastSupplyV, PLLStr])
|
||||
else
|
||||
StatusBar1.Panels[2].Text :=
|
||||
Format('FWD: %.0fW | SWR: %.1f | %s',
|
||||
[FLastFwdW, FLastSWR, PLLStr]);
|
||||
StatusBar1.Panels[2].Text := PLLStr;
|
||||
end;
|
||||
|
||||
procedure TMainForm.OnDDCIQCB(DDCIndex: Integer; const Data: TDDCIQPacket);
|
||||
@@ -3696,7 +3658,7 @@ begin
|
||||
|
||||
BtnStartStop.Caption := 'STOP';
|
||||
StyleButton(BtnStartStop, True);
|
||||
StatusBar1.Panels[4].Text := 'RUNNING ' + FormatFreq(FVfoA);
|
||||
StatusBar1.Panels[4].Text := 'RUNNING';
|
||||
BtnMOX.Enabled := True;
|
||||
end;
|
||||
|
||||
@@ -5535,6 +5497,7 @@ procedure TMainForm.OnPASettingsChange(MaxPower: Double;
|
||||
var i: Integer;
|
||||
begin
|
||||
FPAMaxPower := MaxPower;
|
||||
if FSpecView <> nil then FSpecView.PAMaxPower := MaxPower;
|
||||
for i := 0 to BAND_COUNT - 1 do
|
||||
begin
|
||||
if i <= High(BandCal) then
|
||||
|
||||
Reference in New Issue
Block a user