Changeset 922:fcbc41076194
- Timestamp:
- 04/27/19 12:07:59 (6 years ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/fsuipc.py
r921 r922 1410 1410 1411 1411 numNotchesM1 = len(self._flapsNotches) - 1 1412 flapsIncrement = 16383 / numNotchesM11412 flapsIncrement = 16383 // numNotchesM1 1413 1413 flapsControl = data[self._monidx_flapsControl] 1414 flapsIndex = flapsControl / flapsIncrement1414 flapsIndex = flapsControl // flapsIncrement 1415 1415 if flapsIndex < numNotchesM1: 1416 1416 if (flapsControl - (flapsIndex*flapsIncrement) > -
src/mlx/pyuipc_sim.py
r919 r922 184 184 def _readBCD(value): 185 185 """Convert the given value into BCD format.""" 186 bcd = (value/ 1000) % 10186 bcd = (value//1000) % 10 187 187 bcd <<= 4 188 bcd |= (value/ 100) % 10188 bcd |= (value//100) % 10 189 189 bcd <<= 4 190 bcd |= (value/ 10) % 10190 bcd |= (value//10) % 10 191 191 bcd <<= 4 192 192 bcd |= value % 10 … … 360 360 return int(index * flapsIncrement + 361 361 (self.flapsControl-self.flapsNotches[index]) * 362 flapsIncrement / 362 flapsIncrement // 363 363 (self.flapsNotches[index+1] - self.flapsNotches[index])) 364 364 … … 542 542 elif offset>=0x1400 and offset<=0x1f40 and \ 543 543 ((offset-0x1400)%48)==0: # Payload 544 return self.payload[ (offset - 0x1400) / 48 ]544 return self.payload[ (offset - 0x1400) // 48 ] 545 545 elif offset==0x2000: # Engine #1 N1 546 546 return self.n1[self.ENGINE_1] … … 568 568 elif offset>=0x3210 and offset<0x3210+Values.HOTKEY_SIZE*4: 569 569 tableOffset = offset - 0x3210 570 hotkeyIndex = tableOffset / 4570 hotkeyIndex = tableOffset // 4 571 571 index = tableOffset % 4 572 572 if type=="b" or type=="c": … … 602 602 return self._getFlapsControl() 603 603 elif offset==0x3bfa: # Flaps increment 604 return 16383 / (len(self.flapsNotches)-1)604 return 16383 // (len(self.flapsNotches)-1) 605 605 elif offset==0x3bfc: # ZFW 606 606 return int(self.zfw * 256.0 * const.KGSTOLB) … … 758 758 elif offset==0x0bd0: # Spoilers 759 759 self.spoilters = 0 if value==0 \ 760 else (value - 4800) / (16383 - 4800)760 else (value - 4800) // (16383 - 4800) 761 761 elif offset==0x0bdc: # Flaps control 762 762 numNotchesM1 = len(self.flapsNotches) - 1 … … 768 768 self.flapsControl = self.flapsNotches[index] 769 769 self.flapsControl += (value - index * flapsIncrement) * \ 770 (self.flapsNotches[index+1] - self.flapsNotches[index]) / \770 (self.flapsNotches[index+1] - self.flapsNotches[index]) // \ 771 771 flapsIncrement 772 772 elif offset==0x0be0 or offset==0x0be4: # Flaps left and right … … 816 816 elif offset>=0x1400 and offset<=0x1f40 and \ 817 817 ((offset-0x1400)%48)==0: # Payload 818 self.payload[ (offset - 0x1400) / 48 ] = value818 self.payload[ (offset - 0x1400) // 48 ] = value 819 819 elif offset==0x2000: # Engine #1 N1 820 820 self.n1[self.ENGINE_1] = value … … 840 840 elif offset>=0x3210 and offset<0x3210+Values.HOTKEY_SIZE*4: 841 841 tableOffset = offset - 0x3210 842 hotkeyIndex = tableOffset / 4842 hotkeyIndex = tableOffset // 4 843 843 index = tableOffset % 4 844 844 if type=="b" or type=="c":
Note:
See TracChangeset
for help on using the changeset viewer.