Changeset 398:d49b2b524194


Ignore:
Timestamp:
12/23/12 06:06:36 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Fixed trouble with None values (re #167)

File:
1 edited

Legend:

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

    r390 r398  
    315315            self._stalled.set_sensitive(aircraftState.stalled)
    316316            self._onTheGround.set_sensitive(aircraftState.onTheGround)
    317             self._antiIceOn.set_sensitive(aircraftState.antiIceOn)
     317            self._antiIceOn.set_sensitive(aircraftState.antiIceOn is True)
    318318            self._zfw.set_text("%.0f" % (aircraftState.zfw,))
    319319            self._grossWeight.set_text("%.0f" % (aircraftState.grossWeight,))
     
    363363            self._reverser.set_text(reverserStr)
    364364
    365             self._navLightsOn.set_sensitive(aircraftState.navLightsOn)
     365            self._navLightsOn.set_sensitive(aircraftState.navLightsOn is True)
    366366            self._antiCollisionLightsOn.set_sensitive(aircraftState.antiCollisionLightsOn)
    367367            self._strobeLightsOn.set_sensitive(aircraftState.strobeLightsOn)
     
    387387                                                              aircraftState.longitude)))
    388388            self._elevatorTrim.set_text("%.2f" % (aircraftState.elevatorTrim,))
    389             self._apMaster.set_sensitive(aircraftState.apMaster)
    390             self._apHeadingHold.set_sensitive(aircraftState.apHeadingHold)
    391             self._apHeading.set_text("%03.0f" % (aircraftState.apHeading,))
    392             self._xpdrC.set_sensitive(aircraftState.xpdrC)
    393             self._apAltitudeHold.set_sensitive(aircraftState.apAltitudeHold)
    394             self._apAltitude.set_text("%5.0f" % (aircraftState.apAltitude,))
     389            self._apMaster.set_sensitive(aircraftState.apMaster is True)
     390            self._apHeadingHold.set_sensitive(aircraftState.apHeadingHold is True)
     391            self._apHeading.set_text("-" if aircraftState.apHeading is None
     392                                     else "%03.0f" % (aircraftState.apHeading,))
     393            self._xpdrC.set_sensitive(aircraftState.xpdrC is True)
     394            self._apAltitudeHold.set_sensitive(aircraftState.apAltitudeHold is True)
     395            self._apAltitude.set_text("-" if aircraftState.apAltitude is None
     396                                      else "%5.0f" % (aircraftState.apAltitude,))
    395397
    396398            self._adf1.set_text("-" if aircraftState.adf1 is None else aircraftState.adf1)
Note: See TracChangeset for help on using the changeset viewer.