Index: src/mlx/acft.py
===================================================================
--- src/mlx/acft.py	(revision 273)
+++ src/mlx/acft.py	(revision 274)
@@ -174,26 +174,30 @@
         This is the function that the simulator calls directly with the new
         state."""
-        config = self._flight.config
-
-        self._smoothedIAS.add(config.realIASSmoothingLength, aircraftState.ias)
-        aircraftState.smoothedIAS = self._smoothedIAS.get()
-
-        self._smoothedVS.add(config.realVSSmoothingLength, aircraftState.vs)
-        aircraftState.smoothedVS = self._smoothedVS.get()
-        
-        for checker in self._checkers:
-            try:
-                checker.check(self._flight, self, self._flight.logger,
-                              self._aircraftState, aircraftState)
-            except:
-                print >> sys.stderr, "Checker", checker, "failed"
-                traceback.print_exc()
-
-        self._flight.handleState(self._aircraftState, aircraftState)
-
-        self._maxVS = max(self._maxVS, aircraftState.vs)
-        self._minVS = min(self._minVS, aircraftState.vs)
-
-        self._aircraftState = aircraftState
+        try:
+            config = self._flight.config
+
+            self._smoothedIAS.add(config.realIASSmoothingLength, aircraftState.ias)
+            aircraftState.smoothedIAS = self._smoothedIAS.get()
+
+            self._smoothedVS.add(config.realVSSmoothingLength, aircraftState.vs)
+            aircraftState.smoothedVS = self._smoothedVS.get()
+
+            for checker in self._checkers:
+                try:
+                    checker.check(self._flight, self, self._flight.logger,
+                                  self._aircraftState, aircraftState)
+                except:
+                    print >> sys.stderr, "Checker", checker, "failed"
+                    traceback.print_exc()
+
+            self._flight.handleState(self._aircraftState, aircraftState)
+
+            self._maxVS = max(self._maxVS, aircraftState.vs)
+            self._minVS = min(self._minVS, aircraftState.vs)
+        except:
+            print >> sys.stderr, "Failed to handle the state"
+            traceback.print_exc()
+        finally:
+            self._aircraftState = aircraftState
     
     def setStage(self, aircraftState, newStage):
@@ -203,5 +207,5 @@
             if newStage==const.STAGE_PUSHANDTAXI:
                 self.logger.message(aircraftState.timestamp, "Block time start")
-                self.logFuel(aircraftState)
+                self._flight.logFuel(aircraftState)
                 self.logger.message(aircraftState.timestamp, 
                                     "Zero-fuel weight: %.0f kg" % (aircraftState.zfw))
@@ -234,5 +238,5 @@
                                           force = True)
                 self.logger.message(aircraftState.timestamp, "Flight time end")
-                self.logFuel(aircraftState)
+                self._flight.logFuel(aircraftState)
                 self.logger.message(aircraftState.timestamp,
                                     "Landing weight: %.0f kg, MLW: %.0f" % \
@@ -409,7 +413,5 @@
     - fuel: left, centre, right
     - n1: left, right
-    - reverser: left, right"""
-    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, const.FUELTANK_RIGHT]    
-    
+    - reverser: left, right"""    
     def __init__(self, flight):
         super(Boeing737, self).__init__(flight)
@@ -426,13 +428,4 @@
                                  40 : 162 }
 
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left=%.0f kg - centre=%.0f kg - right=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1],
-                             aircraftState.fuel[2]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-                            
 #---------------------------------------------------------------------------------------
 
@@ -519,5 +512,4 @@
     - n1: left, right
     - reverser: left, right."""
-    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_RIGHT]    
 
     def __init__(self, flight):
@@ -533,12 +525,4 @@
                                  35 : 158 }
 
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left=%.0f kg - right=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-
 #---------------------------------------------------------------------------------------
 
@@ -551,5 +535,4 @@
     - n1: left, right
     - reverser: left, right"""
-    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, const.FUELTANK_RIGHT]    
 
     def __init__(self, flight):
@@ -564,13 +547,4 @@
                                  30 : 175 }
 
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left=%.0f kg - centre=%.0f kg - right=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1],
-                             aircraftState.fuel[2]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-                            
 #---------------------------------------------------------------------------------------
 
@@ -605,6 +579,4 @@
     - n1: left, right
     - reverser: left, right."""
-    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, const.FUELTANK_RIGHT]    
-
     def __init__(self, flight):
         super(CRJ2, self).__init__(flight)
@@ -620,13 +592,4 @@
                                  45 : 175 }
 
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left=%.0f kg - centre=%.0f kg - right=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1],
-                             aircraftState.fuel[2]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-                            
 #---------------------------------------------------------------------------------------
 
