1
0
Fork 0

Autopush: update to last version

This commit is contained in:
legoboyvdlp R 2020-11-15 18:49:17 +00:00
parent 3456e840f0
commit 1cf8fb5cfd
4 changed files with 14 additions and 12 deletions

View file

@ -4506,13 +4506,13 @@
<file>Aircraft/A320-family/Nasal/Autopush/autopush.nas</file>
</autopush>
<autopush_driver>
<file>Aircraft/A320-family/Nasal/Autopush/autopush_driver.nas</file>
<file>Aircraft/A320-family/Nasal/Autopush/driver.nas</file>
</autopush_driver>
<dynarr>
<file>Aircraft/A320-family/Nasal/Autopush/dynarr.nas</file>
</dynarr>
<autopush_route>
<file>Aircraft/A320-family/Nasal/Autopush/autopush_route.nas</file>
<file>Aircraft/A320-family/Nasal/Autopush/route.nas</file>
</autopush_route>
<!-- Panels -->
<rmp>

View file

@ -35,8 +35,8 @@ var _loop = func() {
var y = 0.0;
var z = 0.0;
# Rollspeed is only adequate if the wheel is touching the ground.
if (getprop("gear/gear[0]/wow")) {
var V = getprop("gear/gear[0]/rollspeed-ms") * 3.6;
if (getprop("/gear/gear[0]/wow")) {
var V = getprop("/gear/gear[0]/rollspeed-ms") * 3.6;
var deltaV = getprop("/sim/model/autopush/target-speed-km_h") - V;
var minus_dV = _V - V;
var time = getprop("/sim/time/elapsed-sec");
@ -59,9 +59,9 @@ var _loop = func() {
_V = V;
_time = time;
if (!_yasim) {
force = accel * getprop("fdm/jsbsim/inertia/weight-lbs") * _unitconv;
force = accel * getprop("/fdm/jsbsim/inertia/weight-lbs") * _unitconv;
} else {
force = accel * getprop("fdm/yasim/gross-weight-lbs") * _unitconv;
force = accel * getprop("/fdm/yasim/gross-weight-lbs") * _unitconv;
}
var pitch = getprop("/sim/model/autopush/pitch-deg") * D2R;
z = math.sin(pitch);
@ -85,12 +85,13 @@ var _loop = func() {
}
var _timer = maketimer(0.0167, func{_loop()});
_timer.simulatedTime = 1;
var _start = func() {
# Else overwritten by dialog.
settimer(func() {
setprop("/sim/model/autopush/target-speed-km_h", 0.0)
}, 0.1);
}, 0.1, 1);
_K_p = getprop("/sim/model/autopush/K_p");
_F_p = getprop("/sim/model/autopush/F_p");
_K_i = getprop("/sim/model/autopush/K_i");

View file

@ -54,7 +54,7 @@ var _loop = func() {
D *= NM2M;
var (psi_leg, D_leg) = courseAndDistance(_route[_to_wp - 1], _route[_to_wp]);
var deltapsi = geo.normdeg180(A - psi_leg);
var psi = getprop("orientation/heading-deg") + _push * 180.0;
var psi = getprop("/orientation/heading-deg") + _push * 180.0;
var deltaA = math.min(math.max(_K_psi * geo.normdeg180(A - psi), -_F_psi), _F_psi);
var time = getprop("/sim/time/elapsed-sec");
var dt = time - _time;
@ -88,6 +88,7 @@ var _loop = func() {
}
var _timer = maketimer(0.051, func{_loop()});
_timer.simulatedTime = 1;
var _done = func() {
stop();
@ -123,7 +124,7 @@ var start = func() {
_debug = getprop("/sim/model/autopush/debug") or 0;
if (!_to_wp) {
var (psi_park, D_park) = courseAndDistance(_route[0], _route[1]);
_push = (abs(geo.normdeg180(getprop("orientation/heading-deg") - psi_park)) > 90.0);
_push = (abs(geo.normdeg180(getprop("/orientation/heading-deg") - psi_park)) > 90.0);
_sign = 1.0 - 2.0 * _push;
_advance_wp();
_psi = 0.0;

View file

@ -89,7 +89,7 @@ var _stop = func(fail = 0) {
settimer(func() {
_finalize_top_view();
gui.popupTip("Done");
}, 1.0);
}, 1.0, 1);
} else {
_finalize_top_view();
}
@ -365,12 +365,12 @@ var enter = func() {
var wingspan = getprop("/sim/model/autopush/route/wingspan-m");
if ((wingspan == nil) or (wingspan == 0.0)) {
# JSBSim
wingspan = getprop("fdm/jsbsim/metrics/bw-ft");
wingspan = getprop("/fdm/jsbsim/metrics/bw-ft");
if (wingspan != nil) {
wingspan *= FT2M;
} else {
# YAsim
wingspan = getprop("fdm/yasim/model/wings/wing/wing-span");
wingspan = getprop("/fdm/yasim/model/wings/wing/wing-span");
}
setprop("/sim/model/autopush/route/wingspan-m", wingspan);
}