Changeset 304:9bfef8224383 for src


Ignore:
Timestamp:
08/18/12 09:30:21 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Cruise level changes are logged

Location:
src/mlx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r298 r304  
    172172        This default implementation returns True."""
    173173        return True
    174    
     174
     175    @property
     176    def timestamp(self):
     177        """Get the timestamp of the current state."""
     178        return None if self._aircraftState is None \
     179               else self._aircraftState.timestamp
     180       
    175181    def getFlapsSpeedLimit(self, flaps):
    176182        """Get the speed limit for the given flaps setting."""
  • src/mlx/flight.py

    r303 r304  
    349349                            "Total fuel: %.0f kg" % (aircraftState.totalFuel,))                           
    350350
     351    def cruiseLevelChanged(self):
     352        """Called when the cruise level hass changed."""
     353        if self._stage in [const.STAGE_CRUISE, const.STAGE_DESCENT,
     354                           const.STAGE_LANDING]:
     355            message = "Cruise altitude modified to %d feet" % \
     356                      (self.cruiseAltitude,)
     357            self.logger.message(self.aircraft.timestamp, message)
     358
    351359    def _updateFlownDistance(self, currentState):
    352360        """Update the flown distance."""
  • src/mlx/gui/flight.py

    r303 r304  
    17351735        """Called when the cruise level has changed."""
    17361736        self._updateForwardButton()
     1737        self._wizard.cruiseLevelChanged()
    17371738
    17381739    def _routeChanged(self, textBuffer):
     
    30843085        """Reload the flights from the MAVA server."""
    30853086        self.login(callback, None, None, None)
     3087
     3088    def cruiseLevelChanged(self):
     3089        """Called when the cruise level is changed."""
     3090        self.gui.cruiseLevelChanged()
    30863091
    30873092    def _loginResultCallback(self, returned, result):
  • src/mlx/gui/gui.py

    r303 r304  
    858858            self.simulator.stopMonitoring()
    859859            self._monitoring = False
     860
     861    def cruiseLevelChanged(self):
     862        """Called when the cruise level is changed in the flight wizard."""
     863        if self._flight is not None:
     864            self._flight.cruiseLevelChanged()
    860865
    861866    def _buildMenuBar(self, accelGroup):
Note: See TracChangeset for help on using the changeset viewer.