Changeset 331:79755718ab7d


Ignore:
Timestamp:
11/13/12 16:26:50 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

#136 implemented fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r329 r331  
    5151        """Get the average."""
    5252        return self._sum / len(self._deque)
    53        
     53
    5454#---------------------------------------------------------------------------------------
    5555
     
    6565        self._flight = flight
    6666        self._aircraftState = None
    67        
     67
    6868        self._maxVS = -10000.0
    6969        self._minVS = 10000.0
     
    9393        self._adf2Logger = checks.ADF2Logger()
    9494        self._checkers.append(self._adf2Logger)
    95        
     95
    9696        self._checkers.append(checks.SquawkLogger())
    9797
     
    139139        timeout = 5.0 + config.realIASSmoothingLength - 1
    140140        self._checkers.append(checks.OverspeedChecker(timeout = timeout))
    141                              
     141
    142142        self._checkers.append(checks.StallChecker())
    143143
    144144        self._checkers.append(checks.PitotChecker())
    145        
     145
    146146        self._checkers.append(checks.ReverserChecker())
    147147
     
    186186        return None if self._aircraftState is None \
    187187               else self._aircraftState.timestamp
    188        
     188
    189189    def getFlapsSpeedLimit(self, flaps):
    190190        """Get the speed limit for the given flaps setting."""
     
    229229        finally:
    230230            self._aircraftState = aircraftState
    231    
     231
    232232    def setStage(self, aircraftState, newStage):
    233233        """Set the given stage as the new one and do whatever should be
     
    237237                self.logger.message(aircraftState.timestamp, "Block time start")
    238238                self._flight.logFuel(aircraftState)
    239                 self.logger.message(aircraftState.timestamp, 
     239                self.logger.message(aircraftState.timestamp,
    240240                                    "ZFW: %.2f kg" % (aircraftState.zfw))
    241241                flight = self._flight
     
    247247                self.logger.message(aircraftState.timestamp,
    248248                                    "Flight time start")
    249                 self.logger.message(aircraftState.timestamp, 
     249                self.logger.message(aircraftState.timestamp,
    250250                                    "Takeoff weight: %.0f kg, MTOW: %.0f kg" % \
    251251                                    (aircraftState.grossWeight, self.mtow))
    252252                self.logger.message(aircraftState.timestamp,
    253253                                    "Wind %03.0f degrees at %.0f knots" % \
    254                                     (aircraftState.windDirection, 
     254                                    (aircraftState.windDirection,
    255255                                     aircraftState.windSpeed))
    256256                self._logRadios(aircraftState)
     
    286286                self.logger.message(aircraftState.timestamp,
    287287                                    "Flown distance: %.2f NM" % \
    288                                     (self._flight.flownDistance,))               
     288                                    (self._flight.flownDistance,))
    289289                blockLength = self._flight.blockTimeEnd - self._flight.blockTimeStart
    290290                self.logger.message(aircraftState.timestamp,
     
    299299        self.flight.simulator.startFlare()
    300300
    301     def flareStarted(self, windSpeed, windDirection, visibility, 
     301    def flareStarted(self, windSpeed, windDirection, visibility,
    302302                     flareStart, flareStartFS):
    303303        """Called when the flare has started."""
     
    314314        self.flight.flareStarted(flareStart, flareStartFS)
    315315        fs.sendMessage(const.MESSAGETYPE_INFORMATION, "Flare-time", 3)
    316          
     316
    317317    def flareFinished(self, flareEnd, flareEndFS, tdRate, tdRateCalculatedByFS,
    318318                      ias, pitch, bank, heading):
     
    323323        self.logger.message(self._aircraftState.timestamp,
    324324                            "Flaretime: %.3f (from %s)" % \
    325                             (flareTime, 
     325                            (flareTime,
    326326                             "the simulator" if flareTimeFromFS else "real time",))
    327327        self.logger.message(self._aircraftState.timestamp,
     
    341341        self.logger.message(self._aircraftState.timestamp,
    342342                            "Touchdown heading: %03.0f degrees" % (heading,))
    343         self.logger.message(self._aircraftState.timestamp, 
     343        self.logger.message(self._aircraftState.timestamp,
    344344                           "Centre of gravity:  %.1f%%" % \
    345345                            (self._aircraftState.cog*100.0,))
     
    434434            fs.sendMessage(const.MESSAGETYPE_GATE_SYSTEM,
    435435                           "Free gates: " + gateList, 20)
    436        
     436
    437437
    438438    def _logRadios(self, aircraftState):
     
    455455    - fuel: left, centre, right
    456456    - n1: left, right
    457     - reverser: left, right"""   
     457    - reverser: left, right"""
    458458    def __init__(self, flight):
    459459        super(Boeing737, self).__init__(flight)
     
    605605    """Boeing 767-300 aircraft."""
    606606    def __init__(self, flight):
    607         super(B763, self).__init__(cflight)
     607        super(B763, self).__init__(flight)
    608608        self.dow = 91311
    609609        self.mtow = 181436
     
    714714        """Indicate if the speed is in knots."""
    715715        return False
    716    
     716
    717717    def _appendLightsLoggers(self):
    718718        """Append the loggers needed for the lights."""
     
    752752        """Indicate if the speed is in knots."""
    753753        return False
    754    
     754
    755755    def _appendLightsLoggers(self):
    756756        """Append the loggers needed for the lights."""
     
    791791        """Indicate if the speed is in knots."""
    792792        return False
    793    
     793
    794794    def _appendLightsLoggers(self):
    795795        """Append the loggers needed for the lights."""
Note: See TracChangeset for help on using the changeset viewer.