GIT: Merge dev
This commit is contained in:
commit
d68988def7
3 changed files with 23 additions and 47 deletions
|
@ -181,7 +181,7 @@ var Custom = {
|
|||
spdManaged: props.globals.getNode("/it-autoflight/input/spd-managed", 1),
|
||||
},
|
||||
Output: {
|
||||
fmaPower: props.globals.initNode("/it-autoflight/output/fma-pwr", 0, "BOOL"),
|
||||
fmaPower: 0,
|
||||
vsFCU: props.globals.initNode("/it-autoflight/output/vs-fcu-display", "", "STRING"),
|
||||
},
|
||||
Sound: {
|
||||
|
@ -237,7 +237,7 @@ var ITAF = {
|
|||
me.updateLatText("");
|
||||
me.updateVertText("");
|
||||
Custom.showHdg.setBoolValue(1);
|
||||
Custom.Output.fmaPower.setBoolValue(1);
|
||||
Custom.Output.fmaPower = 1;
|
||||
ManagedSPD.stop();
|
||||
loopTimer.start();
|
||||
slowLoopTimer.start();
|
||||
|
@ -433,8 +433,8 @@ var ITAF = {
|
|||
ap1Master: func(s) {
|
||||
if (s == 1) {
|
||||
if (Output.vert.getValue() != 6 and !Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and systems.ELEC.Bus.acEss.getValue() >= 110 and fbw.FBW.apOff == 0 and Position.gearAglFt.getValue() >= 100) {
|
||||
me.revertBasicMode();
|
||||
Output.ap1.setBoolValue(1);
|
||||
me.updateFma();
|
||||
Output.latTemp = Output.lat.getValue();
|
||||
if (Output.ap2.getBoolValue() and !Output.apprArm.getBoolValue() and Output.latTemp != 2 and Output.latTemp != 4) {
|
||||
me.ap2Master(0);
|
||||
|
@ -450,12 +450,13 @@ var ITAF = {
|
|||
if (Input.ap1.getBoolValue() != Output.ap1Temp) {
|
||||
Input.ap1.setBoolValue(Output.ap1Temp);
|
||||
}
|
||||
fmaAp();
|
||||
},
|
||||
ap2Master: func(s) {
|
||||
if (s == 1) {
|
||||
if (Output.vert.getValue() != 6 and !Gear.wow1.getBoolValue() and !Gear.wow2.getBoolValue() and systems.ELEC.Bus.acEss.getValue() >= 110 and fbw.FBW.apOff == 0 and Position.gearAglFt.getValue() >= 100) {
|
||||
me.revertBasicMode();
|
||||
Output.ap2.setBoolValue(1);
|
||||
me.updateFma();
|
||||
Output.latTemp = Output.lat.getValue();
|
||||
if (Output.ap1.getBoolValue() and !Output.apprArm.getBoolValue() and Output.latTemp != 2 and Output.latTemp != 4) {
|
||||
me.ap1Master(0);
|
||||
|
@ -471,6 +472,7 @@ var ITAF = {
|
|||
if (Input.ap2.getBoolValue() != Output.ap2Temp) {
|
||||
Input.ap2.setBoolValue(Output.ap2Temp);
|
||||
}
|
||||
fmaAp();
|
||||
},
|
||||
apOffFunction: func() {
|
||||
if (!Output.ap1.getBoolValue() and !Output.ap2.getBoolValue()) { # Only do if both APs are off
|
||||
|
@ -500,6 +502,7 @@ var ITAF = {
|
|||
if (Input.athr.getBoolValue() != Output.athrTemp) {
|
||||
Input.athr.setBoolValue(Output.athrTemp);
|
||||
}
|
||||
fmaAthr();
|
||||
},
|
||||
fd1Master: func(s) {
|
||||
if (s == 1) {
|
||||
|
@ -515,6 +518,7 @@ var ITAF = {
|
|||
if (Input.fd1.getBoolValue() != Output.fd1Temp) {
|
||||
Input.fd1.setBoolValue(Output.fd1Temp);
|
||||
}
|
||||
fmaFd();
|
||||
},
|
||||
fd2Master: func(s) {
|
||||
if (s == 1) {
|
||||
|
@ -530,6 +534,7 @@ var ITAF = {
|
|||
if (Input.fd2.getBoolValue() != Output.fd2Temp) {
|
||||
Input.fd2.setBoolValue(Output.fd2Temp);
|
||||
}
|
||||
fmaFd();
|
||||
},
|
||||
setLatMode: func(n) {
|
||||
Output.vertTemp = Output.vert.getValue();
|
||||
|
@ -576,7 +581,9 @@ var ITAF = {
|
|||
Custom.showHdg.setBoolValue(0);
|
||||
me.updateLatText("T/O");
|
||||
} else if (n == 9) { # NONE
|
||||
me.updateLnavArm(0);
|
||||
me.updateLocArm(0);
|
||||
me.updateApprArm(0);
|
||||
Output.lat.setValue(9);
|
||||
Custom.showHdg.setBoolValue(1);
|
||||
me.updateLatText("");
|
||||
|
@ -878,9 +885,10 @@ var ITAF = {
|
|||
me.setLatMode(9);
|
||||
me.setVertMode(9);
|
||||
me.setLatArm(0);
|
||||
Custom.Output.fmaPower.setBoolValue(0);
|
||||
Custom.Output.fmaPower = 0;
|
||||
} else {
|
||||
Custom.Output.fmaPower.setBoolValue(1);
|
||||
if (!Custom.Output.fmaPower) showAllBoxes();
|
||||
Custom.Output.fmaPower = 1;
|
||||
me.revertBasicMode();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -474,7 +474,7 @@ var altvert = func {
|
|||
}
|
||||
|
||||
# AP
|
||||
var ap = func {
|
||||
var fmaAp = func {
|
||||
ap1 = Output.ap1.getValue();
|
||||
ap2 = Output.ap2.getValue();
|
||||
newap = Modes.PFD.FMA.apMode.getValue();
|
||||
|
@ -490,7 +490,7 @@ var ap = func {
|
|||
}
|
||||
|
||||
# FD
|
||||
var fd = func {
|
||||
var fmaFd = func {
|
||||
fd1 = Output.fd1.getValue();
|
||||
fd2 = Output.fd2.getValue();
|
||||
newfd = Modes.PFD.FMA.fdMode.getValue();
|
||||
|
@ -505,8 +505,8 @@ var fd = func {
|
|||
}
|
||||
}
|
||||
|
||||
# AT
|
||||
var atMode = func {
|
||||
# A/THR
|
||||
var fmaAthr = func {
|
||||
at = Output.athr.getValue();
|
||||
if (at and Modes.PFD.FMA.athrMode.getValue() != "A/THR") {
|
||||
Modes.PFD.FMA.athrMode.setValue("A/THR");
|
||||
|
@ -515,14 +515,7 @@ var atMode = func {
|
|||
}
|
||||
}
|
||||
|
||||
var boxchk = func {
|
||||
if ((Output.ap1.getValue() or Output.ap2.getValue() or Output.fd1.getValue() or Output.fd2.getValue()) and !Custom.Output.fmaPower.getValue()) {
|
||||
Input.lat.setValue(3);
|
||||
boxchk_b();
|
||||
}
|
||||
}
|
||||
|
||||
var boxchk_b = func {
|
||||
var showAllBoxes = func {
|
||||
if (Modes.PFD.FMA.rollMode.getValue() != " ") {
|
||||
Modes.PFD.FMA.rollModeTime.setValue(pts.Sim.Time.elapsedSec.getValue());
|
||||
}
|
||||
|
@ -540,27 +533,6 @@ var boxchk_b = func {
|
|||
}
|
||||
}
|
||||
|
||||
# Update AP FD ATHR
|
||||
setlistener("/it-autoflight/output/ap1", func {
|
||||
ap();
|
||||
boxchk();
|
||||
});
|
||||
setlistener("/it-autoflight/output/ap2", func {
|
||||
ap();
|
||||
boxchk();
|
||||
});
|
||||
setlistener("/it-autoflight/output/fd1", func {
|
||||
fd();
|
||||
boxchk();
|
||||
});
|
||||
setlistener("/it-autoflight/output/fd2", func {
|
||||
fd();
|
||||
boxchk();
|
||||
});
|
||||
setlistener("/it-autoflight/output/athr", func {
|
||||
atMode();
|
||||
});
|
||||
|
||||
# Boxes
|
||||
setlistener("/modes/pfd/fma/ap-mode", func {
|
||||
if (Modes.PFD.FMA.apMode.getValue() != " ") {
|
||||
|
|
|
@ -14,8 +14,6 @@ var n1_right = 0;
|
|||
var modelat = "";
|
||||
var mode = 0;
|
||||
var gs = 0;
|
||||
var cruiseft = 0;
|
||||
var cruiseft_b = 0;
|
||||
var state1 = 0;
|
||||
var state2 = 0;
|
||||
var accel_agl_ft = 0;
|
||||
|
@ -44,7 +42,6 @@ var tempOverspeed = nil;
|
|||
setprop("/position/gear-agl-ft", 0);
|
||||
setprop("/it-autoflight/settings/accel-agl-ft", 1500); #eventually set to 1500 above runway
|
||||
setprop("/it-autoflight/internal/vert-speed-fpm", 0);
|
||||
setprop("/it-autoflight/output/fma-pwr", 0);
|
||||
setprop("/instrumentation/nav[0]/nav-id", "XXX");
|
||||
setprop("/instrumentation/nav[1]/nav-id", "XXX");
|
||||
|
||||
|
@ -708,6 +705,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
if (altitude > 20000) {
|
||||
FMGCInternal.clean += (altitude - 20000) / 1000;
|
||||
}
|
||||
|
||||
FMGCInternal.vs1g_clean = 0.0024 * weight_lbs * weight_lbs + 0.124 * weight_lbs + 88.942;
|
||||
FMGCInternal.vs1g_conf_1 = -0.0007 * weight_lbs * weight_lbs + 0.6795 * weight_lbs + 44.673;
|
||||
FMGCInternal.vs1g_conf_1f = -0.0001 * weight_lbs * weight_lbs + 0.5211 * weight_lbs + 49.027;
|
||||
|
@ -718,13 +716,11 @@ var masterFMGC = maketimer(0.2, func {
|
|||
FMGCInternal.flap2 = FMGCInternal.vs1g_conf_2 * 1.47;
|
||||
FMGCInternal.flap3 = FMGCInternal.vs1g_conf_3 * 1.36;
|
||||
if (FMGCInternal.ldgConfig3) {
|
||||
FMGCInternal.vls = FMGCInternal.vs1g_conf_3 * 1.23;
|
||||
FMGCInternal.vls = math.clamp(FMGCInternal.vs1g_conf_3 * 1.23, 113, 999);
|
||||
} else {
|
||||
FMGCInternal.vls = FMGCInternal.vs1g_conf_full * 1.23
|
||||
}
|
||||
if (FMGCInternal.vls < 113) {
|
||||
FMGCInternal.vls = 113;
|
||||
FMGCInternal.vls = math.clamp(FMGCInternal.vs1g_conf_full * 1.23, 113, 999);
|
||||
}
|
||||
|
||||
if (!fmgc.FMGCInternal.vappSpeedSet) {
|
||||
if (FMGCInternal.destWind < 5) {
|
||||
FMGCInternal.vapp = FMGCInternal.vls + 5;
|
||||
|
|
Loading…
Add table
Reference in a new issue