A3XX: Simulate TO-CONFIG button

This commit is contained in:
Joshua Davidson 2017-12-30 10:54:45 -05:00
parent ed7a903a79
commit 03f016117b
4 changed files with 35 additions and 3 deletions

View file

@ -1350,6 +1350,25 @@
</action>
</animation>
<animation>
<type>pick</type>
<object-name>ecam_to_config</object-name>
<action>
<button>0</button>
<repeatable type="bool">false</repeatable>
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>nasal</command>
<script>libraries.ECAM.toConfig();</script>
</binding>
</action>
</animation>
<!-- Engine Cutoff/Mode Selector -->
<animation>
<type>pick</type>

View file

@ -274,8 +274,7 @@ var canvas_upperECAM_base = {
me["TO_Flaps_B"].show();
}
if (getprop("/controls/autobrake/mode") == 3 and getprop("/controls/switches/no-smoking-sign") == 1 and getprop("/controls/switches/seatbelt-sign") == 1 and getprop("/controls/flight/speedbrake-arm") == 1 and getprop("/controls/flight/flap-pos") > 0
and getprop("/controls/flight/flap-pos") < 5) {
if (getprop("/ECAM/to-config") == 1) {
me["TO_Config"].setText("T.O CONFIG NORMAL");
me["TO_Config_B"].hide();
} else {

View file

@ -15,6 +15,7 @@ var ECAM = {
setprop("/ECAM/engine-start-time", 0);
setprop("/ECAM/engine-start-time-switch", 0);
setprop("/ECAM/to-memo-enable", 1);
setprop("/ECAM/to-config", 0);
var stateL = getprop("/engines/engine[0]/state");
var stateR = getprop("/engines/engine[1]/state");
var thrustL = getprop("/systems/thrust/state1");
@ -75,6 +76,19 @@ var ECAM = {
} else {
setprop("/ECAM/left-msg", "NONE");
}
if (getprop("/controls/autobrake/mode") == 3 and getprop("/controls/switches/no-smoking-sign") == 1 and getprop("/controls/switches/seatbelt-sign") == 1 and getprop("/controls/flight/speedbrake-arm") == 1 and getprop("/controls/flight/flap-pos") > 0
and getprop("/controls/flight/flap-pos") < 5) {
# Do nothing
} else {
setprop("/ECAM/to-config", 0);
}
},
toConfig: func() {
if (getprop("/controls/autobrake/mode") == 3 and getprop("/controls/switches/no-smoking-sign") == 1 and getprop("/controls/switches/seatbelt-sign") == 1 and getprop("/controls/flight/speedbrake-arm") == 1 and getprop("/controls/flight/flap-pos") > 0
and getprop("/controls/flight/flap-pos") < 5) {
setprop("/ECAM/to-config", 1);
}
},
};

View file

@ -1 +1 @@
4208
4209