PurgeLoop used Sleep(5000) — Stop had to wait up to 5 seconds for the
purge thread to wake before it could proceed. Fix: add TEvent FStopEvent;
Stop signals it before waiting on threads so PurgeLoop exits immediately.
Also moved client Disconnect calls before WaitFor so all sockets are
unblocked in parallel rather than sequentially.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Settings.pas: add root-level SaveCATSettings/LoadCATSettings so CAT
config is stored independently of device MAC.
- MainForm.pas FormCreate: initialize CAT defaults, load from saved
'cat' JSON section, and apply immediately after InitCATEngine — so
SettingsForm shows correct values before the transceiver connects.
- MainForm.pas OnCATSettingsChange: always save to root 'cat' section
(not only when device is connected) so changes persist immediately.
- Default TCP CAT port changed from 4992 to 19090 everywhere.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove FillDemoSpectrum from FormCreate: spectrum no longer shows
fake signal data before the transceiver is connected.
- Add SaveStartupPreview to STOP path: startup.vfo_a now matches the
device band cache so the display is consistent before and after
clicking START on a fresh launch.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Save current band and global settings in the STOP path so the next
START restores the frequency the user was on, not the hardcoded default.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three params were never synced to FSpecView after FormCreate:
- WDSPReady: now set every timer tick so the draw branch (real
WDSP thresh/hang vs. static AGCTop) is always correct
- AGCThresh/AGCHangLevel: synced from FDSPEngine after
UpdateAGCLines in SpectrumTimerTick
- AGCTop: synced in TrkAGCChange, RestoreBand and DoConnectDevice
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add FRulerLastSpan to ruler cache — previously only FCenterFreq
and ActiveVfoFreq were tracked, so span changes left the ruler
showing stale frequency step marks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New unit SpectrumView.pas (TSpectrumView): encapsulates all
spectrum, waterfall, ruler and S-meter rendering; ~900 lines
removed from MainForm.pas
- Fix marker bug: FMarkerActive/FMarkerX were duplicated in
MainForm and TSpectrumView — mouse handlers now write directly
to FSpecView, stale MainForm fields removed
- Fix filter band and ruler not following VFO: add SyncSpecViewFreq
helper called at every draw site and at top of SpectrumTimerTick
- Remove dead code: WFALL_PALETTE (34 lines), FSplitter, LblAGC,
LblVol, WinFirewall/IntfGraphics/FPImage from uses
- Fix pre-existing bug: SidetoneFreqLo := 600 overflowed Byte,
replaced with Hi(600)/Lo(600)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New units: CATEngine (Kenwood + Thetis ZZ* commands), CATSerial
(up to 4 serial ports), CATTcp (multi-client TCP server on port 4992).
MainForm wired with TCATContext callbacks reusing existing WebOn* handlers.
SettingsForm gets a new CAT tab with 4 serial port groups and TCP section.
Settings.pas extended with CAT config fields (per-device, JSON-persisted).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>