Ignore:
Timestamp:
12/22/12 08:42:13 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added support for logging the state of the anti-ice system (re #159)

File:
1 edited

Legend:

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

    r384 r391  
    19991999                                  xscale = 0.0, yscale = 0.0)
    20002000
    2001         table = gtk.Table(7, 4)
     2001        table = gtk.Table(8, 4)
    20022002        table.set_row_spacings(4)
    20032003        table.set_col_spacings(16)
     
    21022102        table.attach(self._derateUnit, 3, 4, 5, 6)
    21032103
     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
    21042109        self._rto = gtk.CheckButton(xstr("takeoff_rto"))
    21052110        self._rto.set_use_underline(True)
    21062111        self._rto.set_tooltip_text(xstr("takeoff_rto_tooltip"))
    21072112        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)
    21092114
    21102115        self.addCancelFlightButton()
     
    21472152        else:
    21482153            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)
    21492164
    21502165    @property
     
    22132228        self._vr.reset()
    22142229        self._v2.reset()
    2215 
    22162230        self._hasDerate = False
     2231        self._antiIceOn.set_active(False)
    22172232
    22182233    def setRTOEnabled(self, enabled):
     
    22592274    def _forwardClicked(self, button):
    22602275        """Called when the forward button is clicked."""
    2261         self._wizard.gui.flight.aircraft.updateV1R2()
     2276        aircraft = self._wizard.gui.flight.aircraft
     2277        aircraft.updateV1R2()
    22622278        if self._hasDerate:
    2263             self._wizard.gui.flight.aircraft.updateDerate()
     2279            aircraft.updateDerate()
     2280        aircraft.updateTakeoffAntiIce()
    22642281        self._wizard.nextPage()
    22652282
     
    23932410                                  xscale = 0.0, yscale = 0.0)
    23942411
    2395         table = gtk.Table(5, 5)
     2412        table = gtk.Table(6, 5)
    23962413        table.set_row_spacings(4)
    23972414        table.set_col_spacings(16)
     
    24622479        label.set_use_underline(True)
    24632480        label.set_alignment(0.0, 0.5)
    2464         table.attach(label, 1, 2, 5, 6)
     2481        table.attach(label, 1, 2, 4, 5)
    24652482
    24662483        self._vref = IntegerEntry()
     
    24682485        self._vref.set_tooltip_markup(xstr("landing_vref_tooltip_knots"))
    24692486        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)
    24712488        label.set_mnemonic_widget(self._vref)
    24722489
    24732490        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)
    24752497
    24762498        self.addCancelFlightButton()
     
    25102532        return self._vref.get_int()
    25112533
     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
    25122544    def reset(self):
    25132545        """Reset the page if the wizard is reset."""
    25142546        super(LandingPage, self).reset()
    25152547        self._vref.reset()
     2548        self._antiIceOn.set_active(False)
    25162549        self._flightEnded = False
    25172550
     
    25952628    def _forwardClicked(self, button):
    25962629        """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()
    25982633        if self._wizard.gui.config.onlineGateSystem and \
    25992634           self._wizard.loggedIn and not self._completed and \
     
    31873222
    31883223    @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
    31893234    def rtoIndicated(self):
    31903235        """Get whether the pilot has indicated that an RTO has occured."""
     
    32153260        """Get the Vref speed."""
    32163261        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
    32173272
    32183273    @property
Note: See TracChangeset for help on using the changeset viewer.