DU: Inhibit power up self test in flight

This commit is contained in:
Joshua Davidson 2018-09-23 11:41:32 -04:00
parent 95d999f6cb
commit 48f81cfd3a
5 changed files with 98 additions and 57 deletions

View file

@ -91,14 +91,20 @@ var canvas_lowerECAM_base = {
update: func() {
elapsedtime = getprop("/sim/time/elapsed-sec");
if (getprop("/systems/electrical/bus/ac2") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and getprop("/instrumentation/du/du4-test") != 1) {
if (getprop("/gear/gear[0]/wow") == 1) {
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-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du4-test-time", getprop("/sim/time/elapsed-sec") - 30);
}
} else {
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-amount", math.round((rand() * 5 ) + 35, 0.1));
setprop("/instrumentation/du/du4-test-time", getprop("/sim/time/elapsed-sec") - 30);
setprop("/instrumentation/du/du4-test-amount", 0);
setprop("/instrumentation/du/du4-test-time", -100);
}
} else if (getprop("/systems/electrical/ac1-src") == "XX" or getprop("/systems/electrical/ac2-src") == "XX") {
setprop("/instrumentation/du/du4-test", 0);

View file

@ -15,20 +15,23 @@ var ND_2 = nil;
var ND_1_test = nil;
var ND_2_test = nil;
var elapsedtime = 0;
var du1_test = props.globals.getNode("/instrumentation/du/du1-test", 1);
var du1_test_time = props.globals.getNode("/instrumentation/du/du1-test-time", 1);
var du1_test_amount = props.globals.getNode("/instrumentation/du/du1-test-amount", 1);
var du2_test = props.globals.getNode("/instrumentation/du/du2-test", 1);
var du2_test_time = props.globals.getNode("/instrumentation/du/du2-test-time", 1);
var du2_test_amount = props.globals.getNode("/instrumentation/du/du2-test-amount", 1);
var du5_test = props.globals.getNode("/instrumentation/du/du5-test", 1);
var du5_test_time = props.globals.getNode("/instrumentation/du/du5-test-time", 1);
var du5_test_amount = props.globals.getNode("/instrumentation/du/du5-test-amount", 1);
var du6_test = props.globals.getNode("/instrumentation/du/du6-test", 1);
var du6_test_time = props.globals.getNode("/instrumentation/du/du6-test-time", 1);
var du6_test_amount = props.globals.getNode("/instrumentation/du/du6-test-amount", 1);
# Fetch nodes:
var du1_test = props.globals.getNode("/instrumentation/du/du1-test");
var du1_test_time = props.globals.getNode("/instrumentation/du/du1-test-time");
var du1_test_amount = props.globals.getNode("/instrumentation/du/du1-test-amount");
var du2_test = props.globals.getNode("/instrumentation/du/du2-test");
var du2_test_time = props.globals.getNode("/instrumentation/du/du2-test-time");
var du2_test_amount = props.globals.getNode("/instrumentation/du/du2-test-amount");
var du5_test = props.globals.getNode("/instrumentation/du/du5-test");
var du5_test_time = props.globals.getNode("/instrumentation/du/du5-test-time");
var du5_test_amount = props.globals.getNode("/instrumentation/du/du5-test-amount");
var du6_test = props.globals.getNode("/instrumentation/du/du6-test");
var du6_test_time = props.globals.getNode("/instrumentation/du/du6-test-time");
var du6_test_amount = props.globals.getNode("/instrumentation/du/du6-test-amount");
var cpt_du_xfr = props.globals.getNode("/modes/cpt-du-xfr");
var fo_du_xfr = props.globals.getNode("/modes/fo-du-xfr");
var wow0 = props.globals.getNode("/gear/gear[0]/wow");
var nd_display = {};
@ -87,27 +90,39 @@ var canvas_nd_base = {
update: func() {
elapsedtime = getprop("/sim/time/elapsed-sec");
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du2_test.getValue() != 1) {
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du2_test.getValue() != 1) {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du2_test.getValue() != 1) {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
}
} else {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du2_test.getValue() != 1) {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
du2_test_amount.setValue(0);
du2_test_time.setValue(-100);
}
} else {
du2_test.setValue(0);
}
if (getprop("/systems/electrical/bus/ac2") >= 110) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du5_test.getValue() != 1) {
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du5_test.getValue() != 1) {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du5_test.getValue() != 1) {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
}
} else {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du5_test.getValue() != 1) {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
du5_test_amount.setValue(0);
du5_test_time.setValue(-100);
}
} else {
du5_test.setValue(0);

View file

@ -38,8 +38,9 @@ var roll_mode_box = props.globals.getNode("/modes/pfd/fma/roll-mode-box", 1);
var roll_mode_armed_box = props.globals.getNode("/modes/pfd/fma/roll-mode-armed-box", 1);
var thr1 = props.globals.getNode("/controls/engines/engine[0]/throttle-pos", 1);
var thr2 = props.globals.getNode("/controls/engines/engine[1]/throttle-pos", 1);
var wow1 = props.globals.getNode("/gear/gear[1]/wow", 1);
var wow2 = props.globals.getNode("/gear/gear[2]/wow", 1);
var wow0 = props.globals.getNode("/gear/gear[0]/wow");
var wow1 = props.globals.getNode("/gear/gear[1]/wow");
var wow2 = props.globals.getNode("/gear/gear[2]/wow");
var pitch = props.globals.getNode("/orientation/pitch-deg", 1);
var roll = props.globals.getNode("/orientation/roll-deg", 1);
var elapsedtime = props.globals.getNode("/sim/time/elapsed-sec", 1);
@ -203,28 +204,40 @@ var canvas_PFD_base = {
update: func() {
elapsedtime_act = elapsedtime.getValue();
if (acess.getValue() >= 110) {
if (acconfig.getValue() != 1 and du1_test.getValue() != 1) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du1_test.getValue() != 1) {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du1_test.getValue() != 1) {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act - 30);
}
} else {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du1_test.getValue() != 1) {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act - 30);
du1_test_amount.setValue(0);
du1_test_time.setValue(-100);
}
} else {
du1_test.setValue(0);
}
if (ac2.getValue() >= 110) {
if (acconfig.getValue() != 1 and du6_test.getValue() != 1) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du6_test.getValue() != 1) {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du6_test.getValue() != 1) {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act - 30);
}
} else {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du6_test.getValue() != 1) {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act - 30);
du6_test_amount.setValue(0);
du6_test_time.setValue(-100);
}
} else {
du6_test.setValue(0);

View file

@ -54,6 +54,7 @@ var gear = props.globals.getNode("/gear/gear[1]/position-norm", 1);
var smoke = props.globals.getNode("/controls/switches/no-smoking-sign", 1);
var seatbelt = props.globals.getNode("/controls/switches/seatbelt-sign", 1);
var flaps3_ovr = props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 1);
var wow0 = props.globals.getNode("/gear/gear[0]/wow");
var eng1_n1 = props.globals.getNode("/engines/engine[0]/n1-actual", 1);
var eng2_n1 = props.globals.getNode("/engines/engine[1]/n1-actual", 1);
var eng1_n2 = props.globals.getNode("/engines/engine[0]/n2-actual", 1);
@ -119,14 +120,20 @@ var canvas_upperECAM_base = {
elapsedtime = et.getValue();
if (acess.getValue() >= 110) {
if (acconfig.getValue() != 1 and du3_test.getValue() != 1) {
if (wow0.getValue == 1) {
if (acconfig.getValue() != 1 and du3_test.getValue() != 1) {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime);
} else if (acconfig.getValue() == 1 and du3_test.getValue() != 1) {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime - 30);
}
} else {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime);
} else if (acconfig.getValue() == 1 and du3_test.getValue() != 1) {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime - 30);
du3_test_amount.setValue(0);
du3_test_time.setValue(-100);
}
} else {
du3_test.setValue(0);

View file

@ -1 +1 @@
4644
4645