Changeset 7:f8d6fda3c66d for src/acft.py


Ignore:
Timestamp:
02/01/12 16:48:49 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added the different type-specific aircraft classes and the type-specific generic FSUIPC-based models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/acft.py

    r5 r7  
    44
    55import time
     6
     7import const
    68
    79#---------------------------------------------------------------------------------------
     
    163165                (timeStr, aircraftState.nav2)
    164166
     167        if self._aircraftState is None or \
     168           self._aircraftState.fuel != aircraftState.fuel:
     169            print "Aircraft.handleState: %s: fuel=%s" % \
     170                (timeStr, aircraftState.fuel)
     171
     172        if self._aircraftState is None or \
     173           self._aircraftState.n1 != aircraftState.n1:
     174            print "Aircraft.handleState: %s: n1=%s" % \
     175                (timeStr, aircraftState.n1)
     176
     177        if self._aircraftState is None or \
     178           self._aircraftState.reverser != aircraftState.reverser:
     179            print "Aircraft.handleState: %s: reverser=%s" % \
     180                (timeStr, aircraftState.reverser)
     181
    165182        self._aircraftState = aircraftState
    166183           
    167184#---------------------------------------------------------------------------------------
    168            
     185
     186class Boeing737(Aircraft):
     187    """Base class for the various aircraft in the Boeing 737 family.
     188
     189    The aircraft type-specific values in the aircraft state have the following
     190    structure:
     191    - fuel: centre, left, right
     192    - n1: left, right
     193    - reverser: left, right"""
     194    pass
     195
     196#---------------------------------------------------------------------------------------
     197
     198class B736(Boeing737):
     199    """Boeing 737-600 aircraft."""
     200    def __init__(self):
     201        super(B736, self).__init__(const.AIRCRAFT_B736)
     202
     203#---------------------------------------------------------------------------------------
     204
     205class B737(Boeing737):
     206    """Boeing 737-700 aircraft."""
     207    def __init__(self):
     208        super(B737, self).__init__(const.AIRCRAFT_B737)
     209
     210#---------------------------------------------------------------------------------------
     211
     212class B738(Boeing737):
     213    """Boeing 737-800 aircraft."""
     214    def __init__(self):
     215        super(B738, self).__init__(const.AIRCRAFT_B738)
     216
     217#---------------------------------------------------------------------------------------
     218
     219class B733(Boeing737):
     220    """Boeing 737-300 aircraft."""
     221    def __init__(self):
     222        super(B733, self).__init__(const.AIRCRAFT_B733)
     223
     224#---------------------------------------------------------------------------------------
     225
     226class B734(Boeing737):
     227    """Boeing 737-400 aircraft."""
     228    def __init__(self):
     229        super(B734, self).__init__(const.AIRCRAFT_B734)
     230
     231#---------------------------------------------------------------------------------------
     232
     233class B735(Boeing737):
     234    """Boeing 737-500 aircraft."""
     235    def __init__(self):
     236        super(B735, self).__init__(const.AIRCRAFT_B735)
     237
     238#---------------------------------------------------------------------------------------
     239
     240class DH8D(Aircraft):
     241    """Bombardier Dash-8 Q400 aircraft.
     242
     243    The aircraft type-specific values in the aircraft state have the following
     244    structure:
     245    - fuel: centre, left, right
     246    - n1: left, right
     247    - reverser: left, right."""
     248    def __init__(self):
     249        super(DH8D, self).__init__(const.AIRCRAFT_DH8D)
     250
     251#---------------------------------------------------------------------------------------
     252
     253class Boeing767(Aircraft):
     254    """Base class for the various aircraft in the Boeing 767 family.
     255
     256    The aircraft type-specific values in the aircraft state have the following
     257    structure:
     258    - fuel: centre, left, right
     259    - n1: left, right
     260    - reverser: left, right"""
     261
     262#---------------------------------------------------------------------------------------
     263
     264class B762(Boeing767):
     265    """Boeing 767-200 aircraft."""
     266    def __init__(self):
     267        super(B762, self).__init__(const.AIRCRAFT_B762)
     268
     269#---------------------------------------------------------------------------------------
     270
     271class B763(Boeing767):
     272    """Boeing 767-300 aircraft."""
     273    def __init__(self):
     274        super(B763, self).__init__(const.AIRCRAFT_B763)
     275
     276#---------------------------------------------------------------------------------------
     277
     278class CRJ2(Aircraft):
     279    """Bombardier CRJ-200 aircraft.
     280
     281    The aircraft type-specific values in the aircraft state have the following
     282    structure:
     283    - fuel: centre, left, right
     284    - n1: left, right
     285    - reverser: left, right."""
     286    def __init__(self):
     287        super(CRJ2, self).__init__(const.AIRCRAFT_CRJ2)
     288
     289#---------------------------------------------------------------------------------------
     290
     291class F70(Aircraft):
     292    """Fokker 70 aircraft.
     293
     294    The aircraft type-specific values in the aircraft state have the following
     295    structure:
     296    - fuel: centre, left, right
     297    - n1: left, right
     298    - reverser: left, right."""
     299    def __init__(self):
     300        super(F70, self).__init__(const.AIRCRAFT_F70)
     301
     302#---------------------------------------------------------------------------------------
     303
     304class DC3(Aircraft):
     305    """Lisunov Li-2 (DC-3) aircraft.
     306
     307    The aircraft type-specific values in the aircraft state have the following
     308    structure:
     309    - fuel: left, right, left aux, right aix
     310    - rpm: left, right
     311    - reverser: left, right."""
     312    def __init__(self):
     313        super(DC3, self).__init__(const.AIRCRAFT_DC3)
     314
     315#---------------------------------------------------------------------------------------
     316
     317class T134(Aircraft):
     318    """Tupolev Tu-134 aircraft.
     319
     320    The aircraft type-specific values in the aircraft state have the following
     321    structure:
     322    - fuel: centre, left tip, left aux, right tip, right aux, external 1,
     323    external 2
     324    - n1: left, right
     325    - reverser: left, right."""
     326    def __init__(self):
     327        super(T134, self).__init__(const.AIRCRAFT_T134)
     328
     329#---------------------------------------------------------------------------------------
     330
     331class T154(Aircraft):
     332    """Tupolev Tu-154 aircraft.
     333
     334    The aircraft type-specific values in the aircraft state have the following
     335    structure:
     336    - fuel: centre, left, right, centre 2, left aux, right aux
     337    - n1: left, centre, right
     338    - reverser: left, right"""
     339    def __init__(self):
     340        super(T154, self).__init__(const.AIRCRAFT_T154)
     341
     342#---------------------------------------------------------------------------------------
     343
     344class YK40(Aircraft):
     345    """Yakovlev Yak-40 aircraft.
     346
     347    The aircraft type-specific values in the aircraft state have the following
     348    structure:
     349    - fuel: left, right
     350    - n1: left, right
     351    - reverser: left, right"""
     352    def __init__(self):
     353        super(YK40, self).__init__(const.AIRCRAFT_YK40)
     354
     355#---------------------------------------------------------------------------------------
     356
Note: See TracChangeset for help on using the changeset viewer.