1
0
Fork 0

FMGC: Streamline autopilot speeds

This commit is contained in:
Josh Davidson 2020-07-08 21:12:02 -04:00
parent d2dbb68201
commit e6a6398ff6
9 changed files with 95 additions and 95 deletions

View file

@ -4323,7 +4323,7 @@
<axis-alignment>xy-plane</axis-alignment> <axis-alignment>xy-plane</axis-alignment>
<type type="string">number-value</type> <type type="string">number-value</type>
<format type="string">%3.0f</format> <format type="string">%3.0f</format>
<property>it-autoflight/input/spd-kts</property> <property>it-autoflight/input/kts</property>
<truncate>false</truncate> <truncate>false</truncate>
<font type="string">led.txf</font> <font type="string">led.txf</font>
<draw-text>true</draw-text> <draw-text>true</draw-text>
@ -4349,7 +4349,7 @@
<axis-alignment>xy-plane</axis-alignment> <axis-alignment>xy-plane</axis-alignment>
<type type="string">number-value</type> <type type="string">number-value</type>
<format type="string">%0.3f</format> <format type="string">%0.3f</format>
<property>it-autoflight/input/spd-mach</property> <property>it-autoflight/input/mach</property>
<truncate>false</truncate> <truncate>false</truncate>
<font type="string">led.txf</font> <font type="string">led.txf</font>
<draw-text>true</draw-text> <draw-text>true</draw-text>

View file

@ -2531,9 +2531,9 @@ var canvas_MCDU_base = {
} else { } else {
me["Simple_L1"].setText("SELECTED"); me["Simple_L1"].setText("SELECTED");
if (getprop("/it-autoflight/input/kts-mach")) { if (getprop("/it-autoflight/input/kts-mach")) {
me["Simple_L4"].setText(sprintf(" %3.3f", getprop("/it-autoflight/input/spd-mach"))); me["Simple_L4"].setText(sprintf(" %3.3f", getprop("/it-autoflight/input/mach")));
} else { } else {
me["Simple_L4"].setText(sprintf(" %s", int(getprop("/it-autoflight/input/spd-kts")))); me["Simple_L4"].setText(sprintf(" %s", int(getprop("/it-autoflight/input/kts"))));
} }
me.fontLeft(0, 0, 0, default, 0, 0); me.fontLeft(0, 0, 0, default, 0, 0);
} }
@ -2685,9 +2685,9 @@ var canvas_MCDU_base = {
} else { } else {
me["Simple_L1"].setText("SELECTED"); me["Simple_L1"].setText("SELECTED");
if (getprop("/it-autoflight/input/kts-mach")) { if (getprop("/it-autoflight/input/kts-mach")) {
me["Simple_L4"].setText(sprintf(" %3.3f", getprop("/it-autoflight/input/spd-mach"))); me["Simple_L4"].setText(sprintf(" %3.3f", getprop("/it-autoflight/input/mach")));
} else { } else {
me["Simple_L4"].setText(sprintf(" %s", int(getprop("/it-autoflight/input/spd-kts")))); me["Simple_L4"].setText(sprintf(" %s", int(getprop("/it-autoflight/input/kts"))));
} }
me.fontLeft(0, 0, 0, default, 0, 0); me.fontLeft(0, 0, 0, default, 0, 0);
} }
@ -2846,9 +2846,9 @@ var canvas_MCDU_base = {
} else { } else {
me["Simple_L1"].setText("SELECTED"); me["Simple_L1"].setText("SELECTED");
if (getprop("/it-autoflight/input/kts-mach")) { if (getprop("/it-autoflight/input/kts-mach")) {
me["Simple_L4"].setText(sprintf(" %3.3f", getprop("/it-autoflight/input/spd-mach"))); me["Simple_L4"].setText(sprintf(" %3.3f", getprop("/it-autoflight/input/mach")));
} else { } else {
me["Simple_L4"].setText(sprintf(" %3.0f", getprop("/it-autoflight/input/spd-kts"))); me["Simple_L4"].setText(sprintf(" %3.0f", getprop("/it-autoflight/input/kts")));
} }
me.fontLeft(0, 0, 0, default, 0, 0); me.fontLeft(0, 0, 0, default, 0, 0);
} }

View file

