1
0
Fork 0

Add dummy protection speeds, need to fix bottom bar

This commit is contained in:
Matthew Maring 2020-04-11 15:31:58 -04:00
parent e2d40158f8
commit 4173e37e22
3 changed files with 1953 additions and 465 deletions

View file

@ -215,7 +215,7 @@ var canvas_PFD_base = {
getKeys: func() {
return ["FMA_man","FMA_manmode","FMA_flxmode","FMA_flxtemp","FMA_thrust","FMA_lvrclb","FMA_pitch","FMA_pitcharm","FMA_pitcharm2","FMA_roll","FMA_rollarm","FMA_combined","FMA_ctr_msg","FMA_catmode","FMA_cattype","FMA_nodh","FMA_dh","FMA_dhn","FMA_ap","FMA_fd","FMA_athr",
"FMA_man_box","FMA_flx_box","FMA_thrust_box","FMA_pitch_box","FMA_pitcharm_box","FMA_roll_box","FMA_rollarm_box","FMA_combined_box","FMA_catmode_box","FMA_cattype_box","FMA_cat_box","FMA_dh_box","FMA_ap_box","FMA_fd_box","FMA_athr_box","FMA_Middle1",
"FMA_Middle2","ASI_max","ASI_scale","ASI_target","ASI_mach","ASI_mach_decimal","ASI_trend_up","ASI_trend_down","ASI_digit_UP","ASI_digit_DN","ASI_decimal_UP","ASI_decimal_DN","ASI_index","ASI_error","ASI_group","ASI_frame","AI_center","AI_bank",
"FMA_Middle2","ALPHA_MAX","ALPHA_PROT","ALPHA_SW","VLS_min","ASI_max","ASI_scale","ASI_target","ASI_mach","ASI_mach_decimal","ASI_trend_up","ASI_trend_down","ASI_digit_UP","ASI_digit_DN","ASI_decimal_UP","ASI_decimal_DN","ASI_index","ASI_error","ASI_group","ASI_frame","AI_center","AI_bank",
"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_box_flash","ALT_box","ALT_box_amber",
"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",
@ -1127,6 +1127,51 @@ var canvas_PFD_1 = {
me["ASI_scale"].setTranslation(0, me.ASI * 6.6);
me["ASI_max"].setTranslation(0, me.ASImax * -6.6);
if (FMGCphase.getValue() >= 2 and FMGCphase.getValue() <= 6) {
me.FMGC_vls = getprop("FMGC/internal/computed-speeds/vls_min");
if (me.FMGC_vls <= 30) {
me.VLSmin = 0 - me.ASI;
} else if (me.FMGC_vls >= 420) {
me.VLSmin = 390 - me.ASI;
} else {
me.VLSmin = me.FMGC_vls - 30 - me.ASI;
}
me.FMGC_prot = getprop("FMGC/internal/computed-speeds/vls_min") * 0.95;
if (me.FMGC_prot <= 30) {
me.ALPHAprot = 0 - me.ASI;
} else if (me.FMGC_prot >= 420) {
me.ALPHAprot = 390 - me.ASI;
} else {
me.ALPHAprot = me.FMGC_prot - 30 - me.ASI;
}
me.FMGC_max = getprop("FMGC/internal/computed-speeds/vls_min") * 0.90;
if (me.FMGC_max <= 30) {
me.ALPHAmax = 0 - me.ASI;
} else if (me.FMGC_max >= 420) {
me.ALPHAmax = 390 - me.ASI;
} else {
me.ALPHAmax = me.FMGC_max - 30 - me.ASI;
}
me["VLS_min"].setTranslation(0, me.VLSmin * -6.6);
me["VLS_min"].show();
me["ALPHA_PROT"].setTranslation(0, me.ALPHAprot * -6.6); #CHANGE LATER
me["ALPHA_MAX"].setTranslation(0, me.ALPHAmax * -6.6); #CHANGE LATER
if (getprop("it-fbw/law") == 0) {
me["ALPHA_PROT"].show();
me["ALPHA_MAX"].show();
me["ALPHA_SW"].hide();
} else {
me["ALPHA_PROT"].hide();
me["ALPHA_MAX"].hide();
me["ALPHA_SW"].show();
}
} else {
me["VLS_min"].hide();
me["ALPHA_PROT"].hide();
me["ALPHA_MAX"].hide();
me["ALPHA_SW"].hide();
}
if (managed_spd.getValue() == 1) {
if (FMGCphase.getValue() == 5) {
vapp = getprop("FMGC/internal/computed-speeds/vapp");
@ -1785,6 +1830,51 @@ var canvas_PFD_2 = {
me["ASI_scale"].setTranslation(0, me.ASI * 6.6);
me["ASI_max"].setTranslation(0, me.ASImax * -6.6);
if (FMGCphase.getValue() >= 2 and FMGCphase.getValue() <= 6) {
me.FMGC_vls = getprop("FMGC/internal/computed-speeds/vls_min");
if (me.FMGC_vls <= 30) {
me.VLSmin = 0 - me.ASI;
} else if (me.FMGC_vls >= 420) {
me.VLSmin = 390 - me.ASI;
} else {
me.VLSmin = me.FMGC_vls - 30 - me.ASI;
}
me.FMGC_prot = getprop("FMGC/internal/computed-speeds/vls_min") * 0.95;
if (me.FMGC_prot <= 30) {
me.ALPHAprot = 0 - me.ASI;
} else if (me.FMGC_prot >= 420) {
me.ALPHAprot = 390 - me.ASI;
} else {
me.ALPHAprot = me.FMGC_prot - 30 - me.ASI;
}
me.FMGC_max = getprop("FMGC/internal/computed-speeds/vls_min") * 0.90;
if (me.FMGC_max <= 30) {
me.ALPHAmax = 0 - me.ASI;
} else if (me.FMGC_max >= 420) {
me.ALPHAmax = 390 - me.ASI;
} else {
me.ALPHAmax = me.FMGC_max - 30 - me.ASI;
}
me["VLS_min"].setTranslation(0, me.VLSmin * -6.6);
me["VLS_min"].show();
me["ALPHA_PROT"].setTranslation(0, me.ALPHAprot * -6.6); #CHANGE LATER
me["ALPHA_MAX"].setTranslation(0, me.ALPHAmax * -6.6); #CHANGE LATER
if (getprop("it-fbw/law") == 0) {
me["ALPHA_PROT"].show();
me["ALPHA_MAX"].show();
me["ALPHA_SW"].hide();
} else {
me["ALPHA_PROT"].hide();
me["ALPHA_MAX"].hide();
me["ALPHA_SW"].show();
}
} else {
me["VLS_min"].hide();
me["ALPHA_PROT"].hide();
me["ALPHA_MAX"].hide();
me["ALPHA_SW"].hide();
}
if (managed_spd.getValue() == 1) {
if (FMGCphase.getValue() == 5) {
vapp = getprop("FMGC/internal/computed-speeds/vapp");

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 293 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View file

@ -392,6 +392,20 @@ var masterFMGC = maketimer(0.2, func {
setprop("FMGC/internal/computed-speeds/vls_appr", vls_appr);
setprop("FMGC/internal/computed-speeds/vapp_appr", vapp_appr);
if (flap == 0) { # 0
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_clean * 1.23);
} else if (flap == 1) { # 1
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_conf_1 * 1.23);
} else if (flap == 2) { # 1+F
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_conf_1f * 1.23);
} else if (flap == 3) { # 2
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_conf_2 * 1.23);
} else if (flap == 4) { # 3
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_conf_3 * 1.23);;
} else if (flap == 5) { # FULL
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_conf_full * 1.23);
}
if (flap == 0) { # 0
setprop("FMGC/internal/minspeed", clean);
} else if (flap == 1) { # 1