From e1cb80f71662e2246d3b98b04c3b9a237212717d Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Fri, 28 Apr 2017 18:27:21 -0400 Subject: [PATCH] overhauled Pneumatic, fixed bugs, many improvements --- AircraftConfig/acconfig.nas | 45 ++- Models/FlightDeck/a320.flightdeck.xml | 2 + Models/Instruments/OHpanel/OHpanel.xml | 394 +++++++++++++++------- Models/Instruments/OHpanel/res/ohpanel.ac | 324 +++++++++++++++++- Nasal/electrical.nas | 2 +- Nasal/engines.nas | 32 +- Nasal/it-fbw.nas | 2 +- Nasal/pneumatics.nas | 142 ++++---- 8 files changed, 712 insertions(+), 231 deletions(-) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 55477752..cb31c96f 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -104,11 +104,11 @@ var beforestart_b = func { # Continue with engine start prep. setprop("/controls/electrical/switches/gen-apu", 1); setprop("/controls/electrical/switches/galley", 1); - setprop("/controls/bleed/OHP/bleedapu", 1); setprop("/controls/electrical/switches/gen1", 1); setprop("/controls/electrical/switches/gen2", 1); - setprop("/controls/bleed/OHP/bleed1", 1); - setprop("/controls/bleed/OHP/bleed2", 1); + setprop("/controls/pneumatic/switches/bleedapu", 1); + setprop("/controls/pneumatic/switches/bleed1", 1); + setprop("/controls/pneumatic/switches/bleed2", 1); setprop("controls/adirs/ir[0]/knob","2"); setprop("controls/adirs/ir[1]/knob","2"); setprop("controls/adirs/ir[2]/knob","2"); @@ -165,11 +165,11 @@ var taxi_b = func { # Continue with engine start prep, and start engine 2. setprop("/controls/electrical/switches/gen-apu", 1); setprop("/controls/electrical/switches/galley", 1); - setprop("/controls/bleed/OHP/bleedapu", 1); setprop("/controls/electrical/switches/gen1", 1); setprop("/controls/electrical/switches/gen2", 1); - setprop("/controls/bleed/OHP/bleed1", 1); - setprop("/controls/bleed/OHP/bleed2", 1); + setprop("/controls/pneumatic/switches/bleedapu", 1); + setprop("/controls/pneumatic/switches/bleed1", 1); + setprop("/controls/pneumatic/switches/bleed2", 1); setprop("controls/adirs/ir[0]/knob","2"); setprop("controls/adirs/ir[1]/knob","2"); setprop("controls/adirs/ir[2]/knob","2"); @@ -179,31 +179,42 @@ var taxi_b = func { setprop("instrumentation/adirs/ir[0]/aligned",1); setprop("instrumentation/adirs/ir[1]/aligned",1); setprop("instrumentation/adirs/ir[2]/aligned",1); - setprop("/controls/engines/engine-start-switch", 2); - setprop("/controls/engines/engine[1]/cutoff-switch", 0); - var eng_two_chk = setlistener("/engines/engine[1]/state", func { - if (getprop("/engines/engine[1]/state") == 3) { - removelistener(eng_two_chk); + var pneu_chk = setlistener("/systems/pneumatic/total-psi", func { + if (getprop("/systems/pneumatic/total-psi") >= 28) { + removelistener(pneu_chk); taxi_c(); } }); } var taxi_c = func { - # Start engine 1. - setprop("/controls/engines/engine[0]/cutoff-switch", 0); - var eng_one_chk = setlistener("/engines/engine[0]/state", func { - if (getprop("/engines/engine[0]/state") == 3) { - removelistener(eng_one_chk); + setprop("/controls/engines/engine-start-switch", 2); + setprop("/controls/engines/engine[1]/cutoff-switch", 0); + var eng_two_chk = setlistener("/engines/engine[1]/state", func { + if (getprop("/engines/engine[1]/state") == 3) { + removelistener(eng_two_chk); taxi_d(); } }); } var taxi_d = func { + # Start engine 1. + setprop("/controls/engines/engine[0]/cutoff-switch", 0); + var eng_one_chk = setlistener("/engines/engine[0]/state", func { + if (getprop("/engines/engine[0]/state") == 3) { + removelistener(eng_one_chk); + taxi_e(); + } + }); +} +var taxi_e = func { # After Start items. setprop("/controls/engines/engine-start-switch", 1); - setprop("/controls/bleed/OHP/bleedapu", 0); setprop("/controls/APU/master", 0); setprop("/controls/APU/start", 0); + setprop("/controls/pneumatic/switches/bleedapu", 0); + setprop("/controls/pneumatic/switches/pack1", 1); + setprop("/controls/pneumatic/switches/pack2", 1); + setprop("/controls/pneumatic/switches/hot-air", 1); setprop("/systems/acconfig/autoconfig-running", 0); ps_load_dlg.close(); ps_loaded_dlg.open(); diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index e99f91d9..55457d1e 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -4164,6 +4164,7 @@ EngMode + false property-cycle @@ -4175,6 +4176,7 @@ + false property-cycle diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index df7335b7..571b175d 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -69,11 +69,15 @@ - + select ACESSFeedBtn1F ACESSFeedBtn2O + ACPack1Btn1F + ACPack1Btn2O + ACPack2Btn1F + ACPack2Btn2O APUBleedBtn1F APUBleedBtn2O APUGenBtn1F @@ -106,6 +110,8 @@ Gen1Btn2O Gen2Btn1F Gen2Btn2O + HotAirBtn1F + HotAirBtn2O IDG1Btn1F IDG2Btn1F IR1Btn1F @@ -115,6 +121,7 @@ IR3Btn1F IR3Btn2A IrsOnBatLightOB + RamAirBtn2O @@ -172,7 +179,7 @@ - false + false property-cycle /controls/adirs/ir[0]/knob @@ -185,7 +192,7 @@ - false + false property-cycle /controls/adirs/ir[0]/knob @@ -257,7 +264,7 @@ - false + false property-cycle /controls/adirs/ir[1]/knob @@ -270,7 +277,7 @@ - false + false property-cycle /controls/adirs/ir[1]/knob @@ -342,7 +349,7 @@ - false + false property-cycle /controls/adirs/ir[2]/knob @@ -355,7 +362,7 @@ - false + false property-cycle /controls/adirs/ir[2]/knob @@ -427,7 +434,7 @@ - false + false property-cycle /controls/adirs/display/dataknob @@ -443,7 +450,7 @@ - false + false property-cycle /controls/adirs/display/dataknob @@ -488,7 +495,7 @@ - false + false property-cycle /controls/adirs/display/selected @@ -502,7 +509,7 @@ - false + false property-cycle /controls/adirs/display/selected @@ -563,7 +570,7 @@ ADR1Btn2O - false + false property-toggle /controls/adirs/adr[0]/off @@ -614,7 +621,7 @@ ADR2Btn2O - false + false property-toggle /controls/adirs/adr[1]/off @@ -665,7 +672,7 @@ ADR3Btn2O - false + false property-toggle /controls/adirs/adr[2]/off @@ -759,7 +766,7 @@ GroundCall - false + false nasal @@ -2469,7 +2611,7 @@ - true + true property-adjust controls/lighting/overhead-panel-norm @@ -2480,7 +2622,7 @@ - true + true property-adjust controls/lighting/overhead-panel-norm @@ -2516,7 +2658,7 @@ DomeLtSwtch - false + false property-cycle controls/lighting/dome-norm @@ -2554,7 +2696,7 @@ AnnunciatorLtSwtch - false + false property-cycle /controls/switches/annun-test @@ -2595,7 +2737,7 @@ SeatBeltSwtch - false + false property-toggle controls/switches/seatbelt-sign @@ -2630,7 +2772,7 @@ NoSmokingSwtch - false + false property-toggle controls/switches/no-smoking-sign @@ -2672,7 +2814,7 @@ Eng1ManStartBtn2 - false + false property-toggle controls/engines/engine[0]/starter-switch @@ -2699,7 +2841,7 @@ Eng2ManStartBtn2 - false + false property-toggle controls/engines/engine[1]/starter-switch @@ -2728,7 +2870,7 @@ e1-pump - false + false property-toggle hydraulics/control/eng1-pump @@ -2744,7 +2886,7 @@ e2-pump - false + false property-toggle hydraulics/control/eng2-pump @@ -2760,7 +2902,7 @@ elec-pump - false + false property-toggle hydraulics/control/elec-pump @@ -2776,7 +2918,7 @@ y-elec-pump - false + false property-toggle hydraulics/control/y-elec-pump @@ -2792,7 +2934,7 @@ rat - false + false property-cycle hydraulics/control/rat-unlck @@ -2808,7 +2950,7 @@ ptu - false + false property-toggle hydraulics/control/ptu @@ -2901,9 +3043,9 @@ %s /controls/adirs/display/text LED-8.txf - true - false - false + true + false + false 0.0095 32 @@ -2927,9 +3069,9 @@ %2.1f /systems/electrical/battery1-volts led.txf - true - false - false + true + false + false 0.007 32 @@ -2953,9 +3095,9 @@ %2.1f /systems/electrical/battery2-volts led.txf - true - false - false + true + false + false 0.007 32 diff --git a/Models/Instruments/OHpanel/res/ohpanel.ac b/Models/Instruments/OHpanel/res/ohpanel.ac index 1ea65786..de4cd103 100644 --- a/Models/Instruments/OHpanel/res/ohpanel.ac +++ b/Models/Instruments/OHpanel/res/ohpanel.ac @@ -7,7 +7,329 @@ MATERIAL "ac3dmat1" rgb 0.992157 0.992157 0.992157 amb 0.2 0.2 0.2 emis 1 1 1 MATERIAL "OHPanelOnBat" rgb 0.8 0.8 0.8 amb 1 1 1 emis 1 1 1 spec 0.5 0.5 0.5 shi 12 trans 0 MATERIAL "Switch" rgb 0.678431 0.678431 0.678431 amb 0.678431 0.678431 0.678431 emis 0 0 0 spec 0 0 0 shi 32 trans 0.004 OBJECT world -kids 238 +kids 245 +OBJECT poly +name "RamAirBtn2O" +loc 0.0014462 -0.11785 0.08895 +data 8 +Cube.063 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.01 -0.0464 -0.0528 +-0.01 -0.0464 -0.0328 +-0.007 -0.0464 -0.0328 +-0.007 -0.0464 -0.0528 +-0.01 -0.0564 -0.0528 +-0.01 -0.0564 -0.0328 +-0.007 -0.0564 -0.0328 +-0.007 -0.0564 -0.0528 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +3 0.5 0.75 +7 0.5 0.5 +4 0.5 0.5 +0 0.5 0.75 +SURF 0x0 +mat 4 +refs 4 +6 0 0.5 +2 9.31321e-008 0.75 +1 9.31321e-008 0.75 +5 0 0.5 +SURF 0x0 +mat 4 +refs 4 +7 0.5 0.5 +3 0.5 0.75 +2 9.31321e-008 0.75 +6 0 0.5 +SURF 0x0 +mat 4 +refs 4 +7 0.5 0.5 +6 0 0.5 +5 0 0.5 +4 0.5 0.5 +kids 0 +OBJECT poly +name "HotAirBtn2O" +loc 0.0014462 -0.05255 -0.16815 +data 8 +Cube.062 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.01 -0.0464 0.0314 +-0.01 -0.0464 0.0514 +-0.007 -0.0464 0.0514 +-0.007 -0.0464 0.0314 +-0.01 -0.0564 0.0314 +-0.01 -0.0564 0.0514 +-0.007 -0.0564 0.0514 +-0.007 -0.0564 0.0314 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +3 0.5 0.25 +7 0.5 0 +4 0.5 0 +0 0.5 0.25 +SURF 0x0 +mat 4 +refs 4 +6 0 1.19209e-007 +2 9.31321e-008 0.25 +1 9.31321e-008 0.25 +5 0 1.19209e-007 +SURF 0x0 +mat 4 +refs 4 +7 0.5 0 +3 0.5 0.25 +2 9.31321e-008 0.25 +6 0 1.19209e-007 +SURF 0x0 +mat 4 +refs 4 +7 0.5 0 +6 0 1.19209e-007 +5 0 1.19209e-007 +4 0.5 0 +kids 0 +OBJECT poly +name "HotAirBtn1F" +loc 0.0014462 -0.05255 -0.16815 +data 8 +Cube.061 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.007 -0.0464 0.0314 +-0.007 -0.0464 0.0514 +-0.01 -0.0464 0.0514 +-0.01 -0.0464 0.0314 +-0.007 -0.0364 0.0314 +-0.007 -0.0364 0.0514 +-0.01 -0.0364 0.0514 +-0.01 -0.0364 0.0314 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +4 0.5 0.5 +7 0.5 0.5 +6 9.31321e-008 0.5 +5 9.31321e-008 0.5 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0.25 +4 0.5 0.5 +5 9.31321e-008 0.5 +1 0 0.25 +SURF 0x0 +mat 4 +refs 4 +1 0 0.25 +5 9.31321e-008 0.5 +6 9.31321e-008 0.5 +2 0 0.25 +SURF 0x0 +mat 4 +refs 4 +4 0.5 0.5 +0 0.5 0.25 +3 0.5 0.25 +7 0.5 0.5 +kids 0 +OBJECT poly +name "ACPack2Btn2O" +loc 0.0014462 -0.08795 -0.16815 +data 8 +Cube.062 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.007 -0.0564 0.0314 +-0.007 -0.0564 0.0514 +-0.01 -0.0564 0.0514 +-0.01 -0.0564 0.0314 +-0.007 -0.0464 0.0314 +-0.007 -0.0464 0.0514 +-0.01 -0.0464 0.0514 +-0.01 -0.0464 0.0314 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0 +1 0 1.19209e-007 +2 0 1.19209e-007 +3 0.5 0 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0 +4 0.5 0.25 +5 9.31321e-008 0.25 +1 0 1.19209e-007 +SURF 0x0 +mat 4 +refs 4 +1 0 1.19209e-007 +5 9.31321e-008 0.25 +6 9.31321e-008 0.25 +2 0 1.19209e-007 +SURF 0x0 +mat 4 +refs 4 +4 0.5 0.25 +0 0.5 0 +3 0.5 0 +7 0.5 0.25 +kids 0 +OBJECT poly +name "ACPack2Btn1F" +loc 0.0014462 -0.08795 -0.16815 +data 8 +Cube.061 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.01 -0.0364 0.0314 +-0.01 -0.0364 0.0514 +-0.007 -0.0364 0.0514 +-0.007 -0.0364 0.0314 +-0.01 -0.0464 0.0314 +-0.01 -0.0464 0.0514 +-0.007 -0.0464 0.0514 +-0.007 -0.0464 0.0314 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +3 0.5 0.5 +7 0.5 0.25 +4 0.5 0.25 +0 0.5 0.5 +SURF 0x0 +mat 4 +refs 4 +6 0 0.25 +2 9.31321e-008 0.5 +1 9.31321e-008 0.5 +5 0 0.25 +SURF 0x0 +mat 4 +refs 4 +7 0.5 0.25 +3 0.5 0.5 +2 9.31321e-008 0.5 +6 0 0.25 +SURF 0x0 +mat 4 +refs 4 +3 0.5 0.5 +0 0.5 0.5 +1 9.31321e-008 0.5 +2 9.31321e-008 0.5 +kids 0 +OBJECT poly +name "ACPack1Btn2O" +loc 0.0014462 -0.09065 0.0848501 +data 8 +Cube.062 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.01 -0.0464 0.0314 +-0.01 -0.0464 0.0514 +-0.007 -0.0464 0.0514 +-0.007 -0.0464 0.0314 +-0.01 -0.0564 0.0314 +-0.01 -0.0564 0.0514 +-0.007 -0.0564 0.0514 +-0.007 -0.0564 0.0314 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +3 0.5 0.25 +7 0.5 0 +4 0.5 0 +0 0.5 0.25 +SURF 0x0 +mat 4 +refs 4 +6 0 1.19209e-007 +2 9.31321e-008 0.25 +1 9.31321e-008 0.25 +5 0 1.19209e-007 +SURF 0x0 +mat 4 +refs 4 +7 0.5 0 +3 0.5 0.25 +2 9.31321e-008 0.25 +6 0 1.19209e-007 +SURF 0x0 +mat 4 +refs 4 +7 0.5 0 +6 0 1.19209e-007 +5 0 1.19209e-007 +4 0.5 0 +kids 0 +OBJECT poly +name "ACPack1Btn1F" +loc 0.0014462 -0.09065 0.0848501 +data 8 +Cube.061 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.007 -0.0464 0.0314 +-0.007 -0.0464 0.0514 +-0.01 -0.0464 0.0514 +-0.01 -0.0464 0.0314 +-0.007 -0.0364 0.0314 +-0.007 -0.0364 0.0514 +-0.01 -0.0364 0.0514 +-0.01 -0.0364 0.0314 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +4 0.5 0.5 +7 0.5 0.5 +6 9.31321e-008 0.5 +5 9.31321e-008 0.5 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0.25 +4 0.5 0.5 +5 9.31321e-008 0.5 +1 0 0.25 +SURF 0x0 +mat 4 +refs 4 +1 0 0.25 +5 9.31321e-008 0.5 +6 9.31321e-008 0.5 +2 0 0.25 +SURF 0x0 +mat 4 +refs 4 +4 0.5 0.5 +0 0.5 0.25 +3 0.5 0.25 +7 0.5 0.5 +kids 0 OBJECT poly name "APUFireTst" loc 0.00144693 0.411855 0.015845 diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index d51736fd..e2de8936 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -268,4 +268,4 @@ var update_electrical = func { master_elec(); } -var elec_timer = maketimer(0.5, update_electrical); +var elec_timer = maketimer(0.2, update_electrical); diff --git a/Nasal/engines.nas b/Nasal/engines.nas index c0d1e4df..ac06f0a9 100644 --- a/Nasal/engines.nas +++ b/Nasal/engines.nas @@ -48,7 +48,7 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func { }); var start_one_check = func { - if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/controls/bleed/OHP/bleedapu") == 1) and (getprop("/systems/apu/rpm") >= 98)) { + if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28)) { auto_start_one(); } } @@ -65,7 +65,7 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func { }); var start_two_check = func { - if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/controls/bleed/OHP/bleedapu") == 1) and (getprop("/systems/apu/rpm") >= 98)) { + if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28)) { auto_start_two(); } } @@ -166,21 +166,33 @@ var apu_stop = func { setlistener("/controls/engines/engine-start-switch", func { if ((getprop("/controls/engines/engine-start-switch") == 0) or (getprop("/controls/engines/engine-start-switch") == 1)) { if (getprop("/controls/engines/engine[0]/state") == 1) { - eng_one_stop(); + setprop("/controls/engines/engine[0]/starter", 0); + setprop("/controls/engines/engine[0]/cutoff", 1); + setprop("/engines/engine[0]/state", 0); + interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time); } if (getprop("/controls/engines/engine[1]/state") == 1) { - eng_two_stop(); + setprop("/controls/engines/engine[1]/starter", 0); + setprop("/controls/engines/engine[1]/cutoff", 1); + setprop("/engines/engine[1]/state", 0); + interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time); } } }); -setlistener("/controls/bleed/OHP/bleedapu", func { - if (getprop("/controls/bleed/OHP/bleedapu") == 0) { - if (getprop("/controls/engines/engine[0]/state") == 1) { - eng_one_stop(); +setlistener("/systems/pneumatic/start-psi", func { + if (getprop("/systems/pneumatic/total-psi") < 12) { + if (getprop("/engines/engine[0]/state") == 1) { + setprop("/controls/engines/engine[0]/starter", 0); + setprop("/controls/engines/engine[0]/cutoff", 1); + setprop("/engines/engine[0]/state", 0); + interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time); } - if (getprop("/controls/engines/engine[1]/state") == 1) { - eng_two_stop(); + if (getprop("/engines/engine[1]/state") == 1) { + setprop("/controls/engines/engine[1]/starter", 0); + setprop("/controls/engines/engine[1]/cutoff", 1); + setprop("/engines/engine[1]/state", 0); + interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time); } } }); diff --git a/Nasal/it-fbw.nas b/Nasal/it-fbw.nas index 34624161..0e511078 100644 --- a/Nasal/it-fbw.nas +++ b/Nasal/it-fbw.nas @@ -40,7 +40,7 @@ var pitch_input = func { var elev = getprop("/controls/flight/elevator"); if (getprop("/it-fbw/law") == 0) { - if (getprop("/position/gear-agl-ft") <= 30) { + if (getprop("/position/gear-agl-ft") <= 15) { setprop("/it-fbw/pitch-lim-max", "15"); setprop("/it-fbw/pitch-lim-min", "-5"); } else { diff --git a/Nasal/pneumatics.nas b/Nasal/pneumatics.nas index 76ef6ede..fdd22986 100644 --- a/Nasal/pneumatics.nas +++ b/Nasal/pneumatics.nas @@ -1,39 +1,28 @@ # A320 Pneumatics System -# Jonathan Redpath (legoboyvdlp) and Joshua Davidson (it0uchpods) +# Joshua Davidson (it0uchpods) ############# # Init Vars # ############# -# 7th stage of HP compressor is where the bleed is normally extracted at 44 PSI +- 4 but at low N2 10th stage is selected to provide 36 +- 4 psi var pneumatics_init = func { - setprop("/systems/pneumatic/tempspsi/eng1/bleedvalvepsi", 0); - setprop("/systems/pneumatic/tempspsi/eng1/bleedvalvetemp", 0); - setprop("/systems/pneumatic/tempspsi/eng2/bleedvalvepsi", 0); - setprop("/systems/pneumatic/tempspsi/eng2/bleedvalvetemp", 0); - setprop("/systems/pneumatic/tempspsi/eng1/downstreamfavtemp", 0); - setprop("/systems/pneumatic/tempspsi/eng2/downstreamfavtemp", 0); - setprop("/systems/pneumatic/valves/xbleed", 0); - setprop("/systems/pneumatic/valves/eng1/bleedvalvepos", 0); - setprop("/systems/pneumatic/valves/eng1/OPRESSvalve", 0); - setprop("/systems/pneumatic/valves/eng1/bleedengsrc", "7"); - setprop("/systems/pneumatic/valves/eng1/fav", 0); - setprop("/systems/pneumatic/valves/eng2/fav", 0); - setprop("/systems/pneumatic/valves/eng2/bleedvalvepos", 0); - setprop("/systems/pneumatic/valves/eng2/OPRESSvalve", 0); - setprop("/systems/pneumatic/valves/eng2/bleedengsrc", "7"); - setprop("/systems/pneumatic/valves/eng2/fav", 0); - setprop("/systems/pneumatic/valves/apubleed", 0); - setprop("/systems/pneumatic/valves/eng1/startvalve", 0); - setprop("/systems/pneumatic/valves/eng2/startvalve", 0); - setprop("/controls/bleed/ground", 0); - setprop("/controls/bleed/OHP/pack1", 0); - setprop("/controls/bleed/OHP/pack2", 0); - setprop("/controls/bleed/OHP/bleed1", 0); - setprop("/controls/bleed/OHP/bleed2", 0); - setprop("/controls/bleed/OHP/xbleed", 0); - setprop("/controls/bleed/OHP/bleedapu", 0); - setprop("/controls/bleed/OHP/ramair", 0); + setprop("/controls/pneumatic/switches/bleed1", 0); + setprop("/controls/pneumatic/switches/bleed2", 0); + setprop("/controls/pneumatic/switches/bleedapu", 0); + setprop("/controls/pneumatic/switches/pack1", 0); + setprop("/controls/pneumatic/switches/pack2", 0); + setprop("/controls/pneumatic/switches/hot-air", 0); + setprop("/controls/pneumatic/switches/ram-air", 0); + setprop("/controls/pneumatic/switches/pack-flo", 10); # LO: 5, NORM: 10, HI: 15 + setprop("/controls/pneumatic/switches/xbleed", 1); + setprop("/systems/pneumatic/bleed1", 0); + setprop("/systems/pneumatic/bleed2", 0); + setprop("/systems/pneumatic/bleedapu", 0); + setprop("/systems/pneumatic/total-psi", 0); + setprop("/systems/pneumatic/start-psi", 0); + setprop("/systems/pneumatic/pack1", 0); + setprop("/systems/pneumatic/pack2", 0); + setprop("/systems/pneumatic/startpsir", 0); pneu_timer.start(); } @@ -42,59 +31,62 @@ var pneumatics_init = func { ####################### var master_pneu = func { - var bleed1 = getprop("/controls/bleed/OHP/bleed1"); - var bleed2 = getprop("/controls/bleed/OHP/bleed2"); - var apubleedsw = getprop("/controls/bleed/OHP/bleedapu"); - var apubleed = getprop("/systems/pneumatic/valves/apubleed"); - var opress1 = getprop("/systems/pneumatic/valves/eng1/OPRESSvalve"); - var bleedohp1 = getprop("/controls/bleed/OHP/bleed1"); - var eng1valveopen = getprop("/systems/pneumatic/valves/eng1/startvalve"); - var opress2 = getprop("/systems/pneumatic/valves/eng2/OPRESSvalve"); - var bleedohp2 = getprop("/controls/bleed/OHP/bleed2"); - var eng2valveopen = getprop("/systems/pneumatic/valves/eng2/startvalve"); + var bleed1_sw = getprop("/controls/pneumatic/switches/bleed1"); + var bleed2_sw = getprop("/controls/pneumatic/switches/bleed2"); + var bleedapu_sw = getprop("/controls/pneumatic/switches/bleedapu"); + var pack1_sw = getprop("/controls/pneumatic/switches/pack1"); + var pack2_sw = getprop("/controls/pneumatic/switches/pack2"); + var hot_air_sw = getprop("/controls/pneumatic/switches/hot-air"); + var ram_air_sw = getprop("/controls/pneumatic/switches/ram-air"); + var pack_flo_sw = getprop("/controls/pneumatic/switches/pack-flo", 1); + var xbleed_sw = getprop("/controls/pneumatic/switches/xbleed"); + var pack1 = getprop("/systems/pneumatic/pack1"); + var pack2 = getprop("/systems/pneumatic/pack2"); + var rpmapu = getprop("/systems/apu/rpm"); + var stateL = getprop("/engines/engine[0]/state"); + var stateR = getprop("/engines/engine[1]/state"); - if (bleed1) { - setprop("/systems/pneumatic/valves/eng1/bleedvalvepos", 1); + # Air Sources/PSI + if (rpmapu >= 94.9 and bleedapu_sw) { + setprop("/systems/pneumatic/bleedapu", 34); } else { - setprop("/systems/pneumatic/valves/eng1/bleedvalvepos", 0); - } - - if (bleed2) { - setprop("/systems/pneumatic/valves/eng2/bleedvalvepos", 1); - } else { - setprop("/systems/pneumatic/valves/eng2/bleedvalvepos", 0); - } - - if (opress1 or apubleed or !bleedohp1 or eng1valveopen) { - setprop("/systems/pneumatic/valves/eng1/bleedvalvepos", 0); + setprop("/systems/pneumatic/bleedapu", 0); } - if (opress2 or apubleed or !bleedohp2 or eng2valveopen) { - setprop("/systems/pneumatic/valves/eng2/bleedvalvepos", 0); - } - - if (apubleedsw) { - apubleedtimer.start(); + if (stateL == 3 and bleed1_sw) { + setprop("/systems/pneumatic/bleed1", 31); } else { - apubleedtimer.stop(); - setprop("/systems/pneumatic/valves/xbleed", 0); - setprop("/systems/pneumatic/valves/apubleed", 0); + setprop("/systems/pneumatic/bleed1", 0); } + + if (stateR == 3 and bleed2_sw) { + setprop("/systems/pneumatic/bleed2", 32); + } else { + setprop("/systems/pneumatic/bleed2", 0); + } + + var bleed1 = getprop("/systems/pneumatic/bleed1"); + var bleed2 = getprop("/systems/pneumatic/bleed2"); + var bleedapu = getprop("/systems/pneumatic/bleedapu"); + + if ( stateL == 1 or stateR == 1) { + setprop("/systems/pneumatic/start-psi", 18); + } else { + setprop("/systems/pneumatic/start-psi", 0); + } + + var start_psi = getprop("/systems/pneumatic/start-psi"); + + if ((bleed1 + bleed2 + bleedapu) > 42) { + setprop("/systems/pneumatic/total-psi", 42); + } else { + var total_psi_calc = ((bleed1 + bleed2 + bleedapu) - start_psi); # - pack_psi; + setprop("/systems/pneumatic/total-psi", total_psi_calc); + } + + var total_psi = getprop("/systems/pneumatic/total-psi"); } -var apubleedtimer = maketimer(0.5, func { - var APU = getprop("/systems/apu/rpm"); - if (APU > 94.9) { - apubleedtimer.stop(); - setprop("/systems/pneumatic/valves/xbleed", 1); - setprop("/systems/pneumatic/valves/eng1/bleedvalvepos", 0); - setprop("/systems/pneumatic/valves/eng2/bleedvalvepos", 0); - setprop("/controls/bleed/OHP/bleed1", 0); - setprop("/controls/bleed/OHP/bleed2", 0); - setprop("/systems/pneumatic/valves/apubleed", 1); - } -}); - ################### # Update Function # ################### @@ -103,4 +95,4 @@ var update_pneumatic = func { master_pneu(); } -var pneu_timer = maketimer(0.5, update_pneumatic); +var pneu_timer = maketimer(0.2, update_pneumatic);