Changeset 335:db900a4a0930 for src
- Timestamp:
- 11/13/12 18:17:23 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r333 r335 118 118 119 119 self._appendLightsCheckers() 120 121 self._checkers.append(checks.TransponderChecker()) 120 122 121 123 self._checkers.append(checks.BankChecker()) -
src/mlx/checks.py
r333 r335 927 927 """Log the fault.""" 928 928 score = 0 if flight.stage==const.STAGE_LANDING else 1 929 message = "Landing lights were %s" % (("on" if state.landingLightsOn else "off"),) 929 message = "Landing lights were %s" % \ 930 (("on" if state.landingLightsOn else "off"),) 930 931 flight.handleFault(LandingLightsChecker, state.timestamp, 932 FaultChecker._appendDuring(flight, message), 933 score) 934 935 #--------------------------------------------------------------------------------------- 936 937 class TransponderChecker(PatientFaultChecker): 938 """Check if the transponder is used properly.""" 939 def isCondition(self, flight, aircraft, oldState, state): 940 """Check if the fault condition holds.""" 941 return state.xpdrC is not None and \ 942 ((state.xpdrC and flight.stage in 943 [const.STAGE_BOARDING, const.STAGE_PARKING]) or \ 944 (not state.xpdrC and flight.stage in 945 [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB, 946 const.STAGE_CRUISE, const.STAGE_DESCENT, 947 const.STAGE_LANDING, const.STAGE_GOAROUND])) 948 949 def logFault(self, flight, aircraft, logger, oldState, state): 950 """Log the fault.""" 951 score = 0 952 message = "Transponder was %s" % \ 953 (("mode C" if state.xpdrC else "standby"),) 954 flight.handleFault(TransponderChecker, state.timestamp, 931 955 FaultChecker._appendDuring(flight, message), 932 956 score) -
src/mlx/const.py
r329 r335 187 187 """Convert the given stage to a lower-case string.""" 188 188 return _stageStrings[stage] if stage in _stageStrings else None 189 189 190 190 #------------------------------------------------------------------------------- 191 191 … … 233 233 """Get the string equivalent of the given flight type.""" 234 234 return _flightTypeStrings[flightType] \ 235 if flightType in _flightTypeStrings else None 235 if flightType in _flightTypeStrings else None 236 236 237 237 #------------------------------------------------------------------------------- … … 325 325 """Get the string equivalent of the given message type.""" 326 326 return _messageTypeStrings[messageType] \ 327 if messageType in _messageTypeStrings else None 327 if messageType in _messageTypeStrings else None 328 328 329 329 #------------------------------------------------------------------------------- … … 358 358 """Get the string equivalent of the given message level.""" 359 359 return _messageLevelStrings[messageLevel] \ 360 if messageLevel in _messageLevelStrings else None 360 if messageLevel in _messageLevelStrings else None 361 361 362 362 def string2messageLevel(str): … … 476 476 """Get the string equivalent of the given fuelTank.""" 477 477 return _fuelTankStrings[fuelTank] \ 478 if fuelTank in _fuelTankStrings else None 478 if fuelTank in _fuelTankStrings else None 479 479 480 480 #------------------------------------------------------------------------------- … … 525 525 526 526 #------------------------------------------------------------------------------- 527
Note:
See TracChangeset
for help on using the changeset viewer.