Changeset 335:db900a4a0930
- Timestamp:
- 11/13/12 18:17:23 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 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 -
test/test1.txt
r329 r335 1 set xpdrC=1 1 2 set lights=0 3 set noseGear=100 4 set flapsControl=0 2 5 set zfw=46741 hour=7 min=50 3 6 set latitude=47.44 longitude=19.26 … … 7 10 set gs=10 ias=10 8 11 set flapsControl=37.5 12 set xpdrC=0 9 13 set gs=60 ias=60 10 14 set lights=21 … … 23 27 set altitude=22001 24 28 set vs=-200 29 set nav1=116.3 25 30 set flapsControl=87.5 26 31 set ias=130 gs=130 … … 28 33 set ias=125 gs=125 29 34 set radioAltitude=3200 30 set radioAltitude=310031 set radioAltitude=300032 set radioAltitude=290033 set radioAltitude=280034 set radioAltitude=270035 set radioAltitude=260036 set radioAltitude=252137 set radioAltitude=251038 set radioAltitude=250039 set radioAltitude=250040 set radioAltitude=249941 set radioAltitude=252042 set radioAltitude=240043 set radioAltitude=230044 set radioAltitude=220045 set radioAltitude=210046 set radioAltitude=201847 set radioAltitude=195048 set radioAltitude=180049 set radioAltitude=160050 set radioAltitude=155051 set radioAltitude=145052 set radioAltitude=159053 set radioAltitude=149954 set radioAltitude=140055 set radioAltitude=130056 set radioAltitude=120057 set radioAltitude=120058 35 set radioAltitude=1100 59 set radioAltitude=100160 set radioAltitude=91261 set radioAltitude=83262 set radioAltitude=70563 set radioAltitude=59964 set radioAltitude=50165 set radioAltitude=41266 set radioAltitude=33167 set radioAltitude=24168 set radioAltitude=10269 set radioAltitude=9070 36 set noseGear=100 71 set radioAltitude=8072 set radioAltitude=7073 set radioAltitude=6074 set radioAltitude=5175 set radioAltitude=4276 37 set radioAltitude=29 77 38 set radioAltitude=9 … … 82 43 set ias=35 gs=35 83 44 set ias=20 gs=20 45 set xpdrC=1 84 46 set ias=0 gs=0 85 47 set parking=yes
Note:
See TracChangeset
for help on using the changeset viewer.