Changeset 917:803dc6bacfa5


Ignore:
Timestamp:
02/23/19 13:38:11 (4 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Parents:
908:fcf3c44650f1 (diff), 916:4f738ffc3596 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Merged 0.39

Location:
src/mlx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r899 r917  
    11491149            self.mtow = 100000
    11501150            self.mlw = 80000
     1151        elif bookedFlight.tailNumber=="HA-LCX":
     1152            self.mtow = 100000
     1153            self.mlw = 80000
     1154            self.mzfw = 74000
     1155
     1156            self.flapSpeedLimits = { 15 : 227,
     1157                                     28 : 194,
     1158                                     36 : 178,
     1159                                     45 : 162 }
    11511160
    11521161    def _appendLightsLoggers(self):
  • src/mlx/acft.py

    r905 r917  
    9797class Aircraft(object):
    9898    """Base class for aircraft."""
     99    dowCockpit = 2
     100    dowCabin = 3
     101
    99102    @staticmethod
    100103    def create(flight, bookedFlight):
     
    125128        self._landingAntiIceLineID = None
    126129
    127         self.humanWeight = 82.0
     130        self.cockpitCrewWeight = 85.0
     131        self.cabinCrewWeight = 75.0
     132        self.humanWeight = 84.0
    128133
    129134        self.initialClimbSpeedAltitude = 1500
     
    829834class B734(Boeing737CL):
    830835    """Boeing 737-400 aircraft."""
     836    dow = 35100
     837
    831838    def __init__(self, flight):
    832839        super(B734, self).__init__(flight)
    833         self.dow = 35100
    834840        self.mtow = 62822
    835841        self.mlw = 54885
     
    12431249        """Get the derate type for this type."""
    12441250        return DERATE_B462
     1251
     1252#---------------------------------------------------------------------------------------
     1253
     1254class IL62(Aircraft):
     1255    """Ilyushin IL-62 aircraft.
     1256
     1257    The aircraft type-specific values in the aircraft state have the following
     1258    structure:
     1259    - fuel: left, centre, right
     1260    - n1: left outer, left inner, right inner, right outer
     1261    - reverser: empty (the plane has no reversers)"""
     1262    dow = 69500
     1263
     1264    def __init__(self, flight):
     1265        super(B462, self).__init__(flight)
     1266        self.mtow = 165000
     1267        self.mlw = 165000
     1268        self.mzfw = 165000
     1269        self.gearSpeedLimit = 210
     1270        self.flapSpeedLimits = { 18 : 217,
     1271                                 24 : 180,
     1272                                 30 : 170,
     1273                                 33 : 150 }
     1274
     1275    @property
     1276    def derateType(self):
     1277        """Get the derate type for this type."""
     1278        return DERATE_NONE
    12451279
    12461280#---------------------------------------------------------------------------------------
     
    12711305             const.AIRCRAFT_T154  : T154,
    12721306             const.AIRCRAFT_YK40  : YK40,
    1273              const.AIRCRAFT_B462  : B462 }
     1307             const.AIRCRAFT_B462  : B462,
     1308             const.AIRCRAFT_IL62  : IL62 }
    12741309
    12751310#---------------------------------------------------------------------------------------
     
    12811316#---------------------------------------------------------------------------------------
    12821317
     1318def setupTypes(aircraftTypes):
     1319    """Setup the values in the given types using the info retrieved
     1320    from the server."""
     1321    for aircraftTypeInfo in aircraftTypes:
     1322        clazz = getClass(aircraftTypeInfo.aircraftType)
     1323
     1324        clazz.dow = aircraftTypeInfo.dow
     1325        clazz.dowCockpit = aircraftTypeInfo.dowCockpit
     1326        clazz.dowCabin = aircraftTypeInfo.dowCabin
     1327
     1328#---------------------------------------------------------------------------------------
     1329
    12831330if __name__ == "__main__":
    12841331    value = SmoothedValue()
  • src/mlx/checks.py

    r896 r917  
    10211021    def isCondition(self, flight, aircraft, oldState, state):
    10221022        """Check if the fault condition holds."""
     1023        isXPlane = (flight.aircraftType==const.AIRCRAFT_DH8D or
     1024                    flight.aircraftType==const.AIRCRAFT_B733) and \
     1025                    (flight.fsType==const.SIM_XPLANE11 or
     1026                     flight.fsType==const.SIM_XPLANE10 or
     1027                     flight.fsType==const.SIM_XPLANE9)
    10231028        if flight.stage==const.STAGE_CRUISE:
    1024             isDH8DXplane = flight.aircraftType==const.AIRCRAFT_DH8D and \
    1025                            (flight.fsType==const.SIM_XPLANE10 or
    1026                             flight.fsType==const.SIM_XPLANE9)
    1027             bankLimit = 35 if isDH8DXplane else 30
     1029            bankLimit = 40 if isXPlane else 30
    10281030        elif flight.stage in [const.STAGE_TAKEOFF, const.STAGE_CLIMB,
    10291031                              const.STAGE_DESCENT, const.STAGE_LANDING]:
    1030             bankLimit = 35
     1032            bankLimit = 45 if isXPlane else 35
    10311033        else:
    10321034            return False
  • src/mlx/checks.py

    r912 r917  
    14151415class PayloadChecker(SimpleFaultChecker):
    14161416    """Check if the payload matches the specification."""
    1417     TOLERANCE=550
     1417    TOLERANCE=50
    14181418
    14191419    @staticmethod
  • src/mlx/const.py

    r907 r917  
    4949## Flight simulator type: Prepar3D
    5050SIM_P3D = 5
     51
     52## Flight simulator type: X-Plane 11
     53SIM_XPLANE11 = 6
    5154
    5255#-------------------------------------------------------------------------------
  • src/mlx/const.py

    r911 r917  
    1212
    1313## The version of the program
    14 VERSION="0.39.6"
     14VERSION="0.40.1"
    1515
    1616#-------------------------------------------------------------------------------
     
    108108## Aircraft type: British Aerospace BAe-146
    109109AIRCRAFT_B462 = 17
     110
     111## Aircraft type: British Aerospace BAe-146
     112AIRCRAFT_IL62 = 19
    110113
    111114#-------------------------------------------------------------------------------
     
    122125                 AIRCRAFT_T154, AIRCRAFT_T134,
    123126                 AIRCRAFT_YK40, AIRCRAFT_DC3,
    124                  AIRCRAFT_B462]
     127                 AIRCRAFT_B462, AIRCRAFT_IL62]
    125128
    126129#-------------------------------------------------------------------------------
     
    158161## Aircraft type family: British Aerospace BAe-146
    159162AIRCRAFT_FAMILY_B462 = 11
     163
     164## Aircraft type family: Ilyushin IL-62
     165AIRCRAFT_FAMILY_IL62 = 12
    160166
    161167#-------------------------------------------------------------------------------
     
    185191    AIRCRAFT_FAMILY_YK40: [AIRCRAFT_YK40],
    186192
    187     AIRCRAFT_FAMILY_B462: [AIRCRAFT_B462]
     193    AIRCRAFT_FAMILY_B462: [AIRCRAFT_B462],
     194
     195    AIRCRAFT_FAMILY_IL62: [AIRCRAFT_IL62]
    188196
    189197    }
     
    219227              AIRCRAFT_T154  : "T154",
    220228              AIRCRAFT_YK40  : "YK40",
    221               AIRCRAFT_B462  : "B462" }
     229              AIRCRAFT_B462  : "B462",
     230              AIRCRAFT_IL62  : "IL62" }
     231
     232#-------------------------------------------------------------------------------
     233
     234## A mapping from ICAO codes to the corresponding aircraft types
     235icao2Type = { "B736" : AIRCRAFT_B736,
     236              "B737" : AIRCRAFT_B737,
     237              "B738" : AIRCRAFT_B738,
     238              "B732" : AIRCRAFT_B732,
     239              "B733" : AIRCRAFT_B733,
     240              "B734" : AIRCRAFT_B734,
     241              "B735" : AIRCRAFT_B735,
     242              "DH8D" : AIRCRAFT_DH8D,
     243              "B762" : AIRCRAFT_B762,
     244              "B763" : AIRCRAFT_B763,
     245              "CRJ2" : AIRCRAFT_CRJ2,
     246              "F70"  : AIRCRAFT_F70,
     247              "DC3"  : AIRCRAFT_DC3,
     248              "T134" : AIRCRAFT_T134,
     249              "T154" : AIRCRAFT_T154,
     250              "YK40" : AIRCRAFT_YK40,
     251              "B462" : AIRCRAFT_B462,
     252              "IL62" : AIRCRAFT_IL62 }
    222253
    223254#-------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.