Index: src/mlx/acft.py
===================================================================
--- src/mlx/acft.py	(revision 409)
+++ src/mlx/acft.py	(revision 443)
@@ -1017,4 +1017,26 @@
 #---------------------------------------------------------------------------------------
 
+class B462(Aircraft):
+    """British Aerospace BAe-146 aircraft.
+
+    The aircraft type-specific values in the aircraft state have the following
+    structure:
+    - fuel: left, centre, right
+    - n1: left outer, left inner, right inner, right outer
+    - reverser: empty (the plane has no reversers)"""
+    def __init__(self, flight):
+        super(B462, self).__init__(flight)
+        self.dow = 25706
+        self.mtow = 43998
+        self.mlw = 38599
+        self.mzfw = 33792
+        self.gearSpeedLimit = 210
+        self.flapSpeedLimits = { 18 : 217,
+                                 24 : 180,
+                                 30 : 170,
+                                 33 : 150 }
+
+#---------------------------------------------------------------------------------------
+
 mostFuelTanks = [const.FUELTANK_LEFT_TIP, const.FUELTANK_EXTERNAL1,
                  const.FUELTANK_LEFT_AUX,
@@ -1040,5 +1062,6 @@
              const.AIRCRAFT_T134  : T134,
              const.AIRCRAFT_T154  : T154,
-             const.AIRCRAFT_YK40  : YK40 }
+             const.AIRCRAFT_YK40  : YK40,
+             const.AIRCRAFT_B462  : B462 }
 
 #---------------------------------------------------------------------------------------
Index: src/mlx/checks.py
===================================================================
--- src/mlx/checks.py	(revision 416)
+++ src/mlx/checks.py	(revision 443)
@@ -1304,4 +1304,5 @@
         return flight.stage in [const.STAGE_DESCENT, const.STAGE_LANDING,
                                 const.STAGE_TAXIAFTERLAND] and \
+            state.reverser and \
             state.groundSpeed<aircraft.reverseMinSpeed and max(state.reverser)
 
Index: src/mlx/const.py
===================================================================
--- src/mlx/const.py	(revision 437)
+++ src/mlx/const.py	(revision 443)
@@ -95,4 +95,7 @@
 ## Aircraft type: Yakovlev Yak-40
 AIRCRAFT_YK40 = 15
+
+## Aircraft type: British Aerospace BAe-146
+AIRCRAFT_B462 = 16
 
 #-------------------------------------------------------------------------------
@@ -108,5 +111,6 @@
                  AIRCRAFT_B733, AIRCRAFT_B734, AIRCRAFT_B735,
                  AIRCRAFT_T154, AIRCRAFT_T134,
-                 AIRCRAFT_YK40, AIRCRAFT_DC3]
+                 AIRCRAFT_YK40, AIRCRAFT_DC3,
+                 AIRCRAFT_B462]
 
 #-------------------------------------------------------------------------------
@@ -129,5 +133,6 @@
               AIRCRAFT_T134  : "T134",
               AIRCRAFT_T154  : "T154",
-              AIRCRAFT_YK40  : "YK40" }
+              AIRCRAFT_YK40  : "YK40",
+              AIRCRAFT_B462  : "B462" }
 
 #-------------------------------------------------------------------------------
Index: src/mlx/fsuipc.py
===================================================================
--- src/mlx/fsuipc.py	(revision 412)
+++ src/mlx/fsuipc.py	(revision 443)
@@ -2043,4 +2043,31 @@
 #------------------------------------------------------------------------------
 