@ -82,8 +82,8 @@ var FMGC_max_spd = props.globals.getNode("/FMGC/internal/maxspeed", 1);
var ind_spd_kt = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1); var ind_spd_kt = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1);
var ind_spd_mach = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1); var ind_spd_mach = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1);
var at_mach_mode = props.globals.getNode("/it-autoflight/input/kts-mach", 1); var at_mach_mode = props.globals.getNode("/it-autoflight/input/kts-mach", 1);
var at_input_spd_mach = props.globals.getNode("/it-autoflight/input/spd-mach", 1); var at_input_spd_mach = props.globals.getNode("/it-autoflight/input/mach", 1);
var at_input_spd_kts = props.globals.getNode("/it-autoflight/input/spd-kts", 1); var at_input_spd_kts = props.globals.getNode("/it-autoflight/input/kts", 1);
var fd_roll = props.globals.getNode("/it-autoflight/fd/roll-bar", 1); var fd_roll = props.globals.getNode("/it-autoflight/fd/roll-bar", 1);
var fd_pitch = props.globals.getNode("/it-autoflight/fd/pitch-bar", 1); var fd_pitch = props.globals.getNode("/it-autoflight/fd/pitch-bar", 1);
var decision = props.globals.getNode("/instrumentation/mk-viii/inputs/arinc429/decision-height", 1); var decision = props.globals.getNode("/instrumentation/mk-viii/inputs/arinc429/decision-height", 1);

View file

