From 05a9db9b876f7da02830a4e2a23e0405e464a2de Mon Sep 17 00:00:00 2001 From: hayden2000 Date: Mon, 23 Mar 2020 11:31:38 -0400 Subject: [PATCH] Add remaining values to FUELPRED --- Models/Instruments/MCDU/MCDU.nas | 17 +++++++++++++++-- Nasal/MCDU/FUELPRED.nas | 2 +- Nasal/MCDU/MCDU.nas | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas index 754f4a05..111dc7ef 100644 --- a/Models/Instruments/MCDU/MCDU.nas +++ b/Models/Instruments/MCDU/MCDU.nas @@ -89,6 +89,16 @@ var trip_wind = props.globals.getNode("FMGC/internal/trip-wind", 1); var extra_fuel = props.globals.getNode("FMGC/internal/extra-fuel", 1); var extra_time = props.globals.getNode("FMGC/internal/extra-time", 1); +# FUELPRED Specials +var alt_airport = props.globals.getNode("FMGC/internal/alt-airport", 1); +var pri_utc = props.globals.getNode("FMGC/internal/pri-utc", 1); +var alt_utc = props.globals.getNode("FMGC/internal/alt-utc", 1); +var pri_efob = props.globals.getNode("FMGC/internal/pri-efob", 1); +var alt_efob = props.globals.getNode("FMGC/internal/alt-efob", 1); +var fob = props.globals.getNode("FMGC/internal/fob", 1); +var gw = props.globals.getNode("FMGC/internal/gw", 1); +var cg = props.globals.getNode("FMGC/internal/cg", 1); + var state1 = props.globals.getNode("engines/engine[0]/state", 1); var state2 = props.globals.getNode("engines/engine[1]/state", 1); var engrdy = props.globals.getNode("engines/ready", 1); @@ -1241,8 +1251,11 @@ var canvas_MCDU_base = { me["Simple_L5"].setText(sprintf("%4.1f/" ~ final_time.getValue(), final_fuel.getValue())); me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue())); - me["Simple_R4"].setText(sprintf("%4.1f/FF+FQ", 0.0)); - me["Simple_R5"].setText(sprintf("%4.1f/", 0.0) ~ sprintf("%4.1f", 0.0)); + setprop("FMGC/internal/fob", num(getprop("consumables/fuel/total-fuel-lbs") / 1000)); + setprop("FMGC/internal/gw", num(getprop("fdm/jsbsim/inertia/weight-lbs") / 1000)); + setprop("FMGC/internal/cg", num(getprop("FMGC/internal/zfwcg"))); + me["Simple_R4"].setText(sprintf("%4.1f/FF+FQ", fob.getValue())); + me["Simple_R5"].setText(sprintf("%4.1f/", gw.getValue()) ~ sprintf("%4.1f", cg.getValue())); me["Simple_R6"].setText(sprintf("%4.1f/" ~ extra_time.getValue(), extra_fuel.getValue())); me.colorLeft("ack", "ack", "blu", "blu", "blu", "blu"); diff --git a/Nasal/MCDU/FUELPRED.nas b/Nasal/MCDU/FUELPRED.nas index 2648bb5d..995c49f3 100644 --- a/Nasal/MCDU/FUELPRED.nas +++ b/Nasal/MCDU/FUELPRED.nas @@ -33,7 +33,7 @@ var pri_efob = props.globals.getNode("FMGC/internal/pri-efob", 1); var alt_efob = props.globals.getNode("FMGC/internal/alt-efob", 1); var fob = props.globals.getNode("FMGC/internal/fob", 1); var gw = props.globals.getNode("FMGC/internal/gw", 1); -var gc = props.globals.getNode("FMGC/internal/gc", 1); +var cg = props.globals.getNode("FMGC/internal/cg", 1); var fuelPredInput = func(key, i) { diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index ffe7d2a2..f2a7bb01 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -62,6 +62,7 @@ var MCDU_reset = func(i) { setprop("FMGC/internal/extra-fuel", 0); setprop("FMGC/internal/extra-time", "0000"); + #FUELPRED setprop("FMGC/internal/alt-airport", 0); setprop("FMGC/internal/pri-utc", "0000"); setprop("FMGC/internal/alt-utc", "0000"); @@ -69,7 +70,7 @@ var MCDU_reset = func(i) { setprop("FMGC/internal/alt-efob", 0); setprop("FMGC/internal/fob", 0); setprop("FMGC/internal/gw", 0); - setprop("FMGC/internal/gc", 0); + setprop("FMGC/internal/cg", 0); setprop("FMGC/internal/v1-set", 0); setprop("FMGC/internal/vr-set", 0);