mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
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>
This commit is contained in:
+10
-4
@@ -2291,7 +2291,8 @@ begin
|
||||
ExcPwr := (Status.ExciterPwr0Hi shl 8) or Status.ExciterPwr0Lo;
|
||||
FwdPwr := (Status.FwdPwrAlex0Hi shl 8) or Status.FwdPwrAlex0Lo;
|
||||
RevPwr := (Status.RevPwrAlex0Hi shl 8) or Status.RevPwrAlex0Lo;
|
||||
SupplyV := ADCToSupplyVolts((Status.SupplyVoltsHi shl 8) or Status.SupplyVoltsLo);
|
||||
SupplyV := ADCToSupplyVolts((Status.SupplyVoltsHi shl 8) or Status.SupplyVoltsLo,
|
||||
FNetwork.Device.BoardType);
|
||||
// FLastSMeter обновляется только из WDSP (GetSMeterDBm) в SpectrumTimerTick —
|
||||
// ExciterPwr это мощность TX, не уровень принятого сигнала.
|
||||
FwdW := ADCToWatts100(FwdPwr);
|
||||
@@ -2319,9 +2320,14 @@ begin
|
||||
LblFwdPwr.Caption := Format('%.0fW', [FwdW]);
|
||||
LblSWRVal.Caption := Format('SWR:%.1f', [SWRV]);
|
||||
if PLLLock then PLLStr := 'PLL OK' else PLLStr := 'PLL?';
|
||||
StatusBar1.Panels[2].Text :=
|
||||
Format('Supply: %.1fV | FWD: %.0fW | SWR: %.1f | %s',
|
||||
[SupplyV, FwdW, SWRV, PLLStr]);
|
||||
if SupplyV >= 0 then
|
||||
StatusBar1.Panels[2].Text :=
|
||||
Format('Supply: %.1fV | FWD: %.0fW | SWR: %.1f | %s',
|
||||
[SupplyV, FwdW, SWRV, PLLStr])
|
||||
else
|
||||
StatusBar1.Panels[2].Text :=
|
||||
Format('FWD: %.0fW | SWR: %.1f | %s',
|
||||
[FwdW, SWRV, PLLStr]);
|
||||
|
||||
// Hardware PTT (foot switch / mic PTT) — обнаружение фронта
|
||||
if HWPTT <> FHWPTTActive then
|
||||
|
||||
Reference in New Issue
Block a user