add alert ADC overload

This commit is contained in:
2026-05-21 15:42:59 +03:00
parent b5103bf474
commit 960cadd4b0
2 changed files with 25 additions and 7 deletions
+24 -6
View File
@@ -151,8 +151,10 @@ type
FSupplyA: Double;
FPLLLock: Boolean;
FHWPTT: Boolean;
FADCOverload: Byte;
public
constructor Create(AForm: TObject; FW, SW, SV, SA: Double; PLL, HWPTT: Boolean);
constructor Create(AForm: TObject; FW, SW, SV, SA: Double; PLL, HWPTT: Boolean;
ADCOverload: Byte);
procedure Execute;
end;
@@ -473,7 +475,8 @@ type
// Public UI update (called from sync objects)
procedure DoAddDevice(const Dev: THPSDRDevice; const Entry: string);
procedure DoUpdateStatus(FwdW, SWRV, SupplyV, SupplyA: Double; PLLLock, HWPTT: Boolean);
procedure DoUpdateStatus(FwdW, SWRV, SupplyV, SupplyA: Double; PLLLock, HWPTT: Boolean;
ADCOverload: Byte);
procedure UpdateTXMeters;
procedure DoUpdateDDCSeq(DDCIdx: Integer; Seq: LongWord);
procedure DoUpdateDDCSeqOrNoDevice(DDCIdx: Integer; Seq: LongWord);
@@ -883,7 +886,7 @@ begin
end;
constructor TStatusUISync.Create(AForm: TObject;
FW, SW, SV, SA: Double; PLL, HWPTT: Boolean);
FW, SW, SV, SA: Double; PLL, HWPTT: Boolean; ADCOverload: Byte);
begin
inherited Create;
FForm := AForm;
@@ -893,11 +896,13 @@ begin
FSupplyA := SA;
FPLLLock := PLL;
FHWPTT := HWPTT;
FADCOverload := ADCOverload;
end;
procedure TStatusUISync.Execute;
begin
TMainForm(FForm).DoUpdateStatus(FFwdW, FSWRV, FSupplyV, FSupplyA, FPLLLock, FHWPTT);
TMainForm(FForm).DoUpdateStatus(FFwdW, FSWRV, FSupplyV, FSupplyA, FPLLLock, FHWPTT,
FADCOverload);
end;
constructor TDDCSeqSync.Create(AForm: TObject; Idx: Integer; Seq: LongWord);
@@ -2617,6 +2622,10 @@ begin
SetStatusText(5, 'TX idle');
SetStatusText(6, 'SEQ --');
SetStatusText(7, 'PLL --');
if FSpecView <> nil then
FSpecView.ADCOverloadVisible := False;
if PbSpectrum <> nil then
PbSpectrum.Invalidate;
FillChar(FDDCSeqValid, SizeOf(FDDCSeqValid), 0);
FSeqErrorCount := 0;
FLastSeqErrorDDC := -1;
@@ -3250,7 +3259,8 @@ begin
if not IsTx then FwdW := 0;
Sync := TStatusUISync.Create(Self, FwdW, SWRV, SupplyV, SupplyA,
(Status.StatusBits and HPS_PLL_LOCKED) <> 0,
(Status.StatusBits and HPS_PTT) <> 0);
(Status.StatusBits and HPS_PTT) <> 0,
Status.ADCOverload);
try
M := Sync.Execute;
TThread.Synchronize(nil, M);
@@ -3259,7 +3269,8 @@ begin
end;
end;
procedure TMainForm.DoUpdateStatus(FwdW, SWRV, SupplyV, SupplyA: Double; PLLLock, HWPTT: Boolean);
procedure TMainForm.DoUpdateStatus(FwdW, SWRV, SupplyV, SupplyA: Double; PLLLock, HWPTT: Boolean;
ADCOverload: Byte);
const
// Thetis/piHPSDR PEP-style баллистика для FwdW и SWR: атака мгновенная
// (peak-hold), спад медленный — стрелка «висит» на пике и плавно опускается.
@@ -3305,6 +3316,13 @@ begin
FLastSupplyA := -1.0;
FLastPLLLock := PLLLock;
if (FSpecView <> nil) and (FSpecView.ADCOverloadVisible <> (ADCOverload <> 0)) then
begin
FSpecView.ADCOverloadVisible := ADCOverload <> 0;
if PbSpectrum <> nil then
PbSpectrum.Invalidate;
end;
// Hardware PTT (foot switch / mic PTT) — обнаружение фронта (нужно делать
// на rate HP Status, а не таймера, чтобы не пропустить короткое нажатие).
if HWPTT <> FHWPTTActive then