mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
Reduce timer-tick CPU load by removing per-tick ResizeSMeter and throttling AGC line updates
- Remove ResizeSMeter (Pango font measurement + multiple SetBounds) from 60 Hz timer tick; it is still called on actual resize events - Throttle UpdateAGCLines WDSP API calls from 60 Hz to ~10 Hz (every 6 ticks) - Optimize spectrum alpha-fix loop: write-only byte access instead of read-modify-write DWORD Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+9
-4
@@ -301,6 +301,7 @@ type
|
||||
// Waterfall frame timing
|
||||
FWaterfallFrameInterval: Integer;
|
||||
FWaterfallFrameCounter: Integer;
|
||||
FAgcLineCounter: Integer;
|
||||
// ---- Splitter ----
|
||||
FSplitterDrag: Boolean;
|
||||
FSplitterDragY0: Integer;
|
||||
@@ -2874,7 +2875,6 @@ begin
|
||||
((PbWaterfall.Width <> FSpectrumWidth) or
|
||||
(PbWaterfall.Height <> FWaterfallHeight))) then
|
||||
ResizeSpectrumPanels;
|
||||
ResizeSMeter;
|
||||
if FSpectrumWidth <= 0 then Exit;
|
||||
SyncSpecViewFreq;
|
||||
|
||||
@@ -2920,9 +2920,14 @@ begin
|
||||
begin
|
||||
FLastSMeter := FDSPEngine.GetSMeterDBm;
|
||||
FDSPEngine.SetSpectrumWidth(FSpectrumWidth);
|
||||
FDSPEngine.UpdateAGCLines(FSpectrumWidth);
|
||||
FSpecView.AGCThresh := FDSPEngine.AGCThresh;
|
||||
FSpecView.AGCHangLevel := FDSPEngine.AGCHangLevel;
|
||||
Inc(FAgcLineCounter);
|
||||
if FAgcLineCounter >= 6 then
|
||||
begin
|
||||
FDSPEngine.UpdateAGCLines(FSpectrumWidth);
|
||||
FSpecView.AGCThresh := FDSPEngine.AGCThresh;
|
||||
FSpecView.AGCHangLevel := FDSPEngine.AGCHangLevel;
|
||||
FAgcLineCounter := 0;
|
||||
end;
|
||||
end;
|
||||
FSpecView.WDSPReady := FWDSPReady;
|
||||
// Обновляем оверлей если видим
|
||||
|
||||
Reference in New Issue
Block a user