diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas index b0f7caa0..b6610fb9 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM.nas @@ -88,7 +88,7 @@ var canvas_lowerECAM_base = { }, update: func() { elapsedtime = getprop("/sim/time/elapsed-sec"); - if (getprop("/systems/electrical/bus/ac1") >= 110 and getprop("/systems/electrical/bus/ac2") >= 110) { + 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-time", getprop("/sim/time/elapsed-sec")); @@ -100,7 +100,7 @@ var canvas_lowerECAM_base = { setprop("/instrumentation/du/du4-test", 0); } - if (getprop("/systems/electrical/bus/ac1") >= 110 and getprop("/systems/electrical/ac1-src") != "RAT" and getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/systems/electrical/ac2-src") != "RAT" and getprop("/controls/lighting/DU/du4") > 0) { + if (getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/controls/lighting/DU/du4") > 0) { if (getprop("/instrumentation/du/du4-test-time") + 40 >= elapsedtime) { lowerECAM_apu.page.hide(); lowerECAM_eng.page.hide(); diff --git a/Models/Instruments/ND/canvas/ND.nas b/Models/Instruments/ND/canvas/ND.nas index 29d36084..31bcd00f 100644 --- a/Models/Instruments/ND/canvas/ND.nas +++ b/Models/Instruments/ND/canvas/ND.nas @@ -76,7 +76,7 @@ var canvas_nd_base = { }, update: func() { elapsedtime = getprop("/sim/time/elapsed-sec"); - if (getprop("/systems/electrical/bus/ac1") >= 110 and getprop("/systems/electrical/bus/ac2") >= 110) { + 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-time", getprop("/sim/time/elapsed-sec")); @@ -84,6 +84,10 @@ var canvas_nd_base = { setprop("/instrumentation/du/du2-test", 1); setprop("/instrumentation/du/du2-test-time", getprop("/sim/time/elapsed-sec") - 35); } + } else { + setprop("/instrumentation/du/du2-test", 0); + } + 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-time", getprop("/sim/time/elapsed-sec")); @@ -92,11 +96,10 @@ var canvas_nd_base = { setprop("/instrumentation/du/du5-test-time", getprop("/sim/time/elapsed-sec") - 35); } } else { - setprop("/instrumentation/du/du2-test", 0); setprop("/instrumentation/du/du5-test", 0); } - if (getprop("/systems/electrical/bus/ac1") >= 110 and getprop("/systems/electrical/ac1-src") != "RAT" and getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/systems/electrical/ac2-src") != "RAT" and getprop("/controls/lighting/DU/du2") > 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) { ND_1.page.hide(); ND_1_test.page.show(); @@ -112,7 +115,7 @@ var canvas_nd_base = { ND_1_test.page.hide(); ND_1.page.hide(); } - if (getprop("/systems/electrical/bus/ac1") >= 110 and getprop("/systems/electrical/ac1-src") != "RAT" and getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/systems/electrical/ac2-src") != "RAT" and getprop("/controls/lighting/DU/du5") > 0) { + 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) { ND_2.page.hide(); ND_2_test.page.show(); diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index 4017e36a..bc1ef42c 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -132,7 +132,7 @@ var canvas_PFD_base = { }, update: func() { elapsedtime = getprop("/sim/time/elapsed-sec"); - if (getprop("/systems/electrical/bus/ac1") >= 110 or getprop("/systems/electrical/bus/ac2") >= 110) { + 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-time", getprop("/sim/time/elapsed-sec")); @@ -143,7 +143,7 @@ var canvas_PFD_base = { } else { setprop("/instrumentation/du/du1-test", 0); } - if (getprop("/systems/electrical/bus/ac1") >= 110 and getprop("/systems/electrical/bus/ac2") >= 110) { + 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-time", getprop("/sim/time/elapsed-sec")); @@ -155,7 +155,7 @@ var canvas_PFD_base = { setprop("/instrumentation/du/du6-test", 0); } - if ((getprop("/systems/electrical/bus/ac1") >= 110 or getprop("/systems/electrical/bus/ac2") >= 110) and getprop("/controls/lighting/DU/du1") > 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) { PFD_1.page.hide(); PFD_1_test.page.show(); @@ -171,7 +171,7 @@ var canvas_PFD_base = { PFD_1_test.page.hide(); PFD_1.page.hide(); } - if (getprop("/systems/electrical/bus/ac1") >= 110 and getprop("/systems/electrical/ac1-src") != "RAT" and getprop("/systems/electrical/bus/ac2") >= 110 and getprop("/systems/electrical/ac2-src") != "RAT" and getprop("/controls/lighting/DU/du6") > 0) { + 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) { PFD_2.page.hide(); PFD_2_test.page.show(); diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index 8522b3fb..eb24d87e 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -49,7 +49,7 @@ var canvas_upperECAM_base = { }, update: func() { elapsedtime = getprop("/sim/time/elapsed-sec"); - if (getprop("/systems/electrical/bus/ac1") >= 110 or getprop("/systems/electrical/bus/ac2") >= 110) { + 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-time", getprop("/sim/time/elapsed-sec")); @@ -61,7 +61,7 @@ var canvas_upperECAM_base = { setprop("/instrumentation/du/du3-test", 0); } - if ((getprop("/systems/electrical/bus/ac1") >= 110 or getprop("/systems/electrical/bus/ac2") >= 110) and getprop("/controls/lighting/DU/du3") > 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) { upperECAM_cfm_eis2.page.hide(); upperECAM_iae_eis2.page.hide(); diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index 40077eb1..56a14623 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -290,6 +290,26 @@ var ELEC = { replay = getprop("/sim/replay/replay-state"); wow = getprop("/gear/gear[1]/wow"); + if (battery1_sw and !batt1_fail) { + setprop("/systems/electrical/battery1-amps", dc_amps_std); + } else { + setprop("/systems/electrical/battery1-amps", 0); + } + + if (battery2_sw and !batt2_fail) { + setprop("/systems/electrical/battery2-amps", dc_amps_std); + } else { + setprop("/systems/electrical/battery2-amps", 0); + } + + if (getprop("/systems/electrical/battery1-amps") > 120 or getprop("/systems/electrical/battery2-amps") > 120) { + setprop("/systems/electrical/bus/dcbat", dc_volt_std); + } else { + setprop("/systems/electrical/bus/dcbat", 0); + } + + dcbat = getprop("/systems/electrical/bus/dcbat"); + if (extpwr_on and gen_ext_sw) { setprop("/systems/electrical/gen-ext", 1); } else { @@ -348,9 +368,13 @@ var ELEC = { setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); } else if (emergen) { - setprop("/systems/electrical/bus/dc1", dc_volt_std); + setprop("/systems/electrical/bus/dc1", 0); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); - setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); + setprop("/systems/electrical/bus/dc1-amps", 0); + } else if (dcbat and ias >= 50) { + setprop("/systems/electrical/bus/dc1", 0); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc1-amps", 0); } else { setprop("/systems/electrical/bus/dc1", 0); setprop("/systems/electrical/bus/dc1-amps", 0); @@ -377,9 +401,13 @@ var ELEC = { setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); } else if (emergen) { - setprop("/systems/electrical/bus/dc2", dc_volt_std); + setprop("/systems/electrical/bus/dc2", 0); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); - setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + setprop("/systems/electrical/bus/dc2-amps", 0); + } else if (dcbat and ias >= 50) { + setprop("/systems/electrical/bus/dc2", 0); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc2-amps", 0); } else { setprop("/systems/electrical/bus/dc2", 0); setprop("/systems/electrical/bus/dc2-amps", 0); @@ -391,42 +419,114 @@ var ELEC = { # Left AC bus yes? if (stateL == 3 and gen1_sw and !gen1_fail) { setprop("/systems/electrical/bus/ac1", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac1_src = "GEN"; } else if (extpwr_on and gen_ext_sw and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac1", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac1_src = "EXT"; } else if (gen_apu and !genapu_fail and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac1", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac1_src = "APU"; } else if (apu_ext_crosstie_sw == 1 and xtieL) { setprop("/systems/electrical/bus/ac1", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac1_src = "XTIE"; } else if (emergen) { - setprop("/systems/electrical/bus/ac1", ac_volt_std); - ac1_src = "RAT"; + setprop("/systems/electrical/bus/ac1", 0); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } + ac1_src = "ESSRAT"; + } else if (dcbat and ias >= 50) { + setprop("/systems/electrical/bus/ac1", 0); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } + ac1_src = "ESSBAT"; } else { setprop("/systems/electrical/bus/ac1", 0); + if (getprop("/systems/electrical/bus/ac2") == 0) { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac1_src = "XX"; } # Right AC bus yes? if (stateR == 3 and gen2_sw and !gen2_fail) { setprop("/systems/electrical/bus/ac2", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac2_src = "GEN"; } else if (extpwr_on and gen_ext_sw and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac2", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac2_src = "EXT"; } else if (gen_apu and !genapu_fail and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac2", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac2_src = "APU"; } else if (apu_ext_crosstie_sw == 1 and xtieR) { setprop("/systems/electrical/bus/ac2", ac_volt_std); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac2_src = "XTIE"; } else if (emergen) { - setprop("/systems/electrical/bus/ac2", ac_volt_std); - ac2_src = "RAT"; + setprop("/systems/electrical/bus/ac2", 0); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } + ac2_src = "ESSRAT"; + } else if (dcbat and ias >= 50) { + setprop("/systems/electrical/bus/ac2", 0); + if (!ac_ess_fail) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } + ac2_src = "ESSBAT"; } else { setprop("/systems/electrical/bus/ac2", 0); + if (getprop("/systems/electrical/bus/ac1") == 0) { + setprop("/systems/electrical/bus/ac-ess", 0); + } ac2_src = "XX"; } @@ -465,13 +565,6 @@ var ELEC = { ac1 = getprop("/systems/electrical/bus/ac1"); ac2 = getprop("/systems/electrical/bus/ac2"); - - if ((ac_ess_fail or (ac1 <= 110 or ac2 <= 110)) or (ias > 50 and getprop("/controls/hydraulic/rat-deployed") == 1 and (ac1 == 0) and (ac2 == 0) and wow)) { - setprop("/systems/electrical/bus/ac-ess", 0); - } else { - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); - } - ac_ess = getprop("/systems/electrical/bus/ac-ess"); if (ac1 == 0 and ac2 == 0 and emergen == 0) { @@ -496,7 +589,7 @@ var ELEC = { setprop("/systems/electrical/extra/galleyshed", 0); } - if ((ac1 == 0) and (ac2 == 0) and (ias > 100) or (manrat) and replay == 0) { + if (((ac1 == 0 and ac2 == 0 and ias >= 100) or manrat) and replay == 0) { setprop("/controls/hydraulic/rat-deployed", 1); setprop("/controls/hydraulic/rat", 1); setprop("/controls/electrical/switches/emer-gen", 1); @@ -506,25 +599,6 @@ var ELEC = { setprop("/controls/electrical/switches/emer-gen", 0); } - # Battery Amps - if (battery1_sw and !batt1_fail) { - setprop("/systems/electrical/battery1-amps", dc_amps_std); - } else { - setprop("/systems/electrical/battery1-amps", 0); - } - - if (battery2_sw and !batt2_fail) { - setprop("/systems/electrical/battery2-amps", dc_amps_std); - } else { - setprop("/systems/electrical/battery2-amps", 0); - } - - if ((getprop("/systems/electrical/battery1-amps") > 120) or (getprop("/systems/electrical/battery2-amps") > 120)) { - setprop("/systems/electrical/bus/dcbat", dc_volt_std); - } else { - setprop("/systems/electrical/bus/dcbat", 0); - } - dc1 = getprop("/systems/electrical/bus/dc1"); dc2 = getprop("/systems/electrical/bus/dc2"); diff --git a/revision.txt b/revision.txt index 267a2730..29966f59 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4068 \ No newline at end of file +4070 \ No newline at end of file