diff --git a/A320-main.xml b/A320-main.xml index e7a4431f..bee682e1 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -939,6 +939,7 @@ Aircraft/A320Family/Nasal/fuel.nas Aircraft/A320Family/Nasal/engines.nas Aircraft/A320Family/Nasal/ADIRS.nas + Aircraft/A320Family/Nasal/fire.nas Aircraft/A320Family/Nasal/fadec-common.nas @@ -977,7 +978,6 @@ Aircraft/A320Family/Nasal/icing.nas - Aircraft/A320Family/Nasal/PitotIcing.nas diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index e26f5a49..7e8e5676 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -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); diff --git a/AircraftConfig/main.xml b/AircraftConfig/main.xml index 0e224d46..44baae18 100644 --- a/AircraftConfig/main.xml +++ b/AircraftConfig/main.xml @@ -12,7 +12,7 @@ hbox left - + + false + + property-assign + /controls/fire/cargo/test + 1 + + + + Green Eng Pump pick @@ -4655,7 +4670,7 @@ property-toggle - /controls/deice/lengine + /controls/switches/leng nasal @@ -4668,10 +4683,16 @@ select Eng1AntiIceBtn1F - - /controls/switches/annun-test - 1 - + + + /controls/switches/lengfault + 1 + + + /controls/switches/annun-test + 1 + + @@ -4681,7 +4702,7 @@ - /controls/deice/lengine + /controls/switches/leng 1 @@ -4716,7 +4737,7 @@ property-toggle - /controls/deice/rengine + /controls/switches/reng nasal @@ -4729,10 +4750,16 @@ select Eng2AntiIceBtn1F - - /controls/switches/annun-test - 1 - + + + /controls/switches/rengfault + 1 + + + /controls/switches/annun-test + 1 + + @@ -4742,7 +4769,7 @@ - /controls/deice/rengine + /controls/switches/reng 1 @@ -5539,5 +5566,19 @@ + + + + pick + CVRTest + + + false + + nasal + + + + \ No newline at end of file diff --git a/Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png b/Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png new file mode 100644 index 00000000..e053c545 Binary files /dev/null and b/Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png differ diff --git a/Models/Instruments/OHpanel/res/buttonsCargoSmoke.png b/Models/Instruments/OHpanel/res/buttonsCargoSmoke.png new file mode 100644 index 00000000..836f1e9a Binary files /dev/null and b/Models/Instruments/OHpanel/res/buttonsCargoSmoke.png differ diff --git a/Nasal/PitotIcing.nas b/Nasal/PitotIcing.nas deleted file mode 100644 index dd78eaef..00000000 --- a/Nasal/PitotIcing.nas +++ /dev/null @@ -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); \ No newline at end of file diff --git a/Nasal/buttons.nas b/Nasal/buttons.nas index fe95fe16..387a0392 100644 --- a/Nasal/buttons.nas +++ b/Nasal/buttons.nas @@ -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); diff --git a/Nasal/fire.nas b/Nasal/fire.nas new file mode 100644 index 00000000..a59ff3b2 --- /dev/null +++ b/Nasal/fire.nas @@ -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); + diff --git a/Nasal/hydraulics.nas b/Nasal/hydraulics.nas index e1cddf30..27441372 100644 --- a/Nasal/hydraulics.nas +++ b/Nasal/hydraulics.nas @@ -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); diff --git a/Nasal/icing.nas b/Nasal/icing.nas index 4793f824..8be60447 100644 --- a/Nasal/icing.nas +++ b/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); - } + }); } ################### diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 0dfef6b2..30210cbc 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -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); diff --git a/Sounds/A320-common-sound.xml b/Sounds/A320-common-sound.xml index eeed580e..f12c03a6 100644 --- a/Sounds/A320-common-sound.xml +++ b/Sounds/A320-common-sound.xml @@ -1024,6 +1024,21 @@ + + CVRtone + once + Aircraft/A320Family/Sounds/Cockpit/700hz.wav + + + controls/CVR/tone + 1 + + + + 0.60 + + + RelayBatt once diff --git a/Sounds/Cockpit/700hz.wav b/Sounds/Cockpit/700hz.wav new file mode 100644 index 00000000..f075ff1a Binary files /dev/null and b/Sounds/Cockpit/700hz.wav differ diff --git a/Systems/libraries.xml b/Systems/libraries.xml index e657334a..6d049401 100644 --- a/Systems/libraries.xml +++ b/Systems/libraries.xml @@ -527,4 +527,25 @@ /systems/pressurization/targetvs + + + Icing Severity + gain + 1 + 0.1 + + + + /systems/icing/severity + 0-0.00000166 + 1 0.00000277 + 2 0.00000277 + 3 0.00000554 + 4 0.00001108 + 5 0.00002216 +
+
+ + /systems/icing/factor +