Changeset 211:fbd8dad0b6be for src/mlx/checks.py
- Timestamp:
- 05/31/12 15:37:24 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/checks.py
r209 r211 547 547 def isCondition(self, flight, aircraft, oldState, state): 548 548 """Check if the fault condition holds.""" 549 isTupolev = aircraft.type in [const.AIRCRAFT_T134,550 const.AIRCRAFT_T154]551 549 return (flight.stage!=const.STAGE_PARKING or \ 552 550 not flight.config.usingFS2Crew) and \ 553 551 not state.antiCollisionLightsOn and \ 554 ((isTupolev and max(state.n1[1:])>5) or \ 555 (not isTupolev and max(state.n1)>5)) 552 self.isEngineCondition(state) 556 553 557 554 def logFault(self, flight, aircraft, logger, oldState, state): … … 561 558 "Anti-collision lights were off"), 562 559 1) 560 561 def isEngineCondition(self, state): 562 """Determine if the engines are in such a state that the lights should 563 be on.""" 564 return max(state.n1)>5 565 566 #--------------------------------------------------------------------------------------- 567 568 class TupolevAntiCollisionLightsChecker(AntiCollisionLightsChecker): 569 """Check for the anti-collision light for Tuplev planes.""" 570 571 def isEngineCondition(self, state): 572 """Determine if the engines are in such a state that the lights should 573 be on.""" 574 return max(state.n1[1:])>5 575 563 576 564 577 #--------------------------------------------------------------------------------------- … … 923 936 def isCondition(self, flight, aircraft, oldState, state): 924 937 """Check if the fault condition holds.""" 925 if aircraft.type in [const.AIRCRAFT_T134, 926 const.AIRCRAFT_T154, 927 const.AIRCRAFT_YK40]: 928 return False 929 else: 930 return (flight.stage==const.STAGE_BOARDING and \ 931 state.strobeLightsOn and state.onTheGround) or \ 932 (flight.stage==const.STAGE_TAKEOFF and \ 933 not state.strobeLightsOn and not state.gearsDown) or \ 934 (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE, 935 const.STAGE_DESCENT] and \ 936 not state.strobeLightsOn and not state.onTheGround) or \ 937 (flight.stage==const.STAGE_PARKING and \ 938 state.strobeLightsOn and state.onTheGround) 938 return (flight.stage==const.STAGE_BOARDING and \ 939 state.strobeLightsOn and state.onTheGround) or \ 940 (flight.stage==const.STAGE_TAKEOFF and \ 941 not state.strobeLightsOn and not state.gearsDown) or \ 942 (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE, 943 const.STAGE_DESCENT] and \ 944 not state.strobeLightsOn and not state.onTheGround) or \ 945 (flight.stage==const.STAGE_PARKING and \ 946 state.strobeLightsOn and state.onTheGround) 939 947 940 948 def logFault(self, flight, aircraft, logger, oldState, state):
Note:
See TracChangeset
for help on using the changeset viewer.