Changeset 340:36455b73b24f


Ignore:
Timestamp:
11/17/12 13:08:43 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

#142: added the reading and logging of the elevator trim

Location:
src/mlx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r338 r340  
    345345                            "Touchdown heading: %03.0f degrees" % (heading,))
    346346        self.logger.message(self._aircraftState.timestamp,
    347                            "Centre of gravity: %.1f%%" % \
     347                           "CG: %.1f%%" % \
    348348                            (self._aircraftState.cog*100.0,))
    349349
  • src/mlx/checks.py

    r338 r340  
    157157                           "Takeoff pitch: %.1f degrees" % (state.pitch,))
    158158            logger.message(state.timestamp,
    159                            "Centre of gravity:  %.1f%%" % (state.cog*100.0,))
     159                           "CG/Trim: %.1f%%/%.2f" % \
     160                           (state.cog*100.0, state.elevatorTrim))
    160161            self._onTheGround = False
    161162
  • src/mlx/fs.py

    r337 r340  
    258258    - apAltitude: the autopilot altitude value in feet (float),
    259259      or None, if the state cannot be read properly
     260    - elevatorTrim: a float value indicating the deflection of the elevator
     261      trim in degrees
    260262    """
    261 
  • src/mlx/fsuipc.py

    r339 r340  
    1111import sys
    1212import codecs
     13import math
    1314
    1415if os.name == "nt" and "FORCE_PYUIPC_SIM" not in os.environ:
     
    11941195                      ("apHeading", 0x07cc, "H"),
    11951196                      ("apAltitudeHold", 0x07d0, "d"),
    1196                       ("apAltitude", 0x07d4, "u")]
     1197                      ("apAltitude", 0x07d4, "u"),
     1198                      ("elevatorTrim", 0x2ea0, "f")]
    11971199
    11981200    specialModels = []
     
    13991401        state.apAltitude = data[self._monidx_apAltitude] / \
    14001402                           const.FEETTOMETRES / 65536.0
     1403
     1404
     1405        state.elevatorTrim = data[self._monidx_elevatorTrim] * 180.0 / math.pi
    14011406
    14021407        return state
  • src/mlx/gui/monitor.py

    r337 r340  
    188188        table.attach(self._position, 7, 10, 6, 7)
    189189
    190         self._xpdrC = gtk.Label("XPDR CHARLIE")
    191         table.attach(self._xpdrC, 10, 12, 6, 7)
     190        (label, self._elevatorTrim) = self._createLabeledEntry("Trim:", 5)
     191        table.attach(label, 10, 11, 6, 7)
     192        table.attach(self._elevatorTrim, 11, 12, 6, 7)
    192193
    193194        self._apMaster = gtk.Label("AP MASTER")
     
    207208        table.attach(label, 6, 7, 7, 8)
    208209        table.attach(self._apAltitude, 7, 8, 7, 8)
     210
     211        self._xpdrC = gtk.Label("XPDR CHARLIE")
     212        table.attach(self._xpdrC, 10, 12, 7, 8)
    209213
    210214        alignment.add(table)
     
    282286            self._windDirection.set_text("-")
    283287            self._position.set_text("-")
    284             self._xpdrC.set_sensitive(False)
     288            self._elevatorTrim.set_text("-")
    285289            self._apMaster.set_sensitive(False)
    286290            self._apHeadingHold.set_sensitive(False)
     
    288292            self._apAltitudeHold.set_sensitive(False)
    289293            self._apAltitude.set_text("-")
     294            self._xpdrC.set_sensitive(False)
    290295        else:
    291296            self._timestamp.set_text(time.strftime("%H:%M:%S",
     
    366371            self._position.set_text(util.getCoordinateString((aircraftState.latitude,
    367372                                                              aircraftState.longitude)))
    368             self._xpdrC.set_sensitive(aircraftState.xpdrC)
    369 
     373            self._elevatorTrim.set_text("%.2f" % (aircraftState.elevatorTrim,))
    370374            self._apMaster.set_sensitive(aircraftState.apMaster)
    371375            self._apHeadingHold.set_sensitive(aircraftState.apHeadingHold)
     
    374378            self._apAltitude.set_text("%5.0f" % (aircraftState.apAltitude,))
    375379
     380            self._xpdrC.set_sensitive(aircraftState.xpdrC)
     381
    376382#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.