Merge branch 'master' of github.com:it0uchpods/A320Family

This commit is contained in:
Joshua Davidson 2017-07-03 14:26:51 -04:00
commit 15154d6a14
3 changed files with 61 additions and 7 deletions

View file

@ -3957,7 +3957,7 @@
</or> </or>
</condition> </condition>
<command>property-toggle</command> <command>property-toggle</command>
<property>/controls/deice/wing</property> <property>/controls/switches/wing</property>
</binding> </binding>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
@ -3970,10 +3970,16 @@
<type>select</type> <type>select</type>
<object-name>WingAntiIceBtn1F</object-name> <object-name>WingAntiIceBtn1F</object-name>
<condition> <condition>
<equals> <or>
<property>/controls/switches/annun-test</property> <equals>
<value>1</value> <property>/controls/switches/wingfault</property>
</equals> <value>1</value>
</equals>
<equals>
<property>/controls/switches/annun-test</property>
<value>1</value>
</equals>
</or>
</condition> </condition>
</animation> </animation>
@ -3983,7 +3989,7 @@
<condition> <condition>
<or> <or>
<equals> <equals>
<property>/controls/deice/wing</property> <property>/controls/switches/wing</property>
<value>1</value> <value>1</value>
</equals> </equals>
<equals> <equals>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 168 KiB

View file

@ -11,6 +11,8 @@ var icingInit = func {
setprop("/systems/icing/icingcond", 0); setprop("/systems/icing/icingcond", 0);
setprop("/controls/switches/windowprobeheat", 0); setprop("/controls/switches/windowprobeheat", 0);
setprop("/controls/switches/windowprobeheatfault", 0); setprop("/controls/switches/windowprobeheatfault", 0);
setprop("/controls/switches/wing", 0);
setprop("/controls/switches/wingfault", 0);
setprop("/controls/deice/wing", 0); setprop("/controls/deice/wing", 0);
setprop("/controls/deice/lengine", 0); setprop("/controls/deice/lengine", 0);
setprop("/controls/deice/rengine", 0); setprop("/controls/deice/rengine", 0);
@ -34,6 +36,11 @@ var icingModel = func {
var lengine = getprop("/controls/deice/lengine"); var lengine = getprop("/controls/deice/lengine");
var rengine = getprop("/controls/deice/rengine"); var rengine = getprop("/controls/deice/rengine");
var windowprobe = getprop("/controls/deice/windowprobeheat"); 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") { if (severity == "0") {
setprop("/systems/icing/factor", -0.00000166); setprop("/systems/icing/factor", -0.00000166);
@ -139,7 +146,41 @@ var icingModel = func {
} else { } else {
setprop("/systems/icing/icingcond", 0); 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 { setlistener("/controls/switches/windowprobeheat", func {
var windowprb = getprop("/controls/switches/windowprobeheat"); var windowprb = getprop("/controls/switches/windowprobeheat");
var fault = getprop("/controls/switches/windowprobeheatfault"); var fault = getprop("/controls/switches/windowprobeheatfault");
@ -162,6 +203,13 @@ var icingModel = func {
setprop("/controls/deice/windowprobeheat", 0); 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);
}
} }
################### ###################