Changeset 170:7cda0cc74e19 for src/mlx/flight.py
- Timestamp:
- 05/12/12 15:48:45 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/flight.py
r134 r170 2 2 3 3 #--------------------------------------------------------------------------------------- 4 5 from soundsched import SoundScheduler 4 6 5 7 import const … … 32 34 gui.resetFlightStatus() 33 35 36 self._soundScheduler = SoundScheduler(self) 37 self._pilotHotkeyPressed = False 38 self._checklistHotkeyPressed = False 39 34 40 self.flareTimeFromFS = False 35 41 self.entranceExam = False … … 59 65 self._flareStartFS = None 60 66 67 self._tdRate = None 68 61 69 @property 62 70 def config(self): … … 103 111 """Get the VRef speed of the flight.""" 104 112 return self._gui.vref 113 114 @property 115 def tdRate(self): 116 """Get the touchdown rate if known, None otherwise.""" 117 return self._tdRate 105 118 106 119 def handleState(self, oldState, currentState): … … 111 124 if self.startFuel is None: 112 125 self.startFuel = self.endFuel 126 127 self._soundScheduler.schedule(currentState, 128 self._pilotHotkeyPressed) 129 self._pilotHotkeyPressed = False 113 130 114 131 def setStage(self, timestamp, stage): … … 155 172 self._flareStartFS = flareStartFS 156 173 157 def flareFinished(self, flareEnd, flareEndFS ):174 def flareFinished(self, flareEnd, flareEndFS, tdRate): 158 175 """Called when the flare time has ended. 159 176 … … 162 179 - the flare time 163 180 """ 181 self._tdRate = tdRate 164 182 if self.flareTimeFromFS: 165 183 return (True, flareEndFS - self._flareStartFS) … … 176 194 """Get the fleet and call the given callback.""" 177 195 self._gui.getFleetAsync(callback = callback, force = force) 196 197 def pilotHotkeyPressed(self): 198 """Called when the pilot hotkey is pressed.""" 199 self._pilotHotkeyPressed = True 200 201 def checklistHotkeyPressed(self): 202 """Called when the checklist hotkey is pressed.""" 203 self._checklistHotkeyPressed = True 178 204 179 205 def _updateFlownDistance(self, currentState):
Note:
See TracChangeset
for help on using the changeset viewer.