diff --git a/A320-main.xml b/A320-main.xml index 21294ee9..59e89881 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -522,6 +522,7 @@ 1 0 0 + 0.5 diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index d566f8d5..e26f5a49 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -99,6 +99,7 @@ var systemsReset = func { systems.pneu_init(); systems.hyd_init(); systems.fuel_init(); + systems.eng_init(); fmgc.FMGCinit(); mcdu1.MCDU_reset(); mcdu2.MCDU_reset(); diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml index 7e74e9e6..2037a9c3 100644 --- a/Models/Instruments/OHpanel/OHpanel.xml +++ b/Models/Instruments/OHpanel/OHpanel.xml @@ -79,8 +79,10 @@ Eng2AntiIceBtn2O Eng1BleedBtn1F Eng1BleedBtn2O + Eng1ManStartBtn2O Eng2BleedBtn1F Eng2BleedBtn2O + Eng2ManStartBtn2O FuelModeBtn1F FuelModeBtn2O FuelXfeedBtn1A @@ -3955,7 +3957,7 @@ property-toggle - /controls/deice/wing + /controls/switches/wing nasal @@ -3968,10 +3970,16 @@ select WingAntiIceBtn1F - - /controls/switches/annun-test - 1 - + + + /controls/switches/wingfault + 1 + + + /controls/switches/annun-test + 1 + + @@ -3981,7 +3989,7 @@ - /controls/deice/wing + /controls/switches/wing 1 @@ -4322,7 +4330,214 @@ - + + + + pick + Eng1ManStartBtn1 + Eng1ManStartBtn2 + Eng1ManStartBtn2O + + + false + + + + + /controls/OH/protectors/eng1-manstart + 1 + + + + /systems/electrical/bus/dc1 + 25 + + + /systems/electrical/bus/dc2 + 25 + + + + + property-toggle + /controls/engines/engine[0]/man-start + + + + + /controls/OH/protectors/eng1-manstart + 1 + + + nasal + + + + + + + pick + Eng1ManStartBtn1 + Eng1ManStartBtn2 + Eng1ManStartBtn2O + Eng1ManStartProt + + + false + + property-assign + /controls/OH/protectors/eng1-manstart + 1 + + + + property-assign + /controls/OH/protectors/eng1-manstart + 0 + + + nasal + + + + + + + + rotate + Eng1ManStartProt + /controls/OH/protectors/eng1-manstart + -145 + + -0.00641 + 0.18647 + -0.20418 + -0.00353 + 0.20925 + -0.20418 + + + + + select + Eng1ManStartBtn2O + + + + /controls/engines/engine[0]/man-start + 1 + + + /controls/switches/annun-test + 1 + + + + + + + pick + Eng2ManStartBtn1 + Eng2ManStartBtn2 + Eng2ManStartBtn2O + + + false + + + + + /controls/OH/protectors/eng2-manstart + 1 + + + + /systems/electrical/bus/dc1 + 25 + + + /systems/electrical/bus/dc2 + 25 + + + + + property-toggle + /controls/engines/engine[1]/man-start + + + + + /controls/OH/protectors/eng2-manstart + 1 + + + nasal + + + + + + + pick + Eng2ManStartBtn1 + Eng2ManStartBtn2 + Eng2ManStartBtn2O + Eng2ManStartProt + + + false + + property-assign + /controls/OH/protectors/eng2-manstart + 1 + + + + property-assign + /controls/OH/protectors/eng2-manstart + 0 + + + nasal + + + + + + + + rotate + Eng2ManStartProt + /controls/OH/protectors/eng2-manstart + -145 + + -0.00226 + 0.21793 + -0.20418 + 0.00062 + 0.24071 + -0.20418 + + + + + select + Eng2ManStartBtn2O + + + + /controls/engines/engine[1]/man-start + 1 + + + /controls/switches/annun-test + 1 + + + + + Overhead panel light pick diff --git a/Models/Instruments/OHpanel/OHpanelEPR.xml b/Models/Instruments/OHpanel/OHpanelEPR.xml index 4287aaec..89afda1b 100644 --- a/Models/Instruments/OHpanel/OHpanelEPR.xml +++ b/Models/Instruments/OHpanel/OHpanelEPR.xml @@ -114,11 +114,11 @@ - /controls/adirs/adr[2]/off + /controls/fadec/n1mode1 1 - /controls/fadec/n1mode1 + /controls/switches/annun-test 1 @@ -215,11 +215,11 @@ - /controls/adirs/adr[2]/off + /controls/fadec/n1mode2 1 - /controls/fadec/n1mode2 + /controls/switches/annun-test 1 diff --git a/Models/Instruments/OHpanel/res/markings.png b/Models/Instruments/OHpanel/res/markings.png index 84cd7adc..506388cc 100644 Binary files a/Models/Instruments/OHpanel/res/markings.png and b/Models/Instruments/OHpanel/res/markings.png differ diff --git a/Models/Instruments/OHpanel/res/ohpanel.ac b/Models/Instruments/OHpanel/res/ohpanel.ac index 2d116d51..21f76f46 100644 --- a/Models/Instruments/OHpanel/res/ohpanel.ac +++ b/Models/Instruments/OHpanel/res/ohpanel.ac @@ -9,7 +9,99 @@ MATERIAL "Switch" rgb 0.678431 0.678431 0.678431 amb 0.678431 0.678431 0.678431 MATERIAL "ac3dmat1" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 1 1 1 shi 128 trans 0 MATERIAL "DefaultWhite.002" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.0015 0.0015 0.0015 shi 50 trans 0 OBJECT world -kids 285 +kids 287 +OBJECT poly +name "Eng1ManStartBtn2O" +loc 0.000119683 -5.00064e-005 -4.99785e-005 +data 8 +Cube.027 +texture "buttons2.png" +crease 30.000000 +numvert 8 +-0.001687 -0.2257 -0.207197 +-0.004168 -0.2257 -0.187351 +-0.007144 -0.2257 -0.187723 +-0.004664 -0.2257 -0.207569 +-0.001687 -0.2157 -0.207197 +-0.004168 -0.2157 -0.187351 +-0.007144 -0.2157 -0.187723 +-0.004664 -0.2157 -0.207569 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0.5 +1 0 0.5 +2 0 0.5 +3 0.5 0.5 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0.5 +4 0.5 0.75 +5 9.31321e-008 0.75 +1 0 0.5 +SURF 0x0 +mat 4 +refs 4 +1 0 0.5 +5 9.31321e-008 0.75 +6 9.31321e-008 0.75 +2 0 0.5 +SURF 0x0 +mat 4 +refs 4 +4 0.5 0.75 +0 0.5 0.5 +3 0.5 0.5 +7 0.5 0.75 +kids 0 +OBJECT poly +name "Eng2ManStartBtn2O" +loc 0.000119683 -5.00064e-005 -4.99785e-005 +data 8 +Cube.090 +texture "buttons2.png" +crease 30.000000 +numvert 8 +0.002245 -0.2257 -0.238652 +-0.000235999 -0.2257 -0.218806 +-0.003213 -0.2257 -0.219178 +-0.000731999 -0.2257 -0.239024 +0.002245 -0.2157 -0.238652 +-0.000235999 -0.2157 -0.218806 +-0.003213 -0.2157 -0.219178 +-0.000731999 -0.2157 -0.239024 +numsurf 4 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0.5 +1 0 0.5 +2 0 0.5 +3 0.5 0.5 +SURF 0x0 +mat 4 +refs 4 +0 0.5 0.5 +4 0.5 0.75 +5 9.31321e-008 0.75 +1 0 0.5 +SURF 0x0 +mat 4 +refs 4 +1 0 0.5 +5 9.31321e-008 0.75 +6 9.31321e-008 0.75 +2 0 0.5 +SURF 0x0 +mat 4 +refs 4 +4 0.5 0.75 +0 0.5 0.5 +3 0.5 0.5 +7 0.5 0.75 +kids 0 OBJECT poly name "Eng1ManStartProt" loc 7.05261 -5.75766 0.649317 diff --git a/Models/Instruments/PFD/PFD1.xml b/Models/Instruments/PFD/PFD1.xml index 3c790ff7..9ca75b0f 100644 --- a/Models/Instruments/PFD/PFD1.xml +++ b/Models/Instruments/PFD/PFD1.xml @@ -1218,7 +1218,7 @@ 0.00091828 0.0326226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -1242,7 +1242,7 @@ 0.00091828 0.0436226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -2050,7 +2050,7 @@ 0.00091828 0.0656226 - 0.0734781 + 0.0727781 center-center yz-plane @@ -2074,7 +2074,7 @@ 0.00091828 0.0656226 - 0.0662781 + 0.0655781 center-center yz-plane @@ -2098,7 +2098,7 @@ 0.00091828 0.0656226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -2122,7 +2122,7 @@ 0.00091828 0.0656226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -3208,6 +3208,115 @@ + + select + banklim + + + /it-fbw/law + 0 + + + + + + select + banklimXX + + + /it-fbw/law + 0 + + + + + + usemanpitchtrim + + 0.00091828 + -0.00521 + 0.0570781 + + center-center + yz-plane + text-value + USE MAN PITCH TRIM + false + helvetica_medium.txf + autopilot/serviceable + true + false + false + 0.0051 + + 32 + 32 + + + + + select + usemanpitchtrim + + + /it-fbw/law + 2 + + + + + + manpitchtrimonly + + 0.00091828 + -0.00521 + 0.0570781 + + center-center + yz-plane + text-value + MAN PITCH TRIM ONLY + false + helvetica_medium.txf + autopilot/serviceable + true + false + false + 0.0051 + + 32 + 32 + + + + + select + manpitchtrimonly + + + /it-fbw/law + 3 + + + + + + select + fbwmask + + + + /it-fbw/law + 2 + + + /it-fbw/law + 3 + + + + + @@ -3428,6 +3537,7 @@ material athr-afloor-fma athr-togalk-fma + usemanpitchtrim 1 0.45 @@ -3507,4 +3617,30 @@ + + + material + manpitchtrimonly + + 1 + 0 + 0 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 1 + 0 + 0 + + + diff --git a/Models/Instruments/PFD/PFD2.xml b/Models/Instruments/PFD/PFD2.xml index 60755415..cb06c6da 100644 --- a/Models/Instruments/PFD/PFD2.xml +++ b/Models/Instruments/PFD/PFD2.xml @@ -1218,7 +1218,7 @@ 0.00091828 0.0326226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -1242,7 +1242,7 @@ 0.00091828 0.0436226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -2050,7 +2050,7 @@ 0.00091828 0.0656226 - 0.0734781 + 0.0727781 center-center yz-plane @@ -2074,7 +2074,7 @@ 0.00091828 0.0656226 - 0.0662781 + 0.0655781 center-center yz-plane @@ -2098,7 +2098,7 @@ 0.00091828 0.0656226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -2122,7 +2122,7 @@ 0.00091828 0.0656226 - 0.0591781 + 0.0584781 center-center yz-plane @@ -3208,6 +3208,115 @@ + + select + banklim + + + /it-fbw/law + 0 + + + + + + select + banklimXX + + + /it-fbw/law + 0 + + + + + + usemanpitchtrim + + 0.00091828 + -0.00521 + 0.0570781 + + center-center + yz-plane + text-value + USE MAN PITCH TRIM + false + helvetica_medium.txf + autopilot/serviceable + true + false + false + 0.0051 + + 32 + 32 + + + + + select + usemanpitchtrim + + + /it-fbw/law + 2 + + + + + + manpitchtrimonly + + 0.00091828 + -0.00521 + 0.0570781 + + center-center + yz-plane + text-value + MAN PITCH TRIM ONLY + false + helvetica_medium.txf + autopilot/serviceable + true + false + false + 0.0051 + + 32 + 32 + + + + + select + manpitchtrimonly + + + /it-fbw/law + 3 + + + + + + select + fbwmask + + + + /it-fbw/law + 2 + + + /it-fbw/law + 3 + + + + + @@ -3428,6 +3537,7 @@ material athr-afloor-fma athr-togalk-fma + usemanpitchtrim 1 0.45 @@ -3507,4 +3617,30 @@ + + + material + manpitchtrimonly + + 1 + 0 + 0 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 1 + 0 + 0 + + + diff --git a/Models/Instruments/PFD/res/banklim.png b/Models/Instruments/PFD/res/banklim.png new file mode 100644 index 00000000..5a17b5e8 Binary files /dev/null and b/Models/Instruments/PFD/res/banklim.png differ diff --git a/Models/Instruments/PFD/res/banklimXX.png b/Models/Instruments/PFD/res/banklimXX.png new file mode 100644 index 00000000..75bcbdc3 Binary files /dev/null and b/Models/Instruments/PFD/res/banklimXX.png differ diff --git a/Models/Instruments/PFD/res/fastslow.png b/Models/Instruments/PFD/res/fastslow.png index 372d83a0..e1c387f6 100644 Binary files a/Models/Instruments/PFD/res/fastslow.png and b/Models/Instruments/PFD/res/fastslow.png differ diff --git a/Models/Instruments/PFD/res/mask.png b/Models/Instruments/PFD/res/mask.png index 8b56b2f2..6cd8cd9d 100644 Binary files a/Models/Instruments/PFD/res/mask.png and b/Models/Instruments/PFD/res/mask.png differ diff --git a/Models/Instruments/PFD/res/pfd-3d.ac b/Models/Instruments/PFD/res/pfd-3d.ac index 8c026325..ec8e6e2b 100644 --- a/Models/Instruments/PFD/res/pfd-3d.ac +++ b/Models/Instruments/PFD/res/pfd-3d.ac @@ -3,7 +3,101 @@ MATERIAL "ac3dmat1" rgb 1 1 1 amb 0 0 0 emis 0.658824 0.670588 0.67451 spec 0 MATERIAL "white" rgb 1 1 1 amb 1 1 1 emis 0.798 0.798 0.798 spec 0 0 0 shi 0 trans 0 MATERIAL "ac3dmat0" rgb 0 0 0 amb 0 0 0 emis 0 0 0 spec 0 0 0 shi 0 trans 0 OBJECT world -kids 48 +kids 53 +OBJECT poly +name "fbwmask" +loc 0.000382955 0.0573058 0.00520964 +crease 45.000000 +numvert 4 +0 0.00259959 -0.00100451 +0 0.00259959 0.00100451 +0 -0.00336058 0.00100451 +0 -0.00336058 -0.00100451 +numsurf 1 +SURF 0x30 +mat 2 +refs 4 +0 1 1 +1 0 1 +2 0 0 +3 1 0 +kids 0 +OBJECT poly +name "banklimXX" +loc 0.00099002 0.012811 -0.0336226 +texture "banklimXX.png" +crease 45.000000 +numvert 4 +0 -0.00101332 -0.0018114 +0 -0.00101332 0.00106828 +0 0.0018626 0.00106829 +0 0.00186259 -0.0018114 +numsurf 1 +SURF 0x30 +mat 0 +refs 4 +0 1 1 +1 0 1 +2 0 0 +3 1 0 +kids 0 +OBJECT poly +name "banklimXX" +loc 0.00099002 0.012811 0.0443929 +texture "banklimXX.png" +crease 45.000000 +numvert 4 +0 0.00186259 -0.00181141 +0 0.00186259 0.00106828 +0 -0.00101332 0.00106828 +0 -0.00101332 -0.00181141 +numsurf 1 +SURF 0x30 +mat 0 +refs 4 +3 1 1 +2 0 1 +1 0 0 +0 1 0 +kids 0 +OBJECT poly +name "banklim" +loc 0.00099002 0.0133653 -0.0334266 +texture "banklim.png" +crease 45.000000 +numvert 4 +0 -0.000722769 -0.00255431 +0 0.00171136 -0.00152109 +0 0.000463212 0.00141935 +0 -0.00197092 0.00038613 +numsurf 1 +SURF 0x30 +mat 0 +refs 4 +3 1 1 +2 0 1 +1 0 0 +0 1 0 +kids 0 +OBJECT poly +name "banklim" +loc 0.00099002 0.0127372 0.0437205 +texture "banklim.png" +crease 45.000000 +numvert 4 +0 0.00109136 -0.00168599 +0 -0.00134277 -0.000652768 +0 -9.46289e-005 0.00228769 +0 0.00233951 0.00125446 +numsurf 1 +SURF 0x30 +mat 0 +refs 4 +0 1 1 +1 0 1 +2 0 0 +3 1 0 +kids 0 OBJECT poly name "fpd" loc 0.00031928 0.00206621 -0.013179 @@ -117,7 +211,7 @@ refs 4 kids 0 OBJECT poly name "ap-mode-box" -loc 0.000380651 0.0723146 -0.0618702 +loc 0.000380651 0.0716448 -0.0618702 data 6 Circle texture "box.png" @@ -171,7 +265,7 @@ refs 4 kids 0 OBJECT poly name "fd-mode-box" -loc 0.000380651 0.0652178 -0.0618702 +loc 0.000380651 0.064548 -0.0618702 data 6 Circle texture "box.png" @@ -225,7 +319,7 @@ refs 4 kids 0 OBJECT poly name "athr-mode-box" -loc 0.000380651 0.0581517 -0.0618702 +loc 0.000380651 0.0574819 -0.0618702 data 6 Circle texture "box.png" diff --git a/Models/Instruments/PFD/res/spd-tape.png b/Models/Instruments/PFD/res/spd-tape.png index 3e9e709f..beeafadd 100644 Binary files a/Models/Instruments/PFD/res/spd-tape.png and b/Models/Instruments/PFD/res/spd-tape.png differ diff --git a/Nasal/FMGC-b.nas b/Nasal/FMGC-b.nas index 17d53dc3..99d7cb71 100644 --- a/Nasal/FMGC-b.nas +++ b/Nasal/FMGC-b.nas @@ -717,7 +717,7 @@ var make_loc_active = func { var apparmcheck = func { var signal = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm"); - if ((signal <= -0.000000001) and (getprop("/FMGC/internal/loc-source") == "NAV0") and (getprop("/it-autoflight/output/lat") == 2)) { + if (((signal < 0 and signal >= 0.45) or (signal > 0 and signal <= 0.30)) and (getprop("/FMGC/internal/loc-source") == "NAV0") and (getprop("/it-autoflight/output/lat") == 2)) { make_appr_active(); } else { return 0; diff --git a/Nasal/FMGC.nas b/Nasal/FMGC.nas index a40a8560..b7eebb54 100644 --- a/Nasal/FMGC.nas +++ b/Nasal/FMGC.nas @@ -114,8 +114,9 @@ var phasecheck = maketimer(0.2, func { var reduc_agl_ft = getprop("/it-autoflight/settings/reduc-agl-ft"); var locarm = getprop("/it-autopilot/output/loc-armed"); var apprarm = getprop("/it-autopilot/output/appr-armed"); + var gear0 = getprop("/gear/gear[0]/wow"); - if ((((n1_left >= 85) and (n1_right >= 85)) or (gs > 90 )) and (mode == "SRS")) { + if ((((n1_left >= 85) and (n1_right >= 85)) or (gs > 90 )) and (mode == "SRS") and gear0 == 1 and phase == 0) { setprop("/FMGC/status/phase", "1"); setprop("/systems/pressurization/mode", "TO"); } diff --git a/Nasal/PFD_FMA.nas b/Nasal/PFD_FMA.nas index 3f0405fb..88ee6e92 100644 --- a/Nasal/PFD_FMA.nas +++ b/Nasal/PFD_FMA.nas @@ -99,8 +99,9 @@ setlistener("/it-autoflight/mode/lat", func { setprop("/modes/pfd/fma/roll-mode", "NAV"); } } else if (lat == "LOC") { - if (newlat != "LOC") { - setprop("/modes/pfd/fma/roll-mode", "LOC"); + if (newlat != "LOC*" and newlat != "LOC") { + setprop("/modes/pfd/fma/roll-mode", "LOC*"); + locupdate.start(); } } else if (lat == "ALGN") { if (newlat != "LAND") { @@ -113,6 +114,20 @@ setlistener("/it-autoflight/mode/lat", func { } }); +var locupdate = maketimer(0.5, func { + var lat = getprop("/it-autoflight/mode/lat"); + var newlat = getprop("/modes/pfd/fma/roll-mode"); + var nav_defl = getprop("/it-autoflight/internal/nav-heading-error-deg"); + if (lat == "LOC") { + if (nav_defl > -1 and nav_defl < 1) { + locupdate.stop(); + if (newlat != "LOC") { + setprop("/modes/pfd/fma/roll-mode", "LOC"); + } + } + } +}); + # Master Vertical setlistener("/it-autoflight/mode/vert", func { var vert = getprop("/it-autoflight/mode/vert"); @@ -142,8 +157,9 @@ setlistener("/it-autoflight/mode/vert", func { setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); } } else if (vert == "G/S") { - if (newvert != "G/S") { - setprop("/modes/pfd/fma/pitch-mode", "G/S"); + if (newvert != "G/S*" and newvert != "G/S") { + setprop("/modes/pfd/fma/pitch-mode", "G/S*"); + gsupdate.start(); } if (newvertarm != " ") { setprop("/modes/pfd/fma/pitch-mode2-armed", " "); @@ -223,6 +239,20 @@ setlistener("/it-autoflight/mode/vert", func { altvert(); }); +var gsupdate = maketimer(0.5, func { + var vert = getprop("/it-autoflight/mode/vert"); + var newvert = getprop("/modes/pfd/fma/pitch-mode"); + var gs_defl = getprop("/instrumentation/nav[0]/gs-needle-deflection-norm"); + if (vert == "G/S") { + if (gs_defl > -0.06 and gs_defl < 0.06) { + gsupdate.stop(); + if (newvert != "G/S") { + setprop("/modes/pfd/fma/pitch-mode", "G/S"); + } + } + } +}); + var altvert = func { var FMGCalt = getprop("/FMGC/internal/cruise-ft"); var MCPalt = getprop("/it-autoflight/internal/alt"); diff --git a/Nasal/engines.nas b/Nasal/engines.nas index 822235a2..413b901e 100644 --- a/Nasal/engines.nas +++ b/Nasal/engines.nas @@ -32,6 +32,11 @@ setprop("/systems/apu/egt", 42); setprop("/controls/engines/engine[0]/reverser", 0); setprop("/controls/engines/engine[1]/reverser", 0); +var eng_init = func { + setprop("/controls/engines/engine[0]/man-start", 0); + setprop("/controls/engines/engine[1]/man-start", 0); +} + ############################## # Trigger Startups and Stops # ############################## @@ -45,6 +50,7 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func { eng_one_man_startt.start(); } } else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) { + setprop("/controls/engines/engine[0]/man-start", 0); setprop("/systems/pneumatic/eng1-starter", 0); setprop("/controls/engines/engine[0]/starter", 0); setprop("/controls/engines/engine[0]/cutoff", 1); @@ -54,6 +60,26 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func { } }); +setlistener("/controls/engines/engine[0]/man-start", func { + start_one_mancheck(); +}); + +var start_one_mancheck = func { + if (getprop("/controls/engines/engine[0]/man-start") == 1) { + if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28) and (getprop("/controls/engines/engine[0]/cutoff-switch") == 1)) { + setprop("/systems/pneumatic/eng1-starter", 1); + setprop("/engines/engine[0]/state", 1); + setprop("/controls/engines/engine[0]/starter", 1); + } + } else { + if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) { + setprop("/systems/pneumatic/eng1-starter", 0); + setprop("/engines/engine[0]/state", 0); + setprop("/controls/engines/engine[0]/starter", 0); + } + } +} + var start_one_check = func { settimer(start_one_check_b, 0.3); } @@ -73,6 +99,7 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func { eng_two_man_startt.start(); } } else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) { + setprop("/controls/engines/engine[1]/man-start", 0); setprop("/systems/pneumatic/eng2-starter", 0); setprop("/controls/engines/engine[1]/starter", 0); setprop("/controls/engines/engine[1]/cutoff", 1); @@ -81,6 +108,26 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func { } }); +setlistener("/controls/engines/engine[1]/man-start", func { + start_two_mancheck(); +}); + +var start_two_mancheck = func { + if (getprop("/controls/engines/engine[1]/man-start") == 1) { + if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/systems/pneumatic/total-psi") >= 28) and (getprop("/controls/engines/engine[1]/cutoff-switch") == 1)) { + setprop("/systems/pneumatic/eng2-starter", 1); + setprop("/engines/engine[1]/state", 1); + setprop("/controls/engines/engine[1]/starter", 1); + } + } else { + if (getprop("/engines/engine[1]/state") == 1 or getprop("/engines/engine[1]/state") == 2) { + setprop("/systems/pneumatic/eng2-starter", 0); + setprop("/engines/engine[1]/state", 0); + setprop("/controls/engines/engine[1]/starter", 0); + } + } +} + var start_two_check = func { settimer(start_two_check_b, 0.3); } @@ -215,9 +262,11 @@ var apu_stop = func { setlistener("/controls/engines/engine-start-switch", func { if (getprop("/engines/engine[0]/state") == 0) { start_one_check(); + start_one_mancheck(); } if (getprop("/engines/engine[1]/state") == 0) { start_two_check(); + start_two_mancheck(); } if ((getprop("/controls/engines/engine-start-switch") == 0) or (getprop("/controls/engines/engine-start-switch") == 1)) { if (getprop("/engines/engine[0]/state") == 1 or getprop("/engines/engine[0]/state") == 2) { diff --git a/Nasal/fadec-common.nas b/Nasal/fadec-common.nas index 80580fd4..dabe6c98 100644 --- a/Nasal/fadec-common.nas +++ b/Nasal/fadec-common.nas @@ -225,7 +225,7 @@ var thrust_loop = func { if (getprop("/systems/thrust/state1") == "MAN" or getprop("/systems/thrust/state2") == "MAN") { setprop("/systems/thrust/lvrclb", "1"); } else { - if (getprop("/position/gear-agl-ft") >= getprop("/systems/thrust/clbreduc-ft")) { + if (getprop("/instrumentation/altimeter/indicated-altitude-ft") >= getprop("/systems/thrust/clbreduc-ft") and getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0) { setprop("/systems/thrust/lvrclb", "1"); } else { setprop("/systems/thrust/lvrclb", "0"); diff --git a/Nasal/icing.nas b/Nasal/icing.nas index fadc5c51..04a68a1b 100644 --- a/Nasal/icing.nas +++ b/Nasal/icing.nas @@ -11,6 +11,8 @@ var icingInit = func { setprop("/systems/icing/icingcond", 0); setprop("/controls/switches/windowprobeheat", 0); setprop("/controls/switches/windowprobeheatfault", 0); + setprop("/controls/switches/wing", 0); + setprop("/controls/switches/wingfault", 0); setprop("/controls/deice/wing", 0); setprop("/controls/deice/lengine", 0); setprop("/controls/deice/rengine", 0); @@ -34,6 +36,11 @@ var icingModel = func { var lengine = getprop("/controls/deice/lengine"); var rengine = getprop("/controls/deice/rengine"); var windowprobe = getprop("/controls/deice/windowprobeheat"); + var wingBtn = getprop("/controls/switches/wing"); + var wingAnti = getprop("/controls/deice/wing"); + var PSI = getprop("/systems/pneumatic/total-psi"); + var wowl = getprop("/gear/gear[1]/wow"); + var wowr = getprop("/gear/gear[2]/wow"); if (severity == "0") { setprop("/systems/icing/factor", -0.00000166); @@ -139,7 +146,41 @@ var icingModel = func { } else { setprop("/systems/icing/icingcond", 0); } - + + # Switching on the wing anti-ice + setlistener("/controls/switches/wing", func { + var wingBtn = getprop("/controls/switches/wing"); + var wingAnti = getprop("/controls/deice/wing"); + var PSI = getprop("/systems/pneumatic/total-psi"); + var wowl = getprop("/gear/gear[1]/wow"); + var wowr = getprop("/gear/gear[2]/wow"); + if (wowl or wowr and wingBtn and PSI >= 10) { + setprop("/controls/switches/wingfault", 1); + settimer(func() { + setprop("/controls/switches/wingfault", 0); + setprop("/controls/deice/wing", 1); + }, 0.5); + settimer(func() { + setprop("/controls/switches/wingfault", 1); + setprop("/controls/switches/wing", 0); + setprop("/controls/deice/wing", 0); + setprop("/controls/switches/wingfault", 0); + }, 30.5); + } else if (wingBtn and PSI >= 10 and !wowl and !wowr) { + setprop("/controls/switches/wingfault", 1); + settimer(func() { + setprop("/controls/switches/wingfault", 0); + setprop("/controls/deice/wing", 1); + }, 0.5); + } else if (!wingBtn and PSI >= 10 and !wowl and !wowr) { + setprop("/controls/switches/wingfault", 1); + settimer(func() { + setprop("/controls/switches/wingfault", 0); + setprop("/controls/deice/wing", 0); + }, 0.5); + } + }); + setlistener("/controls/switches/windowprobeheat", func { var windowprb = getprop("/controls/switches/windowprobeheat"); var fault = getprop("/controls/switches/windowprobeheatfault"); @@ -162,6 +203,13 @@ var icingModel = func { setprop("/controls/deice/windowprobeheat", 0); } }); + + # If we have low pressure we have a fault + if (PSI < 10) { + setprop("/controls/switches/wingfault", 1); + } else { + setprop("/controls/switches/wingfault", 0); + } } ################### diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index f2471cde..8955d813 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -186,6 +186,7 @@ setlistener("/sim/signals/fdm-initialized", func { systems.pneu_init(); systems.hyd_init(); systems.fuel_init(); + systems.eng_init(); fmgc.APinit(); librariesLoop.start(); fmgc.FMGCinit();