Ignore:
Timestamp:
04/28/12 12:25:48 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented the weight help tab

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/pyuipc_sim.py

    r89 r117  
    243243        self.n1 = [0.0, 0.0, 0.0]
    244244        self.throttles = [0.0, 0.0, 0.0]
     245
     246        self.payloadCount = 1
     247        self.payload = []
     248        for i in range(0, 61): self.payload.append(0.0)
    245249
    246250    def read(self, offset):
     
    402406        elif offset==0x1260:       # External 2 tank capacity
    403407            return self._getFuelCapacity(self.FUEL_EXTERNAL_2)
     408        elif offset==0x13fc:       # The number of the payload stations
     409            return self.payloadCount
     410        elif offset>=0x1400 and offset<=0x1f40 and \
     411             ((offset-0x1400)%48)==0: # Payload
     412            return self.payload[ (offset - 0x1400) / 48 ]
    404413        elif offset==0x2000:       # Engine #1 N1
    405414            return self.n1[self.ENGINE_1]
     
    581590        elif offset==0x1260:       # External 2 tank capacity
    582591            self._setFuelCapacity(self.FUEL_EXTERNAL_2, value)
     592        elif offset==0x13fc:       # The number of the payload stations
     593            self.payloadCount = int(value)
     594        elif offset>=0x1400 and offset<=0x1f40 and \
     595             ((offset-0x1400)%48)==0: # Payload
     596            self.payload[ (offset - 0x1400) / 48 ] = value
    583597        elif offset==0x2000:       # Engine #1 N1
    584598            self.n1[self.ENGINE_1] = value
     
    11141128                                                              100.0/1609.344))
    11151129                                                           
     1130        self._valueHandlers["payloadCount"] = (0x13fc, "d",
     1131                                               lambda value: value,
     1132                                               lambda word: int(word))
     1133        for i in range(0, 61):
     1134            self._valueHandlers["payload%d" % (i,)] = (0x1400 + i * 48, "f",
     1135                                                       lambda value:
     1136                                                       value * const.LBSTOKG,
     1137                                                       lambda word:
     1138                                                       float(word)*const.KGSTOLB)
     1139                                                           
    11161140    def default(self, line):
    11171141        """Handle unhandle commands."""
Note: See TracChangeset for help on using the changeset viewer.