Changeset 5:90eade9afbcb for src/test.py


Ignore:
Timestamp:
01/31/12 18:01:43 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added some further data to those queried and reworked a bit the way the model changes are handled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test.py

    r4 r5  
    99    print data
    1010
    11 class ConnectionListener(fs.ConnectionListener):
    12     def __init__(self):
    13         self._simulator = None
    14         self._monitoring = False
     11def main():
     12    simulator = fs.createSimulator(const.TYPE_MSFS9, fs.ConnectionListener(),
     13                                   acft.Aircraft(const.AIRCRAFT_B737))
     14    simulator.connect()
    1515
    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()
    2618
    2719    while True:
    2820        time.sleep(1000)
     21    simulator.stopMonitoring()
     22    simulator.disconnect()
     23
     24    time.sleep(5)
    2925
    3026if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.