source: src/test.py@ 8:85698811c70e

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

The tracking of flight stages and some basic logging functionality works

File size: 752 bytes
Line 
1# Test module
2
3import fs
4import flight
5import logger
6import acft
7import const
8
9import time
10import sys
11
12def callback(data, extra):
13 print data
14
15def main():
16 with open(sys.argv[1], "wt") as output:
17 fl = flight.Flight(logger.Logger(output = output))
18 fl.cruiseAltitude = 18000
19 fl.aircraftType = const.AIRCRAFT_B736
20 fl.aircraft = acft.Aircraft.create(fl)
21 simulator = fs.createSimulator(const.SIM_MSFS9, fs.ConnectionListener(),
22 fl.aircraft)
23 fl.simulator = simulator
24
25 simulator.connect()
26 simulator.startMonitoring()
27
28 fl.wait()
29
30 simulator.stopMonitoring()
31 simulator.disconnect()
32
33if __name__ == "__main__":
34 main()
Note: See TracBrowser for help on using the repository browser.