Merge branch 'master' into MCDU
This commit is contained in:
commit
f3ecdcb713
3 changed files with 16 additions and 7 deletions
|
@ -112,7 +112,7 @@
|
|||
</text>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>4) Contact "Wecsje" or "it0uchpods" on the FlightGear Forums.</label>
|
||||
<label>4) Open a topic describing the situation in the FlightGear Forums.</label>
|
||||
</text>
|
||||
</group>
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
var gear2 = getprop("/gear/gear[2]/wow");
|
||||
var gnds_mps = 0;
|
||||
var current_course = 0;
|
||||
var wp_fly_from = 0;
|
||||
var wp_fly_to = 0;
|
||||
var next_course = 0;
|
||||
var max_bank_limit = 0;
|
||||
|
@ -224,6 +225,7 @@ var fmabox = func {
|
|||
# Master Lateral
|
||||
setlistener("/it-autoflight/input/lat", func {
|
||||
if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/gear/gear[2]/wow") == 0)) {
|
||||
setprop("/it-autoflight/input/lat-arm", 0);
|
||||
lateral();
|
||||
} else {
|
||||
lat_arm();
|
||||
|
@ -554,12 +556,16 @@ var ap_various = func {
|
|||
|
||||
if (getprop("/autopilot/route-manager/route/num") > 0 and getprop("/autopilot/route-manager/active") == 1) {
|
||||
gnds_mps = getprop("/velocities/groundspeed-kt") * 0.5144444444444;
|
||||
current_course = getprop("/instrumentation/gps/wp/leg-true-course-deg");
|
||||
wp_fly_from = getprop("/autopilot/route-manager/current-wp");
|
||||
if (wp_fly_from < 0) {
|
||||
wp_fly_from = 0;
|
||||
}
|
||||
current_course = getprop("/autopilot/route-manager/route/wp[" ~ wp_fly_from ~ "]/leg-bearing-true-deg");
|
||||
wp_fly_to = getprop("/autopilot/route-manager/current-wp") + 1;
|
||||
if (wp_fly_to < 0) {
|
||||
wp_fly_to = 0;
|
||||
}
|
||||
next_course = getprop("/autopilot/route-manager/route/wp["~wp_fly_to~"]/leg-bearing-true-deg");
|
||||
next_course = getprop("/autopilot/route-manager/route/wp[" ~ wp_fly_to ~ "]/leg-bearing-true-deg");
|
||||
max_bank_limit = getprop("/it-autoflight/internal/bank-limit");
|
||||
|
||||
delta_angle = math.abs(geo.normdeg180(current_course - next_course));
|
||||
|
@ -567,15 +573,18 @@ var ap_various = func {
|
|||
if (max_bank > max_bank_limit) {
|
||||
max_bank = max_bank_limit;
|
||||
}
|
||||
radius = (gnds_mps * gnds_mps) / (9.81 * math.tan(max_bank/57.2957795131));
|
||||
time = 0.64 * gnds_mps * delta_angle * 0.7 / (360 * math.tan(max_bank/57.2957795131));
|
||||
radius = (gnds_mps * gnds_mps) / (9.81 * math.tan(max_bank / 57.2957795131));
|
||||
time = 0.64 * gnds_mps * delta_angle * 0.7 / (360 * math.tan(max_bank / 57.2957795131));
|
||||
delta_angle_rad = (180 - delta_angle) / 114.5915590262;
|
||||
R = radius/math.sin(delta_angle_rad);
|
||||
dist_coeff = delta_angle * -0.011111 + 2;
|
||||
if (dist_coeff < 1) {
|
||||
ist_coeff = 1;
|
||||
dist_coeff = 1;
|
||||
}
|
||||
turn_dist = math.cos(delta_angle_rad) * R * dist_coeff / 1852;
|
||||
if (getprop("/gear/gear[0]/wow") == 1 and turn_dist < 1) {
|
||||
turn_dist = 1;
|
||||
}
|
||||
setprop("/it-autoflight/internal/lnav-advance-nm", turn_dist);
|
||||
if (getprop("/sim/time/elapsed-sec")-getprop("/autopilot/internal/wp-change-time") > 60) {
|
||||
setprop("/autopilot/internal/wp-change-check-period", time);
|
||||
|
|
|
@ -1 +1 @@
|
|||
4070
|
||||
4072
|
Reference in a new issue