Changeset 539:750f64278751 for src/mlx
- Timestamp:
- 09/18/13 04:52:50 (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r526 r539 113 113 self.reverseMinSpeed = 60 114 114 115 self.needNoStrobeSpeedCheck = False 116 115 117 self._checkers = [] 116 118 … … 178 180 self._checkers.append(checks.PayloadChecker()) 179 181 180 self._appendSpeedChecker() 182 self._checkers.append(checks.NoStrobeSpeedChecker()) 183 self._checkers.append(checks.SpeedChecker()) 181 184 self._checkers.append(checks.VSChecker()) 182 185 … … 480 483 self._checkers.append(checks.StrobeLightsChecker()) 481 484 482 def _appendSpeedChecker(self):483 """Append the speed checker.484 485 This default implementation used the SpeedChecker."""486 self._checkers.append(checks.SpeedChecker())487 488 485 def _speedToLog(self, speed): 489 486 """Convert the given speed (being either None or expressed in the … … 651 648 """Get the derate type for this type.""" 652 649 return DERATE_BOEING 653 654 # def _appendSpeedChecker(self):655 # """Append the NoStrobeSpeedChecker to the checkers.656 657 # FOR TESTING ONLY, THIS FUNCTION SHOULD NORMALLY BE COMMENTED OUT!!!"""658 # self._checkers.append(checks.NoStrobeSpeedChecker())659 650 660 651 #--------------------------------------------------------------------------------------- … … 906 897 self.reverseMinSpeed = 50 907 898 899 self.needNoStrobeSpeedCheck = True 900 908 901 @property 909 902 def derateType(self): … … 927 920 self._checkers.append(checks.LandingLightsChecker()) 928 921 self._checkers.append(checks.NavLightsChecker()) 929 930 def _appendSpeedChecker(self):931 """Append the NoStrobeSpeedChecker to the checkers."""932 self._checkers.append(checks.NoStrobeSpeedChecker())933 922 934 923 #--------------------------------------------------------------------------------------- … … 954 943 self.reverseMinSpeed = 50 955 944 945 self.needNoStrobeSpeedCheck = True 946 956 947 @property 957 948 def speedInKnots(self): … … 975 966 self._checkers.append(checks.LandingLightsChecker()) 976 967 self._checkers.append(checks.NavLightsChecker()) 977 978 def _appendSpeedChecker(self):979 """Append the NoStrobeSpeedChecker to the checkers."""980 self._checkers.append(checks.NoStrobeSpeedChecker())981 968 982 969 #--------------------------------------------------------------------------------------- … … 1000 987 35 : 135 } 1001 988 989 self.needNoStrobeSpeedCheck = True 990 1002 991 @property 1003 992 def speedInKnots(self): … … 1021 1010 self._checkers.append(checks.LandingLightsChecker()) 1022 1011 self._checkers.append(checks.NavLightsChecker()) 1023 1024 def _appendSpeedChecker(self):1025 """Append the NoStrobeSpeedChecker to the checkers."""1026 self._checkers.append(checks.NoStrobeSpeedChecker())1027 1012 1028 1013 #--------------------------------------------------------------------------------------- -
src/mlx/checks.py
r529 r539 1342 1342 """Check if the speed is in the prescribed limits.""" 1343 1343 @staticmethod 1344 def needNoStrobe(aircraft, state): 1345 """Determine if the given aircraft and state needs a strobeless speed 1346 checking.""" 1347 return aircraft.needNoStrobeSpeedCheck or \ 1348 (state.strobeLightsOn is None and state.xpdrC is None) 1349 1350 @staticmethod 1344 1351 def logSpeedFault(flight, state, stage = None, updateID = None): 1345 1352 """Log the speed fault.""" … … 1356 1363 def isCondition(self, flight, aircraft, oldState, state): 1357 1364 """Check if the fault condition holds.""" 1358 return flight.stage in [const.STAGE_PUSHANDTAXI, 1359 const.STAGE_RTO, 1360 const.STAGE_TAXIAFTERLAND] and \ 1365 return not self.needNoStrobe(aircraft, state) and \ 1366 flight.stage in [const.STAGE_PUSHANDTAXI, 1367 const.STAGE_RTO, 1368 const.STAGE_TAXIAFTERLAND] and \ 1361 1369 state.groundSpeed>50 1362 1370 … … 1389 1397 def check(self, flight, aircraft, logger, oldState, state): 1390 1398 """Check the state as described above.""" 1391 if flight.stage==const.STAGE_PUSHANDTAXI or \ 1392 flight.stage==const.STAGE_RTO: 1393 self._checkPushAndTaxi(flight, aircraft, state) 1394 elif flight.stage==const.STAGE_TAXIAFTERLAND: 1395 if state.groundSpeed>50: 1396 SpeedChecker.logSpeedFault(flight, state) 1397 else: 1398 self._takeoffState = None 1399 if SpeedChecker.needNoStrobe(aircraft, state): 1400 if flight.stage==const.STAGE_PUSHANDTAXI or \ 1401 flight.stage==const.STAGE_RTO: 1402 self._checkPushAndTaxi(flight, aircraft, state) 1403 elif flight.stage==const.STAGE_TAXIAFTERLAND: 1404 if state.groundSpeed>50: 1405 SpeedChecker.logSpeedFault(flight, state) 1406 else: 1407 self._takeoffState = None 1399 1408 1400 1409 def _checkPushAndTaxi(self, flight, aircraft, state): -
src/mlx/fsuipc.py
r535 r539 1626 1626 return "FSUIPC/Generic Boeing 737" 1627 1627 1628 # Note: the function below should be enabled if testing the speed-based 1629 # takeoff on Linux 1630 # def getAircraftState(self, aircraft, timestamp, data): 1631 # """Get the aircraft state. 1632 1633 # Get it from the parent, and then check some PMDG-specific stuff.""" 1634 # state = super(B737Model, self).getAircraftState(aircraft, 1635 # timestamp, 1636 # data) 1637 # state.strobeLightsOn = None 1638 # state.xpdrC = None 1639 1640 # return state 1641 1628 1642 #------------------------------------------------------------------------------ 1629 1643 … … 1690 1704 apalthold = data[self._pmdgidx_apalthold] 1691 1705 state.apAltitudeHold = apalthold>=3 and apalthold<=6 1706 state.xpdrC = data[self._pmdgidx_xpdr]==4 1707 1708 # Uncomment the following to test the speed-based takeoff 1709 # state.strobeLightsOn = None 1710 # state.xpdrC = None 1692 1711 else: 1693 1712 state.apMaster = data[self._pmdgidx_cmda]!=0 1694 1713 state.apHeadingHold = data[self._pmdgidx_aphdgsel]!=0 1695 1714 state.apAltitudeHold = data[self._pmdgidx_apalthold]!=0 1696 #state.strobeLightsOn = data[self._pmdgidx_lts_positionsw]==0x02 1715 1716 # state.strobeLightsOn = data[self._pmdgidx_lts_positionsw]==0x02 1717 # state.xpdrC = data[self._pmdgidx_xpdr]==4 1697 1718 state.strobeLightsOn = None 1698 1699 state.xpdrC = data[self._pmdgidx_xpdr]==4 1719 state.xpdrC = None 1720 1700 1721 state.apHeading = data[self._pmdgidx_aphdg] 1701 1722 state.apAltitude = data[self._pmdgidx_apalt]
Note:
See TracChangeset
for help on using the changeset viewer.