@@ -639,6 +602,4 @@
     - n1: left, right
     - reverser: left, right."""
-    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, const.FUELTANK_RIGHT]    
-
     def __init__(self, flight):
         super(F70, self).__init__(flight)
@@ -655,13 +616,4 @@
                                  42 : 180 }
 
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left=%.0f kg - centre=%.0f kg - right=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1],
-                             aircraftState.fuel[2]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-                            
 #---------------------------------------------------------------------------------------
 
@@ -674,8 +626,4 @@
     - rpm: left, right
     - reverser: left, right."""
-    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, const.FUELTANK_RIGHT]    
-    # fuelTanks = [const.FUELTANK_LEFT_AUX, const.FUELTANK_LEFT,
-    #              const.FUELTANK_RIGHT, const.FUELTANK_RIGHT_AUX]
-
     def __init__(self, flight):
         super(DC3, self).__init__(flight)
@@ -697,13 +645,4 @@
         return True
 
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left aux=%.0f kg - left=%.0f kg - right=%.0f kg - right aux=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1],
-                             aircraftState.fuel[2], aircraftState.fuel[3]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-                            
 #---------------------------------------------------------------------------------------
 
@@ -717,10 +656,4 @@
     - n1: left, right
     - reverser: left, right."""
-    fuelTanks = [const.FUELTANK_LEFT_TIP, const.FUELTANK_EXTERNAL1,
-                 const.FUELTANK_LEFT_AUX,
-                 const.FUELTANK_CENTRE,
-                 const.FUELTANK_RIGHT_AUX,
-                 const.FUELTANK_EXTERNAL2, const.FUELTANK_RIGHT_TIP]
-
     def __init__(self, flight):
         super(T134, self).__init__(flight)
@@ -740,15 +673,4 @@
         return False
     
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left tip=%.0f kg - external 1=%.0f kg - left aux=%.0f kg - centre= %.0f kg - right aux=%.0f kg - external 2=%.0f kg - right tip=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1],
-                             aircraftState.fuel[2], 
-                             aircraftState.fuel[3], aircraftState.fuel[4],
-                             aircraftState.fuel[5], aircraftState.fuel[6]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-                            
     def _appendLightsLoggers(self):
         """Append the loggers needed for the lights."""
@@ -773,7 +695,4 @@
     - n1: left, centre, right
     - reverser: left, right"""
-    fuelTanks = [const.FUELTANK_LEFT_AUX, const.FUELTANK_LEFT,
-                 const.FUELTANK_CENTRE, const.FUELTANK_CENTRE2,
-                 const.FUELTANK_RIGHT, const.FUELTANK_RIGHT_AUX]
     def __init__(self, flight):
         super(T154, self).__init__(flight)
@@ -793,14 +712,4 @@
         return False
     
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left aux=%.0f kg - left=%.0f kg - centre=%.0f kg - centre 2=%.0f kg - right=%.0f kg - right aux=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1],
-                             aircraftState.fuel[2], aircraftState.fuel[3], 
-                             aircraftState.fuel[4], aircraftState.fuel[5]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-
     def _appendLightsLoggers(self):
         """Append the loggers needed for the lights."""
@@ -826,6 +735,4 @@
     - n1: left, right
     - reverser: left, right"""
-    fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_RIGHT]
-    
     def __init__(self, flight):
         super(YK40, self).__init__(flight)
@@ -844,12 +751,4 @@
         return False
     
-    def logFuel(self, aircraftState):
-        """Log the amount of fuel"""
-        self.logger.message(aircraftState.timestamp,
-                            "Fuel: left=%.0f kg - right=%.0f kg" % \
-                            (aircraftState.fuel[0], aircraftState.fuel[1]))
-        self.logger.message(aircraftState.timestamp,
-                            "Total fuel: %.0f kg" % (sum(aircraftState.fuel),))
-
     def _appendLightsLoggers(self):
         """Append the loggers needed for the lights."""
@@ -866,5 +765,9 @@
 #---------------------------------------------------------------------------------------
 
-MostFuelTankAircraft = T134
+mostFuelTanks = [const.FUELTANK_LEFT_TIP, const.FUELTANK_EXTERNAL1,
+                 const.FUELTANK_LEFT_AUX,
+                 const.FUELTANK_CENTRE,
+                 const.FUELTANK_RIGHT_AUX,
+                 const.FUELTANK_EXTERNAL2, const.FUELTANK_RIGHT_TIP]
 
 #---------------------------------------------------------------------------------------