+class B462Model(GenericAircraftModel):
+    """Generic model for the British Aerospace BAe 146-200 aircraft."""
+    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE,
+                 const.FUELTANK_RIGHT]
+
+    def __init__(self):
+        """Construct the model."""
+        super(B462Model, self). \
+            __init__(flapsNotches = [0, 18, 24, 30, 33],
+                     fuelTanks = B462Model.fuelTanks,
+                     numEngines = 4)
+
+    @property
+    def name(self):
+        """Get the name for this aircraft model."""
+        return "FSUIPC/Generic British Aerospace 146"
+
+    def getAircraftState(self, aircraft, timestamp, data):
+        """Get an aircraft state object for the given monitoring data.
+
+        This removes the reverser value for the middle engine."""
+        state = super(B462Model, self).getAircraftState(aircraft, timestamp, data)
+        state.reverser = []
+        return state
+
+#------------------------------------------------------------------------------
+
 _genericModels = { const.AIRCRAFT_B736  : B737Model,
                    const.AIRCRAFT_B737  : B737Model,
@@ -2058,5 +2085,6 @@
                    const.AIRCRAFT_T134  : T134Model,
                    const.AIRCRAFT_T154  : T154Model,
-                   const.AIRCRAFT_YK40  : YK40Model }
+                   const.AIRCRAFT_YK40  : YK40Model,
+                   const.AIRCRAFT_B462  : B462Model }
 
 #------------------------------------------------------------------------------
Index: src/mlx/gui/common.py
===================================================================
--- src/mlx/gui/common.py	(revision 438)
+++ src/mlx/gui/common.py	(revision 443)
@@ -298,5 +298,6 @@
                   _const.AIRCRAFT_T134  : xstr("aircraft_t134"),
                   _const.AIRCRAFT_T154  : xstr("aircraft_t154"),
-                  _const.AIRCRAFT_YK40  : xstr("aircraft_yk40") }
+                  _const.AIRCRAFT_YK40  : xstr("aircraft_yk40"),
+                  _const.AIRCRAFT_B462  : xstr("aircraft_b462") }
 
 #------------------------------------------------------------------------------
Index: src/mlx/pyuipc_sim.py
===================================================================
--- src/mlx/pyuipc_sim.py	(revision 408)
+++ src/mlx/pyuipc_sim.py	(revision 443)
@@ -158,4 +158,7 @@
     ENGINE_3 = 2
 
+    ## Engine index: engine #4
+    ENGINE_4 = 3
+
     ## The number of hotkey entries
     HOTKEY_SIZE = 56
@@ -295,6 +298,6 @@
         self.visibility = 10000
 
-        self.n1 = [0.0, 0.0, 0.0]
-        self.throttles = [0.0, 0.0, 0.0]
+        self.n1 = [0.0, 0.0, 0.0, 0.0]
+        self.throttles = [0.0, 0.0, 0.0, 0.0]
 
         self.payloadCount = 1
@@ -328,4 +331,5 @@
         self.eng2DeIce = False
         self.eng3DeIce = False
+        self.eng4DeIce = False
         self.propDeIce = False
         self.structDeIce = False
@@ -427,4 +431,8 @@
         elif offset==0x09e2:       # Engine #3 de-ice
             return 1 if self.eng3DeIce else 0
+        elif offset==0x0a54:       # Engine #4 throttle
+            return self._getThrottle(self.ENGINE_4)
+        elif offset==0x0a7a:       # Engine #4 de-ice
+            return 1 if self.eng4DeIce else 0
         elif offset==0x0af4:       # Fuel weight
             return int(self.fuelWeight * 256.0)
@@ -533,4 +541,6 @@
             return self.n1[self.ENGINE_2]
         elif offset==0x2200:       # Engine #3 N1
+            return self.n1[self.ENGINE_3]
+        elif offset==0x2300:       # Engine #4 N1
             return self.n1[self.ENGINE_3]
         elif offset==0x2ea0:       # Elevator trim
@@ -695,4 +705,8 @@
         elif offset==0x09e2:       # Engine #3 de-ice
             self.eng3DeIce = value!=0
+        elif offset==0x0a54:       # Engine #4 throttle
+            self._setThrottle(self.ENGINE_4, value)
+        elif offset==0x0a7a:       # Engine #4 de-ice
+            self.eng4DeIce = value!=0
         elif offset==0x0af4:       # Fuel weight
             self.fuelWeight = value / 256.0
