feat(dmr): default tuning step to 12.5 kHz

This commit is contained in:
2026-07-14 20:51:10 +03:00
parent 5cfd585eea
commit 62e663baf5
3 changed files with 60 additions and 22 deletions
+42 -18
View File
@@ -1535,7 +1535,8 @@ begin
begin
if FStepDropDown <> nil then FStepDropDown.SetItemIndex(FController.FFMStepIdx);
if FWebServer <> nil then FWebServer.FMStepIdx := FController.FFMStepIdx;
if (FController.FMode = MODE_FM) and (FSpecView <> nil) then
if (FController.FMode in [MODE_FM, MODE_DMR]) and
(FSpecView <> nil) then
FSpecView.FMGridStepHz := FM_STEP_HZ[FController.FFMStepIdx];
end;
rfFMStep:
@@ -3237,7 +3238,7 @@ begin
FSpecView.SpanHz := ViewSpan;
FSpecView.Mode := FController.FMode;
FSpecView.FilterBW := FController.FFilterBW;
if FController.FMode = MODE_FM then
if FController.FMode in [MODE_FM, MODE_DMR] then
FSpecView.FMGridStepHz := FM_STEP_HZ[FController.FFMStepIdx]
else
FSpecView.FMGridStepHz := 0;
@@ -4218,11 +4219,26 @@ begin
Exit;
end;
// Non-FM: restore full 2-row height and 5-column layout, hide FM panels
// Non-FM: restore full 2-row height and 5-column layout, hide FM panels.
// DMR reuses only the tuning STEP panel; SQL/CTCSS/repeater stay FM-only.
PanelFilter.Height := 74;
if PanelFMSQ <> nil then PanelFMSQ.Visible := False;
if PanelFMCTCSS <> nil then PanelFMCTCSS.Visible := False;
if PanelFMStep <> nil then begin CloseFMStepPopup; PanelFMStep.Visible := False; end;
if PanelFMStep <> nil then
begin
if FController.FMode = MODE_DMR then
begin
StyleButton(BtnFMStep, FController.FFMStepOn);
if FStepDropDown <> nil then
FStepDropDown.SetItemIndex(FController.FFMStepIdx);
PanelFMStep.Visible := True;
end
else
begin
CloseFMStepPopup;
PanelFMStep.Visible := False;
end;
end;
if PanelFMRpt <> nil then PanelFMRpt.Visible := False;
if FController.FMode = MODE_WFM then
@@ -4472,7 +4488,8 @@ var
ViewCenter, ViewSpan: Double;
begin
if PanelWidth <= 0 then Exit;
if (FController.FMode = MODE_FM) and FController.FFMStepOn then
if (FController.FMode in [MODE_FM, MODE_DMR]) and
FController.FFMStepOn then
StepHz := FM_STEP_HZ[FController.FFMStepIdx]
else
StepHz := 100;
@@ -4496,7 +4513,8 @@ begin
if (FWidebandView = nil) or
(not FWidebandView.TryPixelToFrequency(PixelX, PanelWidth, FreqHz)) then Exit;
if (FController.FMode = MODE_FM) and FController.FFMStepOn then
if (FController.FMode in [MODE_FM, MODE_DMR]) and
FController.FFMStepOn then
StepHz := FM_STEP_HZ[FController.FFMStepIdx]
else
StepHz := 100;
@@ -6037,28 +6055,31 @@ end;
procedure TMainForm.PanClickTune(P: TPanafallPanel; X, W: Integer);
// Клик по фону доп. пана = перестроить его слайс на частоту клика (аналог
// DoSpectrumClick главного: снап к 100 Гц). Цель — активный слайс, если он
// живёт в этом пане, иначе первый слайс пана; слайсов нет — создать в точке.
const
StepHz = 100;
// DoSpectrumClick главного). Цель — активный слайс, если он живёт в этом
// пане, иначе первый слайс пана; слайсов нет — создать в точке.
var
VC, VS, LoHz, HiHz: Double;
Hz: Int64;
Hz, StepHz: Int64;
Id: Integer;
S: TCtrlSlice;
begin
PanViewWindow(P, VC, VS);
if (W <= 0) or (VS <= 0) then Exit;
Hz := Round(VC + (X / W - 0.5) * VS);
Hz := ((Hz + StepHz div 2) div StepHz) * StepHz;
FController.CapturedSpan(LoHz, HiHz, P.PanId);
if Hz < LoHz then Hz := Round(LoHz);
if Hz > HiHz then Hz := Round(HiHz);
if (FActiveSliceId <> 0) and FController.GetSlice(FActiveSliceId, S) and
(S.PanId = P.PanId) then
Id := FActiveSliceId
else
Id := P.FirstSliceId;
StepHz := 100;
if ((Id <> 0) and FController.GetSlice(Id, S) and
(S.Mode = MODE_DMR)) or
((Id = 0) and (FController.FMode = MODE_DMR)) then
StepHz := 12500;
Hz := Round(VC + (X / W - 0.5) * VS);
Hz := ((Hz + StepHz div 2) div StepHz) * StepHz;
FController.CapturedSpan(LoHz, HiHz, P.PanId);
if Hz < LoHz then Hz := Round(LoHz);
if Hz > HiHz then Hz := Round(HiHz);
if Id = 0 then
begin
AddSliceAtFreqPan(P, Hz);
@@ -7571,7 +7592,9 @@ begin
end;
if (SliceId <> 0) and FController.GetSlice(SliceId, Sl) then
begin
if (ssCtrl in Shift) and (ssShift in Shift) then Step := 1000000
if (Sl.Mode = MODE_DMR) and
not ((ssCtrl in Shift) or (ssShift in Shift)) then Step := 12500
else if (ssCtrl in Shift) and (ssShift in Shift) then Step := 1000000
else if ssCtrl in Shift then Step := 1000
else if ssShift in Shift then Step := 10
else Step := 100;
@@ -7593,7 +7616,8 @@ begin
Handled := True;
Exit;
end;
if (FController.FMode = MODE_FM) and FController.FFMStepOn and
if (FController.FMode in [MODE_FM, MODE_DMR]) and
FController.FFMStepOn and
not ((ssCtrl in Shift) or (ssShift in Shift)) then
Step := FM_STEP_HZ[FController.FFMStepIdx]
else if (ssCtrl in Shift) and (ssShift in Shift) then Step := 1000000