Merge branch 'hayden2000-pfd' into dev
This commit is contained in:
commit
f9af7e01e9
2 changed files with 4141 additions and 3990 deletions
|
@ -117,6 +117,9 @@ var ils_data1 = props.globals.getNode("/FMGC/internal/ils1-mcdu/", 1);
|
|||
# var ils_data2 = props.globals.getNode("/FMGC/internal/ils2-mcdu/", 1);
|
||||
var dme_in_range = props.globals.getNode("/instrumentation/nav[0]/dme-in-range", 1);
|
||||
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);
|
||||
|
||||
# Create Nodes:
|
||||
var vs_needle = props.globals.initNode("/instrumentation/pfd/vs-needle", 0.0, "DOUBLE");
|
||||
|
@ -194,7 +197,7 @@ var canvas_PFD_base = {
|
|||
"AI_bank_lim","AI_bank_lim_X","AI_pitch_lim","AI_pitch_lim_X","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky","AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","AI_error","AI_group","FD_roll","FD_pitch","ALT_scale","ALT_target",
|
||||
"ALT_target_digit","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_digit_UP","ALT_digit_DN","ALT_error","ALT_group","ALT_group2","ALT_frame","VS_pointer","VS_box","VS_digit","VS_error","VS_group","QNH","QNH_setting",
|
||||
"QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","HDG_error","HDG_group","HDG_frame",
|
||||
"TRK_pointer","machError","ilsError","ils_code","ils_freq","dme_dist","dme_dist_legend"];
|
||||
"TRK_pointer","machError","ilsError","ils_code","ils_freq","dme_dist","dme_dist_legend", "ILS_HDG_R", "ILS_HDG_L", "ILS_right", "ILS_left"];
|
||||
},
|
||||
updateDu1: func() {
|
||||
var elapsedtime_act = elapsedtime.getValue();
|
||||
|
@ -703,8 +706,7 @@ var canvas_PFD_base = {
|
|||
}
|
||||
|
||||
# ILS
|
||||
me["LOC_pointer"].setTranslation(loc.getValue() * 197, 0);
|
||||
|
||||
me["LOC_pointer"].setTranslation(loc.getValue() * 197, 0);
|
||||
me["GS_pointer"].setTranslation(0, gs.getValue() * -197);
|
||||
|
||||
# Heading
|
||||
|
@ -768,9 +770,76 @@ var canvas_PFD_base = {
|
|||
}
|
||||
|
||||
me["TRK_pointer"].setTranslation((track_diff.getValue() / 10) * 98.5416, 0);
|
||||
split_ils = split("/", ils_data1.getValue());
|
||||
|
||||
me["CRS_pointer"].hide();
|
||||
#Secondary via RAD-NAV
|
||||
if (ap_ils_mode.getValue() == 1 and ils1_crs_set.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) {
|
||||
me["CRS_pointer"].setTranslation((magnetic_hdg_dif / 10) * 98.5416, 0);
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].show();
|
||||
} else if (magnetic_hdg_dif < -23.62 and magnetic_hdg_dif >= -180) {
|
||||
me["ILS_left"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
me["ILS_HDG_L"].show();
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
} else if (magnetic_hdg_dif > 23.62 and magnetic_hdg_dif <= 180) {
|
||||
me["ILS_right"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
me["ILS_HDG_R"].show();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
} else {
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
}
|
||||
} else {
|
||||
me["ILS_HDG_R"].hide();
|
||||
me["ILS_HDG_L"].hide();
|
||||
me["CRS_pointer"].hide();
|
||||
}
|
||||
|
||||
# Primary via MCDU, not implemented yet
|
||||
# if (ap_ils_mode.getValue() == 1 and arrival_airport.getValue() != "" and size(split_ils) == 2) {
|
||||
# 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());
|
||||
# if (magnetic_hdg_dif >= -23.62 and magnetic_hdg_dif <= 23.62) {
|
||||
# me["CRS_pointer"].setTranslation((magnetic_hdg_dif / 10) * 98.5416, 0);
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].show();
|
||||
# } else if (magnetic_hdg_dif < -23.62 and magnetic_hdg_dif >= -180) {
|
||||
# me["ILS_left"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
# me["ILS_HDG_L"].show();
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# } else if (magnetic_hdg_dif > 23.62 and magnetic_hdg_dif <= 180) {
|
||||
# me["ILS_right"].setText(sprintf("%3.0f", int(magnetic_hdg)));
|
||||
# me["ILS_HDG_R"].show();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# } else {
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# }
|
||||
# break;
|
||||
# }
|
||||
# }
|
||||
# } else {
|
||||
# me["ILS_HDG_R"].hide();
|
||||
# me["ILS_HDG_L"].hide();
|
||||
# me["CRS_pointer"].hide();
|
||||
# }
|
||||
|
||||
# AI HDG
|
||||
me.AI_horizon_hdg_trans.setTranslation(me.middleOffset, horizon_pitch.getValue() * 11.825);
|
||||
me.AI_horizon_hdg_rot.setRotation(-roll_cur * D2R, me["AI_center"].getCenter());
|
||||
|
@ -836,12 +905,28 @@ var canvas_PFD_1 = {
|
|||
if (ap_ils_mode.getValue() == 1) {
|
||||
me["LOC_scale"].show();
|
||||
me["GS_scale"].show();
|
||||
me["ils_code"].setText(split("/", ils_data1.getValue())[0]);
|
||||
me["ils_freq"].setText(split("/", ils_data1.getValue())[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
split_ils = split("/", ils_data1.getValue());
|
||||
|
||||
if (size(split_ils) < 2) {
|
||||
me["ils_freq"].setText(split_ils[0]);
|
||||
me["ils_freq"].show();
|
||||
me["ils_code"].hide();
|
||||
me["dme_dist"].hide();
|
||||
me["dme_dist_legend"].hide();
|
||||
} else {
|
||||
me["ils_code"].setText(split_ils[0]);
|
||||
me["ils_freq"].setText(split_ils[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
}
|
||||
|
||||
if (dme_in_range.getValue() == 1) {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", int(dme_data.getValue())));
|
||||
dme_dist_data = dme_data.getValue();
|
||||
if (dme_dist_data < 20.0) {
|
||||
me["dme_dist"].setText(sprintf("%1.1f", dme_dist_data));
|
||||
} else {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", dme_dist_data));
|
||||
}
|
||||
me["dme_dist"].show();
|
||||
me["dme_dist_legend"].show();
|
||||
}
|
||||
|
@ -1144,13 +1229,28 @@ var canvas_PFD_2 = {
|
|||
if (ap_ils_mode2.getValue() == 1) {
|
||||
me["LOC_scale"].show();
|
||||
me["GS_scale"].show();
|
||||
# Independent MCDU ILS not implemented yet, use MCDU1 in the meantime
|
||||
me["ils_code"].setText(split("/", ils_data1.getValue())[0]);
|
||||
me["ils_freq"].setText(split("/", ils_data1.getValue())[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
split_ils = split("/", ils_data1.getValue());
|
||||
|
||||
if (size(split_ils) < 2) {
|
||||
me["ils_freq"].setText(split_ils[0]);
|
||||
me["ils_freq"].show();
|
||||
me["ils_code"].hide();
|
||||
me["dme_dist"].hide();
|
||||
me["dme_dist_legend"].hide();
|
||||
} else {
|
||||
me["ils_code"].setText(split_ils[0]);
|
||||
me["ils_freq"].setText(split_ils[1]);
|
||||
me["ils_code"].show();
|
||||
me["ils_freq"].show();
|
||||
}
|
||||
|
||||
if (dme_in_range.getValue() == 1) {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", int(dme_data.getValue())));
|
||||
dme_dist_data = dme_data.getValue();
|
||||
if (dme_dist_data < 20.0) {
|
||||
me["dme_dist"].setText(sprintf("%1.1f", dme_dist_data));
|
||||
} else {
|
||||
me["dme_dist"].setText(sprintf("%2.0f", dme_dist_data));
|
||||
}
|
||||
me["dme_dist"].show();
|
||||
me["dme_dist_legend"].show();
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 282 KiB |
Loading…
Add table
Reference in a new issue