@@ -796,4 +810,6 @@
         elif offset==0x2200:       # Engine #3 N1
             self.n1[self.ENGINE_3] = value
+        elif offset==0x2300:       # Engine #4 N1
+            self.n1[self.ENGINE_4] = value
         elif offset==0x2ea0:       # Elevator trim
             self.elevatorTrim = value * 180.0 / math.pi
@@ -1413,4 +1429,6 @@
         self._valueHandlers["n1_3"] = ([(0x2200, "f")], lambda value: value,
                                        lambda word: float(word))
+        self._valueHandlers["n1_4"] = ([(0x2300, "f")], lambda value: value,
+                                       lambda word: float(word))
 
         self._valueHandlers["throttle_1"] = ([(0x088c, "H")],
@@ -1421,4 +1439,7 @@
                                              CLI.throttle2pyuipc)
         self._valueHandlers["throttle_3"] = ([(0x09bc, "H")],
+                                             CLI.pyuipc2throttle,
+                                             CLI.throttle2pyuipc)
+        self._valueHandlers["throttle_4"] = ([(0x0a54, "H")],
                                              CLI.pyuipc2throttle,
                                              CLI.throttle2pyuipc)
@@ -1490,4 +1511,6 @@
                                             CLI.bool2str, CLI.str2bool)
         self._valueHandlers["eng3Deice"] = ([(0x09e2, "H")],
+                                            CLI.bool2str, CLI.str2bool)
+        self._valueHandlers["eng4Deice"] = ([(0x0a7a, "H")],
                                             CLI.bool2str, CLI.str2bool)
         self._valueHandlers["propDeice"] = ([(0x337c, "b")],
Index: src/mlx/web.py
===================================================================
--- src/mlx/web.py	(revision 401)
+++ src/mlx/web.py	(revision 443)
@@ -63,5 +63,6 @@
                       "TU3"  : const.AIRCRAFT_T134,
                       "TU5"  : const.AIRCRAFT_T154,
-                      "YK4"  : const.AIRCRAFT_YK40 }
+                      "YK4"  : const.AIRCRAFT_YK40,
+                      "146"  : const.AIRCRAFT_B462 }
 
     TYPE2TYPECODE = { const.AIRCRAFT_B736  : "736",
@@ -80,5 +81,6 @@
                       const.AIRCRAFT_T134  : "TU3",
                       const.AIRCRAFT_T154  : "TU5",
-                      const.AIRCRAFT_YK40  : "YK4" }
+                      const.AIRCRAFT_YK40  : "YK4",
+                      const.AIRCRAFT_B462  : "146" }
 
     @staticmethod
@@ -115,5 +117,5 @@
         departureTime = readline(f)
         self.departureTime = BookedFlight.getDateTime(date, departureTime)
-                                               
+
         arrivalTime = readline(f)
         self.arrivalTime = BookedFlight.getDateTime(date, arrivalTime)
@@ -130,11 +132,11 @@
         departureTime = None
         arrivalTime = None
-        
+
         line = f.readline()
-        lineNumber = 0    
+        lineNumber = 0
         while line:
             lineNumber += 1
             line = line.strip()
-            
+
             hashIndex = line.find("#")
             if hashIndex>=0: line = line[:hashIndex]
@@ -142,9 +144,9 @@
                 equalIndex = line.find("=")
                 lineOK = equalIndex>0
-                
+
                 if lineOK:
-                    key = line[:equalIndex].strip()                    
+                    key = line[:equalIndex].strip()
                     value = line[equalIndex+1:].strip().replace("\:", ":")
-                    
+
                     lineOK = key and value
 
@@ -196,5 +198,5 @@
             self.aircraftTypeName = \
                 BookedFlight.TYPE2TYPECODE[self.aircraftType]
-            
+
     def writeIntoFile(self, f):
         """Write the flight into a file."""
@@ -235,5 +237,5 @@
         else:
             raise Exception("Invalid aircraft type code: '" + typeCode + "'")
