Changeset 349:41c486c8a0b4 for src/mlx/flight.py
- Timestamp:
- 12/10/12 19:28:32 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/flight.py
r348 r349 1 1 2 2 from soundsched import SoundScheduler, ChecklistScheduler 3 from checks import SpeedChecker 3 4 4 5 import const … … 45 46 self.blockTimeEnd = None 46 47 48 self._rtoState = None 49 self._rtoLogEntryID = None 50 47 51 self._lastDistanceTime = None 48 52 self._previousLatitude = None … … 229 233 return self.aircraft.speedInKnots if self.aircraft is not None \ 230 234 else True 235 236 @property 237 def hasRTO(self): 238 """Determine if we have an RTO state.""" 239 return self._rtoState is not None 240 241 @property 242 def rtoState(self): 243 """Get the RTO state.""" 244 return self._rtoState 231 245 232 246 def handleState(self, oldState, currentState): … … 270 284 271 285 def handleFault(self, faultID, timestamp, what, score, 272 updatePrevious = False ):286 updatePrevious = False, updateID = None): 273 287 """Handle the given fault. 274 288 … … 277 291 the score is greater than last time. This ID can be, e.g. the checker 278 292 the report comes from.""" 279 self.logger.fault(faultID, timestamp, what, score, 280 updatePrevious = updatePrevious) 293 id = self.logger.fault(faultID, timestamp, what, score, 294 updatePrevious = updatePrevious, 295 updateID = updateID) 281 296 self._gui.setRating(self.logger.getRating()) 297 return id 282 298 283 299 def handleNoGo(self, faultID, timestamp, what, shortReason): … … 285 301 self.logger.noGo(faultID, timestamp, what) 286 302 self._gui.setNoGo(shortReason) 303 304 def setRTOState(self, state): 305 """Set the state that might be used as the RTO state. 306 307 If there has been no RTO state, the GUI is notified that from now on 308 the user may select to report an RTO.""" 309 hadNoRTOState = self._rtoState is None 310 311 self._rtoState = state 312 self._rtoLogEntryID = \ 313 SpeedChecker.logSpeedFault(self, state, 314 stage = const.STAGE_PUSHANDTAXI) 315 316 if hadNoRTOState: 317 self._gui.updateRTO() 318 319 def rtoToggled(self, indicated): 320 """Called when the user has toggled the RTO indication.""" 321 if self._rtoState is not None: 322 if indicated: 323 self.logger.clearFault(self._rtoLogEntryID, 324 "RTO at %d knots" % 325 (self._rtoState.groundSpeed,)) 326 self._gui.setRating(self.logger.getRating()) 327 else: 328 SpeedChecker.logSpeedFault(self, self._rtoState, 329 stage = const.STAGE_PUSHANDTAXI, 330 updateID = self._rtoLogEntryID) 287 331 288 332 def flareStarted(self, flareStart, flareStartFS):
Note:
See TracChangeset
for help on using the changeset viewer.