mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
fix(dmr): prevent TX selection on receive slices
This commit is contained in:
+10
-1
@@ -1849,6 +1849,9 @@ begin
|
|||||||
FSlices[idx].DMR := TDMRSliceDecoder.Create(Self, Id);
|
FSlices[idx].DMR := TDMRSliceDecoder.Create(Self, Id);
|
||||||
FSlices[idx].Mode := Mode;
|
FSlices[idx].Mode := Mode;
|
||||||
if Assigned(FDSPEngine) then FDSPEngine.SetSliceMode(Id, 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
|
if (OldMode = MODE_DMR) and (Mode <> MODE_DMR) then
|
||||||
FreeAndNil(FSlices[idx].DMR);
|
FreeAndNil(FSlices[idx].DMR);
|
||||||
end;
|
end;
|
||||||
@@ -2134,7 +2137,13 @@ var S: TCtrlSlice;
|
|||||||
begin
|
begin
|
||||||
if SliceId < 0 then SliceId := 0;
|
if SliceId < 0 then SliceId := 0;
|
||||||
// Слайс-источник должен существовать (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;
|
if FTxSliceId = SliceId then Exit;
|
||||||
FTxSliceId := SliceId;
|
FTxSliceId := SliceId;
|
||||||
// Передающий тракт под режим нового источника (idle-канал, применится к PTT).
|
// Передающий тракт под режим нового источника (idle-канал, применится к PTT).
|
||||||
|
|||||||
+17
-5
@@ -141,6 +141,7 @@ type
|
|||||||
function GetFilterBWForMode(ModeIdx, FilterIdx: Integer): Integer;
|
function GetFilterBWForMode(ModeIdx, FilterIdx: Integer): Integer;
|
||||||
function GetFilterLblForMode(ModeIdx, FilterIdx: Integer): string;
|
function GetFilterLblForMode(ModeIdx, FilterIdx: Integer): string;
|
||||||
function GetFilterCountForMode(ModeIdx: Integer): Integer;
|
function GetFilterCountForMode(ModeIdx: Integer): Integer;
|
||||||
|
function TxSelectionAllowed: Boolean;
|
||||||
function PanelContentH: Integer;
|
function PanelContentH: Integer;
|
||||||
function ComputeHeight: Integer;
|
function ComputeHeight: Integer;
|
||||||
procedure SetPanel(P: TFlyPanel);
|
procedure SetPanel(P: TFlyPanel);
|
||||||
@@ -423,6 +424,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TVfoOverlay.TxSelectionAllowed: Boolean;
|
||||||
|
begin
|
||||||
|
// Main A remains the normal TX source. Additional DMR slices are RX-only.
|
||||||
|
Result := FIsMain or (FMode <> 11);
|
||||||
|
end;
|
||||||
|
|
||||||
{ ---- Lifecycle ---- }
|
{ ---- Lifecycle ---- }
|
||||||
|
|
||||||
constructor TVfoOverlay.Create(AOwner: TComponent);
|
constructor TVfoOverlay.Create(AOwner: TComponent);
|
||||||
@@ -1006,13 +1013,14 @@ begin
|
|||||||
C.Font.Name := 'Courier New'; C.Font.Size := 8; C.Font.Style := [];
|
C.Font.Name := 'Courier New'; C.Font.Size := 8; C.Font.Style := [];
|
||||||
C.Font.Color := CLR_DIM; C.Brush.Style := bsClear;
|
C.Font.Color := CLR_DIM; C.Brush.Style := bsClear;
|
||||||
C.TextOut(X + 22, CurY + 1, BWStr);
|
C.TextOut(X + 22, CurY + 1, BWStr);
|
||||||
// TX badge (правый край) — кликабельно: выбор TX-слайса.
|
// TX badge: a DMR slice is visibly disabled and has no hit target.
|
||||||
// передача идёт → красный; слайс выбран для TX → янтарный; иначе → нейтральный.
|
|
||||||
R := Rect(W - PAD - 26, CurY, W - PAD, CurY + HDR_BADGE_H);
|
R := Rect(W - PAD - 26, CurY, W - PAD, CurY + HDR_BADGE_H);
|
||||||
if FTx then DrawBadge(C, R, 'TX', CLR_TX_ON, clWhite)
|
if not TxSelectionAllowed then
|
||||||
|
DrawBadge(C, R, 'TX', CLR_CARD_BG, CLR_DIM)
|
||||||
|
else if FTx then DrawBadge(C, R, 'TX', CLR_TX_ON, clWhite)
|
||||||
else if FTxSel then DrawBadge(C, R, 'TX', CLR_TX_SEL, CLR_BADGE_TXT)
|
else if FTxSel then DrawBadge(C, R, 'TX', CLR_TX_SEL, CLR_BADGE_TXT)
|
||||||
else DrawBadge(C, R, 'TX', CLR_BTN_NORM, CLR_DIM);
|
else DrawBadge(C, R, 'TX', CLR_BTN_NORM, CLR_DIM);
|
||||||
RegisterHit(R, HIT_TX);
|
if TxSelectionAllowed then RegisterHit(R, HIT_TX);
|
||||||
// SPLIT (левее TX) — кликабельно; только у главного: split = TX на VFO B,
|
// SPLIT (левее TX) — кликабельно; только у главного: split = TX на VFO B,
|
||||||
// у слайса своего B-VFO нет (кросс-частотный TX делается TX-бейджем слайса).
|
// у слайса своего B-VFO нет (кросс-частотный TX делается TX-бейджем слайса).
|
||||||
if FIsMain then
|
if FIsMain then
|
||||||
@@ -1168,7 +1176,11 @@ begin
|
|||||||
if Assigned(FOnSquelchChange) then
|
if Assigned(FOnSquelchChange) then
|
||||||
FOnSquelchChange(FSQLOn, FSQLLevel); Exit; end;
|
FOnSquelchChange(FSQLOn, FSQLLevel); Exit; end;
|
||||||
HIT_SPLIT: begin if Assigned(FOnSplit) then FOnSplit(Self); Exit; end;
|
HIT_SPLIT: begin if Assigned(FOnSplit) then FOnSplit(Self); Exit; end;
|
||||||
HIT_TX: begin if Assigned(FOnTxSelect) then FOnTxSelect(Self); Exit; end;
|
HIT_TX: begin
|
||||||
|
if TxSelectionAllowed and Assigned(FOnTxSelect) then
|
||||||
|
FOnTxSelect(Self);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
HIT_SLICE_SEL: begin if Assigned(FOnSliceSelect) then FOnSliceSelect(Self); Exit; end;
|
HIT_SLICE_SEL: begin if Assigned(FOnSliceSelect) then FOnSliceSelect(Self); Exit; end;
|
||||||
HIT_CLOSE: begin if Assigned(FOnClose) then FOnClose(Self); Exit; end;
|
HIT_CLOSE: begin if Assigned(FOnClose) then FOnClose(Self); Exit; end;
|
||||||
HIT_AUD_UP: begin if FAudScroll > 0 then Dec(FAudScroll);
|
HIT_AUD_UP: begin if FAudScroll > 0 then Dec(FAudScroll);
|
||||||
|
|||||||
Reference in New Issue
Block a user