Changeset 391:0f2e90eae832 for src/mlx
- Timestamp:
- 12/22/12 08:42:13 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r384 r391 76 76 self._v1r2LineIndex = None 77 77 self._derateLineID = None 78 self._takeoffAntiIceLineID = None 78 79 self._vrefLineIndex = None 80 self._landingAntiIceLineID = None 79 81 80 82 self.humanWeight = 82.0 … … 294 296 self._logV1R2(aircraftState) 295 297 self._logDerate(aircraftState) 298 self._logTakeoffAntiIce(aircraftState) 296 299 elif newStage==const.STAGE_DESCENT or newStage==const.STAGE_LANDING: 297 300 self._logRadios(aircraftState) … … 351 354 (self._aircraftState.altimeter,)) 352 355 self._logVRef() 356 self._logLandingAntiIce(self._aircraftState) 353 357 self.flight.flareStarted(flareStart, flareStartFS) 354 358 fs.sendMessage(const.MESSAGETYPE_INFORMATION, "Flare-time", 3) … … 409 413 self._logDerate() 410 414 415 def updateTakeoffAntiIce(self): 416 """Update the take-off anti-ice setting.""" 417 if self._takeoffAntiIceLineID is not None: 418 self._logTakeoffAntiIce() 419 411 420 def _appendLightsLoggers(self): 412 421 """Append the loggers needed for the lights. … … 475 484 else: 476 485 self.logger.updateLine(self._derateLineID, message) 486 487 def _logTakeoffAntiIce(self, state = None): 488 """Log the take-off anti-ice setting either newly or by updating the 489 corresponding line.""" 490 antiIceOn = self._flight.takeoffAntiIceOn 491 if state is not None: 492 antiIceOn = antiIceOn or state.antiIceOn is True 493 self._flight.takeoffAntiIceOn = antiIceOn 494 495 message = "Anti-ice was turned %s" % \ 496 ("ON" if antiIceOn else "OFF") 497 498 if self._takeoffAntiIceLineID is None: 499 if state is None: 500 state = self._aircraftState 501 self._takeoffAntiIceLineID = \ 502 self.logger.message(state.timestamp, message) 503 else: 504 self.logger.updateLine(self._takeoffAntiIceLineID, message) 477 505 478 506 def updateVRef(self): … … 492 520 else: 493 521 self.logger.updateLine(self._vrefLineIndex, message) 522 523 def updateLandingAntiIce(self): 524 """Update the landing anti-ice setting.""" 525 if self._landingAntiIceLineID is not None: 526 self._logLandingAntiIce() 527 528 def _logLandingAntiIce(self, state = None): 529 """Log the landing anti-ice setting either newly or by updating the 530 corresponding line.""" 531 antiIceOn = self._flight.landingAntiIceOn 532 if state is not None: 533 antiIceOn = antiIceOn or state.antiIceOn is True 534 self._flight.landingAntiIceOn = antiIceOn 535 536 message = "Anti-ice was turned %s" % \ 537 ("ON" if antiIceOn else "OFF") 538 539 if self._landingAntiIceLineID is None: 540 if state is None: 541 state = self._aircraftState 542 self._landingAntiIceLineID = \ 543 self.logger.message(state.timestamp, message) 544 else: 545 self.logger.updateLine(self._landingAntiIceLineID, message) 494 546 495 547 def _fleetRetrieved(self, fleet): -
src/mlx/flight.py
r384 r391 183 183 184 184 @property 185 def takeoffAntiIceOn(self): 186 """Get whether the anti-ice system was on during takeoff.""" 187 return self._gui.takeoffAntiIceOn 188 189 @takeoffAntiIceOn.setter 190 def takeoffAntiIceOn(self, value): 191 """Set whether the anti-ice system was on during takeoff.""" 192 self._gui.takeoffAntiIceOn = value 193 194 @property 185 195 def derate(self): 186 196 """Get the derate value of the flight.""" … … 211 221 """Get the VRef speed of the flight.""" 212 222 return self._gui.vref 223 224 @property 225 def landingAntiIceOn(self): 226 """Get whether the anti-ice system was on during landing.""" 227 return self._gui.landingAntiIceOn 228 229 @landingAntiIceOn.setter 230 def landingAntiIceOn(self, value): 231 """Set whether the anti-ice system was on during landing.""" 232 self._gui.landingAntiIceOn = value 213 233 214 234 @property -
src/mlx/gui/flight.py
r384 r391 1999 1999 xscale = 0.0, yscale = 0.0) 2000 2000 2001 table = gtk.Table( 7, 4)2001 table = gtk.Table(8, 4) 2002 2002 table.set_row_spacings(4) 2003 2003 table.set_col_spacings(16) … … 2102 2102 table.attach(self._derateUnit, 3, 4, 5, 6) 2103 2103 2104 self._antiIceOn = gtk.CheckButton(xstr("takeoff_antiice")) 2105 self._antiIceOn.set_use_underline(True) 2106 self._antiIceOn.set_tooltip_text(xstr("takeoff_antiice_tooltip")) 2107 table.attach(self._antiIceOn, 2, 4, 6, 7) 2108 2104 2109 self._rto = gtk.CheckButton(xstr("takeoff_rto")) 2105 2110 self._rto.set_use_underline(True) 2106 2111 self._rto.set_tooltip_text(xstr("takeoff_rto_tooltip")) 2107 2112 self._rto.connect("toggled", self._rtoToggled) 2108 table.attach(self._rto, 2, 4, 6, 7, ypadding = 8)2113 table.attach(self._rto, 2, 4, 7, 8, ypadding = 8) 2109 2114 2110 2115 self.addCancelFlightButton() … … 2147 2152 else: 2148 2153 return None 2154 2155 @property 2156 def antiIceOn(self): 2157 """Get whether the anti-ice system has been turned on.""" 2158 return self._antiIceOn.get_active() 2159 2160 @antiIceOn.setter 2161 def antiIceOn(self, value): 2162 """Set the anti-ice indicator.""" 2163 self._antiIceOn.set_active(value) 2149 2164 2150 2165 @property … … 2213 2228 self._vr.reset() 2214 2229 self._v2.reset() 2215 2216 2230 self._hasDerate = False 2231 self._antiIceOn.set_active(False) 2217 2232 2218 2233 def setRTOEnabled(self, enabled): … … 2259 2274 def _forwardClicked(self, button): 2260 2275 """Called when the forward button is clicked.""" 2261 self._wizard.gui.flight.aircraft.updateV1R2() 2276 aircraft = self._wizard.gui.flight.aircraft 2277 aircraft.updateV1R2() 2262 2278 if self._hasDerate: 2263 self._wizard.gui.flight.aircraft.updateDerate() 2279 aircraft.updateDerate() 2280 aircraft.updateTakeoffAntiIce() 2264 2281 self._wizard.nextPage() 2265 2282 … … 2393 2410 xscale = 0.0, yscale = 0.0) 2394 2411 2395 table = gtk.Table( 5, 5)2412 table = gtk.Table(6, 5) 2396 2413 table.set_row_spacings(4) 2397 2414 table.set_col_spacings(16) … … 2462 2479 label.set_use_underline(True) 2463 2480 label.set_alignment(0.0, 0.5) 2464 table.attach(label, 1, 2, 5, 6)2481 table.attach(label, 1, 2, 4, 5) 2465 2482 2466 2483 self._vref = IntegerEntry() … … 2468 2485 self._vref.set_tooltip_markup(xstr("landing_vref_tooltip_knots")) 2469 2486 self._vref.connect("integer-changed", self._vrefChanged) 2470 table.attach(self._vref, 3, 4, 5, 6)2487 table.attach(self._vref, 3, 4, 4, 5) 2471 2488 label.set_mnemonic_widget(self._vref) 2472 2489 2473 2490 self._vrefUnit = gtk.Label(xstr("label_knots")) 2474 table.attach(self._vrefUnit, 4, 5, 5, 6) 2491 table.attach(self._vrefUnit, 4, 5, 4, 5) 2492 2493 self._antiIceOn = gtk.CheckButton(xstr("landing_antiice")) 2494 self._antiIceOn.set_use_underline(True) 2495 self._antiIceOn.set_tooltip_text(xstr("landing_antiice_tooltip")) 2496 table.attach(self._antiIceOn, 3, 5, 5, 6) 2475 2497 2476 2498 self.addCancelFlightButton() … … 2510 2532 return self._vref.get_int() 2511 2533 2534 @property 2535 def antiIceOn(self): 2536 """Get whether the anti-ice system has been turned on.""" 2537 return self._antiIceOn.get_active() 2538 2539 @antiIceOn.setter 2540 def antiIceOn(self, value): 2541 """Set the anti-ice indicator.""" 2542 self._antiIceOn.set_active(value) 2543 2512 2544 def reset(self): 2513 2545 """Reset the page if the wizard is reset.""" 2514 2546 super(LandingPage, self).reset() 2515 2547 self._vref.reset() 2548 self._antiIceOn.set_active(False) 2516 2549 self._flightEnded = False 2517 2550 … … 2595 2628 def _forwardClicked(self, button): 2596 2629 """Called when the forward button is clicked.""" 2597 self._wizard.gui.flight.aircraft.updateVRef() 2630 aircraft = self._wizard.gui.flight.aircraft 2631 aircraft.updateVRef() 2632 aircraft.updateLandingAntiIce() 2598 2633 if self._wizard.gui.config.onlineGateSystem and \ 2599 2634 self._wizard.loggedIn and not self._completed and \ … … 3187 3222 3188 3223 @property 3224 def takeoffAntiIceOn(self): 3225 """Get whether the anti-ice system was on during take-off.""" 3226 return self._takeoffPage.antiIceOn 3227 3228 @takeoffAntiIceOn.setter 3229 def takeoffAntiIceOn(self, value): 3230 """Set anti-ice on indicator.""" 3231 self._takeoffPage.antiIceOn = value 3232 3233 @property 3189 3234 def rtoIndicated(self): 3190 3235 """Get whether the pilot has indicated that an RTO has occured.""" … … 3215 3260 """Get the Vref speed.""" 3216 3261 return self._landingPage.vref 3262 3263 @property 3264 def landingAntiIceOn(self): 3265 """Get whether the anti-ice system was on during landing.""" 3266 return self._landingPage.antiIceOn 3267 3268 @landingAntiIceOn.setter 3269 def landingAntiIceOn(self, value): 3270 """Set anti-ice on indicator.""" 3271 self._landingPage.antiIceOn = value 3217 3272 3218 3273 @property -
src/mlx/gui/gui.py
r384 r391 313 313 314 314 @property 315 def takeoffAntiIceOn(self): 316 """Get whether the anti-ice system was on during take-off.""" 317 return self._wizard.takeoffAntiIceOn 318 319 @takeoffAntiIceOn.setter 320 def takeoffAntiIceOn(self, value): 321 """Set the anti-ice on indicator.""" 322 gobject.idle_add(self._setTakeoffAntiIceOn, value) 323 324 @property 315 325 def rtoIndicated(self): 316 326 """Get whether the pilot has indicated than an RTO has occured.""" … … 341 351 """Get the Vref speed calculated for the flight.""" 342 352 return self._wizard.vref 353 354 @property 355 def landingAntiIceOn(self): 356 """Get whether the anti-ice system was on during landing.""" 357 return self._wizard.landingAntiIceOn 358 359 @landingAntiIceOn.setter 360 def landingAntiIceOn(self, value): 361 """Set the anti-ice on indicator.""" 362 gobject.idle_add(self._setLandingAntiIceOn, value) 343 363 344 364 @property … … 1438 1458 """Show the about URL.""" 1439 1459 webbrowser.open(url = link, new = 1) 1460 1461 def _setTakeoffAntiIceOn(self, value): 1462 """Set the anti-ice on indicator.""" 1463 self._wizard.takeoffAntiIceOn = value 1464 1465 def _setLandingAntiIceOn(self, value): 1466 """Set the anti-ice on indicator.""" 1467 self._wizard.landingAntiIceOn = value
Note:
See TracChangeset
for help on using the changeset viewer.