From 76683730a62cb32406fd43153b20fae7264a0061 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Tue, 24 Jul 2018 20:02:48 -0400 Subject: [PATCH] Control: Fix AP capture problems when descending --- Nasal/FMGC-b.nas | 8 ++++---- revision.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Nasal/FMGC-b.nas b/Nasal/FMGC-b.nas index 3bc66087..6be8a027 100644 --- a/Nasal/FMGC-b.nas +++ b/Nasal/FMGC-b.nas @@ -751,8 +751,8 @@ var updateTimers = func { # Altitude Capture var altcapt = func { vsnow = getprop("/it-autoflight/internal/vert-speed-fpm"); - setprop("/it-autoflight/internal/captvs", math.round(vsnow / 5, 100)); - setprop("/it-autoflight/internal/captvsneg", -1 * math.round(vsnow / 5, 100)); + setprop("/it-autoflight/internal/captvs", math.round(abs(vsnow) / 5, 100)); + setprop("/it-autoflight/internal/captvsneg", -1 * math.round(abs(vsnow) / 5, 100)); if ((getprop("/it-autoflight/output/fd1") == 1 or getprop("/it-autoflight/output/fd2") == 1 or getprop("/it-autoflight/output/ap1") == 1 or getprop("/it-autoflight/output/ap2") == 1) and getprop("/it-autoflight/output/vert") != 9) { var calt = getprop("/instrumentation/altimeter/indicated-altitude-ft"); var alt = getprop("/it-autoflight/internal/alt"); @@ -1171,8 +1171,8 @@ var mng_des_fpm = func { # Managed Capture var mng_altcapt = func { vsnow = getprop("/it-autoflight/internal/vert-speed-fpm"); - setprop("/it-autoflight/internal/captvs", math.round(vsnow / 5, 100)); - setprop("/it-autoflight/internal/captvsneg", -1 * math.round(vsnow / 5, 100)); + setprop("/it-autoflight/internal/captvs", math.round(abs(vsnow) / 5, 100)); + setprop("/it-autoflight/internal/captvsneg", -1 * math.round(abs(vsnow) / 5, 100)); var MNGalt = getprop("/it-autoflight/internal/mng-alt"); var MCPalt = getprop("/it-autoflight/internal/alt"); var MNGdif = abs(MNGalt - MCPalt); diff --git a/revision.txt b/revision.txt index 416e8e4f..e45a74e6 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4610 \ No newline at end of file +4611 \ No newline at end of file