diff --git a/A320-main.xml b/A320-main.xml index 6504666b..c05a2783 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -508,13 +508,34 @@ - 0 - 0 - 0 - 0 - 0 - 0 - 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 0 diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 33866859..96c35811 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -29,6 +29,7 @@ var init_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/init/dialog", "Aircraft/ var help_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/help/dialog", "Aircraft/A320Family/AircraftConfig/help.xml"); var fbw_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fbw/dialog", "Aircraft/A320Family/AircraftConfig/fbw.xml"); var fail_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fail/dialog", "Aircraft/A320Family/AircraftConfig/fail.xml"); +var fail_b_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/failb/dialog", "Aircraft/A320Family/AircraftConfig/fail-b.xml"); spinning.start(); init_dlg.open(); @@ -64,6 +65,42 @@ var failReset = func { setprop("/systems/failures/rudder", 0); setprop("/systems/failures/spoiler-left", 0); setprop("/systems/failures/spoiler-right", 0); + setprop("/systems/failures/elec-ac-ess", 0); + setprop("/systems/failures/elec-batt1", 0); + setprop("/systems/failures/elec-batt2", 0); + setprop("/systems/failures/elec-galley", 0); + setprop("/systems/failures/elec-genapu", 0); + setprop("/systems/failures/elec-gen1", 0); + setprop("/systems/failures/elec-gen2", 0); + setprop("/systems/failures/bleed-apu", 0); + setprop("/systems/failures/bleed-ext", 0); + setprop("/systems/failures/bleed-eng1", 0); + setprop("/systems/failures/bleed-eng2", 0); + setprop("/systems/failures/pack1", 0); + setprop("/systems/failures/pack2", 0); + setprop("/systems/failures/hyd-blue", 0); + setprop("/systems/failures/hyd-green", 0); + setprop("/systems/failures/hyd-yellow", 0); + setprop("/systems/failures/ptu", 0); + setprop("/systems/failures/pump-blue", 0); + setprop("/systems/failures/pump-green", 0); + setprop("/systems/failures/pump-yellow-eng", 0); + setprop("/systems/failures/pump-yellow-elec", 0); +} + +var failPage = func(page) { + if (page == 0) { + gui.popupTip("This is the first page!"); + } else if (page == 1) { + fail_dlg.open(); + fail_b_dlg.close(); + } else if (page == 2) { + fail_dlg.close(); + fail_b_dlg.open(); +# fail_c_dlg.open(); # Fail C Doesn't exist yet!!! :) + } else if (page == 3) { + gui.popupTip("No Moar!"); + } } ################ diff --git a/AircraftConfig/fail-b.xml b/AircraftConfig/fail-b.xml new file mode 100644 index 00000000..eaa93068 --- /dev/null +++ b/AircraftConfig/fail-b.xml @@ -0,0 +1,158 @@ + + + + + + + + aircraft-config-failb + vbox + + + hbox + + left + + + + + + + + + vbox + + + left + + + + + hbox + + + true + + + + + + true + + + + + + left + /systems/failures/bleed-apu + + dialog-apply + + true + + + + + left + /systems/failures/bleed-ext + + dialog-apply + + true + + + + + left + /systems/failures/bleed-eng1 + + dialog-apply + + true + + + + + left + /systems/failures/bleed-eng2 + + dialog-apply + + true + + + + + left + /systems/failures/pack1 + + dialog-apply + + true + + + + + left + /systems/failures/pack2 + + dialog-apply + + true + + + + + + hbox + + + + + + + + + + + + diff --git a/AircraftConfig/fail.xml b/AircraftConfig/fail.xml index dd9cb5ec..2151aefd 100644 --- a/AircraftConfig/fail.xml +++ b/AircraftConfig/fail.xml @@ -12,7 +12,7 @@ hbox left - + + true + + + + + left + /systems/failures/elec-genapu + + dialog-apply + + true + + + + + left + /systems/failures/elec-batt1 + + dialog-apply + + true + + + + + left + /systems/failures/elec-batt2 + + dialog-apply + + true + + + + + left + /systems/failures/elec-gen1 + + dialog-apply + + true + + + + + left + /systems/failures/elec-gen2 + + dialog-apply + + true + + + + + left + /systems/failures/elec-galley + + dialog-apply + + true + + + + hbox + + + true + + + + + + true + + + + + + left + /systems/failures/hyd-blue + + dialog-apply + + true + + + + + left + /systems/failures/pump-blue + + dialog-apply + + true + + + + + left + /systems/failures/hyd-green + + dialog-apply + + true + + + + + left + /systems/failures/pump-green + + dialog-apply + + true + + + + + left + /systems/failures/hyd-yellow + + dialog-apply + + true + + + + + left + /systems/failures/pump-yellow-eng + + dialog-apply + + true + + + + + left + /systems/failures/pump-yellow-elec + + dialog-apply + + true + + + + + + hbox + + + + + + + + diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index 5e108549..e0083742 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -981,10 +981,10 @@ GreenEngPump1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/pump-green + 1 + /controls/switches/annun-test 1 @@ -1054,10 +1054,10 @@ BlueElecPump1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/pump-blue + 1 + /controls/switches/annun-test 1 @@ -1109,10 +1109,10 @@ PTU1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/ptu + 1 + /controls/switches/annun-test 1 @@ -1164,10 +1164,10 @@ YellowEngPump1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/pump-yellow-eng + 1 + /controls/switches/annun-test 1 @@ -1219,10 +1219,10 @@ YellowElecPump1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/pump-yellow-elec + 1 + /controls/switches/annun-test 1 @@ -1274,10 +1274,10 @@ GalleyPwrBtn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/elec-galley + 1 + /controls/switches/annun-test 1 @@ -1329,10 +1329,10 @@ BatteryBtn11F - - /systems/unused/unused-oh - 150 - + + /systems/failures/elec-batt1 + 1 + /controls/switches/annun-test 1 @@ -1384,10 +1384,10 @@ BatteryBtn21F - - /systems/unused/unused-oh - 150 - + + /systems/failures/elec-batt2 + 1 + /controls/switches/annun-test 1 @@ -1472,10 +1472,10 @@ Gen1Btn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/elec-gen1 + 1 + /controls/switches/annun-test 1 @@ -1526,10 +1526,10 @@ ACESSFeedBtn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/elec-ac-ess + 1 + /controls/switches/annun-test 1 @@ -1580,10 +1580,10 @@ APUGenBtn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/elec-genapu + 1 + /controls/switches/annun-test 1 @@ -1729,10 +1729,10 @@ Gen2Btn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/elec-gen2 + 1 + /controls/switches/annun-test 1 @@ -1877,10 +1877,10 @@ ACPack1Btn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/pack1 + 1 + /controls/switches/annun-test 1 @@ -1932,10 +1932,10 @@ Eng1BleedBtn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/bleed-eng1 + 1 + /controls/switches/annun-test 1 @@ -1987,10 +1987,10 @@ APUBleedBtn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/bleed-apu + 1 + /controls/switches/annun-test 1 @@ -2042,10 +2042,10 @@ Eng2BleedBtn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/bleed-eng2 + 1 + /controls/switches/annun-test 1 @@ -2151,10 +2151,10 @@ ACPack2Btn1F - - /systems/unused/unused-oh - 150 - + + /systems/failures/pack2 + 1 + /controls/switches/annun-test 1 diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index 0f47c59d..a7a22098 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -133,14 +133,20 @@ var master_elec = func { var gs = getprop("/velocities/groundspeed-kt"); var rat = getprop("/controls/hydraulic/rat"); var manrat = getprop("/controls/hydraulic/rat-man"); - + var ac_ess_fail = getprop("/systems/failures/elec-ac-ess"); + var batt1_fail = getprop("/systems/failures/elec-batt1"); + var batt2_fail = getprop("/systems/failures/elec-batt2"); + var gallery_fail = getprop("/systems/failures/elec-galley"); + var genapu_fail = getprop("/systems/failures/elec-genapu"); + var gen1_fail = getprop("/systems/failures/elec-gen1"); + var gen2_fail = getprop("/systems/failures/elec-gen2"); # Left cross tie yes? if (extpwr_on and gen_ext_sw) { setprop("/controls/electrical/xtie/xtieR", 1); - } else if (rpmapu >= 94.9 and gen_apu_sw) { + } else if (rpmapu >= 94.9 and gen_apu_sw and !genapu_fail) { setprop("/controls/electrical/xtie/xtieR", 1); - } else if (stateL == 3 and gen1_sw) { + } else if (stateL == 3 and gen1_sw and !gen1_fail) { setprop("/controls/electrical/xtie/xtieR", 1); } else { setprop("/controls/electrical/xtie/xtieR", 0); @@ -149,45 +155,81 @@ var master_elec = func { # Right cross tie yes? if (extpwr_on and gen_ext_sw) { setprop("/controls/electrical/xtie/xtieL", 1); - } else if (rpmapu >= 94.9 and gen_apu_sw) { + } else if (rpmapu >= 94.9 and gen_apu_sw and !genapu_fail) { setprop("/controls/electrical/xtie/xtieL", 1); - } else if (stateR == 3 and gen2_sw) { + } else if (stateR == 3 and gen2_sw and !gen2_fail) { setprop("/controls/electrical/xtie/xtieL", 1); } else { setprop("/controls/electrical/xtie/xtieL", 0); } - # Left AC/DC bus yes? + # Left DC bus yes? if (extpwr_on and gen_ext_sw) { - setprop("/systems/electrical/bus/ac1", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); - setprop("/systems/electrical/extra/ext-volts", ac_volt_std); - setprop("/systems/electrical/extra/ext-hz", ac_volt_std); setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); - } else if (gen_apu) { - setprop("/systems/electrical/bus/ac1", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); - setprop("/systems/electrical/extra/apu-volts", ac_volt_std); - setprop("/systems/electrical/extra/apu-hz", ac_volt_std); + } else if (gen_apu and !genapu_fail) { setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); - } else if (stateL == 3 and gen1_sw) { - setprop("/systems/electrical/bus/ac1", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); - setprop("/systems/electrical/extra/gen1-volts", ac_volt_std); - setprop("/systems/electrical/bus/gen1-hz", ac_hz_std); + } else if (stateL == 3 and gen1_sw and !gen1_fail) { setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); } else if (apu_ext_crosstie_sw == 1 and xtieL) { - setprop("/systems/electrical/bus/ac1", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); + } else { + setprop("/systems/electrical/bus/dc1", 0); + setprop("/systems/electrical/bus/dc1-amps", 0); + if (getprop("/systems/electrical/bus/dc2") == 0) { + setprop("/systems/electrical/bus/dc-ess", 0); + } + } + + # Right DC bus yes? + if (extpwr_on and gen_ext_sw) { + setprop("/systems/electrical/bus/dc2", dc_volt_std); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + } else if (gen_apu and !genapu_fail) { + setprop("/systems/electrical/bus/dc2", dc_volt_std); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + } else if (stateR == 3 and gen2_sw and !gen2_fail) { + setprop("/systems/electrical/bus/dc2", dc_volt_std); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + } else if (apu_ext_crosstie_sw == 1 and xtieR) { + setprop("/systems/electrical/bus/dc2", dc_volt_std); + setprop("/systems/electrical/bus/dc-ess", dc_volt_std); + setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + } else { + setprop("/systems/electrical/bus/dc2", 0); + setprop("/systems/electrical/bus/dc2-amps", 0); + if (getprop("/systems/electrical/bus/dc1") == 0) { + setprop("/systems/electrical/bus/dc-ess", 0); + } + } + + # Left AC bus yes? + if (extpwr_on and gen_ext_sw) { + setprop("/systems/electrical/bus/ac1", ac_volt_std); + setprop("/systems/electrical/extra/ext-volts", ac_volt_std); + setprop("/systems/electrical/extra/ext-hz", ac_volt_std); + } else if (gen_apu and !genapu_fail) { + setprop("/systems/electrical/bus/ac1", ac_volt_std); + setprop("/systems/electrical/extra/apu-volts", ac_volt_std); + setprop("/systems/electrical/extra/apu-hz", ac_volt_std); + } else if (stateL == 3 and gen1_sw and !gen1_fail) { + setprop("/systems/electrical/bus/ac1", ac_volt_std); + setprop("/systems/electrical/extra/gen1-volts", ac_volt_std); + setprop("/systems/electrical/bus/gen1-hz", ac_hz_std); + } else if (apu_ext_crosstie_sw == 1 and xtieL) { + setprop("/systems/electrical/bus/ac1", ac_volt_std); + setprop("/systems/electrical/extra/gen1-volts", ac_volt_std); + setprop("/systems/electrical/bus/gen1-hz", ac_hz_std); } else { setprop("/systems/electrical/bus/ac1", 0); setprop("/systems/electrical/extra/ext-volts", 0); @@ -196,47 +238,25 @@ var master_elec = func { setprop("/systems/electrical/extra/apu-hz", 0); setprop("/systems/electrical/extra/gen1-volts", 0); setprop("/systems/electrical/bus/gen1-hz", 0); - if (getprop("/systems/electrical/bus/ac2") == 0) { - setprop("/systems/electrical/bus/ac-ess", 0); - } - setprop("/systems/electrical/bus/dc1", 0); - setprop("/systems/electrical/bus/dc1-amps", 0); - if (getprop("/systems/electrical/bus/dc2") == 0) { - setprop("/systems/electrical/bus/dc-ess", 0); - } } - # Right AC/DC bus yes? + # Right AC bus yes? if (extpwr_on and gen_ext_sw) { setprop("/systems/electrical/bus/ac2", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); setprop("/systems/electrical/extra/ext-volts", ac_volt_std); setprop("/systems/electrical/extra/ext-hz", ac_hz_std); - setprop("/systems/electrical/bus/dc2", dc_volt_std); - setprop("/systems/electrical/bus/dc-ess", dc_volt_std); - setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); - } else if (gen_apu) { + } else if (gen_apu and !genapu_fail) { setprop("/systems/electrical/bus/ac2", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); setprop("/systems/electrical/extra/apu-volts", ac_volt_std); setprop("/systems/electrical/extra/apu-hz", ac_hz_std); - setprop("/systems/electrical/bus/dc2", dc_volt_std); - setprop("/systems/electrical/bus/dc-ess", dc_volt_std); - setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); - } else if (stateR == 3 and gen2_sw) { + } else if (stateR == 3 and gen2_sw and !gen2_fail) { setprop("/systems/electrical/bus/ac2", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); setprop("/systems/electrical/extra/gen2-volts", ac_volt_std); setprop("/systems/electrical/bus/gen2-hz", ac_hz_std); - setprop("/systems/electrical/bus/dc2", dc_volt_std); - setprop("/systems/electrical/bus/dc-ess", dc_volt_std); - setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); } else if (apu_ext_crosstie_sw == 1 and xtieR) { setprop("/systems/electrical/bus/ac2", ac_volt_std); - setprop("/systems/electrical/bus/ac-ess", ac_volt_std); - setprop("/systems/electrical/bus/dc2", dc_volt_std); - setprop("/systems/electrical/bus/dc-ess", dc_volt_std); - setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); + setprop("/systems/electrical/extra/gen2-volts", ac_volt_std); + setprop("/systems/electrical/bus/gen2-hz", ac_hz_std); } else { setprop("/systems/electrical/bus/ac2", 0); setprop("/systems/electrical/extra/ext-volts", 0); @@ -245,17 +265,20 @@ var master_elec = func { setprop("/systems/electrical/extra/apu-hz", 0); setprop("/systems/electrical/extra/gen2-volts", 0); setprop("/systems/electrical/bus/gen2-hz", 0); - if (getprop("/systems/electrical/bus/ac1") == 0) { - setprop("/systems/electrical/bus/ac-ess", 0); - } - setprop("/systems/electrical/bus/dc2", 0); - setprop("/systems/electrical/bus/dc2-amps", 0); - if (getprop("/systems/electrical/bus/dc1") == 0) { - setprop("/systems/electrical/bus/dc-ess", 0); - } } - if (ac_ess >= 100) { + var ac1 = getprop("/systems/electrical/bus/ac1"); + var ac2 = getprop("/systems/electrical/bus/ac2"); + + if (!ac_ess_fail and (ac1 >= 110 or ac2 >= 110)) { + setprop("/systems/electrical/bus/ac-ess", ac_volt_std); + } else { + setprop("/systems/electrical/bus/ac-ess", 0); + } + + var ac_ess = getprop("/systems/electrical/bus/ac-ess"); + + if (ac_ess >= 110 and !gallery_fail) { if (galley_sw == 1 and !galley_shed) { setprop("/systems/electrical/bus/galley", ac_volt_std); } else if (galley_sw or galley_shed) { @@ -300,13 +323,13 @@ var master_elec = func { # Battery Amps - if (battery1_sw) { + if (battery1_sw and !batt1_fail) { setprop("/systems/electrical/battery1-amps", dc_amps_std); } else { setprop("/systems/electrical/battery1-amps", 0); } - if (battery2_sw) { + if (battery2_sw and !batt2_fail) { setprop("/systems/electrical/battery2-amps", dc_amps_std); } else { setprop("/systems/electrical/battery2-amps", 0); @@ -321,31 +344,37 @@ var master_elec = func { if (battery1_volts > 27.9 or (dcbat == 0)) { setprop("/systems/electrical/extra/battery/bat1-contact", 0); charge1.stop(); + } else if (batt1_fail) { + setprop("/systems/electrical/extra/battery/bat1-contact", 0); + charge1.stop(); } if (battery2_volts > 27.9 or (dcbat == 0)) { setprop("/systems/electrical/extra/battery/bat2-contact", 0); charge2.stop(); + } else if (batt2_fail) { + setprop("/systems/electrical/extra/battery/bat2-contact", 0); + charge2.stop(); } - if ((dcbat > 0) and battery1_sw) { + if ((dcbat > 0) and battery1_sw and !batt1_fail) { setprop("/systems/electrical/extra/battery/bat1-contact", 1); decharge1.stop(); charge1.start(); } - if ((dcbat > 0) and battery2_sw) { + if ((dcbat > 0) and battery2_sw and !batt2_fail) { setprop("/systems/electrical/extra/battery/bat2-contact", 1); decharge1.stop(); charge2.start(); } - if (!bat1_con and (dcbat == 0) and battery1_sw) { + if (!bat1_con and (dcbat == 0) and battery1_sw and !batt1_fail) { decharge1.start(); } - if (!bat2_con and (dcbat == 0) and battery2_sw) { + if (!bat2_con and (dcbat == 0) and battery2_sw and !batt2_fail) { decharge2.start(); } diff --git a/Nasal/hydraulics.nas b/Nasal/hydraulics.nas index 9b16dd2f..cd94d15d 100644 --- a/Nasal/hydraulics.nas +++ b/Nasal/hydraulics.nas @@ -43,6 +43,14 @@ var master_hyd = func { var rat = getprop("/controls/hydraulic/rat"); var ratout = getprop("/controls/hydraulic/rat-deployed"); var gs = getprop("/velocities/groundspeed-kt"); + var blue_leak = getprop("/systems/failures/hyd-blue"); + var green_leak = getprop("/systems/failures/hyd-green"); + var yellow_leak = getprop("/systems/failures/hyd-yellow"); + var blue_pump_fail = getprop("/systems/failures/pump-blue"); + var green_pump_fail = getprop("/systems/failures/pump-green"); + var yellow_pump_eng_fail = getprop("/systems/failures/pump-yellow-eng"); + var yellow_pump_elec_fail = getprop("/systems/failures/pump-yellow-elec"); + var ptu_fail = getprop("/systems/failures/ptu"); if (psi_diff > 500 or psi_diff < -500 and ptu_sw) { setprop("/systems/hydraulic/ptu-active", 1); @@ -59,13 +67,13 @@ var master_hyd = func { var ptu_active = getprop("/systems/hydraulic/ptu-active"); - if (elec_pump_blue_sw and dc_ess >= 25 and (stateL == 3 or stateR == 3)) { + if ((elec_pump_blue_sw and dc_ess >= 25 and !blue_pump_fail) and (stateL == 3 or stateR == 3) and !blue_leak) { if (blue_psi < 2900) { setprop("/systems/hydraulic/blue-psi", blue_psi + 100); } else { setprop("/systems/hydraulic/blue-psi", 3000); } - } else if (gs >= 100 and rat) { + } else if (gs >= 100 and rat and !blue_leak) { if (blue_psi < 2400) { setprop("/systems/hydraulic/blue-psi", blue_psi + 100); } else { @@ -79,13 +87,13 @@ var master_hyd = func { } } - if (eng1_pump_sw and stateL == 3) { + if ((eng1_pump_sw and stateL == 3 and !green_pump_fail) and !green_leak) { if (green_psi < 2900) { setprop("/systems/hydraulic/green-psi", green_psi + 100); } else { setprop("/systems/hydraulic/green-psi", 3000); } - } else if (ptu_active and stateL != 3) { + } else if ((ptu_active and stateL != 3 and !ptu_fail) and !green_leak) { if (green_psi < 2900) { setprop("/systems/hydraulic/green-psi", green_psi + 100); } else { @@ -99,19 +107,19 @@ var master_hyd = func { } } - if (eng2_pump_sw and stateR == 3) { + if ((eng2_pump_sw and stateR == 3 and !yellow_pump_eng_fail) and !yellow_leak) { if (yellow_psi < 2900) { setprop("/systems/hydraulic/yellow-psi", yellow_psi + 100); } else { setprop("/systems/hydraulic/yellow-psi", 3000); } - } else if (elec_pump_yellow_sw and dc_ess >= 25) { + } else if ((elec_pump_yellow_sw and dc_ess >= 25 and !yellow_pump_elec_fail) and !yellow_leak) { if (yellow_psi < 2900) { setprop("/systems/hydraulic/yellow-psi", yellow_psi + 100); } else { setprop("/systems/hydraulic/yellow-psi", 3000); } - } else if (ptu_active and stateR != 3) { + } else if ((ptu_active and stateR != 3 and !ptu_fail) and !yellow_leak) { if (yellow_psi < 2900) { setprop("/systems/hydraulic/yellow-psi", yellow_psi + 100); } else { diff --git a/Nasal/pneumatics.nas b/Nasal/pneumatics.nas index 0e6f8863..aa173e4b 100644 --- a/Nasal/pneumatics.nas +++ b/Nasal/pneumatics.nas @@ -52,21 +52,27 @@ var master_pneu = func { var rpmapu = getprop("/systems/apu/rpm"); var stateL = getprop("/engines/engine[0]/state"); var stateR = getprop("/engines/engine[1]/state"); + var bleedapu_fail = getprop("/systems/failures/bleed-apu"); + var bleedext_fail = getprop("/systems/failures/bleed-ext"); + var bleedeng1_fail = getprop("/systems/failures/bleed-eng1"); + var bleedeng2_fail = getprop("/systems/failures/bleed-eng2"); + var pack1_fail = getprop("/systems/failures/pack1"); + var pack2_fail = getprop("/systems/failures/pack2"); # Air Sources/PSI - if (rpmapu >= 94.9 and bleedapu_sw) { + if (rpmapu >= 94.9 and bleedapu_sw and !bleedapu_fail) { setprop("/systems/pneumatic/bleedapu", 34); } else { setprop("/systems/pneumatic/bleedapu", 0); } - if (stateL == 3 and bleed1_sw) { + if (stateL == 3 and bleed1_sw and !bleedeng1_fail) { setprop("/systems/pneumatic/bleed1", 31); } else { setprop("/systems/pneumatic/bleed1", 0); } - if (stateR == 3 and bleed2_sw) { + if (stateR == 3 and bleed2_sw and !bleedeng2_fail) { setprop("/systems/pneumatic/bleed2", 32); } else { setprop("/systems/pneumatic/bleed2", 0); @@ -83,13 +89,13 @@ var master_pneu = func { setprop("/systems/pneumatic/start-psi", 0); } - if (pack1_sw == 1 and (bleed1 >= 20 or bleedapu >= 20 or ground >= 20) and eng1_starter == 0 and eng2_starter == 0) { + if (pack1_sw == 1 and (bleed1 >= 20 or bleedapu >= 20 or ground >= 20) and eng1_starter == 0 and eng2_starter == 0 and !pack1_fail) { setprop("/systems/pneumatic/pack1", pack_flo_sw); } else { setprop("/systems/pneumatic/pack1", 0); } - if (pack2_sw == 1 and (bleed2 >= 20 or bleedapu >= 20 or ground >= 20) and eng1_starter == 0 and eng2_starter == 0) { + if (pack2_sw == 1 and (bleed2 >= 20 or bleedapu >= 20 or ground >= 20) and eng1_starter == 0 and eng2_starter == 0 and !pack2_fail) { setprop("/systems/pneumatic/pack2", pack_flo_sw); } else { setprop("/systems/pneumatic/pack2", 0); @@ -116,7 +122,7 @@ var master_pneu = func { setprop("/systems/pneumatic/total-psi", total_psi_calc); } - if (groundair_supp) { + if (groundair_supp) { setprop("/systems/pneumatic/groundair", 39); } else { setprop("/systems/pneumatic/groundair", 0);