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
+17 -5
View File
@@ -141,6 +141,7 @@ type
function GetFilterBWForMode(ModeIdx, FilterIdx: Integer): Integer;
function GetFilterLblForMode(ModeIdx, FilterIdx: Integer): string;
function GetFilterCountForMode(ModeIdx: Integer): Integer;
function TxSelectionAllowed: Boolean;
function PanelContentH: Integer;
function ComputeHeight: Integer;
procedure SetPanel(P: TFlyPanel);
@@ -423,6 +424,12 @@ begin
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 ---- }
constructor TVfoOverlay.Create(AOwner: TComponent);
@@ -1006,13 +1013,14 @@ begin
C.Font.Name := 'Courier New'; C.Font.Size := 8; C.Font.Style := [];
C.Font.Color := CLR_DIM; C.Brush.Style := bsClear;
C.TextOut(X + 22, CurY + 1, BWStr);
// TX badge (правый край) — кликабельно: выбор TX-слайса.
// передача идёт → красный; слайс выбран для TX → янтарный; иначе → нейтральный.
// TX badge: a DMR slice is visibly disabled and has no hit target.
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 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,
// у слайса своего B-VFO нет (кросс-частотный TX делается TX-бейджем слайса).
if FIsMain then
@@ -1168,7 +1176,11 @@ begin
if Assigned(FOnSquelchChange) then
FOnSquelchChange(FSQLOn, FSQLLevel); 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_CLOSE: begin if Assigned(FOnClose) then FOnClose(Self); Exit; end;
HIT_AUD_UP: begin if FAudScroll > 0 then Dec(FAudScroll);