Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/fsuipc.py

    r476 r443  
    16461646        super(PMDGBoeing737NGModel, self).addMonitoringData(data, fsType)
    16471647
     1648        self._addOffsetWithIndexMember(data, 0x6202, "b", "_pmdgidx_switches")
     1649        self._addOffsetWithIndexMember(data, 0x6216, "b", "_pmdgidx_xpdr")
     1650        self._addOffsetWithIndexMember(data, 0x6227, "b", "_pmdgidx_ap")
     1651        self._addOffsetWithIndexMember(data, 0x6228, "b", "_pmdgidx_aphdgsel")
     1652        self._addOffsetWithIndexMember(data, 0x622a, "b", "_pmdgidx_apalthold")
     1653        self._addOffsetWithIndexMember(data, 0x622c, "H", "_pmdgidx_aphdg")
     1654        self._addOffsetWithIndexMember(data, 0x622e, "H", "_pmdgidx_apalt")
     1655
    16481656        if fsType==const.SIM_MSFSX:
    1649             print "FSX detected, adding PMDG 737 NGX-specific offsets"
     1657            print "FSX detected, adding position lights switch offset"
    16501658            self._addOffsetWithIndexMember(data, 0x6500, "b",
    16511659                                           "_pmdgidx_lts_positionsw")
    1652             self._addOffsetWithIndexMember(data, 0x6545, "b", "_pmdgidx_cmda")
    1653             self._addOffsetWithIndexMember(data, 0x653f, "b", "_pmdgidx_aphdgsel")
    1654             self._addOffsetWithIndexMember(data, 0x6543, "b", "_pmdgidx_apalthold")
    1655             self._addOffsetWithIndexMember(data, 0x652c, "H", "_pmdgidx_aphdg")
    1656             self._addOffsetWithIndexMember(data, 0x652e, "H", "_pmdgidx_apalt")
    1657             self._addOffsetWithIndexMember(data, 0x65cd, "b", "_pmdgidx_xpdr")
    1658         else:
    1659             print "FS9 detected, adding PMDG 737 NG-specific offsets"
    1660             self._addOffsetWithIndexMember(data, 0x6202, "b", "_pmdgidx_switches")
    1661             self._addOffsetWithIndexMember(data, 0x6216, "b", "_pmdgidx_xpdr")
    1662             self._addOffsetWithIndexMember(data, 0x6227, "b", "_pmdgidx_ap")
    1663             self._addOffsetWithIndexMember(data, 0x6228, "b", "_pmdgidx_aphdgsel")
    1664             self._addOffsetWithIndexMember(data, 0x622a, "b", "_pmdgidx_apalthold")
    1665             self._addOffsetWithIndexMember(data, 0x622c, "H", "_pmdgidx_aphdg")
    1666             self._addOffsetWithIndexMember(data, 0x622e, "H", "_pmdgidx_apalt")
    16671660
    16681661    def getAircraftState(self, aircraft, timestamp, data):
     
    16731666                                                                   timestamp,
    16741667                                                                   data)
    1675         if self._fsType==const.SIM_MSFS9:
    1676             if data[self._pmdgidx_switches]&0x01==0x01:
    1677                 state.altimeter = 1013.25
    1678             state.apMaster = data[self._pmdgidx_ap]&0x02==0x02
    1679             state.apHeadingHold = data[self._pmdgidx_aphdgsel]==2
    1680             apalthold = data[self._pmdgidx_apalthold]
    1681             state.apAltitudeHold = apalthold>=3 and apalthold<=6
    1682         else:
    1683             state.apMaster = data[self._pmdgidx_cmda]!=0
    1684             state.apHeadingHold = data[self._pmdgidx_aphdgsel]!=0
    1685             state.apAltitudeHold = data[self._pmdgidx_apalthold]!=0
    1686             #state.strobeLightsOn = data[self._pmdgidx_lts_positionsw]==0x02
    1687             state.strobeLightsOn = None
     1668        if data[self._pmdgidx_switches]&0x01==0x01:
     1669            state.altimeter = 1013.25
    16881670
    16891671        state.xpdrC = data[self._pmdgidx_xpdr]==4
     1672
     1673        state.apMaster = data[self._pmdgidx_ap]&0x02==0x02
     1674
     1675        state.apHeadingHold = data[self._pmdgidx_aphdgsel]==2
    16901676        state.apHeading = data[self._pmdgidx_aphdg]
     1677
     1678        apalthold = data[self._pmdgidx_apalthold]
     1679        state.apAltitudeHold = apalthold>=3 and apalthold<=6
    16911680        state.apAltitude = data[self._pmdgidx_apalt]
     1681
     1682        if self._fsType==const.SIM_MSFSX:
     1683            state.strobeLightsOn = data[self._pmdgidx_lts_positionsw]==0x02
    16921684
    16931685        return state
     
    17481740        return "FSUIPC/Dreamwings Bombardier Dash 8-Q400"
    17491741
    1750     def addMonitoringData(self, data, fsType):
    1751         """Add the model-specific monitoring data to the given array."""
    1752         super(DreamwingsDH8DModel, self).addMonitoringData(data, fsType)
    1753 
    1754         self._addOffsetWithIndexMember(data, 0x132c, "d", "_dwdh8d_navgps")
    1755 
    17561742    def getAircraftState(self, aircraft, timestamp, data):
    17571743        """Get the aircraft state.
     
    17611747                                                                  timestamp,
    17621748                                                                  data)
    1763         if data[self._dwdh8d_navgps]==1:
    1764             state.apHeading = None
     1749        state.pitotHeatOn = not state.pitotHeatOn
    17651750
    17661751        return state
Note: See TracChangeset for help on using the changeset viewer.