Merge branch 'master' of github.com:it0uchpods/A320Family
This commit is contained in:
commit
357c4bf580
15 changed files with 467 additions and 106 deletions
|
@ -939,6 +939,7 @@
|
|||
<file>Aircraft/A320Family/Nasal/fuel.nas</file>
|
||||
<file>Aircraft/A320Family/Nasal/engines.nas</file>
|
||||
<file>Aircraft/A320Family/Nasal/ADIRS.nas</file>
|
||||
<file>Aircraft/A320Family/Nasal/fire.nas</file>
|
||||
</systems>
|
||||
<thrust>
|
||||
<file>Aircraft/A320Family/Nasal/fadec-common.nas</file>
|
||||
|
@ -977,7 +978,6 @@
|
|||
</canvas_nd>
|
||||
<icing> <!-- leave icing in this -->
|
||||
<file>Aircraft/A320Family/Nasal/icing.nas</file>
|
||||
<file>Aircraft/A320Family/Nasal/PitotIcing.nas</file>
|
||||
</icing>
|
||||
</nasal>
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ var systemsReset = func {
|
|||
fmgc.FMGCinit();
|
||||
mcdu1.MCDU_reset();
|
||||
mcdu2.MCDU_reset();
|
||||
icing.PitotIcingReset();
|
||||
icing.icingInit();
|
||||
fmgc.APinit();
|
||||
setprop("/it-autoflight/input/fd1", 1);
|
||||
setprop("/it-autoflight/input/fd2", 1);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<layout>hbox</layout>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Aircraft Configuration V1.4.1</label>
|
||||
<label>Aircraft Configuration V1.4.2</label>
|
||||
</text>
|
||||
<button>
|
||||
<halign>right</halign>
|
||||
|
@ -305,6 +305,41 @@
|
|||
<live>true</live>
|
||||
</checkbox>
|
||||
|
||||
<checkbox>
|
||||
<label>Yellow HYD Hand Pump</label>
|
||||
<halign>left</halign>
|
||||
<property>/controls/hydraulic/hand-pump-yellow</property>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/hydraulic/hand-pump-yellow</property>
|
||||
</binding>
|
||||
<enable>
|
||||
<and>
|
||||
<equals>
|
||||
<property>/controls/gear/brake-parking</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<less-than>
|
||||
<property>/velocities/groundspeed-kt</property>
|
||||
<value>2</value>
|
||||
</less-than>
|
||||
<less-than>
|
||||
<property>/systems/electrical/bus/ac2</property>
|
||||
<value>115</value>
|
||||
</less-than>
|
||||
<equals>
|
||||
<property>/controls/electrical/switches/gen-ext</property>
|
||||
<value>0</value>
|
||||
</equals>
|
||||
</and>
|
||||
</enable>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
<live>true</live>
|
||||
</checkbox>
|
||||
|
||||
|
||||
<hrule/>
|
||||
|
||||
<checkbox>
|
||||
|
|
|
@ -1726,6 +1726,21 @@
|
|||
</emission>
|
||||
</animation-->
|
||||
|
||||
<animation>
|
||||
<name>Cargo Smoke Test</name>
|
||||
<type>pick</type>
|
||||
<object-name>CargoSmkTest</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/controls/fire/cargo/test</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<!-- Hydraulic -->
|
||||
<animation>
|
||||
<name>Green Eng Pump pick</name>
|
||||
|
@ -4655,7 +4670,7 @@
|
|||
</or>
|
||||
</condition>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/deice/lengine</property>
|
||||
<property>/controls/switches/leng</property>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
|
@ -4668,10 +4683,16 @@
|
|||
<type>select</type>
|
||||
<object-name>Eng1AntiIceBtn1F</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/controls/switches/annun-test</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/controls/switches/lengfault</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/controls/switches/annun-test</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
|
@ -4681,7 +4702,7 @@
|
|||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/controls/deice/lengine</property>
|
||||
<property>/controls/switches/leng</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
|
@ -4716,7 +4737,7 @@
|
|||
</or>
|
||||
</condition>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/deice/rengine</property>
|
||||
<property>/controls/switches/reng</property>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
|
@ -4729,10 +4750,16 @@
|
|||
<type>select</type>
|
||||
<object-name>Eng2AntiIceBtn1F</object-name>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>/controls/switches/annun-test</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/controls/switches/rengfault</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/controls/switches/annun-test</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
|
@ -4742,7 +4769,7 @@
|
|||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/controls/deice/rengine</property>
|
||||
<property>/controls/switches/reng</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
|
@ -5539,5 +5566,19 @@
|
|||
</equals>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<!-- CVR -->
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>CVRTest</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>libraries.CVR_test();</script>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
BIN
Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png
Normal file
BIN
Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
BIN
Models/Instruments/OHpanel/res/buttonsCargoSmoke.png
Normal file
BIN
Models/Instruments/OHpanel/res/buttonsCargoSmoke.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
|
@ -1,35 +0,0 @@
|
|||
######################################################
|
||||
# Fail the pitot tude due to icing of the pitot tube #
|
||||
# Code by Jonathan Redpath #
|
||||
######################################################
|
||||
|
||||
var PitotIcingReset = func {
|
||||
setprop("/systems/pitot/icing", 0.0);
|
||||
setprop("/systems/pitot/failed", 1);
|
||||
pitot_timer.start();
|
||||
}
|
||||
|
||||
PitotIcing = func {
|
||||
var icing = getprop("/systems/pitot/icing");
|
||||
var failed = getprop("/systems/pitot/failed");
|
||||
|
||||
if( icing > 0.03 ) {
|
||||
if( !failed ) {
|
||||
setprop("/systems/pitot/failed", 1);
|
||||
}
|
||||
} else if( icing < 0.03 ) {
|
||||
if( failed ) {
|
||||
setprop("/systems/pitot/failed", 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
###################
|
||||
# Update Function #
|
||||
###################
|
||||
|
||||
var update_pitotIcing = func {
|
||||
PitotIcing();
|
||||
}
|
||||
|
||||
var pitot_timer = maketimer(0.2, update_pitotIcing);
|
|
@ -13,6 +13,38 @@ var variousReset = func {
|
|||
setprop("/instrumentation/mk-viii/inputs/discretes/glideslope-cancel", 0);
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-override", 0);
|
||||
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override", 0);
|
||||
# cockpit voice recorder stuff
|
||||
setprop("/controls/CVR/power", 0);
|
||||
setprop("/controls/CVR/test", 0);
|
||||
setprop("/controls/CVR/tone", 0);
|
||||
setprop("/controls/CVR/gndctl", 0);
|
||||
setprop("/controls/CVR/erase", 0);
|
||||
}
|
||||
|
||||
var CVR_test = func {
|
||||
var parkBrake = getprop("/controls/gear/brake-parking");
|
||||
if (parkBrake) {
|
||||
setprop("controls/CVR/tone", 1);
|
||||
settimer(func() {
|
||||
setprop("controls/CVR/tone", 0);
|
||||
}, 15);
|
||||
}
|
||||
}
|
||||
|
||||
var CVR_master = func {
|
||||
var stateL = getprop("/engines/engine[0]/state");
|
||||
var stateR = getprop("/engines/engine[1]/state");
|
||||
var wowl = getprop("/gear/gear[1]/wow");
|
||||
var wowr = getprop("/gear/gear[2]/wow");
|
||||
var gndCtl = getprop("/systems/CVR/gndctl");
|
||||
var acPwr = getprop("/systems/electrical/bus/ac-ess");
|
||||
if (acPwr > 0 and wowl and wowr and (gndCtl or (stateL == 3 or stateR == 3))) {
|
||||
setprop("/controls/CVR/power", 1);
|
||||
} else if (!wowl and !wowr and acPwr > 0) {
|
||||
setprop("/controls/CVR/power", 1);
|
||||
} else {
|
||||
setprop("/controls/CVR/power", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var mcpSPDKnbPull = func {
|
||||
|
@ -110,3 +142,10 @@ var decreaseManVS = func {
|
|||
setprop("/systems/pressurization/outflowpos-man", manvs - 0.001);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var update_CVR = func {
|
||||
CVR_master();
|
||||
}
|
||||
|
||||
var CVR = maketimer(0.1, update_CVR);
|
||||
|
|
172
Nasal/fire.nas
Normal file
172
Nasal/fire.nas
Normal file
|
@ -0,0 +1,172 @@
|
|||
# A3XX Fire System
|
||||
# Jonathan Redpath
|
||||
|
||||
#############
|
||||
# Init Vars #
|
||||
#############
|
||||
|
||||
var fire_init = func {
|
||||
setprop("/systems/fire/cargo/fwddet", 0);
|
||||
setprop("/systems/fire/cargo/aftdet", 0);
|
||||
setprop("/systems/fire/cargo/fwdsquib", 0);
|
||||
setprop("/systems/fire/cargo/aftsquib", 0);
|
||||
setprop("/systems/fire/cargo/bottlelevel", 100);
|
||||
setprop("/systems/fire/cargo/test", 0);
|
||||
setprop("/controls/fire/cargo/test", 0);
|
||||
setprop("/controls/fire/cargo/fwdguard", 1);
|
||||
setprop("/controls/fire/cargo/aftguard", 1);
|
||||
setprop("/controls/fire/cargo/fwddisch", 0); # pushbutton
|
||||
setprop("/controls/fire/cargo/aftdisch", 0);
|
||||
setprop("/controls/fire/cargo/fwddischLight", 0);
|
||||
setprop("/controls/fire/cargo/aftdischLight", 0);
|
||||
setprop("/controls/fire/cargo/fwdsmokeLight", 0);
|
||||
setprop("/controls/fire/cargo/aftsmokeLight", 0);
|
||||
setprop("/controls/fire/cargo/bottleempty", 0);
|
||||
# status: 1 is ready, 0 is already disch
|
||||
setprop("/controls/fire/cargo/status", 1);
|
||||
setprop("/controls/fire/cargo/warnfwd", 0);
|
||||
setprop("/controls/fire/cargo/warnaft", 0);
|
||||
setprop("/controls/fire/cargo/squib1fault", 0);
|
||||
setprop("/controls/fire/cargo/squib2fault", 0);
|
||||
setprop("/controls/fire/cargo/detfault", 0);
|
||||
setprop("/controls/fire/cargo/test/state", 0);
|
||||
fire_timer.start();
|
||||
}
|
||||
|
||||
##############
|
||||
# Main Loops #
|
||||
##############
|
||||
var master_fire = func {
|
||||
var level = getprop("/systems/fire/cargo/bottlelevel");
|
||||
var fwdsquib = getprop("/systems/fire/cargo/fwdsquib");
|
||||
var aftsquib = getprop("/systems/fire/cargo/aftsquib");
|
||||
var fwddet = getprop("/systems/fire/cargo/fwddet");
|
||||
var aftdet = getprop("/systems/fire/cargo/aftdet");
|
||||
var test = getprop("/controls/fire/cargo/test");
|
||||
var guard1 = getprop("/controls/fire/cargo/fwdguard");
|
||||
var guard2 = getprop("/controls/fire/cargo/aftguard");
|
||||
var dischpb1 = getprop("/controls/fire/cargo/fwddisch");
|
||||
var dischpb2 = getprop("/controls/fire/cargo/aftdisch");
|
||||
var smokedet1 = getprop("/controls/fire/cargo/fwdsmokeLight");
|
||||
var smokedet2 = getprop("/controls/fire/cargo/aftsmokeLight");
|
||||
var bottleIsEmpty = getprop("/controls/fire/cargo/bottleempty");
|
||||
var WeCanExt = getprop("/controls/fire/cargo/status");
|
||||
var test2 = getprop("/systems/fire/cargo/test");
|
||||
var state = getprop("/controls/fire/cargo/test/state");
|
||||
var dc1 = getprop("/systems/electrical/bus/dc1");
|
||||
var dc2 = getprop("/systems/electrical/bus/dc2");
|
||||
var dcbat = getprop("/systems/electrical/bus/dcbat");
|
||||
var pause = getprop("/sim/freeze/master");
|
||||
|
||||
###################
|
||||
# Detection Logic #
|
||||
###################
|
||||
|
||||
if (fwddet) {
|
||||
setprop("/controls/fire/cargo/fwdsmokeLight", 1);
|
||||
setprop("/controls/fire/cargo/warnfwd", 1);
|
||||
} else {
|
||||
setprop("/controls/fire/cargo/fwdsmokeLight", 0);
|
||||
}
|
||||
|
||||
if (aftdet) {
|
||||
setprop("/controls/fire/cargo/aftsmokeLight", 1);
|
||||
setprop("/controls/fire/cargo/warnaft", 1);
|
||||
} else {
|
||||
setprop("/controls/fire/cargo/aftsmokeLight", 0);
|
||||
}
|
||||
|
||||
###############
|
||||
# Discharging #
|
||||
###############
|
||||
|
||||
if (dischpb1) {
|
||||
if (WeCanExt == 1 and !fwdsquib and !bottleIsEmpty and (dc1 > 0 or dc2 > 0 or dcbat > 0)) {
|
||||
setprop("/systems/fire/cargo/fwdsquib", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (dischpb1 and fwdsqib and !bottleIsEmpty and !puase) {
|
||||
var bottle = getprop("/systems/fire/cargo/bottlelevel");
|
||||
setprop("/systems/fire/cargo/bottlelevel", bottle - 0.166);
|
||||
}
|
||||
|
||||
if (dischpb2) {
|
||||
if (WeCanExt == 1 and !aftsquib and !bottleIsEmpty and (dc1 > 0 or dc2 > 0 or dcbat > 0)) {
|
||||
setprop("/systems/fire/cargo/aftsquib", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (dischpb1 and fwdsqib and !bottleIsEmpty and !puase) {
|
||||
var bottle = getprop("/systems/fire/cargo/bottlelevel");
|
||||
setprop("/systems/fire/cargo/bottlelevel", bottle - 0.166);
|
||||
}
|
||||
|
||||
#################
|
||||
# Test Sequence #
|
||||
#################
|
||||
|
||||
setlistener("/controls/fire/cargo/test", func {
|
||||
var test = getprop("/controls/fire/cargo/test");
|
||||
if (test) {
|
||||
setprop("/systems/fire/cargo/test", 1);
|
||||
}
|
||||
});
|
||||
|
||||
if (test2 and state == 0) {
|
||||
setprop("/controls/fire/cargo/fwdsmokeLight", 1);
|
||||
setprop("/controls/fire/cargo/warnfwd", 1);
|
||||
settimer(func(){
|
||||
setprop("/controls/fire/cargo/fwdsmokeLight", 0);
|
||||
setprop("/controls/fire/cargo/warnfwd", 0);
|
||||
setprop("/controls/fire/cargo/test/state", 1);
|
||||
}, 0.5);
|
||||
} else if (test2 and state == 1) {
|
||||
setprop("/controls/fire/cargo/aftsmokeLight", 1);
|
||||
setprop("/controls/fire/cargo/warnaft", 1);
|
||||
settimer(func(){
|
||||
setprop("/controls/fire/cargo/aftsmokeLight", 0);
|
||||
setprop("/controls/fire/cargo/warnaft", 0);
|
||||
setprop("/controls/fire/cargo/test/state", 2);
|
||||
}, 0.5);
|
||||
} else if (test2 and state == 2) {
|
||||
setprop("/controls/fire/cargo/fwddischLight", 1);
|
||||
setprop("/controls/fire/cargo/aftdischLight", 1);
|
||||
settimer(func(){
|
||||
setprop("/controls/fire/cargo/fwddischLight", 0);
|
||||
setprop("/controls/fire/cargo/aftdischLight", 0);
|
||||
setprop("/systems/fire/cargo/test", 0);
|
||||
setprop("/controls/fire/cargo/test", 0);
|
||||
setprop("/controls/fire/cargo/test/state", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
|
||||
|
||||
##########
|
||||
# Status #
|
||||
##########
|
||||
|
||||
if (level < 0.1) {
|
||||
setprop("/controls/fire/cargo/bottleempty", 1);
|
||||
setprop("/controls/fire/cargo/status", 0);
|
||||
setprop("/controls/fire/cargo/fwddischLight", 1);
|
||||
setprop("/controls/fire/cargo/aftdischLight", 1);
|
||||
} else {
|
||||
setprop("/controls/fire/cargo/bottleempty", 0);
|
||||
setprop("/controls/fire/cargo/status", 1);
|
||||
setprop("/controls/fire/cargo/fwddischLight", 0);
|
||||
setprop("/controls/fire/cargo/aftdischLight", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
###################
|
||||
# Update Function #
|
||||
###################
|
||||
|
||||
var update_fire = func {
|
||||
master_fire();
|
||||
}
|
||||
|
||||
var fire_timer = maketimer(0.1, update_fire);
|
||||
|
|
@ -10,6 +10,7 @@ var hyd_init = func {
|
|||
setprop("/controls/hydraulic/eng2-pump", 1);
|
||||
setprop("/controls/hydraulic/elec-pump-blue", 1);
|
||||
setprop("/controls/hydraulic/elec-pump-yellow", 0);
|
||||
setprop("/controls/hydraulic/hand-pump-yellow", 0);
|
||||
setprop("/controls/hydraulic/ptu", 1);
|
||||
setprop("/controls/hydraulic/rat-man", 0);
|
||||
setprop("/controls/hydraulic/rat", 0);
|
||||
|
@ -43,6 +44,7 @@ var master_hyd = func {
|
|||
var eng2_pump_sw = getprop("/controls/hydraulic/eng2-pump");
|
||||
var elec_pump_blue_sw = getprop("/controls/hydraulic/elec-pump-blue");
|
||||
var elec_pump_yellow_sw = getprop("/controls/hydraulic/elec-pump-yellow");
|
||||
var yellow_hand_pump = getprop("/controls/hydraulic/hand-pump-yellow");
|
||||
var ptu_sw = getprop("/controls/hydraulic/ptu");
|
||||
var rat_man_sw = getprop("/controls/hydraulic/rat-man");
|
||||
var blue_psi = getprop("/systems/hydraulic/blue-psi");
|
||||
|
@ -64,8 +66,9 @@ var master_hyd = func {
|
|||
var yellow_pump_eng_fail = getprop("/systems/failures/pump-yellow-eng");
|
||||
var yellow_pump_elec_fail = getprop("/systems/failures/pump-yellow-elec");
|
||||
var ptu_fail = getprop("/systems/failures/ptu");
|
||||
var dc2 = getprop("/systems/electrical/bus/dc2");
|
||||
|
||||
if (psi_diff > 500 or psi_diff < -500 and ptu_sw) {
|
||||
if (psi_diff > 500 or psi_diff < -500 and ptu_sw and dc2 > 28) {
|
||||
setprop("/systems/hydraulic/ptu-active", 1);
|
||||
} else if (psi_diff < 20 and psi_diff > -20) {
|
||||
setprop("/systems/hydraulic/ptu-active", 0);
|
||||
|
@ -138,6 +141,12 @@ var master_hyd = func {
|
|||
} else {
|
||||
setprop("/systems/hydraulic/yellow-psi", 3000);
|
||||
}
|
||||
} else if (yellow_hand_pump and !yellow_leak and (getprop("/gear/gear[0]/wow") or getprop("/gear/gear[1]/wow") or getprop("/gear/gear[2]/wow"))) {
|
||||
if (yellow_psi < 2900) {
|
||||
setprop("/systems/hydraulic/yellow-psi", yellow_psi + 50);
|
||||
} else {
|
||||
setprop("/systems/hydraulic/yellow-psi", 3000);
|
||||
}
|
||||
} else {
|
||||
if (yellow_psi > 1) {
|
||||
setprop("/systems/hydraulic/yellow-psi", yellow_psi - 50);
|
||||
|
|
171
Nasal/icing.nas
171
Nasal/icing.nas
|
@ -10,14 +10,20 @@ var icingInit = func {
|
|||
setprop("/systems/icing/melt-w-heat-factor", -0.00005000);
|
||||
setprop("/systems/icing/icingcond", 0);
|
||||
setprop("/controls/switches/windowprobeheat", 0);
|
||||
setprop("/controls/switches/windowprobeheatfault", 0);
|
||||
setprop("/controls/switches/wing", 0);
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
setprop("/controls/switches/leng", 0);
|
||||
setprop("/controls/switches/lengfault", 0);
|
||||
setprop("/controls/switches/reng", 0);
|
||||
setprop("/controls/switches/rengfault", 0);
|
||||
setprop("/controls/deice/wing", 0);
|
||||
setprop("/controls/deice/lengine", 0);
|
||||
setprop("/controls/deice/rengine", 0);
|
||||
setprop("/controls/deice/windowprobeheat", 0);
|
||||
|
||||
setprop("/systems/pitot/icing", 0.0);
|
||||
setprop("/systems/pitot/failed", 1);
|
||||
setprop("/controls/deice/WingHasBeenTurnedOff", 0);
|
||||
setprop("/controls/deice/GroundModeFinished", 0);
|
||||
icing_timer.start();
|
||||
}
|
||||
|
||||
|
@ -33,29 +39,23 @@ var icingModel = func {
|
|||
var icingCond = getprop("/systems/icing/icingcond");
|
||||
var pause = getprop("/sim/freeze/master");
|
||||
var melt = getprop("/systems/icing/melt-w-heat-factor");
|
||||
var wing = getprop("/controls/deice/wing");
|
||||
var lengine = getprop("/controls/deice/lengine");
|
||||
var rengine = getprop("/controls/deice/rengine");
|
||||
var windowprobe = getprop("/controls/deice/windowprobeheat");
|
||||
var wingBtn = getprop("/controls/switches/wing");
|
||||
var wingFault = getprop("/controls/switches/wingfault");
|
||||
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") {
|
||||
setprop("/systems/icing/factor", -0.00000166);
|
||||
} else if (severity == "1") {
|
||||
setprop("/systems/icing/factor", 0.00000277);
|
||||
} else if (severity == "2") {
|
||||
setprop("/systems/icing/factor", 0.00000277);
|
||||
} else if (severity == "3") {
|
||||
setprop("/systems/icing/factor", 0.00000554);
|
||||
} else if (severity == "4") {
|
||||
setprop("/systems/icing/factor", 0.00001108);
|
||||
} else if (severity == "5") {
|
||||
setprop("/systems/icing/factor", 0.00002216);
|
||||
}
|
||||
var PitotIcing = getprop("/systems/pitot/icing");
|
||||
var PitotFailed = getprop("/systems/pitot/failed");
|
||||
var lengBtn = getprop("/controls/switches/leng");
|
||||
var lengFault = getprop("/controls/switches/lengfault");
|
||||
var rengBtn = getprop("/controls/switches/reng");
|
||||
var rengFault = getprop("/controls/switches/rengfault");
|
||||
var lengAnti = getprop("/controls/deice/lengine");
|
||||
var rengAnti = getprop("/controls/deice/rengine");
|
||||
var WingHasBeenTurnedOff = getprop("/controls/deice/WingHasBeenTurnedOff");
|
||||
var GroundModeFinished = getprop("/controls/deice/GroundModeFinished");
|
||||
|
||||
if (temperature >= 0 or !icingCond) {
|
||||
setprop("/systems/icing/severity", "0");
|
||||
|
@ -77,9 +77,9 @@ var icingModel = func {
|
|||
var a = icing1 + melt;
|
||||
if (icing1 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[0]/ice-inches", 0.0);
|
||||
} else if (wing) {
|
||||
} else if (wingAnti) {
|
||||
setprop("/sim/model/icing/iceable[0]/ice-inches", a);
|
||||
} else if (!pause and !wing) {
|
||||
} else if (!pause and !wingAnti) {
|
||||
setprop("/sim/model/icing/iceable[0]/ice-inches", v);
|
||||
}
|
||||
|
||||
|
@ -89,9 +89,9 @@ var icingModel = func {
|
|||
var b = icing2 + melt;
|
||||
if (icing2 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[1]/ice-inches", 0.0);
|
||||
} else if (lengine) {
|
||||
} else if (lengAnti) {
|
||||
setprop("/sim/model/icing/iceable[1]/ice-inches", b);
|
||||
} else if (!pause and !lengine) {
|
||||
} else if (!pause and !lengAnti) {
|
||||
setprop("/sim/model/icing/iceable[1]/ice-inches", u);
|
||||
}
|
||||
|
||||
|
@ -101,9 +101,9 @@ var icingModel = func {
|
|||
var c = icing3 + melt;
|
||||
if (icing3 < 0.0 and !pause) {
|
||||
setprop("/sim/model/icing/iceable[2]/ice-inches", 0.0);
|
||||
} else if (rengine) {
|
||||
} else if (rengAnti) {
|
||||
setprop("/sim/model/icing/iceable[2]/ice-inches", c);
|
||||
} else if (!pause and !rengine) {
|
||||
} else if (!pause and !rengAnti) {
|
||||
setprop("/sim/model/icing/iceable[2]/ice-inches", t);
|
||||
}
|
||||
|
||||
|
@ -149,32 +149,33 @@ var icingModel = func {
|
|||
setprop("/systems/icing/icingcond", 0);
|
||||
}
|
||||
|
||||
#################
|
||||
# Wing Anti-Ice #
|
||||
#################
|
||||
|
||||
# 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) {
|
||||
# On the ground
|
||||
if (wowl and wowr and wingBtn) {
|
||||
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/WingHasBeenTurnedOff", 1);
|
||||
setprop("/controls/deice/wing", 0);
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
}, 30.5);
|
||||
} else if (wingBtn and PSI >= 10 and !wowl and !wowr) {
|
||||
settimer(func() {
|
||||
setprop("/controls/deice/GroundModeFinished", 1);
|
||||
}, 31);
|
||||
} else if (wingBtn and !wowl and !wowr) { # In the air
|
||||
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) {
|
||||
} else if (!wingBtn) {
|
||||
setprop("/controls/switches/wingfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
|
@ -183,35 +184,97 @@ var icingModel = func {
|
|||
}
|
||||
});
|
||||
|
||||
if (WingHasBeenTurnedOff and !wowl and !wowr and GroundModeFinished) {
|
||||
setprop("/controls/deice/wing", 1);
|
||||
setprop("/controls/switches/WingHasBeenTurnedOff", 0);
|
||||
}
|
||||
|
||||
|
||||
# If we have low pressure we have a fault
|
||||
if (PSI < 10) {
|
||||
setprop("/controls/switches/wingfault", 1);
|
||||
setprop("/controls/deice/wing", 0);
|
||||
}
|
||||
|
||||
if (PSI > 10 and wingFault) {
|
||||
setprop("/controls/switches/wingfault", 0);
|
||||
if (wingBtn) {
|
||||
setprop("/controls/deice/wing", 1);
|
||||
}
|
||||
}
|
||||
|
||||
#################
|
||||
# LEng Anti-Ice #
|
||||
#################
|
||||
|
||||
setlistener("/controls/switches/leng", func {
|
||||
if (lengBtn) {
|
||||
setprop("/controls/switches/lengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/lengfault", 0);
|
||||
setprop("/controls/deice/lengine", 1);
|
||||
}, 0.5);
|
||||
} else if (!lengBtn) {
|
||||
setprop("/controls/switches/lengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/lengfault", 0);
|
||||
setprop("/controls/deice/lengine", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
});
|
||||
|
||||
#################
|
||||
# REng Anti-Ice #
|
||||
#################
|
||||
|
||||
setlistener("/controls/switches/reng", func {
|
||||
if (rengBtn) {
|
||||
setprop("/controls/switches/rengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/rengfault", 0);
|
||||
setprop("/controls/deice/rengine", 1);
|
||||
}, 0.5);
|
||||
} else if (!rengBtn) {
|
||||
setprop("/controls/switches/rengfault", 1);
|
||||
settimer(func() {
|
||||
setprop("/controls/switches/rengfault", 0);
|
||||
setprop("/controls/deice/rengine", 0);
|
||||
}, 0.5);
|
||||
}
|
||||
});
|
||||
|
||||
##################
|
||||
# Probe Anti-Ice #
|
||||
##################
|
||||
|
||||
if (PitotIcing > 0.03) {
|
||||
if (!PitotFailed) {
|
||||
setprop("/systems/pitot/failed", 1);
|
||||
}
|
||||
} else if (PitotIcing < 0.03) {
|
||||
if (PitotFailed) {
|
||||
setprop("/systems/pitot/failed", 0);
|
||||
}
|
||||
}
|
||||
|
||||
setlistener("/controls/switches/windowprobeheat", func {
|
||||
var windowprb = getprop("/controls/switches/windowprobeheat");
|
||||
var fault = getprop("/controls/switches/windowprobeheatfault");
|
||||
if (windowprb == 0.5) { # if in auto
|
||||
var wowl = getprop("/gear/gear[1]/wow");
|
||||
var wowr = getprop("/gear/gear[2]/wow");
|
||||
var stateL = getprop("/engines/engine[0]/state");
|
||||
var stateR = getprop("/engines/engine[1]/state");
|
||||
var fault = getprop("/controls/switches/windowprobeheatfault");
|
||||
if (!wowl or !wowr and !fault) {
|
||||
if (!wowl or !wowr) {
|
||||
setprop("/controls/deice/windowprobeheat", 1);
|
||||
} else if (stateL == 3 or stateR == 3 and !fault) {
|
||||
} else if (stateL == 3 or stateR == 3) {
|
||||
setprop("/controls/deice/windowprobeheat", 1);
|
||||
}
|
||||
} else if (windowprb == 1 and !fault) { # if in ON
|
||||
setprop("/controls/deice/windowprobeheat", 1);
|
||||
} else if (fault) {
|
||||
setprop("/controls/deice/windowprobeheat", 0);
|
||||
} else {
|
||||
setprop("/controls/deice/windowprobeheat", 0);
|
||||
} else if (windowprb == 1) { # if in ON
|
||||
setprop("/controls/deice/windowprobeheat", 1);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
###################
|
||||
|
|
|
@ -192,13 +192,14 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
systems.pneu_init();
|
||||
systems.hyd_init();
|
||||
systems.fuel_init();
|
||||
systems.fire_init();
|
||||
systems.eng_init();
|
||||
fmgc.APinit();
|
||||
librariesLoop.start();
|
||||
fmgc.FMGCinit();
|
||||
mcdu1.MCDU_init();
|
||||
mcdu2.MCDU_init();
|
||||
icing.PitotIcingReset();
|
||||
libraries.CVR.start();
|
||||
icing.icingInit();
|
||||
var autopilot = gui.Dialog.new("sim/gui/dialogs/autopilot/dialog", "Aircraft/A320Family/Systems/autopilot-dlg.xml");
|
||||
setprop("/it-autoflight/input/fd1", 1);
|
||||
|
|
|
@ -1024,6 +1024,21 @@
|
|||
</volume>
|
||||
</switch>
|
||||
|
||||
<cvrtone>
|
||||
<name>CVRtone</name>
|
||||
<mode>once</mode>
|
||||
<path>Aircraft/A320Family/Sounds/Cockpit/700hz.wav</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>controls/CVR/tone</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<factor>0.60</factor>
|
||||
</volume>
|
||||
</cvrtone>
|
||||
|
||||
<relay>
|
||||
<name>RelayBatt</name>
|
||||
<mode>once</mode>
|
||||
|
|
BIN
Sounds/Cockpit/700hz.wav
Normal file
BIN
Sounds/Cockpit/700hz.wav
Normal file
Binary file not shown.
|
@ -527,4 +527,25 @@
|
|||
</input>
|
||||
<output>/systems/pressurization/targetvs</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Icing Severity</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<update-interval-secs type="double">0.1</update-interval-secs>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/systems/icing/severity</property>
|
||||
<entry><ind>0</ind><dep>-0.00000166</dep></entry>
|
||||
<entry><ind>1</ind><dep> 0.00000277</dep></entry>
|
||||
<entry><ind>2</ind><dep> 0.00000277</dep></entry>
|
||||
<entry><ind>3</ind><dep> 0.00000554</dep></entry>
|
||||
<entry><ind>4</ind><dep> 0.00001108</dep></entry>
|
||||
<entry><ind>5</ind><dep> 0.00002216</dep></entry>
|
||||
</table>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/systems/icing/factor</output>
|
||||
</filter>
|
||||
</PropertyList>
|
||||
|
|
Reference in a new issue