1
0
Fork 0

Displays: stop showing self-test on momentary-power down. On first init

does break the test.
This commit is contained in:
legoboyvdlp R 2019-10-17 20:09:06 +01:00
parent 65bba014f1
commit bed1dd5a66
4 changed files with 84 additions and 28 deletions

View file

@ -246,6 +246,8 @@ var gen1_load = props.globals.initNode("/systems/electrical/extra/gen1-load", 0,
var gen2_load = props.globals.initNode("/systems/electrical/extra/gen2-load", 0, "DOUBLE");
var du4_test = props.globals.initNode("/instrumentation/du/du4-test", 0, "BOOL");
var du4_test_time = props.globals.initNode("/instrumentation/du/du4-test-time", 0, "DOUBLE");
var du4_off_time = props.globals.initNode("/instrumentation/du/du4-off-time", 0, "DOUBLE");
var du4_off_time_2 = props.globals.initNode("/instrumentation/du/du4-off-time-2", 0, "DOUBLE");
var du4_test_amount = props.globals.initNode("/instrumentation/du/du4-test-amount", 0, "DOUBLE");
var canvas_lowerECAM_base = {
@ -271,6 +273,10 @@ var canvas_lowerECAM_base = {
update: func() {
elapsedtime = elapsed_sec.getValue();
if (ac2.getValue() >= 110) {
if (du4_off_time.getValue() != 0) {
du4_off_time_2.setValue(elapsedtime - du4_off_time.getValue());
du4_off_time.setValue(0);
}
if (gear0_wow.getValue() == 1) {
if (autoconfig_running.getValue() != 1 and du4_test.getValue() != 1) {
du4_test.setValue(1);
@ -286,12 +292,14 @@ var canvas_lowerECAM_base = {
du4_test_amount.setValue(0);
du4_test_time.setValue(-100);
}
} else if (ac1_src.getValue() == "XX" or ac2_src.getValue() == "XX") {
} elsif (du4_test.getValue() != 0) {
du4_test.setValue(0);
du4_off_time.setValue(elapsedtime);
du4_off_time_2.setValue(0);
}
if (ac2.getValue() >= 110 and lighting_du4.getValue() > 0.01) {
if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime) {
if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime and du4_off_time_2.getValue() > 0.5) {
lowerECAM_apu.page.hide();
lowerECAM_bleed.page.hide();
lowerECAM_cond.page.hide();

View file

@ -14,18 +14,25 @@ var ND_2_test = nil;
var elapsedtime = 0;
# 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 du1_test_time = props.globals.initNode("/instrumentation/du/du1-test-time", 0.0, "DOUBLE");
var du1_off_time = props.globals.initNode("/instrumentation/du/du1-off-time", 0.0, "DOUBLE");
var du1_off_time_2 = props.globals.initNode("/instrumentation/du/du1-off-time-2", 0.0, "DOUBLE");
var du1_test_amount = props.globals.initNode("/instrumentation/du/du1-test-amount", 0.0, "DOUBLE");
var du2_test = props.globals.initNode("/instrumentation/du/du2-test", 0, "BOOL");
var du2_test_time = props.globals.initNode("/instrumentation/du/du2-test-time", 0.0, "DOUBLE");
var du2_off_time = props.globals.initNode("/instrumentation/du/du2-off-time", 0.0, "DOUBLE");
var du2_off_time_2 = props.globals.initNode("/instrumentation/du/du2-off-time-2", 0.0, "DOUBLE");
var du2_test_amount = props.globals.initNode("/instrumentation/du/du2-test-amount", 0.0, "DOUBLE");
var du5_test = props.globals.initNode("/instrumentation/du/du5-test", 0, "BOOL");
var du5_test_time = props.globals.initNode("/instrumentation/du/du5-test-time", 0.0, "DOUBLE");
var du5_off_time = props.globals.initNode("/instrumentation/du/du5-off-time", 0.0, "DOUBLE");
var du5_off_time_2 = props.globals.initNode("/instrumentation/du/du5-off-time-2", 0.0, "DOUBLE");
var du5_test_amount = props.globals.initNode("/instrumentation/du/du5-test-amount", 0.0, "DOUBLE");
var du6_test = props.globals.initNode("/instrumentation/du/du6-test", 0, "BOOL");
var du6_test_time = props.globals.initNode("/instrumentation/du/du6-test-time", 0.0, "DOUBLE");
var du6_off_time = props.globals.initNode("/instrumentation/du/du6-off-time", 0.0, "DOUBLE");
var du6_off_time_2 = props.globals.initNode("/instrumentation/du/du6-off-time-2", 0.0, "DOUBLE");
var du6_test_amount = props.globals.initNode("/instrumentation/du/du6-test-amount", 0.0, "DOUBLE");
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");
@ -87,6 +94,10 @@ var canvas_nd_base = {
update: func() {
elapsedtime = getprop("/sim/time/elapsed-sec");
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110) {
if (du2_off_time.getValue() != 0) {
du2_off_time_2.setValue(elapsedtime - du2_off_time.getValue());
du2_off_time.setValue(0);
}
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du2_test.getValue() != 1) {
du2_test.setValue(1);
@ -102,10 +113,17 @@ var canvas_nd_base = {
du2_test_amount.setValue(0);
du2_test_time.setValue(-100);
}
} else {
} elsif (du2_test.getValue() != 0) {
du2_test.setValue(0);
du2_off_time.setValue(elapsedtime);
du2_off_time_2.setValue(0);
}
if (getprop("/systems/electrical/bus/ac-2") >= 110) {
if (du5_off_time.getValue() != 0) {
du5_off_time_2.setValue(elapsedtime - du5_off_time.getValue());
du5_off_time.setValue(0);
}
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du5_test.getValue() != 1) {
du5_test.setValue(1);
@ -121,16 +139,18 @@ var canvas_nd_base = {
du5_test_amount.setValue(0);
du5_test_time.setValue(-100);
}
} else {
} elsif (du5_test.getValue() != 0) {
du5_test.setValue(0);
du5_off_time.setValue(elapsedtime);
du5_off_time_2.setValue(0);
}
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110 and getprop("/controls/lighting/DU/du2") > 0) {
if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() != 1) {
if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() != 1 and du2_off_time_2.getValue() > 0.5) {
ND_1.page.hide();
ND_1_test.page.show();
ND_1_test.update();
} else if (du1_test_time.getValue() + du1_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() == 1) {
} else if (du1_test_time.getValue() + du1_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() == 1 and du1_off_time_2.getValue() > 0.5) {
ND_1.page.hide();
ND_1_test.page.show();
ND_1_test.update();
@ -144,11 +164,11 @@ var canvas_nd_base = {
ND_1.page.hide();
}
if (getprop("/systems/electrical/bus/ac-2") >= 110 and getprop("/controls/lighting/DU/du5") > 0) {
if (du5_test_time.getValue() + du5_test_amount.getValue() >= elapsedtime and fo_du_xfr.getValue() != 1) {
if (du5_test_time.getValue() + du5_test_amount.getValue() >= elapsedtime and fo_du_xfr.getValue() != 1 and du5_off_time_2.getValue() > 0.5) {
ND_2.page.hide();
ND_2_test.page.show();
ND_2_test.update();
} else if (du6_test_time.getValue() + du6_test_amount.getValue() >= elapsedtime and fo_du_xfr.getValue() == 1) {
} else if (du6_test_time.getValue() + du6_test_amount.getValue() >= elapsedtime and fo_du_xfr.getValue() == 1 and du6_off_time_2.getValue() > 0.5) {
ND_2.page.hide();
ND_2_test.page.show();
ND_2_test.update();

View file

@ -136,15 +136,23 @@ var track_diff = props.globals.initNode("/instrumentation/pfd/track-hdg-diff", 0
var speed_pred = props.globals.initNode("/instrumentation/pfd/speed-lookahead", 0.0, "DOUBLE");
var du1_test = props.globals.initNode("/instrumentation/du/du1-test", 0, "BOOL");
var du1_test_time = props.globals.initNode("/instrumentation/du/du1-test-time", 0.0, "DOUBLE");
var du1_off_time = props.globals.initNode("/instrumentation/du/du1-off-time", 0.0, "DOUBLE");
var du1_off_time_2 = props.globals.initNode("/instrumentation/du/du1-off-time-2", 0.0, "DOUBLE");
var du1_test_amount = props.globals.initNode("/instrumentation/du/du1-test-amount", 0.0, "DOUBLE");
var du2_test = props.globals.initNode("/instrumentation/du/du2-test", 0, "BOOL");
var du2_test_time = props.globals.initNode("/instrumentation/du/du2-test-time", 0.0, "DOUBLE");
var du2_off_time = props.globals.initNode("/instrumentation/du/du2-off-time", 0.0, "DOUBLE");
var du2_off_time_2 = props.globals.initNode("/instrumentation/du/du2-off-time-2", 0.0, "DOUBLE");
var du2_test_amount = props.globals.initNode("/instrumentation/du/du2-test-amount", 0.0, "DOUBLE");
var du5_test = props.globals.initNode("/instrumentation/du/du5-test", 0, "BOOL");
var du5_test_time = props.globals.initNode("/instrumentation/du/du5-test-time", 0.0, "DOUBLE");
var du5_off_time = props.globals.initNode("/instrumentation/du/du5-off-time", 0.0, "DOUBLE");
var du5_off_time_2 = props.globals.initNode("/instrumentation/du/du5-off-time-2", 0.0, "DOUBLE");
var du5_test_amount = props.globals.initNode("/instrumentation/du/du5-test-amount", 0.0, "DOUBLE");
var du6_test = props.globals.initNode("/instrumentation/du/du6-test", 0, "BOOL");
var du6_test_time = props.globals.initNode("/instrumentation/du/du6-test-time", 0.0, "DOUBLE");
var du6_off_time = props.globals.initNode("/instrumentation/du/du6-off-time", 0.0, "DOUBLE");
var du6_off_time_2 = props.globals.initNode("/instrumentation/du/du6-off-time-2", 0.0, "DOUBLE");
var du6_test_amount = props.globals.initNode("/instrumentation/du/du6-test-amount", 0.0, "DOUBLE");
var canvas_PFD_base = {
@ -202,6 +210,10 @@ var canvas_PFD_base = {
update: func() {
elapsedtime_act = elapsedtime.getValue();
if (acess.getValue() >= 110) {
if (du1_off_time.getValue() != 0) {
du1_off_time_2.setValue(elapsedtime_act - du1_off_time.getValue());
du1_off_time.setValue(0);
}
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du1_test.getValue() != 1) {
du1_test.setValue(1);
@ -217,11 +229,17 @@ var canvas_PFD_base = {
du1_test_amount.setValue(0);
du1_test_time.setValue(-100);
}
} else {
} elsif (du1_test.getValue() != 0) {
du1_test.setValue(0);
du1_off_time.setValue(elapsedtime_act);
du1_off_time_2.setValue(0);
}
if (ac2.getValue() >= 110) {
if (du6_off_time.getValue() != 0) {
du6_off_time_2.setValue(elapsedtime_act - du6_off_time.getValue());
du6_off_time.setValue(0);
}
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du6_test.getValue() != 1) {
du6_test.setValue(1);
@ -237,20 +255,22 @@ var canvas_PFD_base = {
du6_test_amount.setValue(0);
du6_test_time.setValue(-100);
}
} else {
} elsif (du6_test.getValue() != 0) {
du6_test.setValue(0);
du6_off_time.setValue(elapsedtime_act);
du6_off_time_2.setValue(0);
}
if (acconfig_mismatch.getValue() == "0x000") {
PFD_1_mismatch.page.hide();
PFD_2_mismatch.page.hide();
if (acess.getValue() >= 110 and du1_lgt.getValue() > 0.01) {
if (du1_test_time.getValue() + du1_test_amount.getValue() >= elapsedtime_act and cpt_du_xfr.getValue() != 1) {
if (du1_test_time.getValue() + du1_test_amount.getValue() >= elapsedtime_act and cpt_du_xfr.getValue() != 1 and du1_off_time_2.getValue() > 0.5) {
PFD_1_test.update();
updateL = 0;
PFD_1.page.hide();
PFD_1_test.page.show();
} else if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime_act and cpt_du_xfr.getValue() == 1) {
} else if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime_act and cpt_du_xfr.getValue() == 1 and du2_off_time_2.getValue() > 0.5) {
PFD_1_test.update();
updateL = 0;
PFD_1.page.hide();
@ -268,12 +288,12 @@ var canvas_PFD_base = {
PFD_1.page.hide();
}
if (ac2.getValue() >= 110 and du6_lgt.getValue() > 0.01) {
if (du6_test_time.getValue() + du6_test_amount.getValue() >= elapsedtime_act and fo_du_xfr.getValue() != 1) {
if (du6_test_time.getValue() + du6_test_amount.getValue() >= elapsedtime_act and fo_du_xfr.getValue() != 1 and du6_off_time_2.getValue() > 0.5) {
PFD_2_test.update();
updateR = 0;
PFD_2.page.hide();
PFD_2_test.page.show();
} else if (du5_test_time.getValue() + du5_test_amount.getValue() >= elapsedtime_act and fo_du_xfr.getValue() == 1) {
} else if (du5_test_time.getValue() + du5_test_amount.getValue() >= elapsedtime_act and fo_du_xfr.getValue() == 1 and du5_off_time_2.getValue() > 0.5) {
PFD_2_test.update();
updateR = 0;
PFD_2.page.hide();

View file

@ -27,6 +27,8 @@ var N1_thr_2 = props.globals.initNode("/ECAM/Upper/N1thr[1]", 0, "DOUBLE");
var N1_lim = props.globals.initNode("/ECAM/Upper/N1ylim", 0, "DOUBLE");
var du3_test = props.globals.initNode("/instrumentation/du/du3-test", 0, "BOOL");
var du3_test_time = props.globals.initNode("/instrumentation/du/du3-test-time", 0.0, "DOUBLE");
var du3_off_time = props.globals.initNode("/instrumentation/du/du3-off-time", 0.0, "DOUBLE");
var du3_off_time_2 = props.globals.initNode("/instrumentation/du/du3-off-time-2", 0.0, "DOUBLE");
var du3_test_amount = props.globals.initNode("/instrumentation/du/du3-test-amount", 0.0, "DOUBLE");
# Fetch nodes:
@ -137,6 +139,10 @@ var canvas_upperECAM_base = {
elapsedtime = et.getValue();
if (acess.getValue() >= 110) {
if (du3_off_time.getValue() != 0) {
du3_off_time_2.setValue(elapsedtime - du3_off_time.getValue());
du3_off_time.setValue(0);
}
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du3_test.getValue() != 1) {
du3_test.setValue(1);
@ -152,13 +158,15 @@ var canvas_upperECAM_base = {
du3_test_amount.setValue(0);
du3_test_time.setValue(-100);
}
} else {
} elsif (du3_test.getValue() != 0) {
du3_test.setValue(0);
du3_off_time.setValue(elapsedtime);
du3_off_time_2.setValue(0);
}
cur_eng_option = eng_option.getValue();
if (acess.getValue() >= 110 and du3_lgt.getValue() > 0.01) {
if (du3_test_time.getValue() + du3_test_amount.getValue() >= elapsedtime) {
if (du3_test_time.getValue() + du3_test_amount.getValue() >= elapsedtime and du3_off_time_2.getValue() > 0.5) {
upperECAM_cfm_eis2.page.hide();
upperECAM_iae_eis2.page.hide();
upperECAM_test.page.show();