1
0
Fork 0

Add wing anti ice / engine anti ice simulation

This commit is contained in:
legoboyvdlp R 2020-05-11 15:57:23 +01:00
parent e1c82555c3
commit 60c18d5282
11 changed files with 363 additions and 232 deletions

View file

@ -24,23 +24,30 @@
<display-contrast type="double">0.7</display-contrast>
<icing>
<iceable>
<name>Wing</name>
<name>WingLeft</name>
<ice-inches>0.0</ice-inches>
<salvage-control>/controls/deice/wing</salvage-control>
<salvage-control>/systems/pneumatics/valves/wing-ice-1</salvage-control>
<sensitivity type="double">0.8</sensitivity>
<output-property>/fdm/jsbsim/ice/wing</output-property>
<output-property>/fdm/jsbsim/ice/wingL</output-property>
</iceable>
<iceable>
<name>WingRight</name>
<ice-inches>0.0</ice-inches>
<salvage-control>/systems/pneumatics/valves/wing-ice-2</salvage-control>
<sensitivity type="double">0.8</sensitivity>
<output-property>/fdm/jsbsim/ice/wingR</output-property>
</iceable>
<iceable>
<name>LeftEngine</name>
<ice-inches>0.0</ice-inches>
<salvage-control>/controls/deice/lengine</salvage-control>
<salvage-control>/systems/pneumatics/valves/engine-ice-1</salvage-control>
<sensitivity type="double">0.5</sensitivity>
<output-property>/fdm/jsbsim/ice/lengine</output-property>
</iceable>
<iceable>
<name>RightEngine</name>
<ice-inches>0.0</ice-inches>
<salvage-control>/controls/deice/rengine</salvage-control>
<salvage-control>/systems/pneumatics/valves/engine-ice-2</salvage-control>
<sensitivity type="double">0.5</sensitivity>
<output-property>/fdm/jsbsim/ice/rengine</output-property>
</iceable>
@ -1049,6 +1056,12 @@
<yellow-elec type="bool">0</yellow-elec>
<yellow-leak type="bool">0</yellow-leak>
</hydraulic>
<icing>
<wing-left-valve type="bool">0</wing-left-valve>
<wing-right-valve type="bool">0</wing-right-valve>
<engine-left-valve type="bool">0</engine-left-valve>
<engine-right-valve type="bool">0</engine-right-valve>
</icing>
<pneumatics>
<apu-valve type="bool">0</apu-valve>
<bleed-1-valve type="bool">0</bleed-1-valve>
@ -1205,6 +1218,8 @@
<engine-2-prv-valve type="double">0</engine-2-prv-valve>
<engine-1-prv-valve-disag type="bool">0</engine-1-prv-valve-disag>
<engine-2-prv-valve-disag type="bool">0</engine-2-prv-valve-disag>
<wing-ice-1 type="double">0</wing-ice-1>
<wing-ice-2 type="double">0</wing-ice-2>
<pack-1 type="double">0</pack-1>
<pack-2 type="double">0</pack-2>
<starter-valve-1 type="double">0</starter-valve-1>

View file