-        
+
     def __repr__(self):
         """Get a representation of the flight."""
@@ -248,5 +250,5 @@
         s += ">"
         return s
-        
+
 #------------------------------------------------------------------------------
 
@@ -279,5 +281,5 @@
     def __repr__(self):
         """Get the representation of the plane object."""
-        s = "<Plane: %s %s" % (self.tailNumber, 
+        s = "<Plane: %s %s" % (self.tailNumber,
                                "home" if self.status==const.PLANE_HOME else \
                                "away" if self.status==const.PLANE_AWAY else \
@@ -288,5 +290,5 @@
         s += ">"
         return s
-        
+
 
 #------------------------------------------------------------------------------
@@ -323,5 +325,5 @@
                 gateNumbers.add(p.gateNumber)
         return gateNumbers
-    
+
     def updatePlane(self, tailNumber, status, gateNumber = None):
         """Update the status of the given plane."""
@@ -330,10 +332,10 @@
             plane.status = status
             plane.gateNumber = gateNumber
-    
+
     def __iter__(self):
         """Get an iterator over the planes."""
         for plane in self._planes.itervalues():
             yield plane
-        
+
     def __getitem__(self, tailNumber):
         """Get the plane with the given tail number.
@@ -345,5 +347,5 @@
         """Get the representation of the fleet object."""
         return self._planes.__repr__()
-        
+
 #------------------------------------------------------------------------------
 
@@ -371,5 +373,5 @@
         s += ">"
         return s
-    
+
 #------------------------------------------------------------------------------
 
@@ -389,16 +391,16 @@
            "E" not in attrs or not attrs["E"]:
             return
-        
+
         icao = attrs["A"]
         if icao not in self._notams:
             return
-        
+
         begin = datetime.datetime.strptime(attrs["B"], "%Y-%m-%d %H:%M:%S")
 
         c = attrs["C"] if "C" in attrs else None
         end = datetime.datetime.strptime(c, "%Y-%m-%d %H:%M:%S") if c else None
-        
+
         permanent = attrs["C_flag"]=="PERM" if "C_flag" in attrs else False
-        
+
         repeatCycle = attrs["D"] if "D" in attrs else None
 
@@ -473,5 +475,5 @@
     """A login request."""
     iso88592decoder = codecs.getdecoder("iso-8859-2")
-    
+
     def __init__(self, callback, pilotID, password, entranceExam):
         """Construct the login request with the given pilot ID and
@@ -488,5 +490,5 @@
         md5.update(self._pilotID)
         pilotID = md5.hexdigest()
-        
+
         md5 = hashlib.md5()
         md5.update(self._password)
@@ -524,5 +526,5 @@
                 result.pilotName = self.iso88592decoder(readline(f))[0]
                 result.exams = readline(f)
-                
+
                 while True:
                     line = readline(f)
@@ -540,10 +542,10 @@
 
         return result
-        
+
 #------------------------------------------------------------------------------
 
 class GetFleet(Request):
     """Request to get the fleet from the website."""
-    
+
     def __init__(self, callback):
         """Construct the fleet request."""
@@ -558,5 +560,5 @@
         result.fleet = Fleet(f)
         f.close()
-        
+
         return result
 
@@ -585,13 +587,13 @@
                                  ("status", status),
                                  ("kapu", gateNumber)])
-        
+
         f = urllib2.urlopen(url, data, timeout = 10.0)
         line = readline(f)
-        
+
         result = Result()
         result.success = line == "OK"
 
         return result
-            
+
 #------------------------------------------------------------------------------
 
@@ -628,5 +630,5 @@
 
 class GetMETARs(Request):
-    """Get the METARs from the NOAA website for certain airport ICAOs."""    
+    """Get the METARs from the NOAA website for certain airport ICAOs."""
 
     def __init__(self, callback, airports):
