ewcalc

July 22, 2026 · View on GitHub

CI License: MIT

A multi-platform electronic warfare engineering calculator covering antenna analysis, RF propagation, link budgets, receiver performance, jamming analysis, emitter location, radar, and spread-spectrum communications — based on the EW101 series by David Adamy.

Getting ewcalc

Pre-built artifacts for all three platforms are attached to each GitHub Release:

PlatformArtifactNotes
Windows.msixUnsigned by default; see frontend/windows/ewcalc-winui/README.md for sideloading a self-signed cert
macOS.dmgSigned and notarized — opens directly, no Gatekeeper prompt
Linux.AppImagechmod +x, then run directly; no installation required

To build from source instead, see Building below.

Architecture

Layered, with clean separation:

  • libew — pure C++20 calculation library, no UI, no external dependencies
  • ewpresenter — platform-agnostic presenter/viewmodel layer
  • bridge/ — plain-C API over ewpresenter, used by the macOS Swift frontend (Swift cannot import C++ directly); Linux and Windows link ewpresenter directly
  • frontend/ — platform-native UIs: WinUI 3 (Windows), SwiftUI (macOS), Qt6 (Linux)

libew modules

ModuleContent
coreStrong-type units (Dbm, Db, Km, Mhz, Kelvin, …), constants
propagationFSPL, 2-ray ground reflection, Fresnel zone, knife-edge diffraction, earth bulge, radar horizon range
antennaERP, gain conversions, beamwidth
linkOne-way link budget, effective range
receiverSensitivity, cascaded NF (Friis), SFDR, digital DR, noise temperature conversions
jammingJ/S ratio, burnthrough range, partial-band optimization
locationCEP from AOA bearing error, TDOA timing error, and EEP
radarRadar range equation, pulse compression, coherent integration gain, LPI advantage
digitalEb/N₀ ↔ SNR conversion (both directions), DSSS process gain, jamming margin, required J/S

ewpresenter

Eight presenters wrap the libew modules for use by any view layer:

PresenterInputsKey outputs
PropagationPresenterdistance, frequency, antenna heights, obstruction heightFSPL, 2-ray loss, Fresnel zone, regime, earth bulge, radar horizon, knife-edge diffraction loss
AntennaPresentergain, az/el beamwidth, Tx power, frequencyERP, beamwidth from gain, gain from beamwidth, wavelength
LinkPresenterTx power/gain, Rx gain, geometry, sensitivityReceived power, link margin, effective range
ReceiverPresenterBandwidth, NF, SNR, stage chain, ADC bitsSensitivity, cascaded NF, system noise temp, SFDR, digital DR
JammingPresenterSignal/jammer ERP, geometry, frequency, J/S thresholdJ/S ratio, burnthrough range, partial-band optimum BW (N/A when hop range = 0)
LocationPresenterBearing error, range, TDOA timing error, EEP semi-axesCEP (AOA, TDOA, and EEP methods)
RadarPresenterTx power, gain, RCS, frequency, NF, TB productMax range, two-way loss, PC gain, coherent integration gain, LPI advantage
DigitalPresenterSNR, bandwidth, data rate, chip rate, required Eb/N₀, impl. lossEb/N₀, SNR from Eb/N₀, DSSS process gain, jamming margin, required J/S

Each presenter validates inputs, calls libew, and fires a std::function callback with formatted output strings. No platform types are exposed.

A console harness (ewpresenter_harness) exercises all presenters against default inputs.

Building

Requires CMake ≥ 3.25 and a C++20 compiler. See AGENTS.md for per-platform toolchain prerequisites (Xcode, Qt6, Visual Studio, etc.).

Core libraries and tests

cmake -B build
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure

To run the presenter harness:

build/bin/Release/ewpresenter_harness

Platform frontends

Platform build scripts are in scripts/. Each builds the native libs then the frontend, and accepts --config Debug|Release and (on Linux/macOS) --package to produce a distributable artifact.

PlatformScriptPackage output
Windowsscripts/build-windows.ps1unsigned .msix (-Sign for signed)
macOSscripts/build-macos.shsigned + notarized .dmg
Linuxscripts/build-linux.sh.AppImage

macOS packaging requires a Developer ID Application certificate in the keychain and xcrun notarytool credentials stored under the ewcalc-notarytool profile.

Formula reference

See docs/formulas.md for the equations, units, assumptions, and references behind each calculator output.

API documentation

libew and ewpresenter headers use Doxygen-style /// comments. Build the HTML API reference locally with:

doxygen Doxyfile

Output lands in docs/html/index.html. CI runs the same command on every push and pull request and publishes docs/html/ as a workflow artifact; it does not publish to GitHub Pages yet (a reasonable future enhancement).

Contributing

See CONTRIBUTING.md for the branch/PR workflow, build and test instructions, and code style. See CHANGELOG.md for release history. Found a security issue? See SECURITY.md for how to report it privately.

Current status

All three platform frontends — Windows (WinUI 3), macOS (SwiftUI), and Linux (Qt6 Widgets) — are feature-complete across all eight calculators plus a Reference page. See CHANGELOG.md for release history.

License

MIT — see LICENSE.