Manual audit fixes A/E/F: fuel totalizer, Victor/Jet airways, TIME TO BOD
A — Fuel totalizer (SYSTEM key, renamed from ENGINE): DEC/INC/RST FUEL had no handler. Now adjust the fuel_totalizer_sum_kg dataref (±1 gal, RST→max fuel) and the EIS shows the calculated remaining/used. cdiSrc-style writable + demo echo. E — AIRWAYS: was a single on/off. earth_awy.dat field 8 (airway layer) is now parsed (1=Victor/low, 2=Jet/high; name-prefix fallback), the bbox returns it, and the AIRWAYS softkey cycles off→all→Victor→Jet with an AIRWY-LO/-HI label. F — CURRENT VNV PROFILE now shows TIME TO BOD (bottom of descent) once past the top of descent, instead of only TIME TO TOD. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -325,6 +325,7 @@ function startDemo() {
|
||||
// engine strip (arrays, like the sim)
|
||||
engRpm: [2410], fuelFlow: [0.0072], oilTemp: [88], oilPress: [52], egt: [720],
|
||||
fuelQty: [60, 58], volts: [process.env.DEMO_ALERT ? 23.4 : 28.0, 27.8], amps: [-1.5], genAmps: [20.5], engHrs: 5040,
|
||||
fuelTot: 118 * 2.72, fuelMax: 144 * 2.72, // fuel totalizer: 118 of 144 gal (kg) — SYSTEM keys adjust
|
||||
});
|
||||
// a sample plan so the map/FMS show something in demo mode
|
||||
fp.setPlan({ name: 'DEMO', waypoints: [
|
||||
|
||||
@@ -96,6 +96,8 @@ export const DATAREFS = {
|
||||
oilPress: 'sim/cockpit2/engine/indicators/oil_pressure_psi',
|
||||
egt: 'sim/cockpit2/engine/indicators/EGT_deg_C',
|
||||
fuelQty: 'sim/cockpit2/fuel/fuel_quantity',
|
||||
fuelTot: 'sim/cockpit2/fuel/fuel_totalizer_sum_kg', // pilot-set fuel totalizer (remaining, kg)
|
||||
fuelMax: 'sim/aircraft/weight/acf_m_fuel_tot', // max fuel capacity (kg) — for RST FUEL
|
||||
volts: 'sim/cockpit2/electrical/bus_volts', // array: [0]=main bus, [1]=essential
|
||||
amps: 'sim/cockpit2/electrical/battery_amps', // battery (S) amps
|
||||
genAmps: 'sim/cockpit2/electrical/generator_amps', // alternator (M) amps
|
||||
@@ -135,6 +137,7 @@ export const WRITABLE_DATAREFS = {
|
||||
xpdrMode: 'sim/cockpit2/radios/actuators/transponder_mode', // 0 off,1 stby,2 on,3 alt
|
||||
xpdrCode: 'sim/cockpit2/radios/actuators/transponder_code', // 4-digit squawk
|
||||
cdiSrc: 'sim/cockpit2/radios/actuators/HSI_source_select_pilot', // 0 NAV1 · 1 NAV2 · 2 GPS (CDI softkey cycles it)
|
||||
fuelTot: 'sim/cockpit2/fuel/fuel_totalizer_sum_kg', // SYSTEM → DEC/INC/RST FUEL adjusts the totalizer
|
||||
};
|
||||
|
||||
// Commands the frontend may TRIGGER (autopilot mode buttons etc.).
|
||||
|
||||
+5
-1
@@ -167,9 +167,13 @@ async function parseAirways(file) {
|
||||
const b = index.get((p[3] || '').toUpperCase());
|
||||
if (!a || !b) continue; // endpoint not in our database
|
||||
const name = p[p.length - 1];
|
||||
// Field 8 (index 7) = airway layer: 1 = low/Victor, 2 = high/Jet (used by the
|
||||
// MFD AIRWAYS key to show all / Victor-only / Jet-only). Fall back to the name
|
||||
// prefix (V… = low, J… = high) if the field is missing.
|
||||
const lyr = +p[7] === 1 ? 1 : +p[7] === 2 ? 2 : /^J/i.test(name) ? 2 : /^V/i.test(name) ? 1 : 0;
|
||||
const k = `${Math.floor((a.lat + b.lat) / 2)},${Math.floor((a.lon + b.lon) / 2)}`;
|
||||
let arr = awyCells.get(k); if (!arr) { arr = []; awyCells.set(k, arr); }
|
||||
arr.push({ la1: a.lat, lo1: a.lon, la2: b.lat, lo2: b.lon, name });
|
||||
arr.push({ la1: a.lat, lo1: a.lon, la2: b.lat, lo2: b.lon, name, lyr });
|
||||
state.awy++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user