Changeset 30:b8f08115af4c for src/mlx/logger.py
- Timestamp:
- 02/25/12 13:55:56 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/logger.py
r27 r30 25 25 const.STAGE_GOAROUND : "Go-Around", 26 26 const.STAGE_END : "End" } 27 28 _noGoScore= 1000027 28 NO_GO_SCORE = 10000 29 29 30 30 def __init__(self, output = sys.stdout): … … 81 81 return 82 82 self._faults[faultID] = score 83 if score==Logger. _noGoScore:83 if score==Logger.NO_GO_SCORE: 84 84 self.message(timestamp, "%s (NO GO)" % (what)) 85 85 else: 86 86 self.message(timestamp, "%s (%.1f)" % (what, score)) 87 87 88 def noGo(self, faultID, timestamp, what , shortReason):88 def noGo(self, faultID, timestamp, what): 89 89 """Report a No-Go fault.""" 90 self.fault(faultID, timestamp, what, Logger. _noGoScore)90 self.fault(faultID, timestamp, what, Logger.NO_GO_SCORE) 91 91 92 def getScore(self): 93 """Get the score of the flight so far.""" 94 totalScore = 100 95 for (id, score) in self._faults.iteritems(): 96 if score==Logger.NO_GO_SCORE: 97 return -score 98 else: 99 totalScore -= score 100 return totalScore 101 92 102 #--------------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.