Ignore:
Timestamp:
09/30/12 09:00:53 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added the logging of the ADF frequencies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/fsuipc.py

    r315 r317  
    11781178                      ("nav1", 0x0350, "H"),
    11791179                      ("nav2", 0x0352, "H"),
     1180                      ("adf1_main", 0x034c, "H"),
     1181                      ("adf1_ext", 0x0356, "H"),
     1182                      ("adf2_main", 0x02d4, "H"),
     1183                      ("adf2_ext", 0x02d6, "H"),
    11801184                      ("squawk", 0x0354, "H"),
    11811185                      ("windSpeed", 0x0e90, "H"),
     
    12271231        return "1" + bcd[0:2] + "." + bcd[2:4]
    12281232
     1233    @staticmethod
     1234    def convertADFFrequency(main, ext):
     1235        """Convert the given ADF frequency data to a string."""
     1236        mainBCD = AircraftModel.convertBCD(main, 4)
     1237        extBCD = AircraftModel.convertBCD(ext, 4)
     1238
     1239        return (extBCD[1] if extBCD[1]!="0" else "") + \
     1240               mainBCD[1:] + "." + extBCD[3]
     1241   
    12291242    def __init__(self, flapsNotches):
    12301243        """Construct the aircraft model.
     
    13501363        state.nav1 = AircraftModel.convertFrequency(data[self._monidx_nav1])
    13511364        state.nav2 = AircraftModel.convertFrequency(data[self._monidx_nav2])
     1365        state.adf1 = \
     1366            AircraftModel.convertADFFrequency(data[self._monidx_adf1_main],
     1367                                              data[self._monidx_adf1_ext])
     1368        state.adf2 = \
     1369            AircraftModel.convertADFFrequency(data[self._monidx_adf2_main],
     1370                                              data[self._monidx_adf2_ext])
    13521371        state.squawk = AircraftModel.convertBCD(data[self._monidx_squawk], 4)
    13531372
Note: See TracChangeset for help on using the changeset viewer.