From ce62c58c79b1b1f96f25c27249da8ff673e18ffe Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 19 Oct 2019 13:37:39 +0100 Subject: [PATCH] Revert "Displays: stop showing self-test on momentary-power down. On first init" This reverts commit bed1dd5a66a027593dcf715d8bb8270245fff99f. --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 12 +---- Models/Instruments/ND/canvas/ND.nas | 56 +++++++------------- Models/Instruments/PFD/PFD.nas | 32 +++-------- Models/Instruments/Upper-ECAM/Upper-ECAM.nas | 12 +---- 4 files changed, 28 insertions(+), 84 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index ff809dd6..29600e5f 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -246,8 +246,6 @@ 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 = { @@ -273,10 +271,6 @@ 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); @@ -292,14 +286,12 @@ var canvas_lowerECAM_base = { du4_test_amount.setValue(0); du4_test_time.setValue(-100); } - } elsif (du4_test.getValue() != 0) { + } else if (ac1_src.getValue() == "XX" or ac2_src.getValue() == "XX") { 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 and du4_off_time_2.getValue() > 0.5) { + if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime) { lowerECAM_apu.page.hide(); lowerECAM_bleed.page.hide(); lowerECAM_cond.page.hide(); diff --git a/Models/Instruments/ND/canvas/ND.nas b/Models/Instruments/ND/canvas/ND.nas index 5c1adc61..7b967524 100644 --- a/Models/Instruments/ND/canvas/ND.nas +++ b/Models/Instruments/ND/canvas/ND.nas @@ -14,25 +14,18 @@ var ND_2_test = nil; var elapsedtime = 0; # Fetch nodes: -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 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"); @@ -94,10 +87,6 @@ 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); @@ -113,17 +102,10 @@ var canvas_nd_base = { du2_test_amount.setValue(0); du2_test_time.setValue(-100); } - } elsif (du2_test.getValue() != 0) { + } else { 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); @@ -139,18 +121,16 @@ var canvas_nd_base = { du5_test_amount.setValue(0); du5_test_time.setValue(-100); } - } elsif (du5_test.getValue() != 0) { + } else { 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 and du2_off_time_2.getValue() > 0.5) { + if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() != 1) { 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 and du1_off_time_2.getValue() > 0.5) { + } else if (du1_test_time.getValue() + du1_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() == 1) { ND_1.page.hide(); ND_1_test.page.show(); ND_1_test.update(); @@ -164,11 +144,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 and du5_off_time_2.getValue() > 0.5) { + if (du5_test_time.getValue() + du5_test_amount.getValue() >= elapsedtime and fo_du_xfr.getValue() != 1) { 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 and du6_off_time_2.getValue() > 0.5) { + } else if (du6_test_time.getValue() + du6_test_amount.getValue() >= elapsedtime and fo_du_xfr.getValue() == 1) { ND_2.page.hide(); ND_2_test.page.show(); ND_2_test.update(); diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index ffca9356..35bdd075 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -136,23 +136,15 @@ 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 = { @@ -210,10 +202,6 @@ 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); @@ -229,17 +217,11 @@ var canvas_PFD_base = { du1_test_amount.setValue(0); du1_test_time.setValue(-100); } - } elsif (du1_test.getValue() != 0) { + } else { 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); @@ -255,22 +237,20 @@ var canvas_PFD_base = { du6_test_amount.setValue(0); du6_test_time.setValue(-100); } - } elsif (du6_test.getValue() != 0) { + } else { 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 and du1_off_time_2.getValue() > 0.5) { + if (du1_test_time.getValue() + du1_test_amount.getValue() >= elapsedtime_act and cpt_du_xfr.getValue() != 1) { 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 and du2_off_time_2.getValue() > 0.5) { + } else if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime_act and cpt_du_xfr.getValue() == 1) { PFD_1_test.update(); updateL = 0; PFD_1.page.hide(); @@ -288,12 +268,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 and du6_off_time_2.getValue() > 0.5) { + if (du6_test_time.getValue() + du6_test_amount.getValue() >= elapsedtime_act and fo_du_xfr.getValue() != 1) { 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 and du5_off_time_2.getValue() > 0.5) { + } else if (du5_test_time.getValue() + du5_test_amount.getValue() >= elapsedtime_act and fo_du_xfr.getValue() == 1) { PFD_2_test.update(); updateR = 0; PFD_2.page.hide(); diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index 890ced6a..8f1602c0 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -27,8 +27,6 @@ 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: @@ -139,10 +137,6 @@ 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); @@ -158,15 +152,13 @@ var canvas_upperECAM_base = { du3_test_amount.setValue(0); du3_test_time.setValue(-100); } - } elsif (du3_test.getValue() != 0) { + } else { 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 and du3_off_time_2.getValue() > 0.5) { + if (du3_test_time.getValue() + du3_test_amount.getValue() >= elapsedtime) { upperECAM_cfm_eis2.page.hide(); upperECAM_iae_eis2.page.hide(); upperECAM_test.page.show();