Changeset 32:46c1a12f72d1 for src/mlx/gui/common.py
- Timestamp:
- 02/25/12 15:49:27 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r29 r32 28 28 import cairo 29 29 30 #------------------------------------------------------------------------------ 31 32 class FlightStatusHandler(object): 33 """Base class for objects that handle the flight status in some way.""" 34 def __init__(self): 35 self._stage = None 36 self._rating = 100 37 self._noGoReason = None 38 39 def resetFlightStatus(self): 40 """Reset the flight status.""" 41 self._stage = None 42 self._rating = 100 43 self._noGoReason = None 44 self._updateFlightStatus() 45 46 def setStage(self, stage): 47 """Set the stage of the flight.""" 48 if stage!=self._stage: 49 self._stage = stage 50 self._updateFlightStatus() 51 52 def setRating(self, rating): 53 """Set the rating to the given value.""" 54 if rating!=self._rating: 55 self._rating = rating 56 if self._noGoReason is None: 57 self._updateFlightStatus() 58 59 def setNoGo(self, reason): 60 """Set a No-Go condition with the given reason.""" 61 if self._noGoReason is None: 62 self._noGoReason = reason 63 self._updateFlightStatus() 64 65 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.