Ignore:
Timestamp:
04/21/12 17:08:58 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Takeoff V-speeds can be entered after takeoff as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/flight.py

    r97 r101  
    13001300                                          completedHelp = completedHelp)
    13011301
     1302        self._forwardAllowed = False
     1303
    13021304        alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
    13031305                                  xscale = 0.0, yscale = 0.0)
     
    13181320        self._runway.set_width_chars(10)
    13191321        self._runway.set_tooltip_text("The runway the takeoff is performed from.")
     1322        self._runway.connect("changed", self._valueChanged)
    13201323        table.attach(self._runway, 1, 3, 0, 1)
    13211324        label.set_mnemonic_widget(self._runway)
     
    13291332        self._sid.set_width_chars(10)
    13301333        self._sid.set_tooltip_text("The name of the Standard Instrument Deparature procedure followed.")
     1334        self._sid.connect("changed", self._valueChanged)
    13311335        table.attach(self._sid, 1, 3, 1, 2)
    13321336        label.set_mnemonic_widget(self._sid)
     
    13411345        self._v1.set_width_chars(4)
    13421346        self._v1.set_tooltip_markup("The takeoff decision speed in knots.")
     1347        self._v1.connect("integer-changed", self._valueChanged)
    13431348        table.attach(self._v1, 2, 3, 2, 3)
    13441349        label.set_mnemonic_widget(self._v1)
     
    13551360        self._vr.set_width_chars(4)
    13561361        self._vr.set_tooltip_markup("The takeoff rotation speed in knots.")
     1362        self._vr.connect("integer-changed", self._valueChanged)
    13571363        table.attach(self._vr, 2, 3, 3, 4)
    13581364        label.set_mnemonic_widget(self._vr)
     
    13691375        self._v2.set_width_chars(4)
    13701376        self._v2.set_tooltip_markup("The takeoff safety speed in knots.")
     1377        self._v2.connect("integer-changed", self._valueChanged)
    13711378        table.attach(self._v2, 2, 3, 4, 5)
    13721379        label.set_mnemonic_widget(self._v2)
     
    14211428        self._button.set_sensitive(False)
    14221429       
    1423     def freezeValues(self):
    1424         """Freeze the values on the page, and enable the forward button."""
     1430    def finalize(self):
     1431        """Finalize the page."""
    14251432        self._runway.set_sensitive(False)
    14261433        self._sid.set_sensitive(False)
     
    14281435        self._vr.set_sensitive(False)
    14291436        self._v2.set_sensitive(False)
    1430         self._button.set_sensitive(True)
     1437        self._wizard.gui.flight.aircraft.updateV1R2()
     1438
     1439    def allowForward(self):
     1440        """Allow going to the next page."""
     1441        self._forwardAllowed = True
     1442        self._updateForwardButton()
     1443
     1444    def _updateForwardButton(self):
     1445        """Update the sensitivity of the forward button based on some conditions."""
     1446        sensitive = self._forwardAllowed and \
     1447                    self._runway.get_text()!="" and \
     1448                    self._sid.get_text()!="" and \
     1449                    self.v1 is not None and \
     1450                    self.vr is not None and \
     1451                    self.v2 is not None and \
     1452                    self.v1 <= self.vr and \
     1453                    self.vr <= self.v2
     1454        self._button.set_sensitive(sensitive)
     1455
     1456    def _valueChanged(self, widget, arg = None):
     1457        """Called when the value of some widget has changed."""
     1458        self._updateForwardButton()
    14311459       
    14321460    def _backClicked(self, button):
     
    20862114        """Set the flight stage to the given one."""
    20872115        if stage==const.STAGE_TAKEOFF:
    2088             self._takeoffPage.freezeValues()
     2116            self._takeoffPage.allowForward()
    20892117        elif stage==const.STAGE_END:
    20902118            self._landingPage.flightEnded()
Note: See TracChangeset for help on using the changeset viewer.