Changeset 365:db5767329602 for src
- Timestamp:
- 12/15/12 06:10:23 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/flight.py
r359 r365 43 43 self.blockTimeStart = None 44 44 self.flightTimeStart = None 45 self.climbTimeStart = None 46 self.cruiseTimeStart = None 47 self.descentTimeStart = None 45 48 self.flightTimeEnd = None 46 49 self.blockTimeEnd = None … … 265 268 Returns if the stage has really changed.""" 266 269 if stage!=self._stage: 270 self._logStageDuration(timestamp, stage) 267 271 self._stage = stage 268 272 self._gui.setStage(stage) … … 272 276 elif stage==const.STAGE_TAKEOFF: 273 277 self.flightTimeStart = timestamp 278 elif stage==const.STAGE_CLIMB: 279 self.climbTimeStart = timestamp 280 elif stage==const.STAGE_CRUISE: 281 self.cruiseTimeStart = timestamp 282 elif stage==const.STAGE_DESCENT: 283 self.descentTimeStart = timestamp 274 284 elif stage==const.STAGE_TAXIAFTERLAND: 275 285 self.flightTimeEnd = timestamp … … 439 449 currentState.latitude, currentState.longitude)[0] 440 450 451 def _logStageDuration(self, timestamp, stage): 452 """Log the duration of the stage preceding the given one.""" 453 what = None 454 startTime = None 455 456 if stage==const.STAGE_TAKEOFF: 457 what = "Pushback and taxi" 458 startTime = self.blockTimeStart 459 elif stage==const.STAGE_CRUISE: 460 what = "Climb" 461 startTime = self.climbTimeStart 462 elif stage==const.STAGE_DESCENT: 463 what = "Cruise" 464 startTime = self.cruiseTimeStart 465 elif stage==const.STAGE_LANDING: 466 what = "Descent" 467 startTime = self.descentTimeStart 468 elif stage==const.STAGE_END: 469 what = "Taxi after landing" 470 startTime = self.flightTimeEnd 471 472 if what is not None and startTime is not None: 473 duration = timestamp - startTime 474 self.logger.message(timestamp, 475 "%s time: %s" % \ 476 (what, util.getTimeIntervalString(duration))) 477 441 478 #---------------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.