1
0
Fork 0

Fix entabing

This commit is contained in:
hayden2000 2020-01-29 06:37:01 -05:00
parent 161ec22f55
commit d978db46a4

View file

@ -769,45 +769,45 @@ var canvas_PFD_base = {
me["TRK_pointer"].setTranslation((track_diff.getValue() / 10) * 98.5416, 0);
if (ap_ils_mode.getValue() == 1) {
var runways = airportinfo(airportinfo(getprop("/FMGC/internal/arr-arpt")).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_data1.getValue())[1]) {
magnetic_hdg = r.heading - getprop("/environment/magnetic-variation-deg");
magnetic_hdg_dif = magnetic_hdg - heading.getValue();
var runways = airportinfo(airportinfo(getprop("/FMGC/internal/arr-arpt")).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_data1.getValue())[1]) {
magnetic_hdg = r.heading - getprop("/environment/magnetic-variation-deg");
magnetic_hdg_dif = 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_R"].hide();
me["ILS_HDG_L"].show();
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();
}
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_R"].hide();
me["ILS_HDG_L"].show();
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_trans.setTranslation(me.middleOffset, horizon_pitch.getValue() * 11.825);
me.AI_horizon_hdg_rot.setRotation(-roll_cur * D2R, me["AI_center"].getCenter());
me["AI_heading"].update();
},
@ -871,21 +871,21 @@ var canvas_PFD_1 = {
if (ap_ils_mode.getValue() == 1) {
me["LOC_scale"].show();
me["GS_scale"].show();
split_ils = split("/", ils_data1.getValue());
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) {
dme_dist_data = dme_data.getValue();
if (dme_dist_data < 10.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();
}
split_ils = split("/", ils_data1.getValue());
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) {
dme_dist_data = dme_data.getValue();
if (dme_dist_data < 10.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();
}
} else {
me["LOC_scale"].hide();
me["GS_scale"].hide();
@ -1185,21 +1185,21 @@ var canvas_PFD_2 = {
if (ap_ils_mode2.getValue() == 1) {
me["LOC_scale"].show();
me["GS_scale"].show();
split_ils = split("/", ils_data1.getValue());
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) {
dme_dist_data = dme_data.getValue();
if (dme_dist_data < 10.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();
}
split_ils = split("/", ils_data1.getValue());
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) {
dme_dist_data = dme_data.getValue();
if (dme_dist_data < 10.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();
}
} else {
me["LOC_scale"].hide();
me["GS_scale"].hide();