Commit Graph
76 Commits
Author SHA1 Message Date
ew8bakandClaude Sonnet 4.6 a5d08fe3d6 Fix supply voltage: apply PCB voltage dividers and read correct ADC source
Protocol Appendix A documents only the ADC reference voltage constant;
the PCB voltage divider must also be applied (from Thetis source):
- Boards 1-3 (Hermes/Angelia): ×(4.7+0.82)/0.82 ≈ 6.73, Vref=3.3V
- Board 5 (Orion MkII): ×(22+1)/1.1 ≈ 20.9, Vref=5.0V

For board type 5, supply voltage is measured via UserADC0 (bytes 57-58),
not the supply_volts field (bytes 49-50), matching Thetis behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 19:00:19 +03:00
ew8bak 1502e6ab83 Refactor VFO-B top panel layout 2026-04-28 16:16:51 +03:00
ew8bakandClaude Sonnet 4.6 055873a43a Fix IQ data flow: send HP Run=1 before DDC/DUC Specific packets
The emulator (and real hardware) creates ddc_specific_thread (port 1025),
duc_specific_thread (port 1026), and rx_thread[0..3] (ports 1035+) only
after receiving HP Run=1. Previously ConfigureDDCs and SendDUCSpecific
were sent before SetRunAndFreq(True), so both packets arrived at closed
ports and were silently dropped — ddcenable remained -1, rx_thread slept
forever, no IQ data ever arrived, and the 5-second timeout fired Run=0.

Fix: reorder DoConnectDevice to send Run=1 first, then DDC/DUC Specific.
Also add keepalive resend of the cached DDC Specific packet every 500 ms
for the first 5 seconds after start, to handle thread-startup races on
real hardware over the network.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 13:31:39 +03:00
ew8bakandClaude Sonnet 4.6 cd0cf21876 Fix supply voltage display: correct constant per board type, hide on unsupported boards
Per Appendix A of openHPSDR Ethernet Protocol v4.3:
- Boards 1,2,3 (Hermes/Angelia): V = ADC/4095 * 3.3 (was always using this)
- Boards 4,5 (Orion/Orion MkII): V = ADC/4095 * 5.0 (was wrong, showing ~66% of real value)
- Board 0 (Atlas) has no supply voltage measurement per protocol spec
  ("not Atlas bus systems")
- Boards 6 (Hermes Lite), 10 (Saturn): constant not documented, hide Supply field

ADCToSupplyVolts now takes BoardType and returns -1.0 for unsupported boards.
DoUpdateStatus omits the Supply field when -1.0 is returned.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 22:06:27 +03:00
ew8bakandClaude Sonnet 4.6 bcd045a1be Fix CAT settings: load before connect, default TCP port 19090
- 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>
2026-04-27 21:58:49 +03:00
ew8bakandClaude Sonnet 4.6 1a264b684e Fix demo spectrum at startup and frequency mismatch after STOP
- 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>
2026-04-27 21:52:11 +03:00
ew8bakandClaude Sonnet 4.6 e2affbb440 Fix frequency reset to 7115 MHz after start/stop or restart
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>
2026-04-27 21:38:23 +03:00
ew8bakandClaude Sonnet 4.6 ee9947acde Fix AGC lines not updating on spectrum
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>
2026-04-27 21:33:29 +03:00
ew8bakandClaude Sonnet 4.6 5421e57f9c Extract spectrum/waterfall rendering into SpectrumView.pas
- 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>
2026-04-27 18:28:20 +03:00
ew8bakandClaude Sonnet 4.6 36ae140cad Add full CAT support (serial + TCP)
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>
2026-04-26 21:46:19 +03:00
ew8bak 537d288e1e refactoring SettingsForm 2026-04-25 14:50:52 +03:00
ew8bak 4c48f22447 Fix waterfall BGRA color pipeline 2026-04-22 22:27:06 +03:00
ew8bak 77d380acfd fix fft, waterfall 2026-04-22 22:09:42 +03:00
ew8bak ae532a33cd start work tx 2026-03-26 22:50:55 +03:00
ew8bak 4407511d56 scroll freq 2026-03-11 22:06:37 +03:00
ew8bak 8d64bba6fc fix vfo on web 2026-03-11 21:58:23 +03:00
ew8bak 443da44e40 vix vfo-a/vfo-b 2026-03-11 21:43:37 +03:00
ew8bak 99463fa22f add splitter 2026-03-11 21:18:18 +03:00
ew8bak e131af9ae5 add gradient 2026-03-09 22:14:04 +03:00
ew8bak 01de71c60f add nb nr 2026-03-09 20:55:19 +03:00
ew8bak f216277736 samplerate button 2026-03-09 00:07:51 +03:00
ew8bak e5441be063 fix s-meter 2026-03-08 23:51:56 +03:00
ew8bak d347a26d6d fix cpu 2026-03-08 22:34:18 +03:00
ew8bak 811c96b36c draw optimization 2026-03-06 12:29:36 +03:00
ew8bak 4e171c3d35 fix button nr nb anf 2026-03-06 00:20:43 +03:00
ew8bak 7521a46bbc init 2026-03-05 16:19:26 +03:00