Changeset 356:a9dd7d794212 for src/mlx
- Timestamp:
- 12/13/12 15:49:06 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/checks.py
r355 r356 261 261 """Base class for classes the instances of which check if a specific change has 262 262 occured in the aircraft's state, and log such change.""" 263 def __init__(self, logInitial = True ):263 def __init__(self, logInitial = True, excludedStages = None): 264 264 """Construct the logger. 265 265 266 266 If logInitial is True, the initial value will be logged, not just the 267 267 changes later. 268 269 If excludedStages is given, it should be a list containing those stages 270 during which the changes should not be logged. 268 271 269 272 Child classes should define the following functions: … … 274 277 """ 275 278 self._logInitial = logInitial 279 self._excludedStages = [] if excludedStages is None else excludedStages 276 280 277 281 def _getLogTimestamp(self, state, forced): … … 281 285 def check(self, flight, aircraft, logger, oldState, state): 282 286 """Check if the state has changed, and if so, log the new state.""" 287 if flight.stage in self._excludedStages: 288 return 289 283 290 shouldLog = False 284 291 if oldState is None: … … 415 422 state possibly with a delay and the logged message comes from a template""" 416 423 def __init__(self, attrName, template, logInitial = True, 417 minDelay = 0.0, maxDelay = 0.0):424 excludedStages = None, minDelay = 0.0, maxDelay = 0.0): 418 425 """Construct the object.""" 419 426 StateChangeLogger.__init__(self, logInitial = logInitial) … … 461 468 462 469 It also logs the OBS radial set.""" 470 excludedStages = [const.STAGE_BOARDING, const.STAGE_PUSHANDTAXI, 471 const.STAGE_RTO, const.STAGE_TAXIAFTERLAND, 472 const.STAGE_PARKING] 473 463 474 @staticmethod 464 475 def getMessage(logName, frequency, obs): … … 470 481 def __init__(self, attrName, logName): 471 482 """Construct the NAV logger.""" 472 StateChangeLogger.__init__(self, logInitial = True) 483 StateChangeLogger.__init__(self, logInitial = False, 484 excludedStages = self.excludedStages) 473 485 DelayedChangeMixin.__init__(self) 474 486 … … 527 539 GenericStateChangeLogger.__init__(self, attr, 528 540 "%s: %%s" % (logName,), 541 logInitial = False, 542 excludedStages = 543 NAVLogger.excludedStages, 529 544 minDelay = 3.0, maxDelay = 10.0) 530 545
Note:
See TracChangeset
for help on using the changeset viewer.