fix(dmr): prevent TX selection on receive slices

This commit is contained in:
2026-07-14 20:31:21 +03:00
parent 53aef502e9
commit e5451b7843
2 changed files with 27 additions and 6 deletions
+10 -1
View File
@@ -1849,6 +1849,9 @@ begin
FSlices[idx].DMR := TDMRSliceDecoder.Create(Self, Id);
FSlices[idx].Mode := Mode;
if Assigned(FDSPEngine) then FDSPEngine.SetSliceMode(Id, Mode);
// DMR is receive-only. If this slice used to be the TX source, hand TX back
// to the main receiver as soon as it enters DMR.
if (Mode = MODE_DMR) and (FTxSliceId = Id) then SetTxSlice(0);
if (OldMode = MODE_DMR) and (Mode <> MODE_DMR) then
FreeAndNil(FSlices[idx].DMR);
end;
@@ -2134,7 +2137,13 @@ var S: TCtrlSlice;
begin
if SliceId < 0 then SliceId := 0;
// Слайс-источник должен существовать (0 = главный всегда валиден).
if (SliceId > 0) and not GetSlice(SliceId, S) then Exit;
if SliceId > 0 then
begin
if not GetSlice(SliceId, S) then Exit;
// EWSDR has no DMR transmitter/AMBE encoder. Do not accidentally use the
// analog WFM transmitter for a receive-only DMR slice.
if S.Mode = MODE_DMR then Exit;
end;
if FTxSliceId = SliceId then Exit;
FTxSliceId := SliceId;
// Передающий тракт под режим нового источника (idle-канал, применится к PTT).