@ -2,37 +2,37 @@
# Copyright (c) 2020 Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp) # Copyright (c) 2020 Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp)
# Nodes # Nodes
var fd1 = props.globals.getNode("it-autoflight/output/fd1", 1); var fd1 = props.globals.getNode("/it-autoflight/output/fd1", 1);
var fd2 = props.globals.getNode("it-autoflight/output/fd2", 1); var fd2 = props.globals.getNode("/it-autoflight/output/fd2", 1);
var ap1 = props.globals.getNode("it-autoflight/output/ap1", 1); var ap1 = props.globals.getNode("/it-autoflight/output/ap1", 1);
var ap2 = props.globals.getNode("it-autoflight/output/ap2", 1); var ap2 = props.globals.getNode("/it-autoflight/output/ap2", 1);
var athr = props.globals.getNode("it-autoflight/output/athr", 1); var athr = props.globals.getNode("/it-autoflight/output/athr", 1);
var fd1Input = props.globals.getNode("it-autoflight/input/fd1", 1); var fd1Input = props.globals.getNode("/it-autoflight/input/fd1", 1);
var fd2Input = props.globals.getNode("it-autoflight/input/fd2", 1); var fd2Input = props.globals.getNode("/it-autoflight/input/fd2", 1);
var ap1Input = props.globals.getNode("it-autoflight/input/ap1", 1); var ap1Input = props.globals.getNode("/it-autoflight/input/ap1", 1);
var ap2Input = props.globals.getNode("it-autoflight/input/ap2", 1); var ap2Input = props.globals.getNode("/it-autoflight/input/ap2", 1);
var athrInput = props.globals.getNode("it-autoflight/input/athr", 1); var athrInput = props.globals.getNode("/it-autoflight/input/athr", 1);
var ktsMach = props.globals.getNode("it-autoflight/input/kts-mach", 1); var ktsMach = props.globals.getNode("/it-autoflight/input/kts-mach", 1);
var iasSet = props.globals.getNode("it-autoflight/input/spd-kts", 1); var iasSet = props.globals.getNode("/it-autoflight/input/kts", 1);
var machSet = props.globals.getNode("it-autoflight/input/spd-mach", 1); var machSet = props.globals.getNode("/it-autoflight/input/mach", 1);
var hdgSet = props.globals.getNode("it-autoflight/input/hdg", 1); var hdgSet = props.globals.getNode("/it-autoflight/input/hdg", 1);
var altSet = props.globals.getNode("it-autoflight/input/alt", 1); var altSet = props.globals.getNode("/it-autoflight/input/alt", 1);
var altSetMode = props.globals.getNode("it-autoflight/config/altitude-dial-mode", 1); var altSetMode = props.globals.getNode("/it-autoflight/config/altitude-dial-mode", 1);
var vsSet = props.globals.getNode("it-autoflight/input/vs", 1); var vsSet = props.globals.getNode("/it-autoflight/input/vs", 1);
var fpaSet = props.globals.getNode("it-autoflight/input/fpa", 1); var fpaSet = props.globals.getNode("/it-autoflight/input/fpa", 1);
var iasNow = props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt", 1); var iasNow = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1);
var machNow = props.globals.getNode("instrumentation/airspeed-indicator/indicated-mach", 1); var machNow = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1);
var spdManaged = props.globals.getNode("it-autoflight/input/spd-managed", 1); var spdManaged = props.globals.getNode("/it-autoflight/input/spd-managed", 1);
var showHDG = props.globals.getNode("it-autoflight/custom/show-hdg", 1); var showHDG = props.globals.getNode("/it-autoflight/custom/show-hdg", 1);
var trkFpaSW = props.globals.getNode("it-autoflight/custom/trk-fpa", 1); var trkFpaSW = props.globals.getNode("/it-autoflight/custom/trk-fpa", 1);
var latMode = props.globals.getNode("it-autoflight/output/lat", 1); var latMode = props.globals.getNode("/it-autoflight/output/lat", 1);
var vertMode = props.globals.getNode("it-autoflight/output/vert", 1); var vertMode = props.globals.getNode("/it-autoflight/output/vert", 1);
var fpaModeInput = props.globals.getNode("it-autoflight/input/fpa", 1); var fpaModeInput = props.globals.getNode("/it-autoflight/input/fpa", 1);
var latModeInput = props.globals.getNode("it-autoflight/input/lat", 1); var latModeInput = props.globals.getNode("/it-autoflight/input/lat", 1);
var vertModeInput = props.globals.getNode("it-autoflight/input/vert", 1); var vertModeInput = props.globals.getNode("/it-autoflight/input/vert", 1);
var vsModeInput = props.globals.getNode("it-autoflight/input/vs", 1); var vsModeInput = props.globals.getNode("/it-autoflight/input/vs", 1);
var locArm = props.globals.getNode("it-autoflight/output/loc-armed", 1); var locArm = props.globals.getNode("/it-autoflight/output/loc-armed", 1);
var apprArm = props.globals.getNode("it-autoflight/output/appr-armed", 1); var apprArm = props.globals.getNode("/it-autoflight/output/appr-armed", 1);
var FCUworkingNode = props.globals.initNode("/FMGC/FCU-working", 0, "BOOL"); var FCUworkingNode = props.globals.initNode("/FMGC/FCU-working", 0, "BOOL");
var FCU = { var FCU = {

View file

@ -14,8 +14,8 @@ var FPLN = {
active: props.globals.getNode("/FMGC/flightplan[2]/active", 1), active: props.globals.getNode("/FMGC/flightplan[2]/active", 1),
activeTemp: 0, activeTemp: 0,
currentCourse: 0, currentCourse: 0,
currentWP: props.globals.getNode("/FMGC/flightplan[2]/current-wp", 1), currentWp: props.globals.getNode("/FMGC/flightplan[2]/current-wp", 1),
currentWPTemp: 0, currentWpTemp: 0,
deltaAngle: 0, deltaAngle: 0,
deltaAngleRad: 0, deltaAngleRad: 0,
distCoeff: 0, distCoeff: 0,
@ -90,11 +90,11 @@ var Input = {
fpaAbs: props.globals.initNode("/it-autoflight/input/fpa-abs", 0, "DOUBLE"), # Set by property rule fpaAbs: props.globals.initNode("/it-autoflight/input/fpa-abs", 0, "DOUBLE"), # Set by property rule
hdg: props.globals.initNode("/it-autoflight/input/hdg", 0, "INT"), hdg: props.globals.initNode("/it-autoflight/input/hdg", 0, "INT"),
hdgCalc: 0, hdgCalc: 0,
ias: props.globals.initNode("/it-autoflight/input/spd-kts", 250, "INT"), kts: props.globals.initNode("/it-autoflight/input/kts", 100, "INT"),
ktsMach: props.globals.initNode("/it-autoflight/input/kts-mach", 0, "BOOL"), ktsMach: props.globals.initNode("/it-autoflight/input/kts-mach", 0, "BOOL"),
lat: props.globals.initNode("/it-autoflight/input/lat", 5, "INT"), lat: props.globals.initNode("/it-autoflight/input/lat", 5, "INT"),
latTemp: 5, latTemp: 5,
mach: props.globals.initNode("/it-autoflight/input/spd-mach", 0.5, "DOUBLE"), mach: props.globals.initNode("/it-autoflight/input/mach", 0.5, "DOUBLE"),
toga: props.globals.initNode("/it-autoflight/input/toga", 0, "BOOL"), toga: props.globals.initNode("/it-autoflight/input/toga", 0, "BOOL"),
trk: props.globals.initNode("/it-autoflight/input/trk", 0, "BOOL"), trk: props.globals.initNode("/it-autoflight/input/trk", 0, "BOOL"),
trueCourse: props.globals.initNode("/it-autoflight/input/true-course", 0, "BOOL"), trueCourse: props.globals.initNode("/it-autoflight/input/true-course", 0, "BOOL"),
@ -112,7 +112,7 @@ var Internal = {
altPredicted: props.globals.initNode("/it-autoflight/internal/altitude-predicted", 0, "DOUBLE"), altPredicted: props.globals.initNode("/it-autoflight/internal/altitude-predicted", 0, "DOUBLE"),
bankLimit: props.globals.initNode("/it-autoflight/internal/bank-limit", 30, "INT"), bankLimit: props.globals.initNode("/it-autoflight/internal/bank-limit", 30, "INT"),
bankLimitAuto: 30, bankLimitAuto: 30,
captVS: 0, captVs: 0,
driftAngle: props.globals.initNode("/it-autoflight/internal/drift-angle-deg", 0, "DOUBLE"), driftAngle: props.globals.initNode("/it-autoflight/internal/drift-angle-deg", 0, "DOUBLE"),
flchActive: 0, flchActive: 0,
fpa: props.globals.initNode("/it-autoflight/internal/fpa", 0, "DOUBLE"), fpa: props.globals.initNode("/it-autoflight/internal/fpa", 0, "DOUBLE"),
@ -120,8 +120,8 @@ var Internal = {
hdgErrorDeg: props.globals.initNode("/it-autoflight/internal/heading-error-deg", 0, "DOUBLE"), hdgErrorDeg: props.globals.initNode("/it-autoflight/internal/heading-error-deg", 0, "DOUBLE"),
hdgPredicted: props.globals.initNode("/it-autoflight/internal/heading-predicted", 0, "DOUBLE"), hdgPredicted: props.globals.initNode("/it-autoflight/internal/heading-predicted", 0, "DOUBLE"),
lnavAdvanceNm: props.globals.initNode("/it-autoflight/internal/lnav-advance-nm", 0, "DOUBLE"), lnavAdvanceNm: props.globals.initNode("/it-autoflight/internal/lnav-advance-nm", 0, "DOUBLE"),
minVS: props.globals.initNode("/it-autoflight/internal/min-vs", -500, "INT"), minVs: props.globals.initNode("/it-autoflight/internal/min-vs", -500, "INT"),
maxVS: props.globals.initNode("/it-autoflight/internal/max-vs", 500, "INT"), maxVs: props.globals.initNode("/it-autoflight/internal/max-vs", 500, "INT"),
trk: props.globals.initNode("/it-autoflight/internal/track-deg", 0, "DOUBLE"), trk: props.globals.initNode("/it-autoflight/internal/track-deg", 0, "DOUBLE"),
vs: props.globals.initNode("/it-autoflight/internal/vert-speed-fpm", 0, "DOUBLE"), vs: props.globals.initNode("/it-autoflight/internal/vert-speed-fpm", 0, "DOUBLE"),
vsTemp: 0, vsTemp: 0,
@ -220,13 +220,13 @@ var ITAF = {
Output.thrMode.setValue(0); Output.thrMode.setValue(0);
Output.lat.setValue(9); Output.lat.setValue(9);
Output.vert.setValue(9); Output.vert.setValue(9);
Internal.minVS.setValue(-500); Internal.minVs.setValue(-500);
Internal.maxVS.setValue(500); Internal.maxVs.setValue(500);
Internal.bankLimit.setValue(30); Internal.bankLimit.setValue(30);
Internal.bankLimitAuto = 30; Internal.bankLimitAuto = 30;
Internal.alt.setValue(10000); Internal.alt.setValue(10000);
Internal.altCaptureActive = 0; Internal.altCaptureActive = 0;
Input.ias.setValue(100); Input.kts.setValue(100);
Input.mach.setValue(0.5); Input.mach.setValue(0.5);
Text.thr.setValue("THRUST"); Text.thr.setValue("THRUST");
Text.arm.setValue(" "); Text.arm.setValue(" ");
@ -309,9 +309,9 @@ var ITAF = {
Internal.altDiff = Internal.altTemp - Position.indicatedAltitudeFtTemp; Internal.altDiff = Internal.altTemp - Position.indicatedAltitudeFtTemp;
if (Output.vertTemp != 0 and Output.vertTemp != 2 and Output.vertTemp != 6 and Output.vertTemp != 9) { if (Output.vertTemp != 0 and Output.vertTemp != 2 and Output.vertTemp != 6 and Output.vertTemp != 9) {
Internal.captVS = math.clamp(math.round(abs(Internal.vs.getValue()) / 5, 100), 50, 2500); # Capture limits Internal.captVs = math.clamp(math.round(abs(Internal.vs.getValue()) / 5, 100), 50, 2500); # Capture limits
Custom.apFdOn = Output.ap1Temp or Output.ap2Temp or Output.fd1.getBoolValue() or Output.fd2.getBoolValue(); Custom.apFdOn = Output.ap1Temp or Output.ap2Temp or Output.fd1.getBoolValue() or Output.fd2.getBoolValue();
if (abs(Internal.altDiff) <= Internal.captVS and !Gear.wow1Temp and !Gear.wow2Temp and Custom.apFdOn) { if (abs(Internal.altDiff) <= Internal.captVs and !Gear.wow1Temp and !Gear.wow2Temp and Custom.apFdOn) {
if (Internal.altTemp >= Position.indicatedAltitudeFtTemp and Internal.vsTemp >= -25) { # Don't capture if we are going the wrong way if (Internal.altTemp >= Position.indicatedAltitudeFtTemp and Internal.vsTemp >= -25) { # Don't capture if we are going the wrong way
me.setVertMode(3); me.setVertMode(3);
} else if (Internal.altTemp < Position.indicatedAltitudeFtTemp and Internal.vsTemp <= 25) { # Don't capture if we are going the wrong way } else if (Internal.altTemp < Position.indicatedAltitudeFtTemp and Internal.vsTemp <= 25) { # Don't capture if we are going the wrong way
@ -380,7 +380,7 @@ var ITAF = {
Input.bankLimitSWTemp = Input.bankLimitSW.getValue(); Input.bankLimitSWTemp = Input.bankLimitSW.getValue();
Velocities.trueAirspeedKtTemp = Velocities.trueAirspeedKt.getValue(); Velocities.trueAirspeedKtTemp = Velocities.trueAirspeedKt.getValue();
FPLN.activeTemp = FPLN.active.getValue(); FPLN.activeTemp = FPLN.active.getValue();
FPLN.currentWPTemp = FPLN.currentWP.getValue(); FPLN.currentWpTemp = FPLN.currentWp.getValue();
# Bank Limit # Bank Limit
if (Velocities.trueAirspeedKtTemp >= 420) { if (Velocities.trueAirspeedKtTemp >= 420) {
@ -402,14 +402,14 @@ var ITAF = {
# Waypoint Advance Logic # Waypoint Advance Logic
if (flightPlanController.num[2].getValue() > 0 and FPLN.activeTemp == 1) { if (flightPlanController.num[2].getValue() > 0 and FPLN.activeTemp == 1) {
if ((FPLN.currentWPTemp + 1) < flightPlanController.num[2].getValue()) { if ((FPLN.currentWpTemp + 1) < flightPlanController.num[2].getValue()) {
Velocities.groundspeedMps = Velocities.groundspeedKt.getValue() * 0.5144444444444; Velocities.groundspeedMps = Velocities.groundspeedKt.getValue() * 0.5144444444444;
FPLN.wpFlyFrom = FPLN.currentWPTemp; FPLN.wpFlyFrom = FPLN.currentWpTemp;
if (FPLN.wpFlyFrom < 0) { if (FPLN.wpFlyFrom < 0) {
FPLN.wpFlyFrom = 0; FPLN.wpFlyFrom = 0;
} }
FPLN.currentCourse = fmgc.wpCourse[2][FPLN.wpFlyFrom].getValue(); FPLN.currentCourse = fmgc.wpCourse[2][FPLN.wpFlyFrom].getValue();
FPLN.wpFlyTo = FPLN.currentWPTemp + 1; FPLN.wpFlyTo = FPLN.currentWpTemp + 1;
FPLN.nextCourse = fmgc.wpCourse[2][FPLN.wpFlyTo].getValue(); FPLN.nextCourse = fmgc.wpCourse[2][FPLN.wpFlyTo].getValue();
FPLN.maxBankLimit = Internal.bankLimit.getValue(); FPLN.maxBankLimit = Internal.bankLimit.getValue();
@ -436,7 +436,7 @@ var ITAF = {
flightPlanController.autoSequencing(); flightPlanController.autoSequencing();
} }
#if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue() and fmgc.flightPlanController.flightplans[2].getWP(FPLN.currentWPTemp).fly_type == "flyBy") { #if (FPLN.wp0Dist.getValue() <= FPLN.turnDist and !Gear.wow1.getBoolValue() and fmgc.flightPlanController.flightplans[2].getWP(FPLN.currentWpTemp).fly_type == "flyBy") {
# flightPlanController.autoSequencing(); # flightPlanController.autoSequencing();
#} elsif (FPLN.wp0Dist.getValue() <= 0.1) { #} elsif (FPLN.wp0Dist.getValue() <= 0.1) {
# flightPlanController.autoSequencing(); # flightPlanController.autoSequencing();
@ -569,7 +569,7 @@ var ITAF = {
Output.lnavArm.setBoolValue(0); Output.lnavArm.setBoolValue(0);
Output.locArm.setBoolValue(0); Output.locArm.setBoolValue(0);
Output.apprArm.setBoolValue(0); Output.apprArm.setBoolValue(0);
me.syncHDG(); me.syncHdg();
Output.lat.setValue(0); Output.lat.setValue(0);
Custom.showHdg.setBoolValue(1); Custom.showHdg.setBoolValue(1);
Text.lat.setValue("HDG"); Text.lat.setValue("HDG");
@ -614,7 +614,7 @@ var ITAF = {
me.armTextCheck(); me.armTextCheck();
} }
} else if (n == 3) { } else if (n == 3) {
me.syncHDG(); me.syncHdg();
Output.lnavArm.setBoolValue(0); Output.lnavArm.setBoolValue(0);
Custom.showHdg.setBoolValue(1); Custom.showHdg.setBoolValue(1);
me.armTextCheck(); me.armTextCheck();
@ -629,7 +629,7 @@ var ITAF = {
Output.vert.setValue(0); Output.vert.setValue(0);
me.resetClimbRateLim(); me.resetClimbRateLim();
Text.vert.setValue("ALT HLD"); Text.vert.setValue("ALT HLD");
me.syncALT(); me.syncAlt();
me.armTextCheck(); me.armTextCheck();
} else if (n == 1) { # V/S } else if (n == 1) { # V/S
if (abs(Input.altDiff) >= 25) { if (abs(Input.altDiff) >= 25) {
@ -638,7 +638,7 @@ var ITAF = {
Output.apprArm.setBoolValue(0); Output.apprArm.setBoolValue(0);
Output.vert.setValue(1); Output.vert.setValue(1);
Text.vert.setValue("V/S"); Text.vert.setValue("V/S");
me.syncVS(); me.syncVs();
me.armTextCheck(); me.armTextCheck();
} else { } else {
Output.apprArm.setBoolValue(0); Output.apprArm.setBoolValue(0);
@ -682,7 +682,7 @@ var ITAF = {
Output.apprArm.setBoolValue(0); Output.apprArm.setBoolValue(0);
Output.vert.setValue(5); Output.vert.setValue(5);
Text.vert.setValue("FPA"); Text.vert.setValue("FPA");
me.syncFPA(); me.syncFpa();
me.armTextCheck(); me.armTextCheck();
} else { } else {
Output.apprArm.setBoolValue(0); Output.apprArm.setBoolValue(0);
@ -807,16 +807,16 @@ var ITAF = {
setClimbRateLim: func() { setClimbRateLim: func() {
Internal.vsTemp = Internal.vs.getValue(); Internal.vsTemp = Internal.vs.getValue();
if (Internal.alt.getValue() >= Position.indicatedAltitudeFt.getValue()) { if (Internal.alt.getValue() >= Position.indicatedAltitudeFt.getValue()) {
Internal.maxVS.setValue(math.round(Internal.vsTemp)); Internal.maxVs.setValue(math.round(Internal.vsTemp));
Internal.minVS.setValue(-500); Internal.minVs.setValue(-500);
} else { } else {
Internal.maxVS.setValue(500); Internal.maxVs.setValue(500);
Internal.minVS.setValue(math.round(Internal.vsTemp)); Internal.minVs.setValue(math.round(Internal.vsTemp));
} }
}, },
resetClimbRateLim: func() { resetClimbRateLim: func() {
Internal.minVS.setValue(-500); Internal.minVs.setValue(-500);
Internal.maxVS.setValue(500); Internal.maxVs.setValue(500);
}, },
takeoffGoAround: func() { takeoffGoAround: func() {
Output.vertTemp = Output.vert.getValue(); Output.vertTemp = Output.vert.getValue();
@ -825,7 +825,7 @@ var ITAF = {
me.setVertMode(7); # Must be before kicking AP off me.setVertMode(7); # Must be before kicking AP off
Text.vert.setValue("G/A CLB"); Text.vert.setValue("G/A CLB");
Input.ktsMach.setBoolValue(0); Input.ktsMach.setBoolValue(0);
me.syncIASGA(); me.syncKtsGa();
if (Gear.wow1.getBoolValue() or Gear.wow2.getBoolValue()) { if (Gear.wow1.getBoolValue() or Gear.wow2.getBoolValue()) {
me.ap1Master(0); me.ap1Master(0);
me.ap2Master(0); me.ap2Master(0);
@ -850,26 +850,26 @@ var ITAF = {
Text.arm.setValue(" "); Text.arm.setValue(" ");
} }
}, },
syncIAS: func() { syncKts: func() {
Input.ias.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), 100, 350)); Input.kts.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), 100, 350));
}, },
syncIASGA: func() { # Same as syncIAS, except doesn't go below V2 syncKtsGa: func() { # Same as syncKts, except doesn't go below V2
Input.ias.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), Custom.FMGC.v2Speed.getValue(), 350)); Input.kts.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), Custom.FMGC.v2Speed.getValue(), 350));
}, },
syncMach: func() { syncMach: func() {
Input.mach.setValue(math.clamp(math.round(Velocities.indicatedMach.getValue(), 0.001), 0.5, 0.82)); Input.mach.setValue(math.clamp(math.round(Velocities.indicatedMach.getValue(), 0.001), 0.5, 0.82));
}, },
syncHDG: func() { syncHdg: func() {
Input.hdg.setValue(math.round(Internal.hdgPredicted.getValue())); # Switches to track automatically Input.hdg.setValue(math.round(Internal.hdgPredicted.getValue())); # Switches to track automatically
}, },
syncALT: func() { syncAlt: func() {
Input.alt.setValue(math.clamp(math.round(Internal.altPredicted.getValue(), 100), 0, 50000)); Input.alt.setValue(math.clamp(math.round(Internal.altPredicted.getValue(), 100), 0, 50000));
Internal.alt.setValue(math.clamp(math.round(Internal.altPredicted.getValue(), 100), 0, 50000)); Internal.alt.setValue(math.clamp(math.round(Internal.altPredicted.getValue(), 100), 0, 50000));
}, },
syncVS: func() { syncVs: func() {
Input.vs.setValue(math.clamp(math.round(Internal.vs.getValue(), 100), -6000, 6000)); Input.vs.setValue(math.clamp(math.round(Internal.vs.getValue(), 100), -6000, 6000));
}, },
syncFPA: func() { syncFpa: func() {
Input.fpa.setValue(math.clamp(math.round(Internal.fpa.getValue(), 0.1), -9.9, 9.9)); Input.fpa.setValue(math.clamp(math.round(Internal.fpa.getValue(), 0.1), -9.9, 9.9));
}, },
# Custom Stuff Below # Custom Stuff Below
@ -986,7 +986,7 @@ setlistener("/it-autoflight/input/kts-mach", func {
if (Input.ktsMach.getBoolValue()) { if (Input.ktsMach.getBoolValue()) {
ITAF.syncMach(); ITAF.syncMach();
} else { } else {
ITAF.syncIAS(); ITAF.syncKts();
} }
}, 0, 0); }, 0, 0);

View file

@ -714,7 +714,7 @@ var reset_FMGC = func {
setprop("/FMGC/status/phase", 0); setprop("/FMGC/status/phase", 0);
fd1 = getprop("/it-autoflight/input/fd1"); fd1 = getprop("/it-autoflight/input/fd1");
fd2 = getprop("/it-autoflight/input/fd2"); fd2 = getprop("/it-autoflight/input/fd2");
spd = getprop("/it-autoflight/input/spd-kts"); spd = getprop("/it-autoflight/input/kts");
hdg = getprop("/it-autoflight/input/hdg"); hdg = getprop("/it-autoflight/input/hdg");
alt = getprop("/it-autoflight/input/alt"); alt = getprop("/it-autoflight/input/alt");
ITAF.init(); ITAF.init();
@ -726,7 +726,7 @@ var reset_FMGC = func {
mcdu.MCDU_reset(1); mcdu.MCDU_reset(1);
setprop("it-autoflight/input/fd1", fd1); setprop("it-autoflight/input/fd1", fd1);
setprop("it-autoflight/input/fd2", fd2); setprop("it-autoflight/input/fd2", fd2);
setprop("it-autoflight/input/spd-kts", spd); setprop("it-autoflight/input/kts", spd);
setprop("it-autoflight/input/hdg", hdg); setprop("it-autoflight/input/hdg", hdg);
setprop("it-autoflight/input/alt", alt); setprop("it-autoflight/input/alt", alt);
setprop("systems/pressurization/mode", "GN"); setprop("systems/pressurization/mode", "GN");
@ -868,8 +868,8 @@ var ManagedSPD = maketimer(0.25, func {
mngktsmach = getprop("/FMGC/internal/mng-kts-mach"); mngktsmach = getprop("/FMGC/internal/mng-kts-mach");
mng_spd = getprop("/FMGC/internal/mng-spd"); mng_spd = getprop("/FMGC/internal/mng-spd");
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd"); mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
kts_sel = getprop("/it-autoflight/input/spd-kts"); kts_sel = getprop("/it-autoflight/input/kts");
mach_sel = getprop("/it-autoflight/input/spd-mach"); mach_sel = getprop("/it-autoflight/input/mach");
srsSPD = getprop("/it-autoflight/settings/togaspd"); srsSPD = getprop("/it-autoflight/settings/togaspd");
phase = getprop("/FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done phase = getprop("/FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
flap = getprop("/controls/flight/flaps-pos"); flap = getprop("/controls/flight/flaps-pos");
@ -973,9 +973,9 @@ var ManagedSPD = maketimer(0.25, func {
mng_spd = getprop("/FMGC/internal/mng-spd"); mng_spd = getprop("/FMGC/internal/mng-spd");
if (kts_sel != mng_spd and !ktsmach) { if (kts_sel != mng_spd and !ktsmach) {
setprop("it-autoflight/input/spd-kts", mng_spd); setprop("it-autoflight/input/kts", mng_spd);
} else if (mach_sel != mng_spd and ktsmach) { } else if (mach_sel != mng_spd and ktsmach) {
setprop("it-autoflight/input/spd-mach", mng_spd); setprop("it-autoflight/input/mach", mng_spd);
} }
} else { } else {
ManagedSPD.stop(); ManagedSPD.stop();

View file

@ -100,7 +100,7 @@
<value>0</value> <value>0</value>
</equals> </equals>
</condition> </condition>
<property>/it-autoflight/input/spd-kts</property> <property>/it-autoflight/input/kts</property>
</input> </input>
<input> <input>
<condition> <condition>
@ -115,7 +115,7 @@
<property>/instrumentation/airspeed-indicator/indicated-speed-kt</property> <property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
<property>/instrumentation/airspeed-indicator/indicated-mach</property> <property>/instrumentation/airspeed-indicator/indicated-mach</property>
</div> </div>
<property>/it-autoflight/input/spd-mach</property> <property>/it-autoflight/input/mach</property>
</product> </product>
</expression> </expression>
</input> </input>
@ -142,7 +142,7 @@
</sum> </sum>
</expression> </expression>
</input> </input>
<input>/it-autoflight/input/spd-kts</input> <input>/it-autoflight/input/kts</input>
<output>/it-autoflight/internal/flch-kts</output> <output>/it-autoflight/internal/flch-kts</output>
<min> <min>
<expression> <expression>
@ -198,7 +198,7 @@
<type>noise-spike</type> <type>noise-spike</type>
<feedback-if-disabled>true</feedback-if-disabled> <feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to> <initialize-to>output</initialize-to>
<input>/it-autoflight/input/spd-mach</input> <input>/it-autoflight/input/mach</input>
<output>/it-autoflight/internal/flch-mach</output> <output>/it-autoflight/internal/flch-mach</output>
<min> <min>
<expression> <expression>
@ -270,7 +270,7 @@
</floor> </floor>
</expression> </expression>
</input> </input>
<output>/it-autoflight/input/spd-kts</output> <output>/it-autoflight/input/kts</output>
</filter> </filter>
<filter> <filter>
@ -301,7 +301,7 @@
</div> </div>
</expression> </expression>
</input> </input>
<output>/it-autoflight/input/spd-mach</output> <output>/it-autoflight/input/mach</output>
</filter> </filter>
<filter> <filter>

View file

@ -11,7 +11,7 @@
<type>noise-spike</type> <type>noise-spike</type>
<feedback-if-disabled>true</feedback-if-disabled> <feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to> <initialize-to>output</initialize-to>
<input>/it-autoflight/input/spd-kts</input> <input>/it-autoflight/input/kts</input>
<output>/it-autoflight/internal/athr-kts</output> <output>/it-autoflight/internal/athr-kts</output>
<min> <min>
<expression> <expression>
@ -69,7 +69,7 @@
<type>noise-spike</type> <type>noise-spike</type>
<feedback-if-disabled>true</feedback-if-disabled> <feedback-if-disabled>true</feedback-if-disabled>
<initialize-to>output</initialize-to> <initialize-to>output</initialize-to>
<input>/it-autoflight/input/spd-mach</input> <input>/it-autoflight/input/mach</input>
<output>/it-autoflight/internal/athr-mach</output> <output>/it-autoflight/internal/athr-mach</output>
<min> <min>
<expression> <expression>

View file

@ -403,7 +403,7 @@
<row>0</row> <row>0</row>
<col>3</col> <col>3</col>
<pref-width>50</pref-width> <pref-width>50</pref-width>
<property>/it-autoflight/input/spd-kts</property> <property>/it-autoflight/input/kts</property>
<live type="bool">true</live> <live type="bool">true</live>
<enable> <enable>
<and> <and>
@ -529,7 +529,7 @@
<row>0</row> <row>0</row>
<col>3</col> <col>3</col>
<pref-width>50</pref-width> <pref-width>50</pref-width>
<property>/it-autoflight/input/spd-mach</property> <property>/it-autoflight/input/mach</property>
<live type="bool">true</live> <live type="bool">true</live>
<enable> <enable>
<and> <and>