Changeset 476:32423909dfdb


Ignore:
Timestamp:
03/16/13 06:15:01 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added the PMDG 737NGX-specific offsets (re #116)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/fsuipc.py

    r456 r476  
    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 
    16561648        if fsType==const.SIM_MSFSX:
    1657             print "FSX detected, adding position lights switch offset"
     1649            print "FSX detected, adding PMDG 737 NGX-specific offsets"
    16581650            self._addOffsetWithIndexMember(data, 0x6500, "b",
    16591651                                           "_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")
    16601667
    16611668    def getAircraftState(self, aircraft, timestamp, data):
     
    16661673                                                                   timestamp,
    16671674                                                                   data)
    1668         if data[self._pmdgidx_switches]&0x01==0x01:
    1669             state.altimeter = 1013.25
     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
    16701688
    16711689        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
    16761690        state.apHeading = data[self._pmdgidx_aphdg]
    1677 
    1678         apalthold = data[self._pmdgidx_apalthold]
    1679         state.apAltitudeHold = apalthold>=3 and apalthold<=6
    16801691        state.apAltitude = data[self._pmdgidx_apalt]
    1681 
    1682         if self._fsType==const.SIM_MSFSX:
    1683             state.strobeLightsOn = data[self._pmdgidx_lts_positionsw]==0x02
    16841692
    16851693        return state
Note: See TracChangeset for help on using the changeset viewer.