@@ -639,5 +641,5 @@
         url = "http://www.aviationweather.gov/adds/dataserver_current/httpparam?"
         data = urllib.urlencode([ ("dataSource" , "metars"),
-                                  ("requestType",  "retrieve"), 
+                                  ("requestType",  "retrieve"),
                                   ("format", "csv"),
                                   ("stationString", " ".join(self._airports)),
@@ -652,5 +654,5 @@
                 if len(line)>5 and line[4]==' ':
                     icao = line[0:4]
-                    if icao in self._airports:                        
+                    if icao in self._airports:
                         result.metars[icao] = line.strip().split(",")[0]
         finally:
@@ -696,5 +698,5 @@
         data["bag"] = str(pirep.bagWeight)
         data["mail"] = str(pirep.mailWeight)
-        
+
         data["flttype"] = SendPIREP._flightTypes[pirep.flightType]
         data["onoff"] = "1" if pirep.online else "0"
@@ -742,5 +744,5 @@
             f.close()
 
-        return result    
+        return result
 #------------------------------------------------------------------------------
 
@@ -757,5 +759,5 @@
         """Perform the sending of the ACARS."""
         print "Sending the online ACARS"
-        
+
         url = "http://www.virtualairlines.hu/acars2/acarsonline.php"
 
@@ -766,10 +768,10 @@
         data["pid"] = acars.pid
         data["pilot"] = SendACARS._latin2Encoder(acars.pilotName)[0]
-    
+
         data["pass"] = str(bookedFlight.numPassengers)
         data["callsign"] = bookedFlight.callsign
         data["airplane"] = bookedFlight.aircraftTypeName
         data["from"] = bookedFlight.departureICAO
-        data["to"] = bookedFlight.arrivalICAO        
+        data["to"] = bookedFlight.arrivalICAO
         data["lajstrom"] = bookedFlight.tailNumber
 
@@ -779,5 +781,5 @@
         data["altitude"] = str(acars.state.altitude)
         data["speed"] = str(acars.state.groundSpeed)
-        
+
         data["event"] = acars.getEventText()
 
@@ -788,5 +790,5 @@
             f.close()
 
-        return result    
+        return result
 
 #------------------------------------------------------------------------------
@@ -813,7 +815,7 @@
         """Enqueue a fleet retrieval request."""
         self._addRequest(GetFleet(callback))
-        
+
     def updatePlane(self, callback, tailNumber, status, gateNumber = None):
-        """Update the status of the given plane."""        
+        """Update the status of the given plane."""
         self._addRequest(UpdatePlane(callback, tailNumber, status, gateNumber))
 
@@ -821,5 +823,5 @@
         """Get the NOTAMs for the given two airports."""
         self._addRequest(GetNOTAMs(callback, departureICAO, arrivalICAO))
-        
+
     def getMETARs(self, callback, airports):
         """Get the METARs for the given airports."""
@@ -833,5 +835,5 @@
         """Send the given ACARS"""
         self._addRequest(SendACARS(callback, acars))
-        
+
     def run(self):
         """Process the requests."""
@@ -844,5 +846,5 @@
 
             request.perform()
-    
+
     def _addRequest(self, request):
         """Add the given request to the queue."""
@@ -855,8 +857,8 @@
 if __name__ == "__main__":
     import time
-    
+
     def callback(returned, result):
         print returned, unicode(result)
-        
+
     handler = Handler()
     handler.start()
@@ -866,5 +868,5 @@
     # Plane: HA-LEG home (gate 67)
     #handler.updatePlane(callback, "HA-LQC", const.PLANE_AWAY, "72")
-    #time.sleep(3)    
+    #time.sleep(3)
     #handler.getFleet(callback)
     #time.sleep(3)
@@ -873,7 +875,7 @@
     #handler.getMETARs(callback, ["LHBP", "EPWA"])
     #time.sleep(5)
-    
+
     handler.updatePlane(callback, "HA-LON", const.PLANE_AWAY, "")
-    time.sleep(3)    
-
-#------------------------------------------------------------------------------
+    time.sleep(3)
+
+#------------------------------------------------------------------------------
