From 49fb706e9db6082fa4fe081a3af519d6e7519c71 Mon Sep 17 00:00:00 2001 From: Jason Watkins Date: Fri, 19 Jun 2015 13:09:17 -0700 Subject: [PATCH] Added monitor example for Python --- Python/src/{example.py => basicExample.py} | 0 Python/src/monitorExample.py | 16 ++++++++++++++++ Python/xplaneConnect.pyproj | 7 +++++-- 3 files changed, 21 insertions(+), 2 deletions(-) rename Python/src/{example.py => basicExample.py} (100%) create mode 100644 Python/src/monitorExample.py diff --git a/Python/src/example.py b/Python/src/basicExample.py similarity index 100% rename from Python/src/example.py rename to Python/src/basicExample.py diff --git a/Python/src/monitorExample.py b/Python/src/monitorExample.py new file mode 100644 index 0000000..c4cdb48 --- /dev/null +++ b/Python/src/monitorExample.py @@ -0,0 +1,16 @@ +import sys + +import xpc + +def monitor(): + with xpc.XPlaneConnect() as client: + while True: + posi = client.getPOSI(); + ctrl = client.getCTRL(); + + print "Loc: (%4f, %4f, %4f) Aileron:%2f Elevator:%2f Rudder:%2f\n"\ + % (posi[0], posi[1], posi[2], ctrl[1], ctrl[0], ctrl[2]) + + +if __name__ == "__main__": + monitor() \ No newline at end of file diff --git a/Python/xplaneConnect.pyproj b/Python/xplaneConnect.pyproj index c288a9c..08039aa 100644 --- a/Python/xplaneConnect.pyproj +++ b/Python/xplaneConnect.pyproj @@ -5,7 +5,7 @@ 2.0 3c7a940d-17c8-4e91-882f-9bc8b1d2f54b . - src\example.py + src\basicExample.py . @@ -24,8 +24,11 @@ false + + Code + - + Code