Changeset 623:33edcb39a260
- Timestamp:
- 04/04/15 09:37:30 (10 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r622 r623 118 118 self.reverseMinSpeed = 50 119 119 120 self.needNoStrobeSpeedCheck = False121 122 120 self.maxTakeOffPitch = 15.0 123 121 self.maxTouchDownPitch = 15.0 … … 189 187 self._checkers.append(checks.PayloadChecker()) 190 188 191 self._checkers.append(checks.NoStrobeSpeedChecker())192 189 self._checkers.append(checks.SpeedChecker()) 193 190 self._checkers.append(checks.VSChecker()) … … 963 960 self.reverseMinSpeed = 50 964 961 965 self.needNoStrobeSpeedCheck = True966 967 962 self.maxTakeOffPitch = 16.0 968 963 self.maxTouchDownPitch = 16.0 … … 1012 1007 self.reverseMinSpeed = 50 1013 1008 1014 self.needNoStrobeSpeedCheck = True1015 1016 1009 self.maxTakeOffPitch = 16.0 1017 1010 self.maxTouchDownPitch = 16.0 … … 1058 1051 self.flapSpeedLimits = { 20 : 165, 1059 1052 35 : 135 } 1060 1061 self.needNoStrobeSpeedCheck = True1062 1053 1063 1054 @property -
src/mlx/checks.py
r622 r623 55 55 (not state.trickMode and state.groundSpeed>5.0): 56 56 aircraft.setStage(state, const.STAGE_PUSHANDTAXI) 57 elif stage==const.STAGE_PUSHANDTAXI or stage==const.STAGE_RTO:58 if state.strobeLightsOn or \59 (state.strobeLightsOn is None and state.xpdrC):60 aircraft.setStage(state, const.STAGE_TAKEOFF)61 57 elif stage==const.STAGE_TAKEOFF: 62 58 if not state.gearsDown or \ … … 1475 1471 #--------------------------------------------------------------------------------------- 1476 1472 1477 class SpeedChecker(SimpleFaultChecker): 1478 """Check if the speed is in the prescribed limits.""" 1479 @staticmethod 1480 def needNoStrobe(aircraft, state): 1481 """Determine if the given aircraft and state needs a strobeless speed 1482 checking.""" 1483 return aircraft.needNoStrobeSpeedCheck or \ 1484 (state.strobeLightsOn is None and state.xpdrC is None) 1485 1473 class SpeedChecker(StateChecker): 1474 """Checker for the ground speed of aircraft. 1475 1476 If, during the PUSHANDTAXI stage the speed exceeds 50 knots, the state is 1477 saved as a provisional takeoff state. If the speed then decreases below 50 1478 knots, or the plane remains on the ground for more than 40 seconds, a taxi 1479 speed error is logged with the highest ground speed detected. This state is 1480 also stored in the flight object as a possible 1481 1482 If the plane becomes airborne within 40 seconds, the stage becomes TAKEOFF, 1483 and the previously saved takeoff state is logged. 1484 1485 During the TAXIAFTERLAND stage, if the speed goes above 50 knots, a fault 1486 is logged based on the actual speed.""" 1486 1487 @staticmethod 1487 1488 def logSpeedFault(flight, state, stage = None, updateID = None): … … 1497 1498 updateID = updateID) 1498 1499 1499 def isCondition(self, flight, aircraft, oldState, state):1500 """Check if the fault condition holds."""1501 return not self.needNoStrobe(aircraft, state) and \1502 flight.stage in [const.STAGE_PUSHANDTAXI,1503 const.STAGE_RTO,1504 const.STAGE_TAXIAFTERLAND] and \1505 state.groundSpeed>501506 1507 def logFault(self, flight, aircraft, logger, oldState, state):1508 """Log the fault."""1509 self.logSpeedFault(flight, state)1510 1511 #---------------------------------------------------------------------------------------1512 1513 class NoStrobeSpeedChecker(StateChecker):1514 """Checker for the ground speed of aircraft that have no strobe lights by1515 which to detect the takeoff stage.1516 1517 If, during the PUSHANDTAXI stage the speed exceeds 50 knots, the state as1518 saved as a provisional takeoff state. If the speed then decreases below 501519 knots, or the plane remains on the ground for more than 40 seconds, a taxi1520 speed error is logged with the highest ground speed detected. This state is1521 also stored in the flight object as a possible1522 1523 If the plane becomes airborne within 40 seconds, the stage becomes TAKEOFF,1524 and the previously saved takeoff state is logged.1525 1526 During the TAXIAFTERLAND stage, speed is checked as in case of1527 SpeedChecker."""1528 1500 def __init__(self): 1529 1501 """Initialize the speed checker.""" … … 1533 1505 def check(self, flight, aircraft, logger, oldState, state): 1534 1506 """Check the state as described above.""" 1535 if SpeedChecker.needNoStrobe(aircraft, state): 1536 if flight.stage==const.STAGE_PUSHANDTAXI or \ 1537 flight.stage==const.STAGE_RTO: 1538 self._checkPushAndTaxi(flight, aircraft, state) 1539 elif flight.stage==const.STAGE_TAXIAFTERLAND: 1540 if state.groundSpeed>50: 1541 SpeedChecker.logSpeedFault(flight, state) 1542 else: 1543 self._takeoffState = None 1507 if flight.stage==const.STAGE_PUSHANDTAXI or \ 1508 flight.stage==const.STAGE_RTO: 1509 self._checkPushAndTaxi(flight, aircraft, state) 1510 elif flight.stage==const.STAGE_TAXIAFTERLAND: 1511 if state.groundSpeed>50: 1512 self.logSpeedFault(flight, state) 1513 else: 1514 self._takeoffState = None 1544 1515 1545 1516 def _checkPushAndTaxi(self, flight, aircraft, state):
Note:
See TracChangeset
for help on using the changeset viewer.