Changeset 337:a276a58aaa6e for src


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

#138: added the reading of the AP data and its displaying in the monitor window

Location:
src/mlx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/fs.py

    r334 r337  
    248248    - xpdrC: a boolean indicating whether the transponder is in C mode, or
    249249      None, if the state cannot be read properly
    250 
    251     FIXME: needed when taxiing only:
    252     - payload weight
    253 
    254     FIXME: needed rarely:
    255     - latitude, longitude
    256     - transporter
    257     - visibility
     250    - apMaster: a boolean indicating whether the autopilot is switched on, or
     251      None, if the state cannot be read properly
     252    - apHeadingHold: a boolean indicating whether the autopilot's heading hold
     253      mode is switched on, or None, if the state cannot be read properly
     254    - apHeading: the autopilot heading value in degrees (float),
     255      or None, if the state cannot be read properly
     256    - apAltitudeHold: a boolean indicating whether the autopilot's altitude hold
     257      mode is switched on, or None, if the state cannot be read properly
     258    - apAltitude: the autopilot altitude value in feet (float),
     259      or None, if the state cannot be read properly
    258260    """
     261
  • src/mlx/fsuipc.py

    r334 r337  
    11891189                      ("visibility", 0x0e8a, "H"),
    11901190                      ("cog", 0x2ef8, "f"),
    1191                       ("xpdrC", 0x7b91, "b")]
     1191                      ("xpdrC", 0x7b91, "b"),
     1192                      ("apMaster", 0x07bc, "d"),
     1193                      ("apHeadingHold", 0x07c8, "d"),
     1194                      ("apHeading", 0x07cc, "H"),
     1195                      ("apAltitudeHold", 0x07d0, "d"),
     1196                      ("apAltitude", 0x07d4, "u")]
    11921197
    11931198    specialModels = []
     
    13871392
    13881393        state.xpdrC = data[self._monidx_xpdrC]==0
     1394
     1395        state.apMaster = data[self._monidx_apMaster]!=0
     1396        state.apHeadingHold = data[self._monidx_apHeadingHold]!=0
     1397        state.apHeading = data[self._monidx_apHeading] * 360.0 / 65536.0
     1398        state.apAltitudeHold = data[self._monidx_apAltitudeHold]!=0
     1399        state.apAltitude = data[self._monidx_apAltitude] / \
     1400                           const.FEETTOMETRES / 65536.0
    13891401
    13901402        return state
  • src/mlx/gui/monitor.py

    r334 r337  
    3737                              padding_left = 16, padding_right = 16)
    3838
    39         table = gtk.Table(rows = 7, columns = 12)
     39        table = gtk.Table(rows = 7, columns = 14)
    4040        table.set_homogeneous(False)
    4141        table.set_row_spacings(4)
     
    190190        self._xpdrC = gtk.Label("XPDR CHARLIE")
    191191        table.attach(self._xpdrC, 10, 12, 6, 7)
     192
     193        self._apMaster = gtk.Label("AP MASTER")
     194        table.attach(self._apMaster, 0, 1, 7, 8)
     195
     196        self._apHeadingHold = gtk.Label("AP HDG HOLD")
     197        table.attach(self._apHeadingHold, 1, 2, 7, 8)
     198
     199        (label, self._apHeading) = self._createLabeledEntry("AP HDG:", 5)
     200        table.attach(label, 2, 3, 7, 8)
     201        table.attach(self._apHeading, 3, 4, 7, 8)
     202
     203        self._apAltitudeHold = gtk.Label("AP ALT HOLD")
     204        table.attach(self._apAltitudeHold, 5, 6, 7, 8)
     205
     206        (label, self._apAltitude) = self._createLabeledEntry("AP ALT:", 10)
     207        table.attach(label, 6, 7, 7, 8)
     208        table.attach(self._apAltitude, 7, 8, 7, 8)
    192209
    193210        alignment.add(table)
     
    266283            self._position.set_text("-")
    267284            self._xpdrC.set_sensitive(False)
     285            self._apMaster.set_sensitive(False)
     286            self._apHeadingHold.set_sensitive(False)
     287            self._apHeading.set_text("-")
     288            self._apAltitudeHold.set_sensitive(False)
     289            self._apAltitude.set_text("-")
    268290        else:
    269291            self._timestamp.set_text(time.strftime("%H:%M:%S",
     
    346368            self._xpdrC.set_sensitive(aircraftState.xpdrC)
    347369
     370            self._apMaster.set_sensitive(aircraftState.apMaster)
     371            self._apHeadingHold.set_sensitive(aircraftState.apHeadingHold)
     372            self._apHeading.set_text("%03.0f" % (aircraftState.apHeading,))
     373            self._apAltitudeHold.set_sensitive(aircraftState.apAltitudeHold)
     374            self._apAltitude.set_text("%5.0f" % (aircraftState.apAltitude,))
     375
    348376#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.