Ignore:
Timestamp:
02/28/13 18:56:30 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added support for the BAe 146-200 aircraft type (re #182)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/pyuipc_sim.py

    r408 r443  
    158158    ENGINE_3 = 2
    159159
     160    ## Engine index: engine #4
     161    ENGINE_4 = 3
     162
    160163    ## The number of hotkey entries
    161164    HOTKEY_SIZE = 56
     
    295298        self.visibility = 10000
    296299
    297         self.n1 = [0.0, 0.0, 0.0]
    298         self.throttles = [0.0, 0.0, 0.0]
     300        self.n1 = [0.0, 0.0, 0.0, 0.0]
     301        self.throttles = [0.0, 0.0, 0.0, 0.0]
    299302
    300303        self.payloadCount = 1
     
    328331        self.eng2DeIce = False
    329332        self.eng3DeIce = False
     333        self.eng4DeIce = False
    330334        self.propDeIce = False
    331335        self.structDeIce = False
     
    427431        elif offset==0x09e2:       # Engine #3 de-ice
    428432            return 1 if self.eng3DeIce else 0
     433        elif offset==0x0a54:       # Engine #4 throttle
     434            return self._getThrottle(self.ENGINE_4)
     435        elif offset==0x0a7a:       # Engine #4 de-ice
     436            return 1 if self.eng4DeIce else 0
    429437        elif offset==0x0af4:       # Fuel weight
    430438            return int(self.fuelWeight * 256.0)
     
    533541            return self.n1[self.ENGINE_2]
    534542        elif offset==0x2200:       # Engine #3 N1
     543            return self.n1[self.ENGINE_3]
     544        elif offset==0x2300:       # Engine #4 N1
    535545            return self.n1[self.ENGINE_3]
    536546        elif offset==0x2ea0:       # Elevator trim
     
    695705        elif offset==0x09e2:       # Engine #3 de-ice
    696706            self.eng3DeIce = value!=0
     707        elif offset==0x0a54:       # Engine #4 throttle
     708            self._setThrottle(self.ENGINE_4, value)
     709        elif offset==0x0a7a:       # Engine #4 de-ice
     710            self.eng4DeIce = value!=0
    697711        elif offset==0x0af4:       # Fuel weight
    698712            self.fuelWeight = value / 256.0
     
    796810        elif offset==0x2200:       # Engine #3 N1
    797811            self.n1[self.ENGINE_3] = value
     812        elif offset==0x2300:       # Engine #4 N1
     813            self.n1[self.ENGINE_4] = value
    798814        elif offset==0x2ea0:       # Elevator trim
    799815            self.elevatorTrim = value * 180.0 / math.pi
     
    14131429        self._valueHandlers["n1_3"] = ([(0x2200, "f")], lambda value: value,
    14141430                                       lambda word: float(word))
     1431        self._valueHandlers["n1_4"] = ([(0x2300, "f")], lambda value: value,
     1432                                       lambda word: float(word))
    14151433
    14161434        self._valueHandlers["throttle_1"] = ([(0x088c, "H")],
     
    14211439                                             CLI.throttle2pyuipc)
    14221440        self._valueHandlers["throttle_3"] = ([(0x09bc, "H")],
     1441                                             CLI.pyuipc2throttle,
     1442                                             CLI.throttle2pyuipc)
     1443        self._valueHandlers["throttle_4"] = ([(0x0a54, "H")],
    14231444                                             CLI.pyuipc2throttle,
    14241445                                             CLI.throttle2pyuipc)
     
    14901511                                            CLI.bool2str, CLI.str2bool)
    14911512        self._valueHandlers["eng3Deice"] = ([(0x09e2, "H")],
     1513                                            CLI.bool2str, CLI.str2bool)
     1514        self._valueHandlers["eng4Deice"] = ([(0x0a7a, "H")],
    14921515                                            CLI.bool2str, CLI.str2bool)
    14931516        self._valueHandlers["propDeice"] = ([(0x337c, "b")],
Note: See TracChangeset for help on using the changeset viewer.