A3XX: Improve FMA

This commit is contained in:
Joshua Davidson 2017-07-01 20:00:18 -04:00
parent 6cefc42cff
commit 535e77bdf8
3 changed files with 81 additions and 281 deletions

View file

@ -2141,29 +2141,6 @@
</font-resolution>
</text>
<text>
<name>athr-thrlvr-fma</name>
<offsets>
<x-m>0.00091828</x-m>
<y-m>-0.0546226</y-m>
<z-m>0.0710781</z-m>
</offsets>
<alignment>center-center</alignment>
<axis-alignment>yz-plane</axis-alignment>
<type type="string">text-value</type>
<format type="string">THR LVR</format>
<property>autopilot/serviceable</property>
<font type="string">helvetica_medium.txf</font>
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.0055</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
</font-resolution>
</text>
<animation>
<type>select</type>
<object-name>thrust-mode-fma</object-name>
@ -2173,50 +2150,6 @@
<property>/it-autoflight/output/athr</property>
<value>1</value>
</equals>
<or>
<and>
<equals>
<property>/it-autoflight/output/thr-mode</property>
<value>2</value>
</equals>
<or>
<equals>
<property>/it-autoflight/output/fd1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/fd2</property>
<value>1</value>
</equals>
</or>
<or>
<equals>
<property>/systems/thrust/state1</property>
<value>CL</value>
</equals>
<equals>
<property>/systems/thrust/state2</property>
<value>CL</value>
</equals>
</or>
</and>
<and>
<or>
<not-equals>
<property>/it-autoflight/output/thr-mode</property>
<value>2</value>
</not-equals>
<and>
<equals>
<property>/it-autoflight/output/fd1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/fd2</property>
<value>0</value>
</equals>
</and>
</or>
<or>
<equals>
<property>/systems/thrust/state1</property>
@ -2236,8 +2169,6 @@
</equals>
</or>
</and>
</or>
</and>
</condition>
</animation>
@ -2351,41 +2282,6 @@
</condition>
</animation>
<animation>
<type>select</type>
<object-name>athr-thrlvr-fma</object-name>
<condition>
<and>
<equals>
<property>/it-autoflight/output/athr</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/thr-mode</property>
<value>2</value>
</equals>
<or>
<equals>
<property>/it-autoflight/output/fd1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/fd2</property>
<value>1</value>
</equals>
</or>
<less-than>
<property>/controls/engines/engine[0]/throttle</property>
<value>0.60</value>
</less-than>
<less-than>
<property>/controls/engines/engine[1]/throttle</property>
<value>0.60</value>
</less-than>
</and>
</condition>
</animation>
<text>
<name>athr-man-fma</name>
<offsets>
@ -2883,7 +2779,6 @@
<type>select</type>
<object-name>thrust-mode-fma</object-name>
<object-name>athr-lvrclb-fma</object-name>
<object-name>athr-thrlvr-fma</object-name>
<object-name>athr-thr-fma</object-name>
<object-name>athr-mct-fma</object-name>
<object-name>athr-toga-fma</object-name>
@ -3396,7 +3291,6 @@
<object-name>pitch-mode-fma</object-name>
<object-name>land-mode-fma</object-name>
<object-name>roll-mode-fma</object-name>
<object-name>athr-thrlvr-fma</object-name>
<diffuse>
<red>0</red>
<green>0.843</green>

View file

