From f94df5e467538c58d23769bf3be08c0dadae1188 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Fri, 7 Jul 2017 15:32:39 +0100 Subject: [PATCH] huge update with cargo smoke, hydraulics update with new hand pump, and huge icing update --- A320-main.xml | 1 - AircraftConfig/acconfig.nas | 2 +- AircraftConfig/main.xml | 37 +++- Models/Instruments/OHpanel/OHpanel.xml | 51 ++++-- .../OHpanel/res/buttonsCargoSmoke-grid.png | Bin 0 -> 8668 bytes .../OHpanel/res/buttonsCargoSmoke.png | Bin 0 -> 7463 bytes Nasal/PitotIcing.nas | 35 ---- Nasal/fire.nas | 172 ++++++++++++++++++ Nasal/hydraulics.nas | 11 +- Nasal/icing.nas | 171 +++++++++++------ Nasal/libraries.nas | 1 - Systems/libraries.xml | 21 +++ 12 files changed, 396 insertions(+), 106 deletions(-) create mode 100644 Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png create mode 100644 Models/Instruments/OHpanel/res/buttonsCargoSmoke.png delete mode 100644 Nasal/PitotIcing.nas create mode 100644 Nasal/fire.nas diff --git a/A320-main.xml b/A320-main.xml index e7a4431f..850b3195 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -977,7 +977,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 diff --git a/Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png b/Models/Instruments/OHpanel/res/buttonsCargoSmoke-grid.png new file mode 100644 index 0000000000000000000000000000000000000000..e053c545e2f22bb6fb491dbcbbc371bb36613745 GIT binary patch literal 8668 zcmbtaWmHsA*Pfv}MY<)V8zcshmKq6>kQ4=_yBkqj0cjW->5>6y5Rj5)=mC+Ap<`fX zK77AF-`{tAKkho`?tAvWXFuz%{hagM^9ih{K}y6x1ONa?wKP=?007{97YHE0yKgK! z%HP~Kc(&RassIci2LKopQh0lBA#~F;^#lNjssCL-KvoXjy%FC_OIHnl9Uqq*2an3e z@!P$L+0p2wmx`;iv%QPg{Vf2X;$d&&W&fJZ*U`&?O+!l;{94E!9{^wjXsIe2`7Ivi z`e!`Y%pFvmUGZccbtC9=`{g$Dgbad(6%mV9^oNEf{ykYrf|ia1>!q>1zM>Xzt z5!`!w0aefB|4^>@c?_|0Kz<4KZOX6>c9V!>i?0~oYRu}uypZL4jTQS>{(1i8rIo7z z`>0OD6{^Fv!?-#%HMP7YwW5L#@b3M4O4U&5KcC;R5qty^M6ltp5k%01u@Tq;BG~@F zhRp8tJ?e5x@DYEQK_pDV2eLX9F;$?d=%)-KxqP=PA3|kcuZRv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&fZHI33U15wl*7*LQECPQsB4mx++&fdGGq+C)R88 zwsNnF7YH@+rgee~{+1Onpa<>Dg&scwN1=CnZoZX+uTYKzHcBkv{kXC_$n$PrZ*MaY f#T5sBJt2~N9m?ihg%>3Md#}{jHo9M{35oe1kk)~n literal 0 HcmV?d00001 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/fire.nas b/Nasal/fire.nas new file mode 100644 index 00000000..f56d7d96 --- /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_fuel = 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"); + 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..3f4cc247 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -198,7 +198,6 @@ setlistener("/sim/signals/fdm-initialized", func { fmgc.FMGCinit(); mcdu1.MCDU_init(); mcdu2.MCDU_init(); - icing.PitotIcingReset(); 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/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 +