source: src/test.py@ 4:bcc93ecb8cb6

Last change on this file since 4:bcc93ecb8cb6 was 4:bcc93ecb8cb6, checked in by István Váradi <ivaradi@…>, 13 years ago

The aircraft model framework is basically implemented

File size: 779 bytes
Line 
1# Test module
2
3import fs
4import acft
5import const
6import time
7
8def callback(data, extra):
9 print data
10
11class ConnectionListener(fs.ConnectionListener):
12 def __init__(self):
13 self._simulator = None
14 self._monitoring = False
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
21def main():
22 connectionListener = ConnectionListener()
23 simulator = fs.createSimulator(const.TYPE_MSFS9, connectionListener)
24 connectionListener._simulator = simulator
25 simulator.connect()
26
27 while True:
28 time.sleep(1000)
29
30if __name__ == "__main__":
31 main()
Note: See TracBrowser for help on using the repository browser.