Changeset 5:90eade9afbcb for src/test.py
- Timestamp:
- 01/31/12 18:01:43 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/test.py
r4 r5 9 9 print data 10 10 11 class ConnectionListener(fs.ConnectionListener):12 def __init__(self):13 self._simulator = None14 self._monitoring = False11 def main(): 12 simulator = fs.createSimulator(const.TYPE_MSFS9, fs.ConnectionListener(), 13 acft.Aircraft(const.AIRCRAFT_B737)) 14 simulator.connect() 15 15 16 def connected(self, fsType, descriptor): 17 print "fs.ConnectionListener.connected, fsType:", fsType, ", descriptor:", descriptor 18 if not self._monitoring: 19 self._simulator.startMonitoring(acft.Aircraft(const.AIRCRAFT_B737)) 20 21 def main(): 22 connectionListener = ConnectionListener() 23 simulator = fs.createSimulator(const.TYPE_MSFS9, connectionListener) 24 connectionListener._simulator = simulator 25 simulator.connect() 16 time.sleep(10) 17 simulator.startMonitoring() 26 18 27 19 while True: 28 20 time.sleep(1000) 21 simulator.stopMonitoring() 22 simulator.disconnect() 23 24 time.sleep(5) 29 25 30 26 if __name__ == "__main__":
Note:
See TracChangeset
for help on using the changeset viewer.