feat(dmr): show stable status on receiver slices

This commit is contained in:
2026-07-14 21:23:24 +03:00
parent 8b28986fec
commit 7c4b024186
3 changed files with 140 additions and 3 deletions
+20
View File
@@ -141,6 +141,7 @@ type
constructor Create(AOwner: TRadioController; ASliceId: Integer);
destructor Destroy; override;
procedure FeedAudio(const Left, Right: array of Single; Count: Integer);
procedure GetStatus(out S: TDMRStatus);
end;
// Слайс уровня контроллера: логическая обёртка над WDSP-слайс-каналом
@@ -697,6 +698,7 @@ type
function GetBeaconScope(out S: TBeaconScope): Boolean;
function GetBeaconFrame(out Frame: TBeaconFrame; out RSErrors: Integer): Boolean;
function GetDMRStatus(out S: TDMRStatus): Boolean;
function GetSliceDMRStatus(SliceId: Integer; out S: TDMRStatus): Boolean;
// Отображение / приём
procedure SetCTun(On_: Boolean);
@@ -839,6 +841,12 @@ begin
if Assigned(FDecoder) then FDecoder.FeedAudio(Left, Right, Count);
end;
procedure TDMRSliceDecoder.GetStatus(out S: TDMRStatus);
begin
if Assigned(FDecoder) then FDecoder.GetStatus(S)
else FillChar(S, SizeOf(S), 0);
end;
procedure TDMRSliceDecoder.AudioReady(const PCM: array of Single;
Count: Integer);
begin
@@ -2380,6 +2388,18 @@ begin
else FillChar(S, SizeOf(S), 0);
end;
function TRadioController.GetSliceDMRStatus(SliceId: Integer;
out S: TDMRStatus): Boolean;
var
Idx: Integer;
begin
Idx := FindSliceIndex(SliceId);
Result := (Idx >= 0) and (FSlices[Idx].Mode = MODE_DMR) and
Assigned(FSlices[Idx].DMR);
if Result then FSlices[Idx].DMR.GetStatus(S)
else FillChar(S, SizeOf(S), 0);
end;
// Кромки полосы под режим/полосу (единый расчёт для главного канала и слайсов).
class procedure TRadioController.FilterEdgesFor(Mode, BW: Integer; out Lo, Hi: Integer);
var Half: Integer;