@ -2141,29 +2141,6 @@
</font-resolution>
</text>
<text>
<name>athr-thrlvr-fma</name>
<offsets>
<x-m>0.00091828</x-m>
<y-m>-0.0546226</y-m>
<z-m>0.0710781</z-m>
</offsets>
<alignment>center-center</alignment>
<axis-alignment>yz-plane</axis-alignment>
<type type="string">text-value</type>
<format type="string">THR LVR</format>
<property>autopilot/serviceable</property>
<font type="string">helvetica_medium.txf</font>
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
<draw-boundingbox type="bool">false</draw-boundingbox>
<character-size>0.0055</character-size>
<font-resolution>
<width type="int">32</width>
<height type="int">32</height>
</font-resolution>
</text>
<animation>
<type>select</type>
<object-name>thrust-mode-fma</object-name>
@ -2173,50 +2150,6 @@
<property>/it-autoflight/output/athr</property>
<value>1</value>
</equals>
<or>
<and>
<equals>
<property>/it-autoflight/output/thr-mode</property>
<value>2</value>
</equals>
<or>
<equals>
<property>/it-autoflight/output/fd1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/fd2</property>
<value>1</value>
</equals>
</or>
<or>
<equals>
<property>/systems/thrust/state1</property>
<value>CL</value>
</equals>
<equals>
<property>/systems/thrust/state2</property>
<value>CL</value>
</equals>
</or>
</and>
<and>
<or>
<not-equals>
<property>/it-autoflight/output/thr-mode</property>
<value>2</value>
</not-equals>
<and>
<equals>
<property>/it-autoflight/output/fd1</property>
<value>0</value>
</equals>
<equals>
<property>/it-autoflight/output/fd2</property>
<value>0</value>
</equals>
</and>
</or>
<or>
<equals>
<property>/systems/thrust/state1</property>
@ -2236,8 +2169,6 @@
</equals>
</or>
</and>
</or>
</and>
</condition>
</animation>
@ -2351,41 +2282,6 @@
</condition>
</animation>
<animation>
<type>select</type>
<object-name>athr-thrlvr-fma</object-name>
<condition>
<and>
<equals>
<property>/it-autoflight/output/athr</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/thr-mode</property>
<value>2</value>
</equals>
<or>
<equals>
<property>/it-autoflight/output/fd1</property>
<value>1</value>
</equals>
<equals>
<property>/it-autoflight/output/fd2</property>
<value>1</value>
</equals>
</or>
<less-than>
<property>/controls/engines/engine[0]/throttle</property>
<value>0.60</value>
</less-than>
<less-than>
<property>/controls/engines/engine[1]/throttle</property>
<value>0.60</value>
</less-than>
</and>
</condition>
</animation>
<text>
<name>athr-man-fma</name>
<offsets>
@ -2883,7 +2779,6 @@
<type>select</type>
<object-name>thrust-mode-fma</object-name>
<object-name>athr-lvrclb-fma</object-name>
<object-name>athr-thrlvr-fma</object-name>
<object-name>athr-thr-fma</object-name>
<object-name>athr-mct-fma</object-name>
<object-name>athr-toga-fma</object-name>
@ -3396,7 +3291,6 @@
<object-name>pitch-mode-fma</object-name>
<object-name>land-mode-fma</object-name>
<object-name>roll-mode-fma</object-name>
<object-name>athr-thrlvr-fma</object-name>
<diffuse>
<red>0</red>
<green>0.843</green>

View file

@ -1,17 +1,36 @@
# Airbus PFD FMA
# Joshua Davidson (it0uchpods/411)
# Joshua Davidson (it0uchpods)
setprop("/FMGC/internal/cruise-ft", 10000);
setprop("/it-autoflight/internal/alt", 10000);
# Speed or Mach?
var speedmach = func {
setlistener("sim/signals/fdm-initialized", func {
speedmach.start();
});
# Master Thrust
var speedmach = maketimer(0.05, func {
var state1 = getprop("/systems/thrust/state1");
var state2 = getprop("/systems/thrust/state2");
var newthr = getprop("/modes/pfd/fma/throttle-mode");
if (state1 == "TOGA" or state2 == "TOGA") {
if (newthr != " ") {
setprop("/modes/pfd/fma/throttle-mode", " ");
}
} else if (state1 == "MCT" or state2 == "MCT") {
if (newthr != " ") {
setprop("/modes/pfd/fma/throttle-mode", " ");
}
} else if (state1 == "MAN THR" or state2 == "MAN THR") {
if (newthr != " ") {
setprop("/modes/pfd/fma/throttle-mode", " ");
}
} else {
if ((getprop("/it-autoflight/output/vert") == 4) or (getprop("/it-autoflight/output/vert") == 6) or (getprop("/it-autoflight/output/vert") == 7) or (getprop("/it-autoflight/output/vert") == 8)) {
if (getprop("/it-autoflight/output/fd1") == 0 and getprop("/it-autoflight/output/fd2") == 0 and getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0) {
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) {
@ -19,15 +38,22 @@ var speedmach = func {
setprop("/modes/pfd/fma/throttle-mode", "THR IDLE");
}
} else if (thr == 2) {
if (state1 == "CL" or state2 == "CL") {
if (newthr != "THR CLB") {
setprop("/modes/pfd/fma/throttle-mode", "THR CLB");
}
} else {
if (newthr != "THR LVR") {
setprop("/modes/pfd/fma/throttle-mode", "THR LVR");
}
}
}
}
} else {
speedmach_b();
}
}
});
var speedmach_b = func {
var newthr = getprop("/modes/pfd/fma/throttle-mode");
@ -42,16 +68,7 @@ var speedmach_b = func {
}
}
# Update Speed or Mach
setlistener("/it-autoflight/input/kts-mach", func {
speedmach();
});
# Master Thrust
setlistener("/it-autoflight/output/thr-mode", func {
speedmach();
});
# HDG/TRK
var hdgmde = func {
var lat = getprop("/it-autoflight/mode/lat");
var newlat = getprop("/modes/pfd/fma/roll-mode");
@ -67,7 +84,6 @@ var hdgmde = func {
}
}
# HDG/TRK
setlistener("/it-autoflight/custom/trk-fpa", func {
hdgmde();
});
@ -389,22 +405,18 @@ var boxchk_b = func {
# Update AP FD ATHR
setlistener("/it-autoflight/output/ap1", func {
speedmach();
ap();
boxchk();
});
setlistener("/it-autoflight/output/ap2", func {
speedmach();
ap();
boxchk();
});
setlistener("/it-autoflight/output/fd1", func {
speedmach();
fd();
boxchk();
});
setlistener("/it-autoflight/output/fd2", func {
speedmach();
fd();
boxchk();
});