A32X: Randomize DU Test times

This commit is contained in:
Joshua Davidson 2017-12-31 09:06:20 -05:00
parent 4c528b0101
commit 9c56c0a764
5 changed files with 35 additions and 18 deletions

View file

@ -65,6 +65,7 @@ setprop("/controls/flight/spoiler-r4-failed", 0);
setprop("/controls/flight/spoiler-r5-failed", 0);
setprop("/instrumentation/du/du4-test", 0);
setprop("/instrumentation/du/du4-test-time", 0);
setprop("/instrumentation/du/du4-test-amount", 0);
var canvas_lowerECAM_base = {
init: func(canvas_group, file) {
@ -91,17 +92,19 @@ var canvas_lowerECAM_base = {
if (getprop("/systems/electrical/bus/ac2") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and getprop("/instrumentation/du/du4-test") != 1) {
setprop("/instrumentation/du/du4-test", 1);
setprop("/instrumentation/du/du4-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du4-test-time", getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and getprop("/instrumentation/du/du4-test") != 1) {
setprop("/instrumentation/du/du4-test", 1);
setprop("/instrumentation/du/du4-test-time", getprop("/sim/time/elapsed-sec") - 35);
setprop("/instrumentation/du/du4-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du4-test-time", getprop("/sim/time/elapsed-sec") - 30);
}
} else if (getprop("/systems/electrical/ac1-src") == "XX" or getprop("/systems/electrical/ac2-src") == "XX") {
setprop("/instrumentation/du/du4-test", 0);
}
if (getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/controls/lighting/DU/du4") > 0) {
if (getprop("/instrumentation/du/du4-test-time") + 40 >= elapsedtime) {
if (getprop("/instrumentation/du/du4-test-time") + getprop("/instrumentation/du/du4-test-amount") >= elapsedtime) {
lowerECAM_apu.page.hide();
lowerECAM_eng.page.hide();
lowerECAM_fctl.page.hide();

View file

@ -17,8 +17,10 @@ var ND_2_test = nil;
var elapsedtime = 0;
setprop("/instrumentation/du/du2-test", 0);
setprop("/instrumentation/du/du2-test-time", 0);
setprop("/instrumentation/du/du2-test-amount", 0);
setprop("/instrumentation/du/du5-test", 0);
setprop("/instrumentation/du/du5-test-time", 0);
setprop("/instrumentation/du/du5-test-amount", 0);
var nd_display = {};
@ -79,10 +81,12 @@ var canvas_nd_base = {
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and getprop("/instrumentation/du/du2-test") != 1) {
setprop("/instrumentation/du/du2-test", 1);
setprop("/instrumentation/du/du2-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du2-test-time", getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and getprop("/instrumentation/du/du2-test") != 1) {
setprop("/instrumentation/du/du2-test", 1);
setprop("/instrumentation/du/du2-test-time", getprop("/sim/time/elapsed-sec") - 35);
setprop("/instrumentation/du/du2-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du2-test-time", getprop("/sim/time/elapsed-sec") - 30);
}
} else {
setprop("/instrumentation/du/du2-test", 0);
@ -90,20 +94,22 @@ var canvas_nd_base = {
if (getprop("/systems/electrical/bus/ac2") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and getprop("/instrumentation/du/du5-test") != 1) {
setprop("/instrumentation/du/du5-test", 1);
setprop("/instrumentation/du/du5-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du5-test-time", getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and getprop("/instrumentation/du/du5-test") != 1) {
setprop("/instrumentation/du/du5-test", 1);
setprop("/instrumentation/du/du5-test-time", getprop("/sim/time/elapsed-sec") - 35);
setprop("/instrumentation/du/du5-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du5-test-time", getprop("/sim/time/elapsed-sec") - 30);
}
} else {
setprop("/instrumentation/du/du5-test", 0);
}
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110 and getprop("/controls/lighting/DU/du2") > 0) {
if (getprop("/instrumentation/du/du2-test-time") + 38.5 >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) {
if (getprop("/instrumentation/du/du2-test-time") + getprop("/instrumentation/du/du2-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) {
ND_1.page.hide();
ND_1_test.page.show();
} else if (getprop("/instrumentation/du/du1-test-time") + 39.5 >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) {
} else if (getprop("/instrumentation/du/du1-test-time") + getprop("/instrumentation/du/du1-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) {
ND_1.page.hide();
ND_1_test.page.show();
} else {
@ -116,10 +122,10 @@ var canvas_nd_base = {
ND_1.page.hide();
}
if (getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/controls/lighting/DU/du5") > 0) {
if (getprop("/instrumentation/du/du5-test-time") + 38.5 >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) {
if (getprop("/instrumentation/du/du5-test-time") + getprop("/instrumentation/du/du6-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) {
ND_2.page.hide();
ND_2_test.page.show();
} else if (getprop("/instrumentation/du/du6-test-time") + 39.5 >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) {
} else if (getprop("/instrumentation/du/du6-test-time") + getprop("/instrumentation/du/du5-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) {
ND_2.page.hide();
ND_2_test.page.show();
} else {

View file

@ -59,8 +59,10 @@ setprop("/instrumentation/pfd/track-hdg-diff", 0);
setprop("/instrumentation/pfd/speed-lookahead", 0);
setprop("/instrumentation/du/du1-test", 0);
setprop("/instrumentation/du/du1-test-time", 0);
setprop("/instrumentation/du/du1-test-amount", 0);
setprop("/instrumentation/du/du6-test", 0);
setprop("/instrumentation/du/du6-test-time", 0);
setprop("/instrumentation/du/du6-test-amount", 0);
setprop("/it-autoflight/internal/vert-speed-fpm-pfd", 0);
setprop("/position/gear-agl-ft", 0);
setprop("/controls/flight/aileron-input-fast", 0);
@ -73,7 +75,6 @@ setprop("/instrumentation/adirs/ir[1]/aligned", 0);
setprop("/instrumentation/adirs/ir[2]/aligned", 0);
setprop("/controls/switching/ATTHDG", 0);
setprop("/controls/switching/AIRDATA", 0);
setprop("/testing", 0);
var canvas_PFD_base = {
init: func(canvas_group, file) {
@ -136,10 +137,12 @@ var canvas_PFD_base = {
if (getprop("/systems/electrical/bus/ac-ess") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and getprop("/instrumentation/du/du1-test") != 1) {
setprop("/instrumentation/du/du1-test", 1);
setprop("/instrumentation/du/du1-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du1-test-time", getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and getprop("/instrumentation/du/du1-test") != 1) {
setprop("/instrumentation/du/du1-test", 1);
setprop("/instrumentation/du/du1-test-time", getprop("/sim/time/elapsed-sec") - 35);
setprop("/instrumentation/du/du1-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du1-test-time", getprop("/sim/time/elapsed-sec") - 30);
}
} else {
setprop("/instrumentation/du/du1-test", 0);
@ -147,20 +150,22 @@ var canvas_PFD_base = {
if (getprop("/systems/electrical/bus/ac2") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and getprop("/instrumentation/du/du6-test") != 1) {
setprop("/instrumentation/du/du6-test", 1);
setprop("/instrumentation/du/du6-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du6-test-time", getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and getprop("/instrumentation/du/du6-test") != 1) {
setprop("/instrumentation/du/du6-test", 1);
setprop("/instrumentation/du/du6-test-time", getprop("/sim/time/elapsed-sec") - 35);
setprop("/instrumentation/du/du6-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du6-test-time", getprop("/sim/time/elapsed-sec") - 30);
}
} else {
setprop("/instrumentation/du/du6-test", 0);
}
if (getprop("/systems/electrical/bus/ac-ess") >= 110 and getprop("/controls/lighting/DU/du1") > 0) {
if (getprop("/instrumentation/du/du1-test-time") + 39.5 >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) {
if (getprop("/instrumentation/du/du1-test-time") + getprop("/instrumentation/du/du1-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) {
PFD_1.page.hide();
PFD_1_test.page.show();
} else if (getprop("/instrumentation/du/du2-test-time") + 38.5 >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) {
} else if (getprop("/instrumentation/du/du2-test-time") + getprop("/instrumentation/du/du2-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) {
PFD_1.page.hide();
PFD_1_test.page.show();
} else {
@ -173,10 +178,10 @@ var canvas_PFD_base = {
PFD_1.page.hide();
}
if (getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/controls/lighting/DU/du6") > 0) {
if (getprop("/instrumentation/du/du6-test-time") + 39.5 >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) {
if (getprop("/instrumentation/du/du6-test-time") + getprop("/instrumentation/du/du6-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) {
PFD_2.page.hide();
PFD_2_test.page.show();
} else if (getprop("/instrumentation/du/du5-test-time") + 38.5 >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) {
} else if (getprop("/instrumentation/du/du5-test-time") + getprop("/instrumentation/du/du5-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) {
PFD_2.page.hide();
PFD_2_test.page.show();
} else {

View file

@ -26,6 +26,7 @@ setprop("/ECAM/Upper/N1thr[1]", 0);
setprop("/ECAM/Upper/N1ylim", 0);
setprop("/instrumentation/du/du3-test", 0);
setprop("/instrumentation/du/du3-test-time", 0);
setprop("/instrumentation/du/du3-test-amount", 0);
var canvas_upperECAM_base = {
init: func(canvas_group, file) {
@ -52,17 +53,19 @@ var canvas_upperECAM_base = {
if (getprop("/systems/electrical/bus/ac-ess") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and getprop("/instrumentation/du/du3-test") != 1) {
setprop("/instrumentation/du/du3-test", 1);
setprop("/instrumentation/du/du3-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du3-test-time", getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and getprop("/instrumentation/du/du3-test") != 1) {
setprop("/instrumentation/du/du3-test", 1);
setprop("/instrumentation/du/du3-test-time", getprop("/sim/time/elapsed-sec") - 35);
setprop("/instrumentation/du/du3-test-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du3-test-time", getprop("/sim/time/elapsed-sec") - 30);
}
} else {
setprop("/instrumentation/du/du3-test", 0);
}
if (getprop("/systems/electrical/bus/ac-ess") >= 110 and getprop("/controls/lighting/DU/du3") > 0) {
if (getprop("/instrumentation/du/du3-test-time") + 39 >= elapsedtime) {
if (getprop("/instrumentation/du/du3-test-time") + getprop("/instrumentation/du/du3-test-amount") >= elapsedtime) {
upperECAM_cfm_eis2.page.hide();
upperECAM_iae_eis2.page.hide();
upperECAM_test.page.show();

View file

@ -1 +1 @@
4213
4214