Changeset 88:3fdb6ad947ad for src/mlx/pyuipc_sim.py
- Timestamp:
- 04/16/12 17:53:47 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/pyuipc_sim.py
r85 r88 351 351 index = 0 352 352 while index<numNotchesM1 and \ 353 self.flapsControl <self.flapsNotches[index]:353 self.flapsControl>self.flapsNotches[index]: 354 354 index += 1 355 355 356 356 if index==numNotchesM1: 357 357 return 16383 358 358 else: 359 return int((self.flapsControl-self.flapsNotches[index]) * \ 360 flapsIncrement / \ 359 return int(index * flapsIncrement + 360 (self.flapsControl-self.flapsNotches[index]) * 361 flapsIncrement / 361 362 (self.flapsNotches[index+1] - self.flapsNotches[index])) 362 363 elif offset==0x0be0 or offset==0x0be4: # Flaps left and right … … 529 530 numNotchesM1 = len(self.flapsNotches) - 1 530 531 flapsIncrement = 16383.0 / numNotchesM1 531 index = value / flapsIncrement532 index = int(value / flapsIncrement) 532 533 if index>=numNotchesM1: 533 534 self.flapsControl = self.flapsNotches[-1] 534 535 else: 535 536 self.flapsControl = self.flapsNotches[index] 536 self.flapsControl += value* \537 self.flapsControl += (value - index * flapsIncrement) * \ 537 538 (self.flapsNotches[index+1] - self.flapsNotches[index]) / \ 538 539 flapsIncrement … … 583 584 elif offset==0x3bfc: # ZFW 584 585 self.zfw = value * const.LBSTOKG / 256.0 585 print "ZFW:", self.zfw586 586 elif offset==0x3c00: # Path of the current AIR file 587 587 self.airPath = value … … 640 640 temperature += 273.15 # Celsius -> Kelvin 641 641 airDensity = pressure / (temperature * 287.05) 642 print "pressure:", pressure, "temperature:", temperature, "airDensity:", airDensity642 #print "pressure:", pressure, "temperature:", temperature, "airDensity:", airDensity 643 643 return self.ias * math.sqrt(1.225 / airDensity) 644 644
Note:
See TracChangeset
for help on using the changeset viewer.