Changeset 662:96f78a73a25c for src


Ignore:
Timestamp:
08/08/15 07:43:18 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added support for the Majestic Dash-8 Q400 model (re #274)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/fsuipc.py

    r660 r662  
    18111811#------------------------------------------------------------------------------
    18121812
     1813class MajesticDH8DModel(DH8DModel):
     1814    """Model handler for the Majestic Dash 8-Q400."""
     1815    @staticmethod
     1816    def doesHandle(aircraft, (name, airPath)):
     1817        """Determine if this model handler handles the aircraft with the given
     1818        name."""
     1819        return aircraft.type==const.AIRCRAFT_DH8D and \
     1820            (name.find("MJC8Q400")!=-1 or \
     1821             airPath.lower().find("mjc8q400") or \
     1822             airPath.lower().find("mjc8q4.air"))
     1823
     1824    @property
     1825    def name(self):
     1826        """Get the name for this aircraft model."""
     1827        return "FSUIPC/Majestic Bombardier Dash 8-Q400"
     1828
     1829    def getAircraftState(self, aircraft, timestamp, data):
     1830        """Get the aircraft state.
     1831
     1832        Get it from the parent, and then clear the anti-collision and landing
     1833        lights."""
     1834        state = super(MajesticDH8DModel, self).getAircraftState(aircraft,
     1835                                                                timestamp,
     1836                                                                data)
     1837        state.antiCollisionLightsOn = None
     1838        state.strobeLightsOn = None
     1839
     1840        return state
     1841
     1842#------------------------------------------------------------------------------
     1843
    18131844class CRJ2Model(GenericAircraftModel):
    18141845    """Generic model for the Bombardier CRJ-200 aircraft."""
     
    21452176AircraftModel.registerSpecial(PMDGBoeing737NGModel)
    21462177AircraftModel.registerSpecial(DreamwingsDH8DModel)
     2178AircraftModel.registerSpecial(MajesticDH8DModel)
    21472179AircraftModel.registerSpecial(DAF70Model)
    21482180AircraftModel.registerSpecial(PTT154Model)
Note: See TracChangeset for help on using the changeset viewer.