diff --git a/Models/Instruments/PFD/PFD1.xml b/Models/Instruments/PFD/PFD1.xml index 8b0802dc..1b014415 100644 --- a/Models/Instruments/PFD/PFD1.xml +++ b/Models/Instruments/PFD/PFD1.xml @@ -951,7 +951,7 @@ 0.00091828 0.0326226 - 0.0581781 + 0.0591781 center-center yz-plane @@ -975,7 +975,7 @@ 0.00091828 0.0436226 - 0.0581781 + 0.0591781 center-center yz-plane @@ -1715,12 +1715,75 @@ + + select + ap-mode-box + + + + /modes/pfd/fma/ap-mode-box + 1 + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + + + + + select + fd-mode-box + + + + /modes/pfd/fma/fd-mode-box + 1 + + + + /it-autoflight/output/fd1 + 1 + + + /it-autoflight/output/fd2 + 1 + + + + + + + + select + athr-mode-box + + + + /modes/pfd/fma/athr-mode-box + 1 + + + /it-autoflight/output/athr + 1 + + + + + ap-mode-fma 0.00091828 0.0656226 - 0.0730781 + 0.0734781 center-center yz-plane @@ -1744,7 +1807,7 @@ 0.00091828 0.0656226 - 0.0655781 + 0.0662781 center-center yz-plane @@ -1768,7 +1831,7 @@ 0.00091828 0.0656226 - 0.0581781 + 0.0591781 center-center yz-plane @@ -1792,7 +1855,7 @@ 0.00091828 0.0656226 - 0.0581781 + 0.0591781 center-center yz-plane diff --git a/Models/Instruments/PFD/PFD2.xml b/Models/Instruments/PFD/PFD2.xml index 35ef74ea..2aba5514 100644 --- a/Models/Instruments/PFD/PFD2.xml +++ b/Models/Instruments/PFD/PFD2.xml @@ -951,7 +951,7 @@ 0.00091828 0.0326226 - 0.0581781 + 0.0591781 center-center yz-plane @@ -975,7 +975,7 @@ 0.00091828 0.0436226 - 0.0581781 + 0.0591781 center-center yz-plane @@ -1715,12 +1715,75 @@ + + select + ap-mode-box + + + + /modes/pfd/fma/ap-mode-box + 1 + + + + /it-autoflight/output/ap1 + 1 + + + /it-autoflight/output/ap2 + 1 + + + + + + + + select + fd-mode-box + + + + /modes/pfd/fma/fd-mode-box + 1 + + + + /it-autoflight/output/fd1 + 1 + + + /it-autoflight/output/fd2 + 1 + + + + + + + + select + athr-mode-box + + + + /modes/pfd/fma/athr-mode-box + 1 + + + /it-autoflight/output/athr + 1 + + + + + ap-mode-fma 0.00091828 0.0656226 - 0.0730781 + 0.0734781 center-center yz-plane @@ -1744,7 +1807,7 @@ 0.00091828 0.0656226 - 0.0655781 + 0.0662781 center-center yz-plane @@ -1768,7 +1831,7 @@ 0.00091828 0.0656226 - 0.0581781 + 0.0591781 center-center yz-plane @@ -1792,7 +1855,7 @@ 0.00091828 0.0656226 - 0.0581781 + 0.0591781 center-center yz-plane diff --git a/Models/Instruments/PFD/res/pfd-3d.ac b/Models/Instruments/PFD/res/pfd-3d.ac index 145742dd..3f95da9f 100644 --- a/Models/Instruments/PFD/res/pfd-3d.ac +++ b/Models/Instruments/PFD/res/pfd-3d.ac @@ -2,7 +2,169 @@ 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 40 +kids 43 +OBJECT poly +name "ap-mode-box" +loc 0.000380651 0.0723146 -0.0618702 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00181733 -0.0133333 +0 -0.00242402 -0.0133333 +0 -0.00242405 0.0055541 +0 -0.00181733 0.0055541 +0 0.00457313 -0.0133093 +0 0.00396641 -0.0133093 +0 0.00396641 0.0055497 +0 0.00457313 0.0055497 +0 0.00462594 0.00618576 +0 0.00462594 0.00557906 +0 -0.00248282 0.00557906 +0 -0.00248282 0.00618576 +0 0.00466499 -0.013348 +0 0.00466499 -0.0139547 +0 -0.00244378 -0.0139547 +0 -0.00244378 -0.013348 +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 "fd-mode-box" +loc 0.000380651 0.0652178 -0.0618702 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00244378 -0.013348 +0 -0.00244378 -0.0139547 +0 0.00466499 -0.0139547 +0 0.00466499 -0.013348 +0 -0.00248282 0.00618576 +0 -0.00248282 0.00557906 +0 0.00462594 0.00557906 +0 0.00462594 0.00618576 +0 0.00457313 0.0055497 +0 0.00396641 0.0055497 +0 0.00396641 -0.0133093 +0 0.00457313 -0.0133093 +0 -0.00181733 0.0055541 +0 -0.00242405 0.0055541 +0 -0.00242402 -0.0133333 +0 -0.00181733 -0.0133333 +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 "athr-mode-box" +loc 0.000380651 0.0581517 -0.0618702 +data 6 +Circle +texture "box.png" +crease 30.000000 +numvert 16 +0 -0.00181732 -0.0133333 +0 -0.00242402 -0.0133333 +0 -0.00242404 0.0055541 +0 -0.00181733 0.0055541 +0 0.00457314 -0.0133093 +0 0.00396642 -0.0133093 +0 0.00396642 0.0055497 +0 0.00457314 0.0055497 +0 0.00462595 0.00618576 +0 0.00462595 0.00557906 +0 -0.00248282 0.00557906 +0 -0.00248282 0.00618576 +0 0.004665 -0.013348 +0 0.004665 -0.0139547 +0 -0.00244377 -0.0139547 +0 -0.00244377 -0.013348 +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 "throttle-mode-box" loc 0.000380651 0.0698612 0.054728 diff --git a/Nasal/PFD_FMA.nas b/Nasal/PFD_FMA.nas index e014974c..7ce5b764 100644 --- a/Nasal/PFD_FMA.nas +++ b/Nasal/PFD_FMA.nas @@ -208,13 +208,14 @@ setlistener("/it-autoflight/output/appr-armed", func { var ap = func { var ap1 = getprop("/it-autoflight/output/ap1"); var ap2 = getprop("/it-autoflight/output/ap2"); - if (ap1 and ap2) { + var newap = getprop("/modes/pfd/fma/ap-mode"); + if (ap1 and ap2 and newap != "AP1+2") { setprop("/modes/pfd/fma/ap-mode", "AP1+2"); - } else if (ap1 and !ap2) { + } else if (ap1 and !ap2 and newap != "AP1") { setprop("/modes/pfd/fma/ap-mode", "AP1"); - } else if (ap2 and !ap1) { + } else if (ap2 and !ap1 and newap != "AP2") { setprop("/modes/pfd/fma/ap-mode", "AP2"); - } else { + } else if (!ap1 and !ap2) { setprop("/modes/pfd/fma/ap-mode", " "); } } @@ -223,13 +224,14 @@ var ap = func { var fd = func { var fd1 = getprop("/it-autoflight/output/fd1"); var fd2 = getprop("/it-autoflight/output/fd2"); - if (fd1 and fd2) { + var newfd = getprop("/modes/pfd/fma/fd-mode"); + if (fd1 and fd2 and newfd != "1FD2") { setprop("/modes/pfd/fma/fd-mode", "1FD2"); - } else if (fd1 and !fd2) { + } else if (fd1 and !fd2 and newfd != "1FD-") { setprop("/modes/pfd/fma/fd-mode", "1FD-"); - } else if (fd2 and !fd1) { + } else if (fd2 and !fd1 and newfd != "-FD2") { setprop("/modes/pfd/fma/fd-mode", "-FD2"); - } else { + } else if (!fd1 and !fd2) { setprop("/modes/pfd/fma/fd-mode", " "); } } @@ -237,9 +239,10 @@ var fd = func { # AT var at = func { var at = getprop("/it-autoflight/output/athr"); - if (at) { + var newat = getprop("/modes/pfd/fma/at-mode"); + if (at and newat != "A/THR") { setprop("/modes/pfd/fma/at-mode", "A/THR"); - } else { + } else if (!at) { setprop("/modes/pfd/fma/at-mode", " "); } } @@ -323,11 +326,46 @@ setlistener("/it-autoflight/output/athr", func { }); # Boxes +setlistener("/modes/pfd/fma/ap-mode", func { + if (getprop("/modes/pfd/fma/ap-mode") != " ") { + setprop("/modes/pfd/fma/ap-mode-box", 1); + settimer(func { + setprop("/modes/pfd/fma/ap-mode-box", 0); + }, 5); + } +}); + +setlistener("/modes/pfd/fma/fd-mode", func { + if (getprop("/modes/pfd/fma/fd-mode") != " ") { + setprop("/modes/pfd/fma/fd-mode-box", 1); + settimer(func { + setprop("/modes/pfd/fma/fd-mode-box", 0); + }, 5); + } +}); + +setlistener("/modes/pfd/fma/at-mode", func { + if (getprop("/modes/pfd/fma/at-mode") != " ") { + setprop("/modes/pfd/fma/throttle-mode-box", 1); + settimer(func { + setprop("/modes/pfd/fma/throttle-mode-box", 0); + }, 5); + setprop("/modes/pfd/fma/athr-mode-box", 1); + settimer(func { + setprop("/modes/pfd/fma/athr-mode-box", 0); + }, 5); + } +}); + 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); + var state1 = getprop("/systems/thrust/state1"); + var state2 = getprop("/systems/thrust/state2"); + if (getprop("/it-autoflight/output/athr") == 1 and state1 != "MCT" and state2 != "MCT" and state1 != "MAN THR" and state2 != "MAN THR" and state1 != "TOGA" and state2 != "TOGA" and state1 != "IDLE" and state2 != "IDLE") { + 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 {