Implement partial ILS select functionality
This commit is contained in:
parent
5417101ca0
commit
acd64cde37
2 changed files with 59 additions and 21 deletions
|
@ -124,7 +124,6 @@ var dme_in_range = props.globals.getNode("instrumentation/nav[0]/dme-in-range",
|
|||
var dme_data = props.globals.getNode("instrumentation/dme[0]/indicated-distance-nm", 1);
|
||||
var ils_crs = props.globals.getNode("instrumentation/nav[0]/radials/selected-deg", 1);
|
||||
var ils1_crs_set = props.globals.getNode("FMGC/internal/ils1crs-set/", 1);
|
||||
var arrival_airport = props.globals.getNode("FMGC/internal/arr-arpt", 1);
|
||||
var outer_marker = props.globals.getNode("instrumentation/marker-beacon/outer", 1);
|
||||
var middle_marker = props.globals.getNode("instrumentation/marker-beacon/middle", 1);
|
||||
var inner_marker = props.globals.getNode("instrumentation/marker-beacon/inner", 1);
|
||||
|
@ -871,7 +870,7 @@ var canvas_PFD_base = {
|
|||
me["TRK_pointer"].setTranslation((track_diff.getValue() / 10) * 98.5416, 0);
|
||||
split_ils = split("/", ils_data1.getValue());
|
||||
|
||||
if (ap_ils_mode.getValue() == 1 and ils1_crs_set.getValue() == 1 and size(split_ils) == 2) {
|
||||
if (ap_ils_mode.getValue() == 1 and size(split_ils) == 2) {
|
||||
magnetic_hdg = ils_crs.getValue();
|
||||
magnetic_hdg_dif = geo.normdeg180(magnetic_hdg - heading.getValue());
|
||||
if (magnetic_hdg_dif >= -23.62 and magnetic_hdg_dif <= 23.62) {
|
||||
|
@ -906,25 +905,6 @@ var canvas_PFD_base = {
|
|||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
}
|
||||
|
||||
#Approach selected and tuned, overwrite RAD NAV
|
||||
# } else if (0) {
|
||||
# var runways = airportinfo(airportinfo(arrival_airport.getValue()).id).runways;
|
||||
# var runway_keys = sort(keys(runways), string.icmp);
|
||||
# foreach(var rwy; runway_keys) {
|
||||
# var r = runways[rwy];
|
||||
# if (r.ils_frequency_mhz == split_ils[1]) {
|
||||
# magnetic_hdg = r.heading - getprop("environment/magnetic-variation-deg");
|
||||
# magnetic_hdg_dif = geo.normdeg180(magnetic_hdg - heading.getValue());
|
||||
#
|
||||
# SET THE FMGC values here!!!!!
|
||||
# course = r.heading;
|
||||
# ils_frequency = r.ils_frequency_mhz;
|
||||
#
|
||||
# break;
|
||||
# }
|
||||
# }
|
||||
|
||||
} else {
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["ILS_HDG_L"].hide();
|
||||
|
|
|
@ -463,6 +463,64 @@ var masterFMGC = maketimer(0.2, func {
|
|||
if (pts.Position.gearAglFt.getValue() >= 55) {
|
||||
setprop("FMGC/status/to-state", 0);
|
||||
}
|
||||
|
||||
#handle radios, runways, v1/vr/v2
|
||||
if (fmgc.flightPlanController.flightplans[2].approach != nil and phase >= 2) {
|
||||
var runways = airportinfo(airportinfo(getprop("FMGC/internal/arr-arpt")).id).runways;
|
||||
var rwy = string.replace(fmgc.flightPlanController.flightplans[2].approach.id, "ILS", "");
|
||||
if (runways[rwy] != nil) {
|
||||
var r = runways[rwy];
|
||||
#print(r.lat);
|
||||
#print(r.lon);
|
||||
#print(r.length);
|
||||
#print(r.width);
|
||||
#print(r.heading);
|
||||
#print(r.stopway);
|
||||
#print(r.threshold);
|
||||
magnetic_hdg = geo.normdeg(r.heading - getprop("environment/magnetic-variation-deg"));
|
||||
if (!getprop("FMGC/internal/ils1freq-set") and !getprop("FMGC/internal/ils1crs-set")) {
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", r.ils_frequency_mhz);
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
} else if (!getprop("FMGC/internal/ils1freq-set")) {
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", r.ils_frequency_mhz);
|
||||
} else if (!getprop("FMGC/internal/ils1crs-set")) {
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
}
|
||||
# if (getprop("FMGC/internal/ils1freq-set") and r.ils_frequency_mhz != getprop("instrumentation/nav[0]/frequencies/selected-mhz")) {
|
||||
# if (getprop("MCDU[0]/page") == "RADNAV") {
|
||||
# setprop("MCDU[0]/scratchpad-msg", 1);
|
||||
# setprop("MCDU[0]/scratchpad", "RWY/LS MISMATCH");
|
||||
# } else if (getprop("MCDU[1]/page") == "RADNAV") {
|
||||
# setprop("MCDU[1]/scratchpad-msg", 1);
|
||||
# setprop("MCDU[1]/scratchpad", "RWY/LS MISMATCH");
|
||||
# }
|
||||
# }
|
||||
}
|
||||
} else if (fmgc.flightPlanController.flightplans[2].departure_runway != nil and phase <= 1) {
|
||||
var runways = airportinfo(airportinfo(getprop("FMGC/internal/dep-arpt")).id).runways;
|
||||
var rwy = fmgc.flightPlanController.flightplans[2].departure_runway.id;
|
||||
if (runways[rwy] != nil) {
|
||||
var r = runways[rwy];
|
||||
magnetic_hdg = geo.normdeg(r.heading - getprop("environment/magnetic-variation-deg"));
|
||||
if (!getprop("FMGC/internal/ils1freq-set") and !getprop("FMGC/internal/ils1crs-set")) {
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", r.ils_frequency_mhz);
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
} else if (!getprop("FMGC/internal/ils1freq-set")) {
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", r.ils_frequency_mhz);
|
||||
} else if (!getprop("FMGC/internal/ils1crs-set")) {
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
}
|
||||
# if (getprop("FMGC/internal/ils1freq-set") and r.ils_frequency_mhz != getprop("instrumentation/nav[0]/frequencies/selected-mhz")) {
|
||||
# if (getprop("MCDU[0]/page") == "RADNAV") {
|
||||
# setprop("MCDU[0]/scratchpad-msg", 1);
|
||||
# setprop("MCDU[0]/scratchpad", "RWY/LS MISMATCH");
|
||||
# } else if (getprop("MCDU[1]/page") == "RADNAV") {
|
||||
# setprop("MCDU[1]/scratchpad-msg", 1);
|
||||
# setprop("MCDU[1]/scratchpad", "RWY/LS MISMATCH");
|
||||
# }
|
||||
# }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var reset_FMGC = func {
|
||||
|
|
Loading…
Reference in a new issue