b05ffedbc1
Add a switchable cockpit-profile selector (Garmin G1000 / Cessna Citation X / GA steam) and recreate the Citation X Honeywell Primus 2000 avionics line-for- line from the X-Plane Citation X + FMS manuals: - CitPFD: attitude w/ FD command bars, speed tape (Vmo barber-pole, Vfe, low- speed red/amber bands), AOA index, altitude tape + trend, VSI, round HSI with CDI/course pointer + VOR/ADF bearing pointers, radar altimeter, minimums, STD/BARO/CRS/HDG bezel. - CitEICAS: twin FAN%/ITT bar gauges, OIL °C/PSI, FUEL (flow/qty PPH·LBS), ELECTRICAL, HYDRAULICS, slat chevron, STAB trim, FLAPS, CAS message stack, softkeys NORM/FUEL-HYD/ELEC/CTRL-POS/ENG + control-position overlay. - CitMFD: Honeywell heading-up arc map, FMS route (magenta active/white future), TCAS, terrain/WX, range arc, ETE/SAT/TAS/GSPD block, clock + ET/FT timer, V-SPEEDS reference card, MFD-setup overlays (TRAFFIC/TERRAIN/APTS/VOR). - CitAP: HDG/NAV/APP/BC · ALT/VNAV/BANK/STBY · FLC/C-O/VS · pitch wheel · AP/YD/M-TRIM/PFD-SEL, FMA bar + lamps from per-mode *_status datarefs. - CitRMU: COM/NAV active+standby tuning, transponder, ADF, TCAS range/mode, IDENT + Nav Source Selector (NAV1/2/FMS, VOR/ADF/FMS bearing source). Integration: all avionics stream live via the X-Plane Web API (new datarefs for N1/N2/ITT, radar-alt, AOA, hydraulics, trim, flaps/slats/gear, control positions, ADF, mach, yaw-damper); the existing fms-sync.lua drives the Citation's built-in FMS (aircraft-agnostic XPLM FMS SDK). Demo seeds added so every panel renders offline. Verified headless via Playwright (no console errors; G1000/GA profiles unaffected). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
62 lines
3.4 KiB
Markdown
62 lines
3.4 KiB
Markdown
# 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. Start the bridge (desktop app or `node server/bridge.js`) **on the same PC**
|
|
as X-Plane. On startup it auto-copies these three scripts into
|
|
`<X-Plane>/Resources/plugins/FlyWithLua/Scripts/` and keeps them up to date
|
|
on every launch (it only writes changed/missing files):
|
|
- **`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. In X-Plane: *FlyWithLua → Reload all Lua script files* (or restart).
|
|
The log shows `[glass-cockpit] FMS sync active`.
|
|
|
|
No manual copying needed. If you install FlyWithLua *after* the bridge is
|
|
already running, trigger a re-install without restarting via
|
|
`POST /api/lua/install`. The current install state is reported under `lua` in
|
|
`GET /api/health`. The bridge must run on the **same PC** as X-Plane so both see
|
|
`<X-Plane>/Output/fms-sync/`. (The auto-install honours `LUA_SRC_DIR` — the
|
|
desktop app sets it to the bundled scripts; otherwise it finds `plugins/` itself.)
|
|
|
|
## 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).
|
|
|
|
## Cessna Citation X (Honeywell Primus 2000)
|
|
|
|
The app ships three switchable **cockpit profiles** (sidebar dropdown): the
|
|
Garmin **G1000**, the **Citation X**, and a **GA steam** panel. The Citation
|
|
profile recreates the Primus 2000 suite line-for-line from the X-Plane Citation
|
|
X manual — **PFD** (attitude, speed/alt tapes with Vmo barber-pole + Vfe + AOA,
|
|
HSI with VOR/ADF bearing pointers, CDI, VSI, FD bars, radar altimeter,
|
|
minimums), **MFD** (Honeywell arc map, FMS route, TCAS, terrain/WX, ETE/SAT/TAS/
|
|
GSPD, ET/FT timer, V-SPEEDS card), **EICAS** (twin N1/ITT/oil, fuel, electrical,
|
|
hydraulics, slats, stab-trim, flaps, CAS), the **autopilot/flight-guidance**
|
|
controller (HDG/NAV/APP/BC · ALT/VNAV/BANK/STBY · FLC/VS · AP/YD/M-TRIM/PFD-SEL
|
|
+ pitch wheel), the **Radio Management Unit**, and the **Nav Source Selector**.
|
|
|
|
Integration:
|
|
- **Avionics (PFD/MFD/EICAS/AP/RMU):** every value is a universal X-Plane
|
|
dataref / command streamed live by the bridge over the **Web API** — no Lua
|
|
needed (N1/N2/ITT, radar-alt, AOA, hydraulics, trim, flaps/slats/gear, control
|
|
positions, ADF, mach, yaw-damper, the per-mode `*_status` AFCS annunciation…).
|
|
- **FMS / CDU:** the same **`fms-sync.lua`** bridges the web CDU ↔ the in-sim
|
|
FMS. It uses the aircraft-agnostic XPLM FMS SDK, so it drives the Citation X's
|
|
built-in FMS exactly as it does the G1000's — load/build a plan on a tablet and
|
|
the Citation flies it; build it in the sim and it shows on every tablet.
|