@ -103,8 +103,7 @@ var precooler2_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-
var bmc1working = props.globals.getNode("/systems/pneumatics/indicating/bmc1-working", 1);
var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1);
var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1);
var switch_wing_aice = props.globals.getNode("/controls/switches/wing", 1);
var deice_wing = props.globals.getNode("/controls/deice/wing", 1);
var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 1);
var eng1_n2_actual = props.globals.getNode("/engines/engine[0]/n2-actual", 1);
var eng2_n2_actual = props.globals.getNode("/engines/engine[1]/n2-actual", 1);
var pack1_out_temp = props.globals.getNode("/systems/pneumatics/pack-1-out-temp", 1);
@ -935,21 +934,6 @@ var canvas_lowerECAM_bleed = {
if (switch_wing_aice.getValue() == 1) {
me["BLEED-Anti-Ice-Left"].show();
me["BLEED-Anti-Ice-Right"].show();
# TODO when seperated valves for left and right wing are implemented, do the following `if` and `else` clause for each wing.
if (deice_wing.getValue()) {
me["BLEED-ANTI-ICE-ARROW-LEFT"].show();
me["BLEED-ANTI-ICE-ARROW-RIGHT"].show();
#if (total_psi.getValue() < 4 or total_psi.getValue() > 57) {
# me["BLEED-ANTI-ICE-ARROW-LEFT"].setColor(0.7333,0.3803,0);
# me["BLEED-ANTI-ICE-ARROW-RIGHT"].setColor(0.7333,0.3803,0);
#} else {
# me["BLEED-ANTI-ICE-ARROW-LEFT"].setColor(0.0509,0.7529,0.2941);
# me["BLEED-ANTI-ICE-ARROW-RIGHT"].setColor(0.0509,0.7529,0.2941);
#}
} else {
me["BLEED-ANTI-ICE-ARROW-LEFT"].hide();
me["BLEED-ANTI-ICE-ARROW-RIGHT"].hide();
}
} else {
me["BLEED-Anti-Ice-Left"].hide();
me["BLEED-Anti-Ice-Right"].hide();

View file

@ -40,9 +40,9 @@
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview371"
showgrid="false"
showgrid="true"
inkscape:zoom="0.73868665"
inkscape:cx="667.77011"
inkscape:cx="712.19908"
inkscape:cy="792.63918"
inkscape:window-x="-8"
inkscape:window-y="-8"
@ -1141,12 +1141,12 @@
transform="scale(0.94655352,1.0564643)"
inkscape:label="#text3720"
id="APUGentext-7-2-1-3-6-1"
y="426.34195"
x="148.62262"
y="417.6925"
x="130.38766"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32.18700027px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#cecdce;fill-opacity:1;stroke:none;stroke-width:2.68228602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="426.34195"
x="148.62262"
y="417.6925"
x="130.38766"
id="tspan5816-7"
sodipodi:role="line">ANTI</tspan></text>
<path
@ -1159,12 +1159,12 @@
transform="scale(0.94655352,1.0564643)"
inkscape:label="#text3720"
id="APUGentext-7-2-1-3-6-7-5"
y="457.41693"
x="171.19373"
y="448.76749"
x="152.95877"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32.18700027px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#cecdce;fill-opacity:1;stroke:none;stroke-width:2.68228602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="457.41693"
x="171.19373"
y="448.76749"
x="152.95877"
id="tspan5836-7"
sodipodi:role="line">ICE</tspan></text>
</g>

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View file

@ -30,6 +30,10 @@
<object-name>ELAC1Btn1F</object-name>
<object-name>ELAC1Btn2O</object-name>
<object-name>EmerExtLtBtn2O</object-name>
<object-name>Eng1AntiIceBtn1F</object-name>
<object-name>Eng1AntiIceBtn2O</object-name>
<object-name>Eng2AntiIceBtn1F</object-name>
<object-name>Eng2AntiIceBtn2O</object-name>
<object-name>ExtPwrBtn2O</object-name>
<object-name>FAC1Btn1F</object-name>
<object-name>FAC1Btn2O</object-name>
@ -42,6 +46,8 @@
<object-name>RamAirBtn2O</object-name>
<object-name>SEC1Btn1F</object-name>
<object-name>SEC1Btn2O</object-name>
<object-name>WingAntiIceBtn1F</object-name>
<object-name>WingAntiIceBtn2O</object-name>
<object-name>VentBlowBtn1F</object-name>
<condition>
<greater-than-equals>
@ -110,10 +116,6 @@
<object-name>EmerCallBtn1C</object-name>
<object-name>EmerCallBtn2O</object-name>
<object-name>EmerGenInd1F</object-name>
<object-name>Eng1AntiIceBtn1F</object-name>
<object-name>Eng1AntiIceBtn2O</object-name>
<object-name>Eng2AntiIceBtn1F</object-name>
<object-name>Eng2AntiIceBtn2O</object-name>
<object-name>Eng1ManStartBtn2O</object-name>
<object-name>Eng2ManStartBtn2O</object-name>
<object-name>EvacCommandBtn1E</object-name>
@ -164,8 +166,6 @@
<object-name>VentBlowBtn2O</object-name>
<object-name>VentExtractBtn1F</object-name>
<object-name>VentExtractBtn2O</object-name>
<object-name>WingAntiIceBtn1F</object-name>
<object-name>WingAntiIceBtn2O</object-name>
<object-name>YellowElecPump1F</object-name>
<object-name>YellowElecPump2O</object-name>
<object-name>YellowEngPump1F</object-name>
@ -5335,12 +5335,12 @@
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<property>systems/electrical/bus/dc-ess-shed</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/switches/wing</property>
<property>controls/ice-protection/wing</property>
</binding>
<binding>
<command>nasal</command>
@ -5355,7 +5355,7 @@
<condition>
<or>
<equals>
<property>controls/switches/wingfault</property>
<property>controls/ice-protection/wingfault</property>
<value>1</value>
</equals>
<equals>
@ -5372,7 +5372,7 @@
<condition>
<or>
<equals>
<property>controls/switches/wing</property>
<property>controls/ice-protection/wing</property>
<value>1</value>
</equals>
<equals>
@ -5396,12 +5396,12 @@
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<property>systems/electrical/bus/dc-1</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/switches/leng</property>
<property>controls/ice-protection/leng</property>
</binding>
<binding>
<command>nasal</command>
@ -5416,7 +5416,7 @@
<condition>
<or>
<equals>
<property>controls/switches/lengfault</property>
<property>controls/ice-protection/lengfault</property>
<value>1</value>
</equals>
<equals>
@ -5433,7 +5433,7 @@
<condition>
<or>
<equals>
<property>controls/switches/leng</property>
<property>controls/ice-protection/leng</property>
<value>1</value>
</equals>
<equals>
@ -5457,12 +5457,12 @@
<binding>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<property>systems/electrical/bus/dc-2</property>
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/switches/reng</property>
<property>controls/ice-protection/reng</property>
</binding>
<binding>
<command>nasal</command>
@ -5477,7 +5477,7 @@
<condition>
<or>
<equals>
<property>controls/switches/rengfault</property>
<property>controls/ice-protection/rengfault</property>
<value>1</value>
</equals>
<equals>
@ -5494,7 +5494,7 @@
<condition>
<or>
<equals>
<property>controls/switches/reng</property>
<property>controls/ice-protection/reng</property>
<value>1</value>
</equals>
<equals>
@ -5525,7 +5525,7 @@
</greater-than-equals>
</condition>
<command>property-cycle</command>
<property>controls/switches/windowprobeheat</property>
<property>controls/ice-protection/windowprobeheat</property>
<value>0.5</value>
<value>1</value>
</binding>
@ -5542,7 +5542,7 @@
<condition>
<or>
<equals>
<property>controls/switches/windowprobeheat</property>
<property>controls/ice-protection/windowprobeheat</property>
<value>1</value>
</equals>
<equals>

View file

@ -15,7 +15,7 @@ var state1Node = props.globals.getNode("engines/engine[0]/state", 1);
var state2Node = props.globals.getNode("engines/engine[1]/state", 1);
var wowNode = props.globals.getNode("fdm/jsbsim/position/wow", 1);
var apu_rpm = props.globals.getNode("engines/engine[2]/n1", 1);
var wing_pb = props.globals.getNode("controls/switches/wing", 1);
var wing_pb = props.globals.getNode("controls/ice-protection/wing", 1);
var apumaster = props.globals.getNode("controls/apu/master", 1);
var apu_bleedSw = props.globals.getNode("controls/pneumatics/switches/apu", 1);
var gear = props.globals.getNode("gear/gear-pos-norm", 1);
@ -1236,7 +1236,7 @@ var messages_priority_2 = func {
warningNodes.Timers.bleed1Fault.setValue(0);
}
if (bleed1Fault.clearFlag == 0 and (phaseVar == 2 or phaseVar == 6 or phaseVar == 9) and warningNodes.Timers.bleed1FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and getprop("/controls/switches/wing")))) { # inverse pulse
if (bleed1Fault.clearFlag == 0 and (phaseVar == 2 or phaseVar == 6 or phaseVar == 9) and warningNodes.Timers.bleed1FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and getprop("/controls/ice-protection/wing")))) { # inverse pulse
bleed1Fault.active = 1;
} else {
ECAM_controller.warningReset(bleed1Fault);
@ -1249,7 +1249,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(bleed1FaultOff);
}
if (bleed1FaultPack.clearFlag == 0 and systems.PNEU.Switch.pack1.getBoolValue() and systems.PNEU.Switch.pack2.getBoolValue() and getprop("/controls/switches/wing")) {
if (bleed1FaultPack.clearFlag == 0 and systems.PNEU.Switch.pack1.getBoolValue() and systems.PNEU.Switch.pack2.getBoolValue() and getprop("/controls/ice-protection/wing")) {
bleed1FaultPack.active = 1;
} else {
ECAM_controller.warningReset(bleed1FaultPack);
@ -1273,7 +1273,7 @@ var messages_priority_2 = func {
warningNodes.Timers.bleed2Fault.setValue(0);
}
if (bleed2Fault.clearFlag == 0 and (phaseVar == 2 or phaseVar == 6 or phaseVar == 9) and warningNodes.Timers.bleed2FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and getprop("/controls/switches/wing")))) { # inverse pulse
if (bleed2Fault.clearFlag == 0 and (phaseVar == 2 or phaseVar == 6 or phaseVar == 9) and warningNodes.Timers.bleed2FaultOutput.getValue() == 1 and (!systems.PNEU.Switch.pack1.getBoolValue() or !systems.PNEU.Switch.pack2.getBoolValue() or !(getprop("/ECAM/phases/wing-anti-ice-pulse") and getprop("/controls/ice-protection/wing")))) { # inverse pulse
bleed2Fault.active = 1;
} else {
ECAM_controller.warningReset(bleed2Fault);
@ -1286,7 +1286,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(bleed2FaultOff);
}
if (bleed2FaultPack.clearFlag == 0 and systems.PNEU.Switch.pack1.getValue() and systems.PNEU.Switch.pack2.getValue() and getprop("/controls/switches/wing")) {
if (bleed2FaultPack.clearFlag == 0 and systems.PNEU.Switch.pack1.getValue() and systems.PNEU.Switch.pack2.getValue() and getprop("/controls/ice-protection/wing")) {
bleed2FaultPack.active = 1;
} else {
ECAM_controller.warningReset(bleed2FaultPack);
@ -1337,7 +1337,7 @@ var messages_priority_2 = func {
}
if (warningNodes.Logic.crossbleedWai.getValue()) {
if (getprop("/controls/switches/wing")) {
if (getprop("/controls/ice-protection/wing")) {
xBleedOff.active = 1;
} else {
ECAM_controller.warningReset(xBleedOff);
@ -2051,13 +2051,13 @@ var messages_right_memo = func {
ldg_lt.active = 0;
}
if (getprop("controls/switches/leng") == 1 or getprop("controls/switches/reng") == 1 or getprop("systems/electrical/bus/dc-1") == 0 or getprop("systems/electrical/bus/dc-2") == 0) {
if (getprop("controls/ice-protection/leng") == 1 or getprop("controls/ice-protection/reng") == 1 or getprop("systems/electrical/bus/dc-1") == 0 or getprop("systems/electrical/bus/dc-2") == 0) {
eng_aice.active = 1;
} else {
eng_aice.active = 0;
}
if (getprop("controls/switches/wing") == 1) {
if (getprop("controls/ice-protection/wing") == 1) {
wing_aice.active = 1;
} else {
wing_aice.active = 0;

View file

@ -296,6 +296,48 @@ var warnings = std.Vector.new([
var bleedMon1Fault = warning.new(msg: "BLEED MONIT SYS 1 FAULT", colour: "a", aural: 0, light: 0),
var bleedMon2Fault = warning.new(msg: "BLEED MONIT SYS 2 FAULT", colour: "a", aural: 0, light: 0),
# Eng AICE
var eng1IceClosed = warning.new(msg: "ANTI ICE ENG1 VALVE CLSD", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng1IceClosedIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
var eng2IceClosed = warning.new(msg: "ANTI ICE ENG2 VALVE CLSD", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng2IceClosedIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
var eng1IceOpen = warning.new(msg: "ANTI ICE ENG1 VALVE OPEN", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng1IceOpenThrust = warning.new(msg: " THRUST LIM PENALTY", colour: "c"),
var eng2IceOpen = warning.new(msg: "ANTI ICE ENG2 VALVE OPEN", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng2IceOpenThrust = warning.new(msg: " THRUST LIM PENALTY", colour: "c"),
# Wing AICE
var wingIceSysFault = warning.new(msg: "WING A.ICE SYS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var wingIceSysFaultXbld = warning.new(msg: " -X BLEED...........OPEN", colour: "c"),
var wingIceSysFaultOff = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var wingIceSysFaultIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
var wingIceLOpen = warning.new(msg: "WING A.ICE L VALVE OPEN", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var wingIceLOpenOff = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var wingIceLOpenEngOff = warning.new(msg: " -ENG1 BLEED.........OFF", colour: "c"),
var wingIceLOpenXbld = warning.new(msg: " -X BLEED...........SHUT", colour: "c"),
var wingIceLOpenApuOff = warning.new(msg: " -APU BLEED..........OFF", colour: "c"),
var wingIceLOpenSpacer = warning.new(msg: " ", colour: "c"),
var wingIceLOpenFlt = warning.new(msg: " WAI AVAIL IN FLT", colour: "c"),
var wingIceLOpenEngOn = warning.new(msg: " -ENG1 BLEED.........OFF", colour: "c"),
var wingIceLOpenIceReq = warning.new(msg: " -WING ANTI ICE..AS RQRD", colour: "c"),
var wingIceLOpenThrust = warning.new(msg: " THRUST LIM PENALTY", colour: "c"),
var wingIceROpen = warning.new(msg: "WING A.ICE R VALVE OPEN", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var wingIceROpenOff = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var wingIceROpenEngOff = warning.new(msg: " -ENG2 BLEED.........OFF", colour: "c"),
var wingIceROpenXbld = warning.new(msg: " -X BLEED...........SHUT", colour: "c"),
var wingIceROpenApuOff = warning.new(msg: " -APU BLEED..........OFF", colour: "c"),
var wingIceROpenSpacer = warning.new(msg: " ", colour: "c"),
var wingIceROpenFlt = warning.new(msg: " WAI AVAIL IN FLT", colour: "c"),
var wingIceROpenEngOn = warning.new(msg: " -ENG2 BLEED.........OFF", colour: "c"),
var wingIceROpenIceReq = warning.new(msg: " -WING ANTI ICE..AS RQRD", colour: "c"),
var wingIceROpenThrust = warning.new(msg: " THRUST LIM PENALTY", colour: "c"),
var wingIceOpenGnd = warning.new(msg: "WING A.ICE OPEN ON GND", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var wingIceOpenGndShut = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var wingIceLHiPr = warning.new(msg: "WING A.ICE L HI PR", colour: "a", aural: 0, light: 0, isMainMsg: 1),
var wingIceLHiPrThrust = warning.new(msg: " THRUST LIM PENTALTY", colour: "c"),
var wingIceRHiPr = warning.new(msg: "WING A.ICE R HI PR", colour: "a", aural: 0, light: 0, isMainMsg: 1),
var wingIceRHiPrThrust = warning.new(msg: " THRUST LIM PENTALTY", colour: "c"),
# FIRE det fault
var eng1FireDetFault = warning.new(msg: "ENG 1 FIRE DET FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng1LoopAFault = warning.new(msg: "ENG 1 FIRE LOOP A FAULT", colour: "a", isMainMsg: 1),

View file

@ -100,7 +100,6 @@ var pause = 0;
var windowprobe = 0;
var wingBtn = 0;
var wingFault = 0;
var wingAnti = 0;
var PSI = 0;
var wowl = 0;
var wowr = 0;
@ -110,8 +109,6 @@ var lengBtn = 0;
var lengFault = 0;
var rengBtn = 0;
var rengFault = 0;
var lengAnti = 0;
var rengAnti = 0;
var WingHasBeenTurnedOff = 0;
var GroundModeFinished = 0;
var windowprb = 0;
@ -121,21 +118,16 @@ var stateR = 0;
var iceables = [];
var icingInit = func {
setprop("controls/switches/windowprobeheat", 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);
setprop("/controls/ice-protection/windowprobeheat", 0);
setprop("/controls/ice-protection/wingfault", 0);
setprop("/controls/ice-protection/wing", 0);
setprop("/controls/ice-protection/leng", 0);
setprop("/controls/ice-protection/lengfault", 0);
setprop("/controls/ice-protection/reng", 0);
setprop("/controls/ice-protection/rengfault", 0);
setprop("/controls/deice/windowprobeheat", 0);
setprop("/systems/pitot/icing", 0.0);
setprop("/systems/pitot/failed", 1);
iceables = props.globals.getNode("sim/model/icing", 1).getChildren("iceable");
forindex(var i; iceables) {
@ -147,24 +139,19 @@ var icingInit = func {
var icingModel = func {
speed = getprop("velocities/airspeed-kt");
pause = getprop("sim/freeze/master");
windowprobe = getprop("controls/deice/windowprobeheat");
wingBtn = getprop("controls/switches/wing");
wingFault = getprop("controls/switches/wingfault");
wingAnti = getprop("controls/deice/wing");
#PSI = getprop("systems/pneumatic/total-psi");
pause = getprop("/sim/freeze/master");
windowprobe = getprop("/controls/deice/windowprobeheat");
wingBtn = getprop("/controls/ice-protection/wing");
wingFault = getprop("/controls/ice-protection/wingfault");
#PSI = getprop("/systems/pneumatic/total-psi");
wowl = getprop("gear/gear[1]/wow");
wowr = getprop("gear/gear[2]/wow");
PitotIcing = getprop("systems/pitot/icing");
PitotFailed = getprop("systems/pitot/failed");
lengBtn = getprop("controls/switches/leng");
lengFault = getprop("controls/switches/lengfault");
rengBtn = getprop("controls/switches/reng");
rengFault = getprop("controls/switches/rengfault");
lengAnti = getprop("controls/deice/lengine");
rengAnti = getprop("controls/deice/rengine");
WingHasBeenTurnedOff = getprop("controls/deice/WingHasBeenTurnedOff");
GroundModeFinished = getprop("controls/deice/GroundModeFinished");
PitotIcing = getprop("/systems/pitot/icing");
PitotFailed = getprop("/systems/pitot/failed");
lengBtn = getprop("/controls/ice-protection/leng");
lengFault = getprop("/controls/ice-protection/lengfault");
rengBtn = getprop("/controls/ice-protection/reng");
rengFault = getprop("/controls/ice-protection/rengfault");
var factor = icing_factor();
foreach(iceable; iceables) {
@ -173,156 +160,49 @@ var icingModel = func {
effects.frost_norm.setDoubleValue(effects.frost_inch.getValue() * 50);
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);
# }
#}
if (PitotIcing > 0.03) {
if (!PitotFailed) {
setprop("systems/pitot/failed", 1);
setprop("/systems/pitot/failed", 1);
}
} else if (PitotIcing < 0.03) {
if (PitotFailed) {
setprop("systems/pitot/failed", 0);
setprop("/systems/pitot/failed", 0);
}
}
# if ((getprop("systems/electrical/bus/dc-1") == 0 or getprop("systems/electrical/bus/dc-2") == 0) and getprop("fdm/jsbsim/position/wow") == 0) {
# setprop("controls/switches/leng", 1);
# setprop("controls/switches/reng", 1);
# if ((getprop("/systems/electrical/bus/dc-1") == 0 or getprop("/systems/electrical/bus/dc-2") == 0) and getprop("fdm/jsbsim/position/wow") == 0) {
# setprop("/controls/ice-protection/leng", 1);
# setprop("/controls/ice-protection/reng", 1);
# }
#if (getprop("systems/electrical/bus/dc-ess-shed") == 0) {
# setprop("controls/switches/wing", 0);
#if (getprop("/systems/electrical/bus/dc-ess-shed") == 0) {
# setprop("/controls/ice-protection/wing", 0);
#}
}
#################
# LEng Anti-Ice #
#################
setlistener("/controls/switches/leng", func {
if (getprop("controls/switches/leng") == 1 and getprop("engines/engine[0]/state") == 3) {
setprop("controls/switches/lengfault", 1);
settimer(func() {
setprop("controls/switches/lengfault", 0);
setprop("controls/deice/lengine", 1);
}, 0.5);
} else if (getprop("controls/switches/leng") == 0) {
setprop("controls/switches/lengfault", 1);
settimer(func() {
setprop("controls/switches/lengfault", 0);
setprop("controls/deice/lengine", 0);
}, 0.5);
}
});
setlistener("/engines/engine[0]/state", func {
if (getprop("engines/engine[0]/state") != 3) {
setprop("controls/switches/leng", 0);
}
});
#################
# REng Anti-Ice #
#################
setlistener("/controls/switches/reng", func {
if (getprop("controls/switches/reng") == 1 and getprop("engines/engine[1]/state") == 3) {
setprop("controls/switches/rengfault", 1);
settimer(func() {
setprop("controls/switches/rengfault", 0);
setprop("controls/deice/rengine", 1);
}, 0.5);
} else if (getprop("controls/switches/reng") == 0) {
setprop("controls/switches/rengfault", 1);
settimer(func() {
setprop("controls/switches/rengfault", 0);
setprop("controls/deice/rengine", 0);
}, 0.5);
}
});
setlistener("/engines/engine[1]/state", func {
if (getprop("engines/engine[1]/state") != 3) {
setprop("controls/switches/reng", 0);
}
});
##################
# Probe Anti-Ice #
##################
setlistener("/controls/switches/windowprobeheat", func {
windowprb = getprop("controls/switches/windowprobeheat");
setlistener("/controls/ice-protection/windowprobeheat", func {
windowprb = getprop("/controls/ice-protection/windowprobeheat");
if (windowprb == 0.5) { # if in auto
wowl = getprop("gear/gear[1]/wow");
wowr = getprop("gear/gear[2]/wow");
stateL = getprop("engines/engine[0]/state");
stateR = getprop("engines/engine[1]/state");
if (!wowl or !wowr) {
setprop("controls/deice/windowprobeheat", 1);
setprop("/controls/deice/windowprobeheat", 1);
} else if (stateL == 3 or stateR == 3) {
setprop("controls/deice/windowprobeheat", 1);
setprop("/controls/deice/windowprobeheat", 1);
}
} else if (windowprb == 1) { # if in ON
setprop("controls/deice/windowprobeheat", 1);
setprop("/controls/deice/windowprobeheat", 1);
} else {
setprop("controls/deice/windowprobeheat", 0);
setprop("/controls/deice/windowprobeheat", 0);
}
});
#################
# Wing Anti-Ice #
#################
# Switching on the wing anti-ice
setlistener("/controls/switches/wing", func {
wowl = getprop("gear/gear[1]/wow");
wowr = getprop("gear/gear[2]/wow");
wingBtn = getprop("controls/switches/wing");
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/deice/WingHasBeenTurnedOff", 1);
setprop("controls/deice/wing", 0);
}, 30.5);
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) {
setprop("controls/switches/wingfault", 1);
settimer(func() {
setprop("controls/switches/wingfault", 0);
setprop("controls/deice/wing", 0);
}, 0.5);
}
});
###################
# Update Function #
###################

View file

@ -4,7 +4,8 @@
<aerodynamics>
<property value="0.0">ice/wing</property>
<property value="0.0">ice/wingL</property>
<property value="0.0">ice/wingR</property>
<property value="0">rubbish/landL</property>
<property value="0">rubbish/landR</property>
@ -143,18 +144,35 @@
</product>
</function>
<function name="aero/coefficient/CLicew">
<function name="aero/coefficient/CLicewl">
<description>Lift_decrease_due_to_ice_on_wing</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar>ice/wing</independentVar>
<independentVar>ice/wingL</independentVar>
<tableData>
0.0 0.00
0.5 -0.05
1.0 -0.15
2.0 -1.25
</tableData>
</table>
</product>
</function>
<function name="aero/coefficient/CLicewr">
<description>Lift_decrease_due_to_ice_on_wing</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar>ice/wingR</independentVar>
<tableData>
0.0 0.0
0.5 -0.1
1.0 -0.3
2.0 -1.5
0.5 -0.05
1.0 -0.15
2.0 -1.25
</tableData>
</table>
</product>
@ -337,18 +355,35 @@
</product>
</function>
<function name="aero/force/Drag_wingice">
<function name="aero/force/Drag_wingicel">
<description>Drag_due_to_ice_on_wing</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar>ice/wing</independentVar>
<independentVar>ice/wingL</independentVar>
<tableData>
0.0 0.000
0.5 0.004
1.0 0.010
2.0 0.100
0.5 0.002
1.0 0.005
2.0 0.050
</tableData>
</table>
</product>
</function>
<function name="aero/force/Drag_wingicer">
<description>Drag_due_to_ice_on_wing</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<table>
<independentVar>ice/wingR</independentVar>
<tableData>
0.0 0.000
0.5 0.002
1.0 0.005
2.0 0.050
</tableData>
</table>
</product>

View file

@ -283,7 +283,7 @@
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/controls/switches/wing eq 0
/controls/ice-protection/wing eq 0
/ECAM/warnings/logic/wai-falling-pulse eq 0
</test>
/gear/gear[1]/wow eq 1

View file

@ -115,7 +115,7 @@
/systems/pneumatics/source/engine-1-hp-psi lt 8
/systems/pneumatics/source/engine-1-hp-psi ge 120
<test logic="AND">
/controls/deice/wing eq 0
/systems/pneumatics/valves/wing-ice-1 eq 0
/systems/pneumatics/source/engine-1-hp-psi ge 110
/position/altitude-ft ge 15000
/systems/pneumatics/valves/engine-1-prv-valve eq 1
@ -143,7 +143,7 @@
/systems/pneumatics/source/engine-2-hp-psi lt 8
/systems/pneumatics/source/engine-2-hp-psi ge 120
<test logic="AND">
/controls/deice/wing eq 0
/systems/pneumatics/valves/wing-ice-2 eq 0
/systems/pneumatics/source/engine-2-hp-psi ge 110
/position/altitude-ft ge 15000
/systems/pneumatics/valves/engine-1-prv-valve eq 1
@ -377,6 +377,158 @@
<rate_limit>1.0</rate_limit> <!-- pneumatically controlled -->
</actuator>
<!-- Wing Anti Ice -->
<switch name="/systems/pneumatics/valves/wing-ice-gnd-cmd">
<default value="0"/>
<test logic="AND" value="1">
/gear/gear[1]/wow eq 1
/controls/ice-protection/wing eq 1
</test>
</switch>
<actuator name="/systems/pneumatics/valves/wing-ice-gnd">
<input>/systems/pneumatics/valves/wing-ice-gnd-cmd</input>
<rate_limit sense="incr">0.033333</rate_limit> <!-- 30 seconds -->
<rate_limit sense="decr">100</rate_limit>
</actuator>
<switch name="overwrite-wing-ice-sw">
<default value="/controls/ice-protection/wing"/>
<test logic="OR" value="0">
/systems/electrical/bus/dc-ess-shed lt 25
<test logic="AND">
/systems/pneumatics/valves/wing-ice-gnd eq 1
/gear/gear[1]/wow eq 1
/controls/ice-protection/wing eq 1
</test>
</test>
<output>/controls/ice-protection/wing</output>
</switch>
<switch name="/systems/pneumatics/valves/wing-ice-1-cmd">
<default value="0"/>
<test logic="AND" value="0">
/systems/electrical/bus/dc-ess-shed lt 25
</test>
<test logic="AND" value="1">
/controls/ice-protection/wing eq 1
</test>
</switch>
<switch name="/systems/pneumatics/valves/wing-ice-1-power">
<default value="0"/>
<test logic="OR" value="0">
/systems/failures/icing/wing-left-valve eq 1
/systems/pneumatics/psi/engine-1-psi lt 7
</test>
<test logic="AND" value="0.5">
/systems/electrical/bus/dc-ess-shed lt 25
/systems/pneumatics/valves/wing-ice-1-cmd eq 0
/systems/pneumatics/valves/wing-ice-1 ne 0
</test>
<test logic="AND" value="2">
/systems/electrical/bus/dc-ess-shed ge 25
</test>
</switch>
<actuator name="/systems/pneumatics/valves/wing-ice-1">
<input>/systems/pneumatics/valves/wing-ice-1-cmd</input>
<rate_limit>/systems/pneumatics/valves/wing-ice-1-power</rate_limit>
</actuator>
<switch name="/systems/pneumatics/valves/wing-ice-2-cmd">
<default value="0"/>
<test logic="AND" value="0">
/systems/electrical/bus/dc-ess-shed lt 25
</test>
<test logic="AND" value="1">
/controls/ice-protection/wing eq 1
</test>
</switch>
<switch name="/systems/pneumatics/valves/wing-ice-2-power">
<default value="0"/>
<test logic="OR" value="0">
/systems/failures/icing/wing-right-valve eq 1
/systems/pneumatics/psi/engine-2-psi lt 7
</test>
<test logic="AND" value="0.5">
/systems/electrical/bus/dc-ess-shed lt 25
/systems/pneumatics/valves/wing-ice-2-cmd eq 0
/systems/pneumatics/valves/wing-ice-2 ne 0
</test>
<test logic="AND" value="2">
/systems/electrical/bus/dc-ess-shed ge 25
</test>
</switch>
<actuator name="/systems/pneumatics/valves/wing-ice-2">
<input>/systems/pneumatics/valves/wing-ice-2-cmd</input>
<rate_limit>/systems/pneumatics/valves/wing-ice-2-power</rate_limit>
</actuator>
<switch name="/systems/pneumatics/valves/engine-ice-1-cmd">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-1 lt 25
</test>
<test logic="AND" value="1">
/controls/ice-protection/leng eq 1
</test>
</switch>
<switch name="/systems/pneumatics/valves/engine-ice-1-power">
<default value="0"/>
<test logic="AND" value="0">
/systems/failures/icing/engine-left-valve eq 1
/systems/pneumatics/source/engine-1-hp-psi lt 7
</test>
<test logic="AND" value="0.5">
/systems/electrical/bus/dc-1 lt 25
/systems/pneumatics/valves/engine-ice-1-cmd eq 1
/systems/pneumatics/valves/engine-ice-1 ne 1
</test>
<test logic="AND" value="2">
/systems/electrical/bus/dc-1 ge 25
</test>
</switch>
<actuator name="/systems/pneumatics/valves/engine-ice-1">
<input>/systems/pneumatics/valves/engine-ice-1-cmd</input>
<rate_limit>/systems/pneumatics/valves/engine-ice-1-power</rate_limit>
</actuator>
<switch name="/systems/pneumatics/valves/engine-ice-2-cmd">
<default value="0"/>
<test logic="AND" value="1">
/systems/electrical/bus/dc-2 lt 25
</test>
<test logic="AND" value="1">
/controls/ice-protection/reng eq 1
</test>
</switch>
<switch name="/systems/pneumatics/valves/engine-ice-2-power">
<default value="0"/>
<test logic="AND" value="0">
/systems/failures/icing/engine-right-valve eq 1
/systems/pneumatics/source/engine-1-hp-psi lt 7
</test>
<test logic="AND" value="0.5">
/systems/electrical/bus/dc-2 lt 25
/systems/pneumatics/valves/engine-ice-2-cmd eq 1
/systems/pneumatics/valves/engine-ice-2 ne 1
</test>
<test logic="AND" value="2">
/systems/electrical/bus/dc-2 ge 25
</test>
</switch>
<actuator name="/systems/pneumatics/valves/engine-ice-2">
<input>/systems/pneumatics/valves/engine-ice-2-cmd</input>
<rate_limit>/systems/pneumatics/valves/engine-ice-2-power</rate_limit>
</actuator>
</channel>
<channel name="Source PSI">
@ -825,7 +977,7 @@
<default value="0"/>
<test logic="AND" value="1">
/systems/pneumatics/precooler/temp-1 lt 150
/controls/deice/wing eq 1
/systems/pneumatics/valves/wing-ice-1 eq 1
/gear/gear[1]/wow eq 0
</test>
</switch>
@ -938,7 +1090,7 @@
<default value="0"/>
<test logic="AND" value="1">
/systems/pneumatics/precooler/temp-2 lt 150
/controls/deice/wing eq 1
/systems/pneumatics/valves/wing-ice-2 eq 1
/gear/gear[1]/wow eq 0
</test>
</switch>
@ -1073,6 +1225,29 @@
/systems/pneumatics/psi/engine-2-downstream-prv gt 57
</test>
</switch>
<switch name="/controls/ice-protection/wingfault">
<default value="0"/>
<test logic="OR" value="1">
/systems/pneumatics/valves/wing-ice-1 ne /systems/pneumatics/valves/wing-ice-1-cmd
/systems/pneumatics/valves/wing-ice-2 ne /systems/pneumatics/valves/wing-ice-2-cmd
/systems/electrical/bus/dc-ess-shed lt 25
</test>
</switch>
<switch name="/controls/ice-protection/lengfault">
<default value="0"/>
<test logic="OR" value="1">
/systems/pneumatics/valves/engine-ice-1 ne /systems/pneumatics/valves/engine-ice-1-cmd
</test>
</switch>
<switch name="/controls/ice-protection/rengfault">
<default value="0"/>
<test logic="OR" value="1">
/systems/pneumatics/valves/engine-ice-2 ne /systems/pneumatics/valves/engine-ice-2-cmd
</test>
</switch>
</channel>
</system>

View file

@ -407,7 +407,7 @@
<value>1.0</value>
</time>
<S>
<not><property>/controls/switches/wing</property></not>
<not><property>/controls/ice-protection/wing</property></not>
</S>
<output>/ECAM/phases/wing-anti-ice-pulse</output>
</flipflop>
@ -561,7 +561,7 @@
<value>1.0</value>
</time>
<S>
<property>/controls/switches/wing</property>
<property>/controls/ice-protection/wing</property>
</S>
<output>/ECAM/warnings/logic/wai-falling-pulse</output>
</flipflop>