Changeset 559:54fa2efc1dc2 for src/mlx/pyuipc_sim.py
- Timestamp:
- 02/06/14 16:47:52 (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/pyuipc_sim.py
r443 r559 342 342 print "failed to read offset %04x: %s" % (offset, str(e)) 343 343 raise FSUIPCException(ERR_DATA) 344 345 def _getFlapsControl(self): 346 """Get the flaps control value""" 347 numNotchesM1 = len(self.flapsNotches) - 1 348 flapsIncrement = 16383.0 / numNotchesM1 349 index = 0 350 while index<numNotchesM1 and \ 351 self.flapsControl>self.flapsNotches[index]: 352 index += 1 353 354 if index==numNotchesM1: 355 return 16383 356 else: 357 return int(index * flapsIncrement + 358 (self.flapsControl-self.flapsNotches[index]) * 359 flapsIncrement / 360 (self.flapsNotches[index+1] - self.flapsNotches[index])) 344 361 345 362 def _read(self, offset, type): … … 473 490 else int(self.spoilers * (16383 - 4800) + 4800) 474 491 elif offset==0x0bdc: # Flaps control 475 numNotchesM1 = len(self.flapsNotches) - 1 476 flapsIncrement = 16383.0 / numNotchesM1 477 index = 0 478 while index<numNotchesM1 and \ 479 self.flapsControl>self.flapsNotches[index]: 480 index += 1 481 482 if index==numNotchesM1: 483 return 16383 484 else: 485 return int(index * flapsIncrement + 486 (self.flapsControl-self.flapsNotches[index]) * 487 flapsIncrement / 488 (self.flapsNotches[index+1] - self.flapsNotches[index])) 492 return self._getFlapsControl() 489 493 elif offset==0x0be0 or offset==0x0be4: # Flaps left and right 490 494 return self.flaps * 16383.0 / self.flapsNotches[-1] … … 592 596 elif offset==0x3364: # Frozen 593 597 return 1 if self.frozen else 0 598 elif offset==0x3414: # Flaps axis 599 return self._getFlapsControl() 600 elif offset==0x3bfa: # Flaps increment 601 return 16383 / (len(self.flapsNotches)-1) 594 602 elif offset==0x3bfc: # ZFW 595 603 return int(self.zfw * 256.0 * const.KGSTOLB)
Note:
See TracChangeset
for help on using the changeset viewer.