Ignore:
Timestamp:
02/25/12 13:55:56 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Fault messages are routed through the Flight object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/logger.py

    r27 r30  
    2525                const.STAGE_GOAROUND : "Go-Around",
    2626                const.STAGE_END : "End" }
    27 
    28     _noGoScore = 10000
     27   
     28    NO_GO_SCORE = 10000
    2929
    3030    def __init__(self, output = sys.stdout):
     
    8181                return
    8282        self._faults[faultID] = score
    83         if score==Logger._noGoScore:
     83        if score==Logger.NO_GO_SCORE:
    8484            self.message(timestamp, "%s (NO GO)" % (what))
    8585        else:
    8686            self.message(timestamp, "%s (%.1f)" % (what, score))
    8787
    88     def noGo(self, faultID, timestamp, what, shortReason):
     88    def noGo(self, faultID, timestamp, what):
    8989        """Report a No-Go fault."""
    90         self.fault(faultID, timestamp, what, Logger._noGoScore)
     90        self.fault(faultID, timestamp, what, Logger.NO_GO_SCORE)
    9191
     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       
    92102#--------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.