mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 17:27:32 +00:00
feat(dmr): show stable status on receiver slices
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user