diff --git a/Models/Instruments/PFD/PFD1.xml b/Models/Instruments/PFD/PFD1.xml index 3c74e935..af922ecc 100644 --- a/Models/Instruments/PFD/PFD1.xml +++ b/Models/Instruments/PFD/PFD1.xml @@ -1590,6 +1590,67 @@ + + select + throttle-mode-box + + + /modes/pfd/fma/throttle-mode-box + 1 + + + + + + select + pitch-mode-box + + + /modes/pfd/fma/pitch-mode-box + 1 + + + + + + select + pitch-mode-armed-box + + + + /modes/pfd/fma/pitch-mode-armed-box + 1 + + + /modes/pfd/fma/pitch-mode2-armed-box + 1 + + + + + + + select + roll-mode-box + + + /modes/pfd/fma/roll-mode-box + 1 + + + + + + select + roll-mode-armed-box + + + /modes/pfd/fma/roll-mode-armed-box + 1 + + + + ap-mode-fma diff --git a/Models/Instruments/PFD/PFD2.xml b/Models/Instruments/PFD/PFD2.xml index 05198044..8a420242 100644 --- a/Models/Instruments/PFD/PFD2.xml +++ b/Models/Instruments/PFD/PFD2.xml @@ -1590,6 +1590,67 @@ + + select + throttle-mode-box + + + /modes/pfd/fma/throttle-mode-box + 1 + + + + + + select + pitch-mode-box + + + /modes/pfd/fma/pitch-mode-box + 1 + + + + + + select + pitch-mode-armed-box + + + + /modes/pfd/fma/pitch-mode-armed-box + 1 + + + /modes/pfd/fma/pitch-mode2-armed-box + 1 + + + + + + + select + roll-mode-box + + + /modes/pfd/fma/roll-mode-box + 1 + + + + + + select + roll-mode-armed-box + + + /modes/pfd/fma/roll-mode-armed-box + 1 + + + + ap-mode-fma diff --git a/Models/Instruments/PFD/res/box.ac b/Models/Instruments/PFD/res/box.ac new file mode 100644 index 00000000..f0df8e9a --- /dev/null +++ b/Models/Instruments/PFD/res/box.ac @@ -0,0 +1,58 @@ +AC3Db +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 +OBJECT world +kids 1 +OBJECT poly +name "Box-speed" +loc 0.002941 0.0876799 0.042908 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00312543 -0.0156029 +0 -0.00377741 -0.0156029 +0 -0.00377742 0.0155739 +0 -0.00312544 0.0155739 +0 0.00374188 -0.0155771 +0 0.0030899 -0.0155771 +0 0.00308989 0.0155997 +0 0.00374188 0.0155997 +0 0.00379864 0.0162948 +0 0.00379864 0.0156428 +0 -0.00384059 0.0156428 +0 -0.00384059 0.0162948 +0 0.0038406 -0.0156428 +0 0.0038406 -0.0162948 +0 -0.00379863 -0.0162948 +0 -0.00379863 -0.0156428 +numsurf 4 +SURF 0x0 +mat 0 +refs 4 +3 0.654297 0.439453 +2 0.679687 0.439453 +1 0.679687 0.464844 +0 0.654297 0.464844 +SURF 0x0 +mat 0 +refs 4 +7 0.654297 0.439453 +6 0.679687 0.439453 +5 0.679687 0.464844 +4 0.654297 0.464844 +SURF 0x0 +mat 0 +refs 4 +11 0.654297 0.439453 +10 0.679687 0.439453 +9 0.679687 0.464844 +8 0.654297 0.464844 +SURF 0x0 +mat 0 +refs 4 +15 0.654297 0.439453 +14 0.679687 0.439453 +13 0.679687 0.464844 +12 0.654297 0.464844 +kids 0 diff --git a/Models/Instruments/PFD/res/box.png b/Models/Instruments/PFD/res/box.png new file mode 100644 index 00000000..e3001148 Binary files /dev/null and b/Models/Instruments/PFD/res/box.png differ diff --git a/Models/Instruments/PFD/res/pfd-3d.ac b/Models/Instruments/PFD/res/pfd-3d.ac index 5d36f0b1..145742dd 100644 --- a/Models/Instruments/PFD/res/pfd-3d.ac +++ b/Models/Instruments/PFD/res/pfd-3d.ac @@ -1,7 +1,278 @@ AC3Db MATERIAL "ac3dmat1" rgb 1 1 1 amb 0 0 0 emis 0.658824 0.670588 0.67451 spec 0 0 0 shi 128 trans 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 OBJECT world -kids 35 +kids 40 +OBJECT poly +name "throttle-mode-box" +loc 0.000380651 0.0698612 0.054728 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00244377 -0.0145566 +0 -0.00244377 -0.0151633 +0 0.004665 -0.0151633 +0 0.004665 -0.0145566 +0 -0.00248282 0.0151633 +0 -0.00248282 0.0145566 +0 0.00462595 0.0145566 +0 0.00462595 0.0151633 +0 0.00457313 0.0145165 +0 0.00396641 0.0145165 +0 0.00396641 -0.0144955 +0 0.00457313 -0.0144955 +0 -0.00181733 0.0144925 +0 -0.00242404 0.0144925 +0 -0.00242402 -0.0145195 +0 -0.00181732 -0.0145195 +numsurf 4 +SURF 0x0 +mat 1 +refs 4 +0 0.654297 0.439453 +1 0.679687 0.439453 +2 0.679687 0.464844 +3 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +4 0.654297 0.439453 +5 0.679687 0.439453 +6 0.679687 0.464844 +7 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +8 0.654297 0.439453 +9 0.679687 0.439453 +10 0.679687 0.464844 +11 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +12 0.654297 0.439453 +13 0.679687 0.439453 +14 0.679687 0.464844 +15 0.654297 0.464844 +kids 0 +OBJECT poly +name "roll-mode-armed-box" +loc 0.000380651 0.06242 -0.0107672 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00181732 -0.0145195 +0 -0.00242402 -0.0145195 +0 -0.00242404 0.0144925 +0 -0.00181733 0.0144925 +0 0.00457313 -0.0144955 +0 0.00396642 -0.0144955 +0 0.00396642 0.0145165 +0 0.00457313 0.0145165 +0 0.00462596 0.0151633 +0 0.00462596 0.0145566 +0 -0.00248282 0.0145566 +0 -0.00248282 0.0151633 +0 0.004665 -0.0145566 +0 0.004665 -0.0151633 +0 -0.00244377 -0.0151633 +0 -0.00244377 -0.0145566 +numsurf 4 +SURF 0x0 +mat 1 +refs 4 +3 0.654297 0.439453 +2 0.679687 0.439453 +1 0.679687 0.464844 +0 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +7 0.654297 0.439453 +6 0.679687 0.439453 +5 0.679687 0.464844 +4 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +11 0.654297 0.439453 +10 0.679687 0.439453 +9 0.679687 0.464844 +8 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +15 0.654297 0.439453 +14 0.679687 0.439453 +13 0.679687 0.464844 +12 0.654297 0.464844 +kids 0 +OBJECT poly +name "roll-mode-box" +loc 0.000380651 0.0698612 -0.0107672 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00244377 -0.0145566 +0 -0.00244377 -0.0151633 +0 0.004665 -0.0151633 +0 0.004665 -0.0145566 +0 -0.00248282 0.0151633 +0 -0.00248282 0.0145566 +0 0.00462595 0.0145566 +0 0.00462595 0.0151633 +0 0.00457313 0.0145165 +0 0.00396641 0.0145165 +0 0.00396641 -0.0144955 +0 0.00457313 -0.0144955 +0 -0.00181733 0.0144925 +0 -0.00242404 0.0144925 +0 -0.00242402 -0.0145195 +0 -0.00181732 -0.0145195 +numsurf 4 +SURF 0x0 +mat 1 +refs 4 +0 0.654297 0.439453 +1 0.679687 0.439453 +2 0.679687 0.464844 +3 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +4 0.654297 0.439453 +5 0.679687 0.439453 +6 0.679687 0.464844 +7 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +8 0.654297 0.439453 +9 0.679687 0.439453 +10 0.679687 0.464844 +11 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +12 0.654297 0.439453 +13 0.679687 0.439453 +14 0.679687 0.464844 +15 0.654297 0.464844 +kids 0 +OBJECT poly +name "pitch-mode-armed-box" +loc 0.000380651 0.06242 0.0211119 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00244377 -0.0145566 +0 -0.00244377 -0.0151633 +0 0.004665 -0.0151633 +0 0.004665 -0.0145566 +0 -0.00248282 0.0151633 +0 -0.00248282 0.0145566 +0 0.00462596 0.0145566 +0 0.00462596 0.0151633 +0 0.00457313 0.0145165 +0 0.00396642 0.0145165 +0 0.00396642 -0.0144955 +0 0.00457313 -0.0144955 +0 -0.00181733 0.0144925 +0 -0.00242404 0.0144925 +0 -0.00242402 -0.0145195 +0 -0.00181732 -0.0145195 +numsurf 4 +SURF 0x0 +mat 1 +refs 4 +0 0.654297 0.439453 +1 0.679687 0.439453 +2 0.679687 0.464844 +3 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +4 0.654297 0.439453 +5 0.679687 0.439453 +6 0.679687 0.464844 +7 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +8 0.654297 0.439453 +9 0.679687 0.439453 +10 0.679687 0.464844 +11 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +12 0.654297 0.439453 +13 0.679687 0.439453 +14 0.679687 0.464844 +15 0.654297 0.464844 +kids 0 +OBJECT poly +name "pitch-mode-box" +loc 0.000380651 0.0698612 0.0211119 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00181732 -0.0145195 +0 -0.00242402 -0.0145195 +0 -0.00242404 0.0144925 +0 -0.00181733 0.0144925 +0 0.00457313 -0.0144955 +0 0.00396641 -0.0144955 +0 0.00396641 0.0145165 +0 0.00457313 0.0145165 +0 0.00462595 0.0151633 +0 0.00462595 0.0145566 +0 -0.00248282 0.0145566 +0 -0.00248282 0.0151633 +0 0.004665 -0.0145566 +0 0.004665 -0.0151633 +0 -0.00244377 -0.0151633 +0 -0.00244377 -0.0145566 +numsurf 4 +SURF 0x0 +mat 1 +refs 4 +3 0.654297 0.439453 +2 0.679687 0.439453 +1 0.679687 0.464844 +0 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +7 0.654297 0.439453 +6 0.679687 0.439453 +5 0.679687 0.464844 +4 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +11 0.654297 0.439453 +10 0.679687 0.439453 +9 0.679687 0.464844 +8 0.654297 0.464844 +SURF 0x0 +mat 1 +refs 4 +15 0.654297 0.439453 +14 0.679687 0.439453 +13 0.679687 0.464844 +12 0.654297 0.464844 +kids 0 OBJECT poly name "trgt-spd-mng" loc 0.00121828 0.000747255 0.0473924 diff --git a/Models/Interior/a320.interior.xml b/Models/Interior/a320.interior.xml index f3c66d0d..9de21623 100644 --- a/Models/Interior/a320.interior.xml +++ b/Models/Interior/a320.interior.xml @@ -2,7 +2,7 @@ - res/libraries.interior.ac + res/a320.interior.ac diff --git a/Nasal/FMGC.nas b/Nasal/FMGC.nas index ba4020b6..a2075622 100644 --- a/Nasal/FMGC.nas +++ b/Nasal/FMGC.nas @@ -122,10 +122,16 @@ var phasecheck = maketimer(0.2, func { setprop("/systems/pressurization/mode", "DE"); } - if (getprop("/FMGC/status/to-state") == 0 and flaps >= 3 and ((phase == "2") or (phase == "4"))) { + if (getprop("/FMGC/status/to-state") == 0 and flaps >= 3 and ((phase == "3") or (phase == "4")) and alt < 7200) { setprop("/FMGC/status/phase", "5"); } + if (getprop("/autopilot/route-manager/route/num") > 0 and getprop("/autopilot/route-manager/active") == 1 and getprop("/autopilot/route-manager/distance-remaining-nm") <= 15) { + setprop("/FMGC/internal/decel", 1); + } else { + setprop("/FMGC/internal/decel", 0); + } + if ((phase == "5") and (state1 == "TOGA") and (state2 == "TOGA")) { setprop("/FMGC/status/phase", "6"); setprop("/it-autoflight/input/toga", 1); diff --git a/Nasal/MCDU/MCDU1.nas b/Nasal/MCDU/MCDU1.nas index 36fc2d81..4e0e4414 100644 --- a/Nasal/MCDU/MCDU1.nas +++ b/Nasal/MCDU/MCDU1.nas @@ -242,7 +242,7 @@ var initInputB = func(key) { setprop("/MCDU[0]/scratchpad", ""); } else { var tfs = size(scratchpad); - if (tfs == 3 or tfs == 4) { + if (tfs == 2 or tfs == 4) { if (scratchpad >= 1.0 and scratchpad <= 45.0) { setprop("/FMGC/internal/block", scratchpad); setprop("/FMGC/internal/block-set", 1); diff --git a/Nasal/MCDU/MCDU2.nas b/Nasal/MCDU/MCDU2.nas index 79722661..7c427fae 100644 --- a/Nasal/MCDU/MCDU2.nas +++ b/Nasal/MCDU/MCDU2.nas @@ -242,7 +242,7 @@ var initInputB = func(key) { setprop("/MCDU[1]/scratchpad", ""); } else { var tfs = size(scratchpad); - if (tfs == 3 or tfs == 4) { + if (tfs == 2 or tfs == 4) { if (scratchpad >= 1.0 and scratchpad <= 45.0) { setprop("/FMGC/internal/block", scratchpad); setprop("/FMGC/internal/block-set", 1); diff --git a/Nasal/PFD_FMA.nas b/Nasal/PFD_FMA.nas index 7041afad..1c1f5bd8 100644 --- a/Nasal/PFD_FMA.nas +++ b/Nasal/PFD_FMA.nas @@ -8,12 +8,17 @@ var speedmach = func { speedmach_b(); } else { var thr = getprop("/it-autoflight/output/thr-mode"); + var newthr = getprop("/modes/pfd/fma/throttle-mode"); if (thr == 0) { speedmach_b(); } else if (thr == 1) { - setprop("/modes/pfd/fma/throttle-mode", "THR IDLE"); + if (newthr != "THR IDLE") { + setprop("/modes/pfd/fma/throttle-mode", "THR IDLE"); + } } else if (thr == 2) { - setprop("/modes/pfd/fma/throttle-mode", "THR CLB"); + if (newthr != "THR CLB") { + setprop("/modes/pfd/fma/throttle-mode", "THR CLB"); + } } } } else { @@ -22,10 +27,15 @@ var speedmach = func { } var speedmach_b = func { + var newthr = getprop("/modes/pfd/fma/throttle-mode"); if (getprop("/it-autoflight/input/kts-mach") == 0) { - setprop("/modes/pfd/fma/throttle-mode", "SPEED"); + if (newthr != "SPEED") { + setprop("/modes/pfd/fma/throttle-mode", "SPEED"); + } } else if (getprop("/it-autoflight/input/kts-mach") == 1) { - setprop("/modes/pfd/fma/throttle-mode", "MACH"); + if (newthr != "MACH") { + setprop("/modes/pfd/fma/throttle-mode", "MACH"); + } } } @@ -42,113 +52,155 @@ setlistener("/it-autoflight/output/thr-mode", func { # Master Lateral setlistener("/it-autoflight/mode/lat", func { var lat = getprop("/it-autoflight/mode/lat"); + var newlat = getprop("/modes/pfd/fma/roll-mode"); if (lat == "HDG") { - setprop("/modes/pfd/fma/roll-mode", "HDG"); + if (newlat != "HDG") { + setprop("/modes/pfd/fma/roll-mode", "HDG"); + } } else if (lat == "LNAV") { - setprop("/modes/pfd/fma/roll-mode", "NAV"); + if (newlat != "NAV") { + setprop("/modes/pfd/fma/roll-mode", "NAV"); + } } else if (lat == "LOC") { - setprop("/modes/pfd/fma/roll-mode", "LOC"); + if (newlat != "LOC") { + setprop("/modes/pfd/fma/roll-mode", "LOC"); + } } else if (lat == "ALGN") { - setprop("/modes/pfd/fma/roll-mode", "LAND"); + if (newlat != "LAND") { + setprop("/modes/pfd/fma/roll-mode", "LAND"); + } } else if (lat == "T/O") { - setprop("/modes/pfd/fma/roll-mode", "RWY"); + if (newlat != "RWY") { + setprop("/modes/pfd/fma/roll-mode", "RWY"); + } } }); # Master Vertical setlistener("/it-autoflight/mode/vert", func { var vert = getprop("/it-autoflight/mode/vert"); + var newvert = getprop("/modes/pfd/fma/pitch-mode"); + var newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed"); if (vert == "ALT HLD") { - setprop("/modes/pfd/fma/pitch-mode", "ALT"); - setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + if (newvert != "ALT") { + setprop("/modes/pfd/fma/pitch-mode", "ALT"); + } + if (newvertarm != " ") { + setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + } } else if (vert == "ALT CAP") { - setprop("/modes/pfd/fma/pitch-mode", "ALT"); - setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + if (newvert != "ALT") { + setprop("/modes/pfd/fma/pitch-mode", "ALT"); + } + if (newvertarm != " ") { + setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + } } else if (vert == "V/S") { - setprop("/modes/pfd/fma/pitch-mode", "V/S"); - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + if (newvert != "V/S") { + setprop("/modes/pfd/fma/pitch-mode", "V/S"); + } + if (newvertarm != "ALT") { + setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + } } else if (vert == "G/S") { - setprop("/modes/pfd/fma/pitch-mode", "G/S"); - setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + if (newvert != "G/S") { + setprop("/modes/pfd/fma/pitch-mode", "G/S"); + } + if (newvertarm != " ") { + setprop("/modes/pfd/fma/pitch-mode2-armed", " "); + } } else if (vert == "SPD CLB") { - setprop("/modes/pfd/fma/pitch-mode", "OP CLB"); - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + if (newvert != "OP CLB") { + setprop("/modes/pfd/fma/pitch-mode", "OP CLB"); + } + if (newvertarm != "ALT") { + setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + } } else if (vert == "SPD DES") { - setprop("/modes/pfd/fma/pitch-mode", "OP DES"); - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + if (newvert != "OP DES") { + setprop("/modes/pfd/fma/pitch-mode", "OP DES"); + } + if (newvertarm != "ALT") { + setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + } } else if (vert == "FPA") { - setprop("/modes/pfd/fma/pitch-mode", "FPA"); - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + if (newvert != "FPA") { + setprop("/modes/pfd/fma/pitch-mode", "FPA"); + } + if (newvertarm != "ALT") { + setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); + } } else if (vert == "LAND") { - setprop("/modes/pfd/fma/pitch-mode", "LAND"); + if (newvert != "LAND") { + setprop("/modes/pfd/fma/pitch-mode", "LAND"); + } } else if (vert == "FLARE") { - setprop("/modes/pfd/fma/pitch-mode", "FLARE"); + if (newvert != "FLARE") { + setprop("/modes/pfd/fma/pitch-mode", "FLARE"); + } } else if (vert == "T/O CLB") { - setprop("/modes/pfd/fma/pitch-mode", "SRS"); - setprop("/modes/pfd/fma/pitch-mode2-armed", "CLB"); + if (newvert != "SRS") { + setprop("/modes/pfd/fma/pitch-mode", "SRS"); + } + if (newvertarm != "CLB") { + setprop("/modes/pfd/fma/pitch-mode2-armed", "CLB"); + } } else if (vert == "G/A CLB") { - setprop("/modes/pfd/fma/pitch-mode", "SRS"); - setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); - } -}); - -# Master VNAV -setlistener("/it-autoflight/mode/prof", func { - var prof = getprop("/it-autoflight/mode/prof"); - if (prof == "VNAV HLD") { - setprop("/modes/pfd/fma/pitch-mode", "ALT"); - } else if (prof == "VNAV CAP") { - setprop("/modes/pfd/fma/pitch-mode", "ALT"); - } else if (prof == "VNAV SPD") { - vnav_clbdes(); - } else if (prof == "VNAV PTH") { - vnav_clbdes(); - } -}); - -var vnav_clbdes = func { - var vert = getprop("/it-autoflight/output/vert"); - if (vert == 8) { - var prof = getprop("/it-autoflight/internal/prof-mode"); - if (prof == "XX") { - # Do nothing - } else if (prof == "DES") { - setprop("/modes/pfd/fma/pitch-mode", "DES"); - } else if (prof == "CLB") { - setprop("/modes/pfd/fma/pitch-mode", "CLB"); + if (newvert != "SRS") { + setprop("/modes/pfd/fma/pitch-mode", "SRS"); + } + if (newvertarm != "ALT") { + setprop("/modes/pfd/fma/pitch-mode2-armed", "ALT"); } } -} +}); # Arm HDG or NAV setlistener("/it-autoflight/mode/arm", func { var arm = getprop("/it-autoflight/mode/arm"); + var newarm = getprop("/modes/pfd/fma/roll-mode-armed"); if (arm == "HDG") { - setprop("/modes/pfd/fma/roll-mode-armed", "HDG"); + if (newarm != "HDG") { + setprop("/modes/pfd/fma/roll-mode-armed", "HDG"); + } } else if (arm == "LNV") { - setprop("/modes/pfd/fma/roll-mode-armed", "NAV"); + if (newarm != "NAV") { + setprop("/modes/pfd/fma/roll-mode-armed", "NAV"); + } } else if (arm == " ") { - setprop("/modes/pfd/fma/roll-mode-armed", " "); + if (newarm != " ") { + setprop("/modes/pfd/fma/roll-mode-armed", " "); + } } }); # Arm LOC setlistener("/it-autoflight/output/loc-armed", func { var loca = getprop("/it-autoflight/output/loc-armed"); + var newarm = getprop("/modes/pfd/fma/roll-mode-armed"); if (loca) { - setprop("/modes/pfd/fma/roll-mode-armed", "LOC"); + if (newarm != "LOC") { + setprop("/modes/pfd/fma/roll-mode-armed", "LOC"); + } } else { - setprop("/modes/pfd/fma/roll-mode-armed", " "); + if (newarm != " ") { + setprop("/modes/pfd/fma/roll-mode-armed", " "); + } } }); # Arm G/S setlistener("/it-autoflight/output/appr-armed", func { var appa = getprop("/it-autoflight/output/appr-armed"); + var newvert2arm = getprop("/modes/pfd/fma/pitch-mode-armed"); if (appa) { - setprop("/modes/pfd/fma/pitch-mode-armed", "G/S"); + if (newvert2arm != "G/S") { + setprop("/modes/pfd/fma/pitch-mode-armed", "G/S"); + } } else { - setprop("/modes/pfd/fma/pitch-mode-armed", " "); + if (newvert2arm != " ") { + setprop("/modes/pfd/fma/pitch-mode-armed", " "); + } } }); @@ -210,3 +262,55 @@ setlistener("/it-autoflight/output/fd2", func { setlistener("/it-autoflight/output/athr", func { at(); }); + +# Boxes +setlistener("/modes/pfd/fma/throttle-mode", func { + setprop("/modes/pfd/fma/throttle-mode-box", 1); + settimer(func { + setprop("/modes/pfd/fma/throttle-mode-box", 0); + }, 5); +}); + +setlistener("/modes/pfd/fma/roll-mode", func { + setprop("/modes/pfd/fma/roll-mode-box", 1); + settimer(func { + setprop("/modes/pfd/fma/roll-mode-box", 0); + }, 5); +}); + +setlistener("/modes/pfd/fma/pitch-mode", func { + setprop("/modes/pfd/fma/pitch-mode-box", 1); + settimer(func { + setprop("/modes/pfd/fma/pitch-mode-box", 0); + }, 5); +}); + +setlistener("/modes/pfd/fma/roll-mode-armed", func { + var newarm = getprop("/modes/pfd/fma/roll-mode-armed"); + if (newarm != " ") { + setprop("/modes/pfd/fma/roll-mode-armed-box", 1); + settimer(func { + setprop("/modes/pfd/fma/roll-mode-armed-box", 0); + }, 5); + } +}); + +setlistener("/modes/pfd/fma/pitch-mode-armed", func { + var newarm = getprop("/modes/pfd/fma/pitch-mode-armed"); + if (newarm != " ") { + setprop("/modes/pfd/fma/pitch-mode-armed-box", 1); + settimer(func { + setprop("/modes/pfd/fma/pitch-mode-armed-box", 0); + }, 5); + } +}); + +setlistener("/modes/pfd/fma/pitch-mode2-armed", func { + var newarm = getprop("/modes/pfd/fma/pitch-mode2-armed"); + if (newarm != " ") { + setprop("/modes/pfd/fma/pitch-mode2-armed-box", 1); + settimer(func { + setprop("/modes/pfd/fma/pitch-mode2-armed-box", 0); + }, 5); + } +});