Rev | Line | |
---|
[3] | 1 | # Module for generic flight-simulator interfaces
|
---|
| 2 |
|
---|
| 3 | # Flight simulator type: MS Flight Simulator 2004
|
---|
| 4 | TYPE_FS2K4 = 1
|
---|
| 5 |
|
---|
| 6 | # Flight simulator type: MS Flight Simulator X
|
---|
| 7 | TYPE_FSX = 2
|
---|
| 8 |
|
---|
| 9 | # Flight simulator type: X-Plane 9
|
---|
| 10 | TYPE_XPLANE9 = 3
|
---|
| 11 |
|
---|
| 12 | # Flight simulator type: X-Plane 10
|
---|
| 13 | TYPE_XPLANE10 = 4
|
---|
| 14 |
|
---|
| 15 | class ConnectionListener:
|
---|
| 16 | """Base class for listeners on connections to the flight simulator."""
|
---|
| 17 | def connected(self, fsType, descriptor):
|
---|
| 18 | """Called when a connection has been established to the flight
|
---|
| 19 | simulator of the given type."""
|
---|
| 20 | print "fs.ConnectionListener.connected, fsType:", fsType, ", descriptor:", descriptor
|
---|
| 21 |
|
---|
| 22 | def disconnected(self):
|
---|
| 23 | """Called when a connection to the flight simulator has been broken."""
|
---|
| 24 | print "fs.ConnectionListener.disconnected"
|
---|
| 25 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.