Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/xplane.py

    r893 r909  
    506506                  (xplaneVersion, xplmVersion, xplraVersion)
    507507                if not autoReconnection:
    508                     fsType = const.SIM_XPLANE10 if xplaneVersion>=10000 else const.SIM_XPLANE9
     508                    fsType = const.SIM_XPLANE11 if xplaneVersion>=11000 else \
     509                      (const.SIM_XPLANE10 if xplaneVersion>=10000 else const.SIM_XPLANE9)
    509510
    510511                    Handler._callSafe(lambda:
     
    14341435
    14351436        flapsControl = data[self._monidx_flapsControl]
    1436         flapsIndex = int(flapsControl * (len(self._flapsNotches)-1))
     1437        flapsIndex = int(round(flapsControl * (len(self._flapsNotches)-1)))
    14371438        state.flapsSet = 0 if flapsIndex<1 else self._flapsNotches[flapsIndex]
    14381439
     
    18781879
    18791880class T154Model(GenericAircraftModel):
    1880     """Generic model for the Tupolev Tu-134 aircraft."""
     1881    """Generic model for the Tupolev Tu-154 aircraft."""
    18811882    fuelTanks = [const.FUELTANK_CENTRE, const.FUELTANK_CENTRE2,
    18821883                 const.FUELTANK_RIGHT, const.FUELTANK_LEFT,
     
    19021903        del state.reverser[1]
    19031904        return state
     1905
     1906#------------------------------------------------------------------------------
     1907
     1908class FelisT154Model(T154Model):
     1909    """Model for Felis' Tupolev Tu-154-M aircraft."""
     1910    @staticmethod
     1911    def doesHandle(aircraft, (tailnum, author, description, notes,
     1912                              icao, liveryPath)):
     1913        """Determine if this model handler handles the aircraft with the given
     1914        name."""
     1915        return aircraft.type==const.AIRCRAFT_T154 and \
     1916          author.find("Felis")!=-1 and \
     1917          description.find("Tu154M")!=-1
     1918
     1919    def __init__(self):
     1920        """Construct the model."""
     1921        super(T154Model, self). \
     1922            __init__(flapsNotches = [0, 15, 28, 36, 45],
     1923                     fuelTanks = T154Model.fuelTanks,
     1924                     numEngines = 3)
     1925
     1926    @property
     1927    def name(self):
     1928        """Get the name for this aircraft model."""
     1929        return "X-Plane/Felis Tupolev Tu-154-M"
    19041930
    19051931#------------------------------------------------------------------------------
     
    19441970
    19451971AircraftModel.registerSpecial(FJSDH8DModel)
     1972AircraftModel.registerSpecial(FelisT154Model)
    19461973
    19471974#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.