Changeset 324:b1d504a874dc
- Timestamp:
- 10/21/12 05:08:13 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/checks.py
r321 r324 275 275 self._logInitial = logInitial 276 276 277 def _getLogTimestamp(self, state ):277 def _getLogTimestamp(self, state, forced): 278 278 """Get the log timestamp.""" 279 279 return state.timestamp … … 294 294 message = self._getMessage(flight, state, forced) 295 295 if message is not None: 296 logger.message(self._getLogTimestamp(state ), message)296 logger.message(self._getLogTimestamp(state, forced), message) 297 297 298 298 #------------------------------------------------------------------------------- … … 351 351 352 352 if self._firstChange is not None: 353 if state.timestamp >= min(self._lastChangeState.timestamp + self._minDelay, 353 if state.timestamp >= min(self._lastChangeState.timestamp + 354 self._minDelay, 354 355 self._firstChange + self._maxDelay): 355 356 self._firstChange = None … … 358 359 return False 359 360 360 def _getLogTimestamp(self, state ):361 def _getLogTimestamp(self, state, forced): 361 362 """Get the log timestamp.""" 362 return self._lastChangeState.timestamp if \ 363 self._lastChangeState is not None else state.timestamp 363 return self._lastChangeState.timestamp \ 364 if not forced and self._lastChangeState is not None \ 365 else state.timestamp 364 366 365 367 def _isDifferent(self, oldValue, newValue): … … 398 400 DelayedChangeMixin.__init__(self, minDelay = minDelay, maxDelay = maxDelay) 399 401 TemplateMessageMixin.__init__(self, template) 400 self._getLogTimestamp = lambda state: \ 401 DelayedChangeMixin._getLogTimestamp(self, state) 402 self._getLogTimestamp = \ 403 lambda state, forced: \ 404 DelayedChangeMixin._getLogTimestamp(self, state, forced) 402 405 403 406 #--------------------------------------------------------------------------------------- … … 449 452 SingleValueMixin.__init__(self, "altimeter") 450 453 DelayedChangeMixin.__init__(self) 451 self._getLogTimestamp = lambda state: \ 452 DelayedChangeMixin._getLogTimestamp(self, state) 454 self._getLogTimestamp = \ 455 lambda state, forced: \ 456 DelayedChangeMixin._getLogTimestamp(self, state, forced) 453 457 454 458 def _getMessage(self, flight, state, forced): … … 482 486 forced = forced) 483 487 self._getLogTimestamp = \ 484 lambda state: DelayedChangeMixin._getLogTimestamp(self, state) 488 lambda state, forced: \ 489 DelayedChangeMixin._getLogTimestamp(self, state, forced) 485 490 self._changed = lambda oldState, state: \ 486 491 ForceableLoggerMixin._changed(self, oldState, state) -
test/test1.txt
r273 r324 2 2 set zfw=46741 hour=7 min=50 3 3 set latitude=47.44 longitude=19.26 4 set nav1=115.9 4 5 set parking=no 5 6 set gs=10 ias=10
Note:
See TracChangeset
for help on using the changeset viewer.