diff --git a/A320-main.xml b/A320-main.xml
index 30f2db4f..b645ef0f 100644
--- a/A320-main.xml
+++ b/A320-main.xml
@@ -3,7 +3,6 @@
-
Joshua Davidson (it0uchpods) and Jonathan Redpath (legoboyvdlp)
Pre V1.0
@@ -22,6 +21,44 @@
0
0
+
+
+ Wing
+ /controls/deice/wing
+ 0.8
+ /fdm/jsbsim/ice/wing
+
+
+ LeftEngine
+ /controls/deice/lengine
+ 0.5
+ /fdm/jsbsim/ice/lengine
+
+
+ RightEngine
+ /controls/deice/rengine
+ 0.5
+ /fdm/jsbsim/ice/rengine
+
+
+ Windshield
+ /controls/deice/windowprobeheat
+ 0.5
+
+
+
+ Fuselage
+
+ 0.3
+ /fdm/jsbsim/ice/fuselage
+
+
+ Pitot tube
+ 1
+ /controls/deice/windowprobeheat
+ /systems/pitot/icing
+
+
@@ -229,7 +266,6 @@
-
Cockpit Crew
@@ -287,45 +323,45 @@
-
-
- 0
-
- -0.45
- 0.45
- 0.045
- 0.07
- 10.0
- 0.00001 |
-
-
- -0.20
- 0.20
- -0.06
- 10.0
- 0.00001 |
-
-
- -0.9
- 1.6
- -4.0
- 0.01
- 0.30
-
-
- 0.035
- -0.05
-
-
-
-
- 0
- 0
-
-
+
+
+ 0
+
+ -0.45
+ 0.45
+ 0.045
+ 0.07
+ 10.0
+ 0.00001 |
+
+
+ -0.20
+ 0.20
+ -0.06
+ 10.0
+ 0.00001 |
+
+
+ -0.9
+ 1.6
+ -4.0
+ 0.01
+ 0.30
+
+
+ 0.035
+ -0.05
+
+
+
+
+ 0
+ 0
+
+
0
@@ -788,6 +824,10 @@
Aircraft/A320Family/Models/Instruments/ND/canvas/ND.nas
+
+ Aircraft/A320Family/Nasal/icing.nas
+ Aircraft/A320Family/Nasal/PitotIcing.nas
+
diff --git a/Models/Fuselages/A319/fuselage.xml b/Models/Fuselages/A319/fuselage.xml
index 223c9e18..67a49d2e 100644
--- a/Models/Fuselages/A319/fuselage.xml
+++ b/Models/Fuselages/A319/fuselage.xml
@@ -44,7 +44,7 @@
nasal
@@ -92,7 +92,7 @@
nasal
@@ -140,7 +140,7 @@
nasal
@@ -188,7 +188,7 @@
nasal
@@ -238,7 +238,7 @@
nasal
@@ -273,7 +273,7 @@
nasal
diff --git a/Models/Fuselages/A320/fuselage.xml b/Models/Fuselages/A320/fuselage.xml
index 1048cf90..ee16a147 100644
--- a/Models/Fuselages/A320/fuselage.xml
+++ b/Models/Fuselages/A320/fuselage.xml
@@ -44,7 +44,7 @@
nasal
@@ -92,7 +92,7 @@
nasal
@@ -140,7 +140,7 @@
nasal
@@ -188,7 +188,7 @@
nasal
diff --git a/Models/Fuselages/A320neo/fuselage.xml b/Models/Fuselages/A320neo/fuselage.xml
index 1048cf90..ee16a147 100644
--- a/Models/Fuselages/A320neo/fuselage.xml
+++ b/Models/Fuselages/A320neo/fuselage.xml
@@ -44,7 +44,7 @@
nasal
@@ -92,7 +92,7 @@
nasal
@@ -140,7 +140,7 @@
nasal
@@ -188,7 +188,7 @@
nasal
diff --git a/Models/Fuselages/A321/fuselage.xml b/Models/Fuselages/A321/fuselage.xml
index 10d67c1c..af2daea4 100644
--- a/Models/Fuselages/A321/fuselage.xml
+++ b/Models/Fuselages/A321/fuselage.xml
@@ -44,7 +44,7 @@
nasal
@@ -92,7 +92,7 @@
nasal
@@ -140,7 +140,7 @@
nasal
@@ -188,7 +188,7 @@
nasal
@@ -236,7 +236,7 @@
nasal
@@ -284,7 +284,7 @@
nasal
@@ -332,7 +332,7 @@
nasal
@@ -380,7 +380,7 @@
nasal
@@ -430,7 +430,7 @@
nasal
@@ -465,7 +465,7 @@
nasal
@@ -498,7 +498,7 @@
nasal
diff --git a/Models/Fuselages/A321neo/fuselage.xml b/Models/Fuselages/A321neo/fuselage.xml
index 10d67c1c..af2daea4 100644
--- a/Models/Fuselages/A321neo/fuselage.xml
+++ b/Models/Fuselages/A321neo/fuselage.xml
@@ -44,7 +44,7 @@
nasal
@@ -92,7 +92,7 @@
nasal
@@ -140,7 +140,7 @@
nasal
@@ -188,7 +188,7 @@
nasal
@@ -236,7 +236,7 @@
nasal
@@ -284,7 +284,7 @@
nasal
@@ -332,7 +332,7 @@
nasal
@@ -380,7 +380,7 @@
nasal
@@ -430,7 +430,7 @@
nasal
@@ -465,7 +465,7 @@
nasal
@@ -498,7 +498,7 @@
nasal
diff --git a/Models/Instruments/OHpanel/OHpanel.xml b/Models/Instruments/OHpanel/OHpanel.xml
index e966ab2b..89d30d06 100644
--- a/Models/Instruments/OHpanel/OHpanel.xml
+++ b/Models/Instruments/OHpanel/OHpanel.xml
@@ -3587,6 +3587,79 @@
+
+
+
+
+ select
+ PrbWinHeatBtn2O
+
+
+
+ /controls/switches/windowprobeheat
+ 1
+
+
+ /controls/switches/annun-test
+ 1
+
+
+
+
+
+
+ select
+ PrbWinHeatBtn2
+
+
+ /controls/switches/windowprobeheat
+ 0.5
+
+
+
+
+
+ Window Probe Heat Toggle
+ pick
+ PrbWinHeatBtn2
+ PrbWinHeatBtn2O
+ PrbWinHeatBtn1
+
+
+ false
+
+
+
+
+ /systems/electrical/battery1-amps
+ 120
+
+
+ /systems/electrical/battery2-amps
+ 120
+
+
+ /systems/electrical/bus/dc1
+ 25
+
+
+ /systems/electrical/bus/dc2
+ 25
+
+
+
+ property-cycle
+ /controls/switches/windowprobeheat
+ 0.5
+ 1
+
+
+ nasal
+
+
+
+
+
APU master switch pick
diff --git a/Models/Instruments/OHpanel/res/ohpanel.ac b/Models/Instruments/OHpanel/res/ohpanel.ac
index 93db398b..8e31332c 100644
--- a/Models/Instruments/OHpanel/res/ohpanel.ac
+++ b/Models/Instruments/OHpanel/res/ohpanel.ac
@@ -8,7 +8,53 @@ MATERIAL "OHPanelOnBat" rgb 0.8 0.8 0.8 amb 1 1 1 emis 1 1 1 spec 0.5 0.5 0.5
MATERIAL "Switch" rgb 0.678431 0.678431 0.678431 amb 0.678431 0.678431 0.678431 emis 0 0 0 spec 0 0 0 shi 32 trans 0.004
MATERIAL "ac3dmat1" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 1 1 1 shi 128 trans 0
OBJECT world
-kids 266
+kids 267
+OBJECT poly
+name "PrbWinHeatBtn2O"
+loc 0.000113685 -5.00064e-005 -4.99785e-005
+data 8
+Cube.032
+texture "buttons2.png"
+crease 30.000000
+numvert 8
+-0.01 -0.2182 -0.0109
+-0.01 -0.2182 0.0091
+-0.007 -0.2182 0.0091
+-0.007 -0.2182 -0.0109
+-0.01 -0.2282 -0.0109
+-0.01 -0.2282 0.0091
+-0.007 -0.2282 0.0091
+-0.007 -0.2282 -0.0109
+numsurf 4
+SURF 0x0
+mat 4
+refs 4
+3 0.5 0.75
+7 0.5 0.5
+4 0.5 0.5
+0 0.5 0.75
+SURF 0x0
+mat 4
+refs 4
+6 0 0.5
+2 9.31321e-008 0.75
+1 9.31321e-008 0.75
+5 0 0.5
+SURF 0x0
+mat 4
+refs 4
+7 0.5 0.5
+3 0.5 0.75
+2 9.31321e-008 0.75
+6 0 0.5
+SURF 0x0
+mat 4
+refs 4
+7 0.5 0.5
+6 0 0.5
+5 0 0.5
+4 0.5 0.5
+kids 0
OBJECT poly
name "FuelXfeedBtn1A"
loc 0.000175806 0.13925 0.04185
@@ -27946,52 +27992,6 @@ refs 4
2 9.31321e-008 1
kids 0
OBJECT poly
-name "PrbWinHeatBtn2"
-loc 0.000113685 -5.00064e-005 -4.99785e-005
-data 8
-Cube.032
-texture "buttons.png"
-crease 30.000000
-numvert 8
--0.01 -0.2182 -0.0109
--0.01 -0.2182 0.0091
--0.007 -0.2182 0.0091
--0.007 -0.2182 -0.0109
--0.01 -0.2282 -0.0109
--0.01 -0.2282 0.0091
--0.007 -0.2282 0.0091
--0.007 -0.2282 -0.0109
-numsurf 4
-SURF 0x0
-mat 4
-refs 4
-3 0.5 0.75
-7 0.5 0.5
-4 0.5 0.5
-0 0.5 0.75
-SURF 0x0
-mat 4
-refs 4
-6 0 0.5
-2 9.31321e-008 0.75
-1 9.31321e-008 0.75
-5 0 0.5
-SURF 0x0
-mat 4
-refs 4
-7 0.5 0.5
-3 0.5 0.75
-2 9.31321e-008 0.75
-6 0 0.5
-SURF 0x0
-mat 4
-refs 4
-7 0.5 0.5
-6 0 0.5
-5 0 0.5
-4 0.5 0.5
-kids 0
-OBJECT poly
name "RFuelTank1Btn1"
loc 0.000113685 -5.00064e-005 -4.99785e-005
data 8
@@ -35059,3 +35059,49 @@ refs 3
12 0 0
0 0 0
kids 0
+OBJECT poly
+name "PrbWinHeatBtn2"
+loc 0.000113685 -5.00064e-005 -4.99785e-005
+data 8
+Cube.032
+texture "buttons.png"
+crease 30.000000
+numvert 8
+-0.007 -0.2282 -0.0109
+-0.007 -0.2282 0.0091
+-0.01 -0.2282 0.0091
+-0.01 -0.2282 -0.0109
+-0.007 -0.2182 -0.0109
+-0.007 -0.2182 0.0091
+-0.01 -0.2182 0.0091
+-0.01 -0.2182 -0.0109
+numsurf 4
+SURF 0x0
+mat 4
+refs 4
+0 0.5 0.5
+1 0 0.5
+2 0 0.5
+3 0.5 0.5
+SURF 0x0
+mat 4
+refs 4
+0 0.5 0.5
+4 0.5 0.75
+5 9.31321e-008 0.75
+1 0 0.5
+SURF 0x0
+mat 4
+refs 4
+1 0 0.5
+5 9.31321e-008 0.75
+6 9.31321e-008 0.75
+2 0 0.5
+SURF 0x0
+mat 4
+refs 4
+4 0.5 0.75
+0 0.5 0.5
+3 0.5 0.5
+7 0.5 0.75
+kids 0
diff --git a/Nasal/PitotIcing.nas b/Nasal/PitotIcing.nas
new file mode 100644
index 00000000..c4cc2e4a
--- /dev/null
+++ b/Nasal/PitotIcing.nas
@@ -0,0 +1,80 @@
+#############################################################################
+# This file is part of FlightGear, the free flight simulator
+# http://www.flightgear.org/
+#
+# Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#############################################################################
+
+#########################################################################################
+# Fail the airspeed indicator due to icing of the pitot tube
+# Maintainer: Torsten Dreyer (Torsten at t3r dot de)
+#
+# inputs
+# /instrumentation/airspeed-indicator[n]/icing
+#
+# outputs
+# /instrumentation/airspeed-indicator/serviceable
+# /instrumentation/airspeed-indicator/indicated-speed-kt
+#########################################################################################
+
+var PitotIcingHandler = {};
+PitotIcingHandler.new = func {
+ var m = {};
+ m.parents = [PitotIcingHandler];
+
+ m.failAtIcelevel = arg[1];
+
+ m.baseNodeName = "/systems/pitot[" ~ arg[0] ~ "]";
+
+ print( "creating PitotIcingHandler for " ~ m.baseNodeName );
+
+ m.baseN = props.globals.getNode( m.baseNodeName );
+
+ m.icingN = m.baseN.initNode( "icing", 0.0 );
+
+ m.serviceableN = m.baseN.initNode( "serviceable", 1, "BOOL" );
+
+ setlistener( m.icingN, func { m.listener() } );
+
+ return m;
+};
+
+#########################################################################################
+# The handler. Check if ice is above threshold, then fail the device
+#########################################################################################
+
+PitotIcingHandler.listener = func {
+
+ if( me.icingN.getValue() < me.failAtIcelevel ) {
+ # everything is fine
+
+ if( me.serviceableN.getBoolValue() == 0 ) {
+ # if the inidcator failed before, re-enable it
+ print( me.baseNodeName ~ " is functional again" );
+ me.serviceableN.setBoolValue( 1 );
+ }
+
+ } else {
+ # pitot is iced
+
+ if( me.serviceableN.getBoolValue() != 0 ) {
+ # if the indicator was servicable before, fail it now
+ print( me.baseNodeName ~ " is failing" );
+ me.serviceableN.setBoolValue( 0 );
+ }
+
+ }
+};
+
+# Fail pitot at 0.03" of ice
+PitotIcingHandler.new( 0, 0.03 );
diff --git a/Nasal/icing.nas b/Nasal/icing.nas
new file mode 100644
index 00000000..17dc0fc8
--- /dev/null
+++ b/Nasal/icing.nas
@@ -0,0 +1,276 @@
+#############################################################################
+# This file is part of FlightGear, the free flight simulator
+# http://www.flightgear.org/
+#
+# Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#############################################################################
+
+#########################################################################################
+# this are the helper functions to model structural icing on airplanes
+# Maintainer: Torsten Dreyer (Torsten at t3r dot de)
+#
+# Simple model: we listen to temperature and dewpoint. If the difference (spread)
+# is near zero and temperature is below zero, icing may occour.
+#
+# inputs
+# /environment/dewpoint-degc
+# /environment/temperature-degc
+# /environment/effective-visibility-m
+# /velocities/airspeed-kt
+# /environment/icing/max-spread-degc default: 0.1
+#
+# outputs
+# /environment/icing/icing-severity numeric value of icing severity
+# /environment/icing/icing-severity-name textual representation of icing severity one of
+# none,trace,light,moderate,severe
+# /environment/icing/icing-factor ammound of ice accumulation per NAM
+
+#########################################################################
+# implementation of the global icemachine
+#########################################################################
+
+var ICING_NONE = 0;
+var ICING_TRACE = 1;
+var ICING_LIGHT = 2;
+var ICING_MODERATE = 3;
+var ICING_SEVERE = 4;
+
+# these are the names for the icing severities
+var ICING_CATEGORY = [ "none", "trace", "light", "moderate", "severe" ];
+
+# the ice accumulating factors. Inches per nautical air mile flown
+var ICING_FACTOR = [
+ # none: sublimating 0.3" / 80NM
+ -0.3/80,
+
+ # traces: 0.5" / 80NM
+ 0.5/80.0,
+
+ # light: 0.5" / 40NM
+ 0.5/40.0,
+
+ # moderate: 0.5" / 20NM
+ 0.5/20.0,
+
+ #severe: 0.5" / 10NM
+ 0.5/10
+];
+
+# since we don't know the LWC of our clouds, just define some severities
+# depending on temperature and a random offset
+# format: upper temperatur, lower temperatur, minimum severity, maximum severity
+var ICING_TEMPERATURE = [
+ [ 999, 0, ICING_NONE, ICING_NONE ],
+ [ 0, -2, ICING_NONE, ICING_MODERATE ],
+ [ -2, -12, ICING_LIGHT, ICING_SEVERE ],
+ [ -12, -20, ICING_LIGHT, ICING_MODERATE ],
+ [ -20, -30, ICING_TRACE, ICING_LIGHT ],
+ [ -30, -99, ICING_TRACE, ICING_NONE ]
+];
+
+var dewpointN = props.globals.getNode( "/environment/dewpoint-degc" );
+var temperatureN = props.globals.getNode( "/environment/temperature-degc" );
+var speedN = props.globals.getNode( "/velocities/airspeed-kt" );
+var icingRootN = props.globals.getNode( "/environment/icing", 1 );
+var visibilityN = props.globals.getNode( "/environment/effective-visibility-m" );
+
+var severityN = icingRootN.initNode( "icing-severity", ICING_NONE, "INT" );
+var severityNameN = icingRootN.initNode( "icing-severity-name", ICING_CATEGORY[severityN.getValue()] );
+var icingFactorN = icingRootN.initNode( "icing-factor", 0.0 );
+var maxSpreadN = icingRootN.initNode( "max-spread-degc", 0.1 );
+
+var setSeverity = func {
+ var value = arg[0];
+ if( severityN.getValue() != value ) {
+ severityN.setValue( value );
+ severityNameN.setValue( ICING_CATEGORY[value] );
+ }
+}
+
+#########################################################################################
+# These are objects that are subject to icing
+# inputs under /sim/model/icing/iceable (multiple instances allowed)
+# ./name # name of this object, more or less useless
+# ./salvage-control # name of a boolean property that salvages from ice
+# ./output-property # the name of the property where the ice amount is written to
+# ./sensitivity # a multiplier for the ice accumulation
+#
+# outputs
+# ./ice-inches # the amount of ice in inches OR
+# [property named by output-property] # the amount of ice in inches
+#########################################################################################
+var IceSensitiveElement = {};
+
+IceSensitiveElement.new = func {
+ var obj = {};
+ obj.parents = [IceSensitiveElement];
+ obj.node = arg[0];
+
+ obj.nameN = obj.node.initNode( "name", "noname" );
+ var n = obj.node.getNode( "salvage-control", 0 );
+ obj.controlN = nil;
+ if( n != nil ) {
+ n = n.getValue();
+ if( n != nil ) {
+ obj.controlN = props.globals.initNode( n, 0, "BOOL" );
+ }
+ }
+ obj.sensitivityN = obj.node.initNode( "sensitivity", 1.0 );
+
+ obj.iceAmountN = nil;
+ n = obj.node.getNode( "output-property", 0 );
+ if( n != nil ) {
+ n = n.getValue();
+ if( n != nil ) {
+ obj.iceAmountN = props.globals.initNode( n, 0.0 );
+ }
+ }
+ if( obj.iceAmountN == nil ) {
+ obj.iceAmountN = obj.node.initNode( "ice-inches", 0.0 );
+ }
+
+ return obj;
+};
+
+#####################################################################
+# this gets called from the icemachine on each update cycle
+# arg[0] is the time in seconds since last update
+# arg[1] is the number of NAM traveled since last update
+# arg[2] is the ice-accumulation-factor for the current severity
+#####################################################################
+IceSensitiveElement.update = func {
+ if( me.controlN != nil and me.controlN.getBoolValue() ) {
+ if( me.iceAmountN.getValue() != 0.0 ) {
+ me.iceAmountN.setDoubleValue( 0.0 );
+ }
+ return;
+ }
+
+ var deltat = arg[0];
+ var dist_nm = arg[1];
+ var factor = arg[2];
+
+ var v = me.iceAmountN.getValue() + dist_nm * factor * me.sensitivityN.getValue();
+ if( v < 0.0 ) {
+ v = 0.0;
+ }
+ if( me.iceAmountN.getValue() != v ) {
+ me.iceAmountN.setValue( v );
+ }
+};
+
+#####################################################################
+# read the ice sensitive elements from the config file
+#####################################################################
+var iceSensitiveElements = nil;
+
+var icingConfigN = props.globals.getNode( "/sim/model/icing", 0 );
+if( icingConfigN != nil ) {
+ iceSensitiveElements = [];
+ var iceableNodes = icingConfigN.getChildren( "iceable" );
+ foreach( var iceable; iceableNodes ) {
+ append( iceSensitiveElements, IceSensitiveElement.new( iceable ) );
+ }
+};
+
+#####################################################################
+# the time triggered loop
+#####################################################################
+var elapsedTimeNode = props.globals.getNode( "/sim/time/elapsed-sec" );
+var lastUpdate = 0.0;
+var icing = func {
+
+ var temperature = temperatureN.getValue();
+ var severity = ICING_NONE;
+ icingFactorN.setDoubleValue( ICING_FACTOR[severity] );
+
+ var visibility = 0;
+ if( visibilityN != nil ) {
+ visibility = visibilityN.getValue();
+ }
+
+ # check if we should create some ice
+ var spread = temperature - dewpointN.getValue();
+ if( spread < maxSpreadN.getValue() and visibility < 1000 ) {
+ for( var i = 0; i < size(ICING_TEMPERATURE); i = i + 1 ) {
+ if( ICING_TEMPERATURE[i][0] > temperature and
+ ICING_TEMPERATURE[i][1] <= temperature ) {
+ var s1 = ICING_TEMPERATURE[i][2];
+ var s2 = ICING_TEMPERATURE[i][3];
+ var ds = s2 - s1 + 1;
+ severity = s1 + int(rand()*ds);
+ icingFactorN.setDoubleValue( ICING_FACTOR[severity] );
+ break;
+ }
+ }
+ } else {
+ # clear air
+ # melt ice if above freezing temperature
+ # the warmer, the faster. Lets guess that at 10degc
+ # 0.5 inch goes in 10miles
+ if( temperature > 0.0 ) {
+ icingFactorN.setDoubleValue( factor = -0.05 * temperature / 10.0 );
+ }
+ # if temperature below zero, sublimating factor is initialized
+ }
+
+ setSeverity( severity );
+
+ # update all sensitive areas
+ var now = elapsedTimeNode.getValue();
+ var dt = now - lastUpdate;
+ foreach( var iceable; iceSensitiveElements ) {
+ iceable.update( dt, dt * speedN.getValue()/3600.0, icingFactorN.getValue() );
+ }
+
+ lastUpdate = now;
+ settimer( icing, 2 );
+}
+
+#####################################################################
+# start our icemachine
+# don't care if there is nothing to put ice on
+#####################################################################
+if( iceSensitiveElements != nil ) {
+ lastUpdate = elapsedTimeNode.getValue();
+ icing();
+}
+#####################################################################
+# OHP button
+#####################################################################
+setprop("/controls/switches/windowprobeheat", 0);
+setprop("/controls/switches/windowprobeheatfault", 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) {
+ setprop("/controls/deice/windowprobeheat", 1);
+ } else if (stateL == 3 or stateR == 3 and !fault) {
+ 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);
+ }
+});
+#####################################################################
\ No newline at end of file
diff --git a/Systems/a319-aerodynamics.xml b/Systems/a319-aerodynamics.xml
index ebda9b4c..24831ba1 100644
--- a/Systems/a319-aerodynamics.xml
+++ b/Systems/a319-aerodynamics.xml
@@ -2,6 +2,7 @@
+ ice/wing
@@ -70,6 +71,22 @@
+
+ Lift_decrease_due_to_ice_on_wing
+
+ aero/qbar-psf
+ metrics/Sw-sqft
+
+ ice/wing
+
+ 0.0 0
+ 0.5 -0.1
+ 1.0 -0.3
+ 2.0 -1.5
+
+
+
+
@@ -185,6 +202,23 @@
0.035
+
+
+ Drag_due_to_ice_on_wing
+
+ aero/qbar-psf
+ metrics/Sw-sqft
+
+ ice/wing
+
+ 0.0 0
+ 0.5 0.004
+ 1.0 0.010
+ 2.0 0.100
+
+
+
+
diff --git a/Systems/a320-aerodynamics.xml b/Systems/a320-aerodynamics.xml
index ebda9b4c..7d59bfe3 100644
--- a/Systems/a320-aerodynamics.xml
+++ b/Systems/a320-aerodynamics.xml
@@ -2,6 +2,7 @@
+ ice/wing
@@ -70,6 +71,22 @@
+
+ Lift_decrease_due_to_ice_on_wing
+
+ aero/qbar-psf
+ metrics/Sw-sqft
+
+ ice/wing
+
+ 0.0 0
+ 0.5 -0.1
+ 1.0 -0.3
+ 2.0 -1.5
+
+
+
+
@@ -200,6 +217,22 @@
+
+ Drag_due_to_ice_on_wing
+
+ aero/qbar-psf
+ metrics/Sw-sqft
+
+ ice/wing
+
+ 0.0 0
+ 0.5 0.004
+ 1.0 0.010
+ 2.0 0.100
+
+
+
+
diff --git a/Systems/a321-aerodynamics.xml b/Systems/a321-aerodynamics.xml
index ebda9b4c..47a3d268 100644
--- a/Systems/a321-aerodynamics.xml
+++ b/Systems/a321-aerodynamics.xml
@@ -2,6 +2,7 @@
+ ice/wing
@@ -69,7 +70,23 @@
0.04
-
+
+
+ Lift_decrease_due_to_ice_on_wing
+
+ aero/qbar-psf
+ metrics/Sw-sqft
+
+ ice/wing
+
+ 0.0 0
+ 0.5 -0.1
+ 1.0 -0.3
+ 2.0 -1.5
+
+
+
+
@@ -186,6 +203,22 @@
+
+ Drag_due_to_ice_on_wing
+
+ aero/qbar-psf
+ metrics/Sw-sqft
+
+ ice/wing
+
+ 0.0 0
+ 0.5 0.004
+ 1.0 0.010
+ 2.0 0.100
+
+
+
+
diff --git a/Systems/icing.xml b/Systems/icing.xml
new file mode 100644
index 00000000..d6ccaa88
--- /dev/null
+++ b/Systems/icing.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ Wing
+ /controls/deice/surface-deice-wingtail-light
+ 0.8
+ /fdm/jsbsim/ice/wing
+
+
+ Stabilizer
+ /controls/deice/surface-deice-wingtail-light
+ 1.0
+ /fdm/jsbsim/ice/stabilizer
+
+
+ LeftEngine
+ /controls/deice/prop-deice
+ 0.5
+ /fdm/jsbsim/ice/propeller
+
+
+ RightEngine
+ /controls/deice/prop-deice
+ 0.5
+ /fdm/jsbsim/ice/propeller
+
+
+ Windshield
+ /controls/deice/windshield-deice
+ 0.5
+
+
+
+ Fuselage
+
+ 0.3
+ /fdm/jsbsim/ice/fuselage
+
+
+ Pitot tube
+ 1
+ /controls/anti-ice/pitot-heat
+ /systems/pitot/icing
+
+
+
+
+
\ No newline at end of file