towerops/test/support/fixtures
Graham McIntire 40db913170 feat: end-to-end /coverage compute pipeline + antenna catalog + cnHeat-style form
The compute pipeline now actually runs: per-pixel path loss over LIDAR
terrain, antenna pattern lookup, real GeoTIFF + colored PNG output,
Leaflet imageOverlay rendering with opacity slider and dBm legend.

Propagation:
- Towerops.Coverages.Propagation: Friis FSPL + Bullington single-knife-edge
  diffraction (ITU-R P.526). Pure Elixir, closed-form, no NIF dependency.
  Clean signature so a future ITM/Longley-Rice backend can drop in.
- Towerops.Coverages.Profile: AAIGrid sampler with elevation_at, sample
  along great circle, haversine distance.
- Towerops.Coverages.Raster: Float32 GeoTIFF via gdal_translate (with VRT
  wrapper) and colored PNG via gdaldem color-relief. Outputs to
  priv/static/coverage/<org>/<id>/, served by existing Plug.Static.

Worker:
- Towerops.Workers.CoverageWorker now does the full pipeline: bbox compute
  -> Towerops.Lidar.get_elevation_grid -> per-pixel Task.async_stream
  (parallel = schedulers) running antenna pattern lookup + propagation +
  RSSI threshold check, write rasters. Configurable terrain source via
  :coverage_terrain_module application env so tests can stub. Friendly
  failure messages for :no_tile, :grid_too_large, :nodata,
  :unknown_antenna, :missing_location.

Bundled antenna catalog (~95 entries):
- AntennaCatalog with compact specs for every antenna in the request list:
  Cambium, ALPHA, Antel, ITELITE, KP Performance, L-com, MARS, MikroTik,
  Mimosa, MTI, RADWIN, RF Elements, Ruckus, Tarana, Simulate, Ubiquiti.
- Antenna.from_spec/1 synthesizes 360+360 attenuation patterns from
  gain+beamwidth (cosine-squared main lobe, smooth transition,
  front-to-back floor with mild ripple). Real .ant files in priv/antennas/
  override the catalog by slug. Test fixtures moved to test/support.

Schema (migration add_radio_fields_to_coverages):
- tx_power_dbm replaces eirp_dbm; EIRP is now derived as
  tx_power + antenna.gain - cable_loss in Coverage.eirp_dbm/2 and shown
  live in the form header.
- cable_loss_db, sm_gain_dbi, latitude_override, longitude_override,
  height_above_rooftop_m, tx_clearance_m, foliage_tuning (0-100 slider).
- Coverage.location/1 returns {lat, lon} from override or parent site.

UI:
- form.html.heex: cnHeat-style grouped form (Identity / Location /
  Mounting / RF / Coverage extent), foliage tuning range slider,
  computed EIRP badge in the header.
- show.html.heex: Leaflet map area with L.imageOverlay heatmap,
  opacity slider, dBm color legend, antenna marker with directional
  wedge for azimuth.
- assets/js/app.ts: CoverageMap hook registered.

Tests: 24 new (propagation reference values, profile sampling,
worker end-to-end with stubbed terrain that writes real GeoTIFF + PNG,
org-mismatch job-cancel guard). Full suite: 10815 tests.
2026-05-06 14:32:38 -05:00
..
antennas feat: end-to-end /coverage compute pipeline + antenna catalog + cnHeat-style form 2026-05-06 14:32:38 -05:00
accounts_fixtures.ex perf(tests): disable TOTP by default in fixtures for faster tests 2026-03-06 07:21:52 -06:00
accounts_fixtures_test.exs remove passkeys for now 2026-01-31 09:50:35 -06:00
agents_fixtures.ex rename equipment to device 2026-01-17 14:48:46 -06:00
agents_fixtures_test.exs make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
billing_fixtures.ex stripe and email after signup 2026-03-06 10:07:27 -06:00
coverages_fixtures.ex feat: end-to-end /coverage compute pipeline + antenna catalog + cnHeat-style form 2026-05-06 14:32:38 -05:00
devices_fixtures.ex test: add comprehensive VISP sync tests and Gaiia/SNMP fixtures 2026-03-10 12:36:07 -05:00
gaiia_fixtures.ex test: fix all compile warnings in subscriber matching tests 2026-03-10 13:02:32 -05:00
integrations_fixtures.ex add integrations test fixture 2026-02-12 17:03:00 -06:00
jobs_fixtures.ex more tests and fixes 2026-02-07 11:50:18 -06:00
maintenance_fixtures.ex add maintenance windows REST API and GraphQL support 2026-03-11 14:33:25 -05:00
on_call_fixtures.ex feat: add on-call schedules and escalation policies 2026-03-11 12:32:54 -05:00
organizations_fixtures.ex test: add comprehensive VISP sync tests and Gaiia/SNMP fixtures 2026-03-10 12:36:07 -05:00
organizations_fixtures_test.exs Add tests for OrganizationsFixtures 2026-01-13 08:59:40 -06:00
snmp_fixtures.ex refactor/dry-improvements (#202) 2026-03-28 10:56:34 -05:00