Ignore:
Timestamp:
04/21/12 17:08:58 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Takeoff V-speeds can be entered after takeoff as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r96 r101  
    2626        self._minVS = 10000.0
    2727
     28        self._v1r2LineIndex = None
    2829        self._vrefLineIndex = None
    2930
     
    140141                                    (aircraftState.windDirection,
    141142                                     aircraftState.windSpeed))
    142                 self.logger.message(aircraftState.timestamp,
    143                                     "Speeds calculated by the pilot: V1: %s, VR: %s, V2: %s" % \
    144                                     ("-" if self._flight.v1 is None
    145                                      else str(self._flight.v1),
    146                                      "-" if self._flight.vr is None
    147                                      else str(self._flight.vr),
    148                                      "-" if self._flight.v2 is None
    149                                      else str(self._flight.v2)))
     143                self._logV1R2()
    150144            elif newStage==const.STAGE_TAXIAFTERLAND:
    151145                self.logger.message(aircraftState.timestamp, "Flight time end")
     
    191185                            "Altimeter setting: %.0f hPa" % \
    192186                            (self._aircraftState.altimeter,))
    193         self._vrefLineIndex = \
    194             self.logger.message(self._aircraftState.timestamp,
    195                                 "VRef speed calculated by the pilot: %s" % \
    196                                 ("-" if self._flight.vref is None
    197                                  else str(self._flight.vref)))
     187        self._logVRef()
    198188        self.flight.flareStarted(flareStart, flareStartFS)
    199189         
     
    233223            if n1>=0.5: return False
    234224        return True
     225
     226    def updateV1R2(self):
     227        """Update the V1, Vr and V2 values from the flight, if the these values
     228        have already been logged."""
     229        if self._v1r2LineIndex is not None:
     230            self._logV1R2()
     231
     232    def _logV1R2(self):
     233        """Log the V1, Vr and V2 value either newly, or by updating the
     234        corresponding line."""
     235        message = "Speeds calculated by the pilot: V1: %s, VR: %s, V2: %s" % \
     236                  ("-" if self._flight.v1 is None
     237                   else str(self._flight.v1),
     238                   "-" if self._flight.vr is None
     239                   else str(self._flight.vr),
     240                   "-" if self._flight.v2 is None
     241                   else str(self._flight.v2))
     242
     243        if self._v1r2LineIndex is None:
     244            self._v1r2LineIndex = \
     245                self.logger.message(self._aircraftState.timestamp, message)
     246        else:
     247            self.logger.updateLine(self._v1r2LineIndex, message)
    235248
    236249    def updateVRef(self):
Note: See TracChangeset for help on using the changeset viewer.