Changeset 361:297b84854dfc for src/mlx
- Timestamp:
- 12/14/12 18:39:04 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/checks.py
r360 r361 1070 1070 class TransponderChecker(PatientFaultChecker): 1071 1071 """Check if the transponder is used properly.""" 1072 def isCondition(self, flight, aircraft, oldState, state): 1073 """Check if the fault condition holds.""" 1072 def __init__(self): 1073 """Construct the transponder checker.""" 1074 super(TransponderChecker, self).__init__() 1075 self._liftOffTime = None 1076 1077 def isCondition(self, flight, aircraft, oldState, state): 1078 """Check if the fault condition holds.""" 1079 if state.onTheGround: 1080 self._liftOffTime = None 1081 elif self._liftOffTime is None: 1082 self._liftOffTime = state.timestamp 1083 1074 1084 return state.xpdrC is not None and \ 1075 1085 ((state.xpdrC and flight.stage in 1076 1086 [const.STAGE_BOARDING, const.STAGE_PARKING]) or \ 1077 (not state.xpdrC and flight.stage in 1078 [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB, 1079 const.STAGE_CRUISE, const.STAGE_DESCENT, 1080 const.STAGE_LANDING, const.STAGE_GOAROUND])) 1087 (not state.xpdrC and 1088 (flight.stage in 1089 [const.STAGE_CRUISE, const.STAGE_DESCENT, 1090 const.STAGE_LANDING, const.STAGE_GOAROUND] or \ 1091 ((not state.autoXPDR or \ 1092 (self._liftOffTime is not None and 1093 state.timestamp > (self._liftOffTime+8))) and \ 1094 flight.stage in 1095 [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB]) 1096 ) 1097 ) 1098 ) 1081 1099 1082 1100 def logFault(self, flight, aircraft, logger, oldState, state): -
src/mlx/fs.py
r341 r361 250 250 - xpdrC: a boolean indicating whether the transponder is in C mode, or 251 251 None, if the state cannot be read properly 252 - autoXPDR: a boolean indicating whether the transponder is turned on 253 automatically if the aircraft becomes airborne 252 254 - apMaster: a boolean indicating whether the autopilot is switched on, or 253 255 None, if the state cannot be read properly -
src/mlx/fsuipc.py
r341 r361 1394 1394 1395 1395 state.xpdrC = data[self._monidx_xpdrC]==0 1396 state.autoXPDR = False 1396 1397 1397 1398 state.apMaster = data[self._monidx_apMaster]!=0 … … 1792 1793 state.landingLightsOn = None 1793 1794 state.nav2_manual = aircraft.flight.stage!=const.STAGE_CRUISE 1795 self.autoXPDR = True 1794 1796 1795 1797 return state
Note:
See TracChangeset
for help on using the changeset viewer.