Files
karim 38b048ad41 G1000: two-way sim sync, more PFD/MFD fidelity, authentic dialogs
Sync (FlyWithLua companions in plugins/ + server/fmssync.js):
- FMS flight-plan two-way sync (App <-> in-sim FMS) via fms-sync.lua
- G1000 UI-state publish (page/range/inset) via ui-sync.lua + CDI source,
  baro, map-range follow
- Terrain awareness: elevation grid probe (terrain-probe.lua) -> red/yellow
  MFD overlay vs aircraft altitude

PFD:
- AFCS mode annunciation bar from autopilot _status datarefs
- CDI source GPS/VLOC colouring, BRG1/BRG2 pointers + DME windows, marker beacons
- magenta speed/altitude trend vectors, selected-altitude alerting
- time-based (frame-rate-independent) smoothing for attitude/heading/tapes

MFD:
- nav data bar (DTK/ETE/active leg), airways overlay from earth_awy.dat,
  compass rose anchored to the ownship

Dialogs (NEAREST/FLIGHTPLAN/DIRECT-TO/PROCEDURES):
- flat, square, embedded G1000 look (no shadow/rounded/transparency)
- compact lower-right placement, no close X (softkey toggles), single window
- NEAREST 2-line entries (ILS/VFR, COM freq, runway length), PROC action menu

Service worker: network-first HTML so reloads pick up new builds (cache v2).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 02:17:06 +02:00

1.5 KiB

FlyWithLua companion — FMS two-way sync

X-Plane's Web API can't write a flight plan into the FMS. fms-sync.lua runs inside X-Plane (via FlyWithLua, which has the FMS SDK) and syncs the shared cockpit plan ↔ the in-sim FMS through two files in Output/fms-sync/.

Install (sim PC only)

  1. Install FlyWithLua NG+ (free): copy its plugin folder into <X-Plane>/Resources/plugins/FlyWithLua/.
  2. Copy the scripts into <X-Plane>/Resources/plugins/FlyWithLua/Scripts/:
    • fms-sync.lua — flight-plan two-way sync
    • ui-sync.lua — G1000 UI state (page / range / inset)
    • terrain-probe.lua — terrain-awareness elevation grid for the MFD
  3. Restart X-Plane (or FlyWithLua → Reload all Lua script files). The log shows [glass-cockpit] FMS sync active.

The bridge (desktop app / node server/bridge.js) must run on the same PC as X-Plane, so both see <X-Plane>/Output/fms-sync/.

What you get

  • App → Sim: load/build a plan in the web cockpit → it appears in the 3-D G1000 and the autopilot can fly it.
  • Sim → App: build/edit the plan in the real FMS → it shows on every tablet.
  • Terrain: the MFD TERRAIN map colours real scenery elevation red/yellow relative to your altitude (probed live by terrain-probe.lua).

A 3-decimal lat/lon signature de-dupes the round-trip, so the two sides never loop. Waypoints are pushed as lat/lon legs (exact route; in-sim idents are generic — route accuracy over cosmetics).