FMGC: Refactor to prepare for TMPY logic
This commit is contained in:
parent
939e6e1dce
commit
d4648754bd
8 changed files with 76 additions and 76 deletions
Models/Instruments/ND/canvas
Nasal
Systems
|
@ -233,7 +233,7 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
|
|||
#print("navdisplay.mfd:ND layer setup completed");
|
||||
|
||||
# TODO: move this to RTE.lcontroller ?
|
||||
me.listen("/FMGC/flightplan/r1/current-wp", func(activeWp) {
|
||||
me.listen("/FMGC/flightplan[1]/current-wp", func(activeWp) {
|
||||
canvas.updatewp( activeWp.getValue() );
|
||||
});
|
||||
|
||||
|
@ -304,12 +304,12 @@ canvas.NavDisplay.update_sub = func(){
|
|||
pos.lat = wp.wp_lat;
|
||||
pos.lon = wp.wp_lon;
|
||||
} else {
|
||||
pos.lat = getprop("/FMGC/flightplan/r1/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan/r1/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
pos.lat = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
}
|
||||
} else {
|
||||
pos.lat = getprop("/FMGC/flightplan/r1/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan/r1/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
pos.lat = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lat");
|
||||
pos.lon = getprop("/FMGC/flightplan[1]/wp[" ~ pln_wpt_idx ~ "]/lon");
|
||||
}
|
||||
} else {
|
||||
pos.lat = userLat;
|
||||
|
|
|
@ -12,9 +12,9 @@ SymbolLayer.add(name, {
|
|||
type: name, # Symbol type
|
||||
df_controller: __self__, # controller to use by default -- this one
|
||||
df_options: { # default configuration options
|
||||
active_node: "/FMGC/flightplan/r1/active",
|
||||
current_wp_node: "/FMGC/flightplan/r1/current-wp",
|
||||
wp_num: "/FMGC/flightplan/r1/num",
|
||||
active_node: "/FMGC/flightplan[1]/active",
|
||||
current_wp_node: "/FMGC/flightplan[1]/current-wp",
|
||||
wp_num: "/FMGC/flightplan[1]/num",
|
||||
display_inactive_rte: 0
|
||||
}
|
||||
});
|
||||
|
|
|
@ -46,12 +46,12 @@ canvas.NDStyles["Airbus"] = {
|
|||
# that the lateral flight mode is managed.
|
||||
# You can easily override these options before creating the ND, example:
|
||||
# canvas.NDStyles["Airbus"].options.defaults.fplan_active = "my/autpilot/f-plan/active"
|
||||
fplan_active: "/FMGC/flightplan/r1/active",
|
||||
fplan_active: "/FMGC/flightplan[1]/active",
|
||||
lat_ctrl: "/it-autoflight/output/lat",
|
||||
managed_val: 1,
|
||||
ver_ctrl: "/it-autoflight/output/vert",
|
||||
spd_ctrl: "/flight-management/control/spd-ctrl",
|
||||
current_wp: "/FMGC/flightplan/r1/current-wp",
|
||||
current_wp: "/FMGC/flightplan[1]/current-wp",
|
||||
ap1: "/it-autoflight/output/ap1",
|
||||
ap2: "/it-autoflight/output/ap2",
|
||||
nav1_frq: "/instrumentation/nav[0]/frequencies/selected-mhz",
|
||||
|
@ -740,11 +740,11 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveId",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan/r1/current-leg") != nil and
|
||||
getprop("FMGC/flightplan/r1/active") and
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg") != nil and
|
||||
getprop("FMGC/flightplan[1]/active") and
|
||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan/r1/current-leg"));
|
||||
nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan[1]/current-leg"));
|
||||
nd.symbols.wpActiveId.show();
|
||||
},
|
||||
is_false: func(nd) nd.symbols.wpActiveId.hide(),
|
||||
|
@ -754,15 +754,15 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveCrs",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan/r1/current-leg") != nil and
|
||||
getprop("FMGC/flightplan/r1/active") and
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg") != nil and
|
||||
getprop("FMGC/flightplan[1]/active") and
|
||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
#var cur_wp = getprop("autopilot/route-manager/current-wp");
|
||||
if (nd.get_switch("toggle_true_north")) {
|
||||
var deg = math.round(getprop("/FMGC/flightplan/r1/current-leg-course"));
|
||||
var deg = math.round(getprop("/FMGC/flightplan[1]/current-leg-course"));
|
||||
} else {
|
||||
var deg = math.round(getprop("/FMGC/flightplan/r1/current-leg-course-mag"));
|
||||
var deg = math.round(getprop("/FMGC/flightplan[1]/current-leg-course-mag"));
|
||||
}
|
||||
nd.symbols.wpActiveCrs.setText((deg or "")~"°");
|
||||
nd.symbols.wpActiveCrs.show();
|
||||
|
@ -774,11 +774,11 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveDist",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan/r1/current-leg-dist") != nil and
|
||||
getprop("FMGC/flightplan/r1/active") and
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg-dist") != nil and
|
||||
getprop("FMGC/flightplan[1]/active") and
|
||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
var dst = getprop("/FMGC/flightplan/r1/current-leg-dist");
|
||||
var dst = getprop("/FMGC/flightplan[1]/current-leg-dist");
|
||||
nd.symbols.wpActiveDist.setText(sprintf("%3.01f",dst));
|
||||
nd.symbols.wpActiveDist.show();
|
||||
},
|
||||
|
@ -789,10 +789,10 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "wpActiveDistLbl",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan/r1/current-leg-dist") != nil and getprop("FMGC/flightplan/r1/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
predicate: func(nd) getprop("/FMGC/flightplan[1]/current-leg-dist") != nil and getprop("FMGC/flightplan[1]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
nd.symbols.wpActiveDistLbl.show();
|
||||
if(getprop("/FMGC/flightplan/r1/current-leg-dist") > 1000)
|
||||
if(getprop("/FMGC/flightplan[1]/current-leg-dist") > 1000)
|
||||
nd.symbols.wpActiveDistLbl.setText(" NM");
|
||||
},
|
||||
is_false: func(nd) nd.symbols.wpActiveDistLbl.hide(),
|
||||
|
@ -802,7 +802,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
id: "eta",
|
||||
impl: {
|
||||
init: func(nd,symbol),
|
||||
predicate: func(nd) getprop("autopilot/route-manager/wp/eta") != nil and getprop("FMGC/flightplan/r1/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
predicate: func(nd) getprop("autopilot/route-manager/wp/eta") != nil and getprop("FMGC/flightplan[1]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||
is_true: func(nd) {
|
||||
var etaSec = getprop("/sim/time/utc/day-seconds")+
|
||||
getprop("autopilot/route-manager/wp/eta-seconds");
|
||||
|
@ -1683,7 +1683,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan/r1/active");
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1712,7 +1712,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan/r1/active");
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1741,7 +1741,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan/r1/active");
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1770,7 +1770,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan/r1/active");
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
@ -1799,7 +1799,7 @@ canvas.NDStyles["Airbus"] = {
|
|||
init: func(nd,symbol),
|
||||
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["MAP", "PLAN"])),
|
||||
is_true: func(nd){
|
||||
var active = getprop("FMGC/flightplan/r1/active");
|
||||
var active = getprop("FMGC/flightplan[1]/active");
|
||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||
var managed_v = nd.options.defaults.managed_val;
|
||||
var is_managed = (lat_ctrl == managed_v);
|
||||
|
|
|
@ -338,7 +338,7 @@ var lateral = func {
|
|||
setprop("/it-autoflight/mode/lat", "HDG");
|
||||
setprop("/it-autoflight/mode/arm", " ");
|
||||
} else if (latset == 1) {
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
make_lnav_active();
|
||||
} else {
|
||||
if (getprop("/it-autoflight/output/lat") != 1) {
|
||||
|
@ -396,7 +396,7 @@ var lat_arm = func {
|
|||
setprop("/it-autoflight/mode/arm", " ");
|
||||
setprop("/it-autoflight/custom/show-hdg", 1);
|
||||
} else if (latset == 1) {
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
setprop("/it-autoflight/input/lat-arm", 1);
|
||||
setprop("/it-autoflight/mode/arm", "LNV");
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ var vertical = func {
|
|||
setprop("/it-autoflight/internal/alt", altinput);
|
||||
thrustmodet.start();
|
||||
} else if (vertset == 8) {
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1 and getprop("/it-autoflight/internal/alt-const") >= 100) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/it-autoflight/internal/alt-const") >= 100) {
|
||||
alandt.stop();
|
||||
alandt1.stop();
|
||||
setprop("/it-autoflight/output/appr-armed", 0);
|
||||
|
@ -662,19 +662,19 @@ var ap_various = func {
|
|||
setprop("/it-autoflight/internal/bank-limit", 25);
|
||||
}
|
||||
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1) {
|
||||
if ((getprop("/FMGC/flightplan/r1/current-wp") + 1) < getprop("/FMGC/flightplan/r1/num")) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
if ((getprop("/FMGC/flightplan[1]/current-wp") + 1) < getprop("/FMGC/flightplan[1]/num")) {
|
||||
gnds_mps = getprop("/velocities/groundspeed-kt") * 0.5144444444444;
|
||||
wp_fly_from = getprop("/FMGC/flightplan/r1/current-wp");
|
||||
wp_fly_from = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
if (wp_fly_from < 0) {
|
||||
wp_fly_from = 0;
|
||||
}
|
||||
current_course = getprop("/FMGC/flightplan/r1/wp[" ~ wp_fly_from ~ "]/course");
|
||||
wp_fly_to = getprop("/FMGC/flightplan/r1/current-wp") + 1;
|
||||
current_course = getprop("/FMGC/flightplan[1]/wp[" ~ wp_fly_from ~ "]/course");
|
||||
wp_fly_to = getprop("/FMGC/flightplan[1]/current-wp") + 1;
|
||||
if (wp_fly_to < 0) {
|
||||
wp_fly_to = 0;
|
||||
}
|
||||
next_course = getprop("/FMGC/flightplan/r1/wp[" ~ wp_fly_to ~ "]/course");
|
||||
next_course = getprop("/FMGC/flightplan[1]/wp[" ~ wp_fly_to ~ "]/course");
|
||||
max_bank_limit = getprop("/it-autoflight/internal/bank-limit");
|
||||
|
||||
delta_angle = math.abs(geo.normdeg180(current_course - next_course));
|
||||
|
@ -696,7 +696,7 @@ var ap_various = func {
|
|||
}
|
||||
setprop("/it-autoflight/internal/lnav-advance-nm", turn_dist);
|
||||
|
||||
if (getprop("/FMGC/flightplan/r1/current-leg-dist") <= turn_dist) {
|
||||
if (getprop("/FMGC/flightplan[1]/current-leg-dist") <= turn_dist) {
|
||||
r1_currentWP = r1_currentWP + 1;
|
||||
}
|
||||
}
|
||||
|
@ -914,7 +914,7 @@ var check_arms = func {
|
|||
}
|
||||
|
||||
var update_arms = func {
|
||||
if (getprop("/it-autoflight/input/lat-arm") == 1 and getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
if (getprop("/it-autoflight/input/lat-arm") == 1 and getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/position/gear-agl-ft") >= 30) {
|
||||
make_lnav_active();
|
||||
}
|
||||
if (getprop("/instrumentation/nav[0]/in-range") == 1) {
|
||||
|
@ -1014,10 +1014,10 @@ var aland1 = func {
|
|||
|
||||
# Managed Climb/Descent
|
||||
var mng_main = func {
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
altinput = getprop("/it-autoflight/input/alt");
|
||||
setprop("/it-autoflight/internal/alt", altinput);
|
||||
var wp_curr = getprop("/FMGC/flightplan/r1/current-wp");
|
||||
var wp_curr = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
var mng_alt_wp = getprop("/autopilot/route-manager/route/wp", wp_curr, "altitude-ft");
|
||||
if (getprop("/it-autoflight/internal/alt-const") == mng_alt_wp) {
|
||||
# Do nothing
|
||||
|
@ -1056,7 +1056,7 @@ setlistener("/it-autoflight/internal/alt-const", func {
|
|||
}
|
||||
});
|
||||
|
||||
setlistener("/FMGC/flightplan/r1/current-wp", func {
|
||||
setlistener("/FMGC/flightplan[1]/current-wp", func {
|
||||
if (getprop("/it-autoflight/output/vert") == 8) {
|
||||
mng_alt_selector();
|
||||
mng_run();
|
||||
|
@ -1064,11 +1064,11 @@ setlistener("/FMGC/flightplan/r1/current-wp", func {
|
|||
});
|
||||
|
||||
var mng_run = func {
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan/r1/current-wp");
|
||||
var wptnum = getprop("/FMGC/flightplan/r1/current-wp");
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
var wptnum = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
var mng_alt_wp = getprop("/autopilot/route-manager/route/wp",wp_curr,"altitude-ft");
|
||||
if ((wptnum - 1) < getprop("/FMGC/flightplan/r1/num")) {
|
||||
if ((wptnum - 1) < getprop("/FMGC/flightplan[1]/num")) {
|
||||
var mng_alt_wp_prev = getprop("/autopilot/route-manager/route/wp",wp_curr - 1,"altitude-ft");
|
||||
var altcurr = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
if (mng_alt_wp_prev >= 100) {
|
||||
|
@ -1134,11 +1134,11 @@ var mng_run = func {
|
|||
|
||||
# Managed Top of Descent
|
||||
var mng_des_tod = func {
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan/r1/current-wp");
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
var wp_curr = getprop("/FMGC/flightplan[1]/current-wp");
|
||||
var mng_alt_wp = getprop("/autopilot/route-manager/route/wp",wp_curr,"altitude-ft");
|
||||
var alt_curr = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
var dist = getprop("/FMGC/flightplan/r1/current-leg-dist");
|
||||
var dist = getprop("/FMGC/flightplan[1]/current-leg-dist");
|
||||
var vdist = dist + 1;
|
||||
var alttl = abs(alt_curr - mng_alt_wp);
|
||||
setprop("/it-autoflight/internal/top-of-des-nm", (alttl / 1000) * 3);
|
||||
|
@ -1180,7 +1180,7 @@ var mng_alt_selector = func {
|
|||
setprop("/it-autoflight/internal/mng-alt", getprop("/it-autoflight/internal/alt-const"));
|
||||
}
|
||||
} else if (getprop("/it-autoflight/internal/mng-mode") == "DES") {
|
||||
var dist = getprop("/FMGC/flightplan/r1/current-leg-dist");
|
||||
var dist = getprop("/FMGC/flightplan[1]/current-leg-dist");
|
||||
var vdist = dist - 1;
|
||||
if (vdist < getprop("/it-autoflight/internal/top-of-des-nm")) {
|
||||
if (sdif <= vdif) {
|
||||
|
@ -1231,7 +1231,7 @@ var mng_des_pth = func {
|
|||
mng_altcaptt.start();
|
||||
}
|
||||
var mng_des_fpm = func {
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1) {
|
||||
var gndspd = getprop("/velocities/groundspeed-kt");
|
||||
var desfpm = ((gndspd * 0.5) * 10);
|
||||
setprop("/it-autoflight/internal/mng-fpm", desfpm);
|
||||
|
|
|
@ -230,7 +230,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
setprop("/FMGC/status/phase", "5");
|
||||
}
|
||||
|
||||
if (getprop("/FMGC/flightplan/r1/num") > 0 and getprop("/FMGC/flightplan/r1/active") == 1 and getprop("/FMGC/flightplan/r1/arrival-leg-dist") <= 15) {
|
||||
if (getprop("/FMGC/flightplan[1]/num") > 0 and getprop("/FMGC/flightplan[1]/active") == 1 and getprop("/FMGC/flightplan[1]/arrival-leg-dist") <= 15) {
|
||||
setprop("/FMGC/internal/decel", 1);
|
||||
} else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) {
|
||||
setprop("/FMGC/internal/decel", 0);
|
||||
|
|
|
@ -46,7 +46,7 @@ var fpln_end = "------END OF F-PLN------";
|
|||
var altn_fpln_end = "----END OF ALTN F-PLN---";
|
||||
var no_altn_fpln_end = "------NO ALTN F-PLN-----";
|
||||
|
||||
var r1_active_out = props.globals.getNode("/FMGC/flightplan/r1/active");
|
||||
var r1_active_out = props.globals.getNode("/FMGC/flightplan[1]/active");
|
||||
|
||||
var updateFPLN = func(i) {
|
||||
if (r1_active_out.getBoolValue()) {
|
||||
|
|
|
@ -21,14 +21,14 @@ var sizeWP = nil;
|
|||
var magTrueError = 0;
|
||||
var arrivalAirportI = 0;
|
||||
var altFeet = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1);
|
||||
var r1_active_out = props.globals.initNode("/FMGC/flightplan/r1/active", 0, "BOOL");
|
||||
var r1_currentWP_out = props.globals.initNode("/FMGC/flightplan/r1/current-wp", 0, "INT");
|
||||
var r1_currentLeg_out = props.globals.initNode("/FMGC/flightplan/r1/current-leg", "", "STRING");
|
||||
var r1_currentLegCourse_out = props.globals.initNode("/FMGC/flightplan/r1/current-leg-course", 0, "DOUBLE");
|
||||
var r1_currentLegDist_out = props.globals.initNode("/FMGC/flightplan/r1/current-leg-dist", 0, "DOUBLE");
|
||||
var r1_currentLegCourseMag_out = props.globals.initNode("/FMGC/flightplan/r1/current-leg-course-mag", 0, "DOUBLE");
|
||||
var r1_arrivalLegDist_out = props.globals.initNode("/FMGC/flightplan/r1/arrival-leg-dist", 0, "DOUBLE");
|
||||
var r1_num_out = props.globals.initNode("/FMGC/flightplan/r1/num", 0, "INT");
|
||||
var r1_active_out = props.globals.initNode("/FMGC/flightplan[1]/active", 0, "BOOL");
|
||||
var r1_currentWP_out = props.globals.initNode("/FMGC/flightplan[1]/current-wp", 0, "INT");
|
||||
var r1_currentLeg_out = props.globals.initNode("/FMGC/flightplan[1]/current-leg", "", "STRING");
|
||||
var r1_currentLegCourse_out = props.globals.initNode("/FMGC/flightplan[1]/current-leg-course", 0, "DOUBLE");
|
||||
var r1_currentLegDist_out = props.globals.initNode("/FMGC/flightplan[1]/current-leg-dist", 0, "DOUBLE");
|
||||
var r1_currentLegCourseMag_out = props.globals.initNode("/FMGC/flightplan[1]/current-leg-course-mag", 0, "DOUBLE");
|
||||
var r1_arrivalLegDist_out = props.globals.initNode("/FMGC/flightplan[1]/arrival-leg-dist", 0, "DOUBLE");
|
||||
var r1_num_out = props.globals.initNode("/FMGC/flightplan[1]/num", 0, "INT");
|
||||
var toFromSet = props.globals.initNode("/FMGC/internal/tofrom-set", 0, "BOOL");
|
||||
var magHDG = props.globals.getNode("/orientation/heading-magnetic-deg", 1);
|
||||
var trueHDG = props.globals.getNode("/orientation/heading-deg", 1);
|
||||
|
@ -36,13 +36,13 @@ var FMGCdep = props.globals.getNode("/FMGC/internal/dep-arpt", 1);
|
|||
var FMGCarr = props.globals.getNode("/FMGC/internal/arr-arpt", 1);
|
||||
|
||||
# props.nas for flightplan
|
||||
var wpID = [props.globals.initNode("/FMGC/flightplan/r1/wp[0]/id", "", "STRING")];
|
||||
var wpLat = [props.globals.initNode("/FMGC/flightplan/r1/wp[0]/lat", 0, "DOUBLE")];
|
||||
var wpLon = [props.globals.initNode("/FMGC/flightplan/r1/wp[0]/lon", 0, "DOUBLE")];
|
||||
var wpCourse = [props.globals.initNode("/FMGC/flightplan/r1/wp[0]/course", 0, "DOUBLE")];
|
||||
var wpDistance = [props.globals.initNode("/FMGC/flightplan/r1/wp[0]/distance", 0, "DOUBLE")];
|
||||
var wpCoursePrev = [props.globals.initNode("/FMGC/flightplan/r1/wp[0]/course-from-prev", 0, "DOUBLE")];
|
||||
var wpDistancePrev = [props.globals.initNode("/FMGC/flightplan/r1/wp[0]/distance-from-prev", 0, "DOUBLE")];
|
||||
var wpID = [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/id", "", "STRING")];
|
||||
var wpLat = [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lat", 0, "DOUBLE")];
|
||||
var wpLon = [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lon", 0, "DOUBLE")];
|
||||
var wpCourse = [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course", 0, "DOUBLE")];
|
||||
var wpDistance = [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance", 0, "DOUBLE")];
|
||||
var wpCoursePrev = [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course-from-prev", 0, "DOUBLE")];
|
||||
var wpDistancePrev = [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance-from-prev", 0, "DOUBLE")];
|
||||
|
||||
var flightplan = {
|
||||
reset: func() {
|
||||
|
@ -104,13 +104,13 @@ var flightplan = {
|
|||
canvas_nd.A3XXRouteDriver.triggerSignal("fp-added");
|
||||
sizeWP = size(wpID);
|
||||
for (var counter = sizeWP; counter < r1.getPlanSize(); counter += 1) {
|
||||
append(wpID, props.globals.initNode("/FMGC/flightplan/r1/wp[" ~ counter ~ "]/id", "", "STRING"));
|
||||
append(wpLat, props.globals.initNode("/FMGC/flightplan/r1/wp[" ~ counter ~ "]/lat", 0, "DOUBLE"));
|
||||
append(wpLon, props.globals.initNode("/FMGC/flightplan/r1/wp[" ~ counter ~ "]/lon", 0, "DOUBLE"));
|
||||
append(wpCourse, props.globals.initNode("/FMGC/flightplan/r1/wp[" ~ counter ~ "]/course", 0, "DOUBLE"));
|
||||
append(wpDistance, props.globals.initNode("/FMGC/flightplan/r1/wp[" ~ counter ~ "]/distance", 0, "DOUBLE"));
|
||||
append(wpCoursePrev, props.globals.initNode("/FMGC/flightplan/r1/wp[" ~ counter ~ "]/course-from-prev", 0, "DOUBLE"));
|
||||
append(wpDistancePrev, props.globals.initNode("/FMGC/flightplan/r1/wp[" ~ counter ~ "]/distance-from-prev", 0, "DOUBLE"));
|
||||
append(wpID, props.globals.initNode("/FMGC/flightplan[1]/wp[" ~ counter ~ "]/id", "", "STRING"));
|
||||
append(wpLat, props.globals.initNode("/FMGC/flightplan[1]/wp[" ~ counter ~ "]/lat", 0, "DOUBLE"));
|
||||
append(wpLon, props.globals.initNode("/FMGC/flightplan[1]/wp[" ~ counter ~ "]/lon", 0, "DOUBLE"));
|
||||
append(wpCourse, props.globals.initNode("/FMGC/flightplan[1]/wp[" ~ counter ~ "]/course", 0, "DOUBLE"));
|
||||
append(wpDistance, props.globals.initNode("/FMGC/flightplan[1]/wp[" ~ counter ~ "]/distance", 0, "DOUBLE"));
|
||||
append(wpCoursePrev, props.globals.initNode("/FMGC/flightplan[1]/wp[" ~ counter ~ "]/course-from-prev", 0, "DOUBLE"));
|
||||
append(wpDistancePrev, props.globals.initNode("/FMGC/flightplan[1]/wp[" ~ counter ~ "]/distance-from-prev", 0, "DOUBLE"));
|
||||
}
|
||||
},
|
||||
outputProps: func() {
|
||||
|
|
|
@ -449,7 +449,7 @@
|
|||
</condition>
|
||||
<expression>
|
||||
<sum>
|
||||
<property>/FMGC/flightplan/r1/current-leg-course</property>
|
||||
<property>/FMGC/flightplan[1]/current-leg-course</property>
|
||||
<product>
|
||||
<property>/it-autoflight/internal/drift-angle-deg</property>
|
||||
<value>-1.0</value>
|
||||
|
|
Reference in a new issue