Changeset 212:fab302d5b7f6 for src/mlx/fsuipc.py
- Timestamp:
- 05/31/12 17:25:32 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/fsuipc.py
r209 r212 343 343 pyuipc.fs_version) 344 344 if not autoReconnection: 345 fsType = const.SIM_MSFSX \ 346 if pyuipc.fs_version == pyuipc.SIM_FSX \ 347 else const.SIM_MSFS9 348 345 349 Handler._callSafe(lambda: 346 self._connectionListener.connected( const.SIM_MSFS9,350 self._connectionListener.connected(fsType, 347 351 description)) 348 352 self._connected = True … … 531 535 from the simulator or was calculated by the adapter. The other data 532 536 are self-explanatory and expressed in their 'natural' units.""" 537 self._fsType = None 533 538 self._aircraft = None 534 539 … … 749 754 """Called when a connection has been established to the flight 750 755 simulator of the given type.""" 756 self._fsType = fsType 751 757 with self._hotkeyLock: 752 758 if self._hotkeys is not None: … … 892 898 """Start monitoring with the current aircraft model.""" 893 899 data = Simulator.normalData[:] 894 self._aircraftModel.addMonitoringData(data )900 self._aircraftModel.addMonitoringData(data, self._fsType) 895 901 896 902 self._normalRequestID = \ … … 1239 1245 self._addOffsetWithIndexMember(dest, offset, type, prefix + name) 1240 1246 1241 def addMonitoringData(self, data ):1247 def addMonitoringData(self, data, fsType): 1242 1248 """Add the model-specific monitoring data to the given array.""" 1243 1249 self._addDataWithIndexMembers(data, "_monidx_", … … 1367 1373 return True 1368 1374 1369 def addMonitoringData(self, data ):1375 def addMonitoringData(self, data, fsType): 1370 1376 """Add the model-specific monitoring data to the given array.""" 1371 super(GenericAircraftModel, self).addMonitoringData(data )1377 super(GenericAircraftModel, self).addMonitoringData(data, fsType) 1372 1378 1373 1379 self._addOffsetWithIndexMember(data, 0x0af4, "H", "_monidx_fuelWeight") … … 1464 1470 def name(self): 1465 1471 """Get the name for this aircraft model.""" 1466 return "FSUIPC/PMDG Boeing 737NG "1467 1468 def addMonitoringData(self, data ):1472 return "FSUIPC/PMDG Boeing 737NG(X)" 1473 1474 def addMonitoringData(self, data, fsType): 1469 1475 """Add the model-specific monitoring data to the given array.""" 1470 super(PMDGBoeing737NGModel, self).addMonitoringData(data) 1476 self._fsType = fsType 1477 1478 super(PMDGBoeing737NGModel, self).addMonitoringData(data, fsType) 1471 1479 1472 1480 self._addOffsetWithIndexMember(data, 0x6202, "b", "_pmdgidx_switches") 1481 1482 if fsType==const.SIM_MSFSX: 1483 print "FSX detected, adding position lights switch offset" 1484 self._addOffsetWithIndexMember(data, 0x6500, "b", 1485 "_pmdgidx_lts_positionsw") 1473 1486 1474 1487 def getAircraftState(self, aircraft, timestamp, data): … … 1481 1494 if data[self._pmdgidx_switches]&0x01==0x01: 1482 1495 state.altimeter = 1013.25 1496 1497 if self._fsType==const.SIM_MSFSX: 1498 state.strobeLightsOn = data[self._pmdgidx_lts_positionsw]==0x02 1483 1499 1484 1500 return state
Note:
See TracChangeset
for help on using the changeset viewer.