icing update to wing
This commit is contained in:
parent
593aaa00d1
commit
0c08b4ba6b
3 changed files with 61 additions and 7 deletions
|
@ -3955,7 +3955,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>
|
||||||
|
@ -3968,10 +3968,16 @@
|
||||||
<type>select</type>
|
<type>select</type>
|
||||||
<object-name>WingAntiIceBtn1F</object-name>
|
<object-name>WingAntiIceBtn1F</object-name>
|
||||||
<condition>
|
<condition>
|
||||||
|
<or>
|
||||||
|
<equals>
|
||||||
|
<property>/controls/switches/wingfault</property>
|
||||||
|
<value>1</value>
|
||||||
|
</equals>
|
||||||
<equals>
|
<equals>
|
||||||
<property>/controls/switches/annun-test</property>
|
<property>/controls/switches/annun-test</property>
|
||||||
<value>1</value>
|
<value>1</value>
|
||||||
</equals>
|
</equals>
|
||||||
|
</or>
|
||||||
</condition>
|
</condition>
|
||||||
</animation>
|
</animation>
|
||||||
|
|
||||||
|
@ -3981,7 +3987,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 |
|
@ -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);
|
||||||
|
@ -140,6 +147,40 @@ var icingModel = func {
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
###################
|
###################
|
||||||
|
|
Reference in a new issue