Align spectrum grid and ruler to FM tuning step

When FM mode is active, vertical grid lines and frequency labels snap to
FM channel boundaries (FM_STEP_HZ) instead of the fixed 8-division layout.
Grid and label density auto-adapt: lines thinner than 4px are thinned,
labels are spaced so they never overlap (short tick shown between labeled
lines). Grid cache invalidates on center-freq, step, or span changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 22:44:32 +03:00
co-authored by Claude Sonnet 4.6
parent a59501f2c4
commit 7b4ea733a2
2 changed files with 115 additions and 18 deletions
+6
View File
@@ -2797,6 +2797,10 @@ begin
FSpecView.SpanHz := FSpanHz;
FSpecView.Mode := FMode;
FSpecView.FilterBW := FFilterBW;
if FMode = MODE_FM then
FSpecView.FMGridStepHz := FM_STEP_HZ[FFMStepIdx]
else
FSpecView.FMGridStepHz := 0;
// TX overlay следует за активной TX-частотой (учитывает split). При CTUN
// спектр TX будет отрисован на VFO, а не в центре дисплея.
FSpecView.TXFreq := ActiveTXFreqHz;
@@ -4805,6 +4809,8 @@ begin
if FBtnFMSteps[Idx] <> nil then
FBtnFMSteps[Idx].Active := True;
if FWebServer <> nil then FWebServer.FMStepIdx := Idx;
if (FMode = MODE_FM) and (FSpecView <> nil) then
FSpecView.FMGridStepHz := FM_STEP_HZ[Idx];
end;
procedure TMainForm.BtnFMStepClick(Sender: TObject);