From 48f81cfd3a5933ac63e8aff39334b263356a07f9 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Sun, 23 Sep 2018 11:41:32 -0400 Subject: [PATCH 1/2] DU: Inhibit power up self test in flight --- Models/Instruments/Lower-ECAM/Lower-ECAM.nas | 20 ++++-- Models/Instruments/ND/canvas/ND.nas | 67 ++++++++++++-------- Models/Instruments/PFD/PFD.nas | 45 ++++++++----- Models/Instruments/Upper-ECAM/Upper-ECAM.nas | 21 ++++-- revision.txt | 2 +- 5 files changed, 98 insertions(+), 57 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index f5ac95e3..df109412 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -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); diff --git a/Models/Instruments/ND/canvas/ND.nas b/Models/Instruments/ND/canvas/ND.nas index a44e8ab9..5311ee7b 100644 --- a/Models/Instruments/ND/canvas/ND.nas +++ b/Models/Instruments/ND/canvas/ND.nas @@ -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); diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 916e125a..300cf3c1 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -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); diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index 91515f4d..bcdf45ba 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -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); diff --git a/revision.txt b/revision.txt index 31d0253a..17680eaf 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4644 \ No newline at end of file +4645 \ No newline at end of file From 3aa56a862794acf3fb19516245b4ca2489ca5092 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Sun, 23 Sep 2018 11:52:19 -0400 Subject: [PATCH 2/2] DU: Bugfix UECAM --- Models/Instruments/Upper-ECAM/Upper-ECAM.nas | 3 ++- revision.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index bcdf45ba..814fdf53 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -120,7 +120,7 @@ var canvas_upperECAM_base = { elapsedtime = et.getValue(); if (acess.getValue() >= 110) { - if (wow0.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)); @@ -168,6 +168,7 @@ var canvas_upperECAM_base = { # Reversers rev_1_cur = rev_1.getValue(); rev_2_cur = rev_2.getValue(); + cur_eng_option = eng_option.getValue(); if (rev_1_cur >= 0.01 and eng1_n1mode.getValue() == 1 and cur_eng_option == "CFM") { me["REV1"].show(); me["REV1-box"].show(); diff --git a/revision.txt b/revision.txt index 17680eaf..18fd8374 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4645 \ No newline at end of file +4646 \ No newline at end of file