Changeset 9:3dac12e8914d for src/flight.py
- Timestamp:
- 02/05/12 13:42:53 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/flight.py
r8 r9 19 19 self.logger = logger 20 20 self.cruiseAltitude = None 21 self.flareTimeFromFS = False 21 22 self.aircraftType = None 22 23 self.aircraft = None … … 24 25 25 26 self._endCondition = threading.Condition() 27 28 self._flareStart = None 29 self._flareStartFS = None 26 30 27 31 @property … … 31 35 32 36 def setStage(self, timestamp, stage): 33 """Set the flight stage.""" 37 """Set the flight stage. 38 39 Returns if the stage has really changed.""" 34 40 if stage!=self._stage: 35 41 self._stage = stage … … 38 44 with self._endCondition: 39 45 self._endCondition.notify() 46 return True 47 else: 48 return False 49 50 def flareStarted(self, flareStart, flareStartFS): 51 """Called when the flare time has started.""" 52 self._flareStart = flareStart 53 self._flareStartFS = flareStartFS 54 55 def flareFinished(self, flareEnd, flareEndFS): 56 """Called when the flare time has ended. 57 58 Return a tuple of the following items: 59 - a boolean indicating if FS time is used 60 - the flare time 61 """ 62 if self.flareTimeFromFS: 63 return (True, flareEndFS - self._flareStartFS) 64 else: 65 return (False, flareEnd - self._flareStart) 40 66 41 67 def wait(self):
Note:
See TracChangeset
for help on using the changeset viewer.