Added monitor example for Python
This commit is contained in:
16
Python/src/monitorExample.py
Normal file
16
Python/src/monitorExample.py
Normal file
@@ -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()
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>3c7a940d-17c8-4e91-882f-9bc8b1d2f54b</ProjectGuid>
|
<ProjectGuid>3c7a940d-17c8-4e91-882f-9bc8b1d2f54b</ProjectGuid>
|
||||||
<ProjectHome>.</ProjectHome>
|
<ProjectHome>.</ProjectHome>
|
||||||
<StartupFile>src\example.py</StartupFile>
|
<StartupFile>src\basicExample.py</StartupFile>
|
||||||
<SearchPath>
|
<SearchPath>
|
||||||
</SearchPath>
|
</SearchPath>
|
||||||
<WorkingDirectory>.</WorkingDirectory>
|
<WorkingDirectory>.</WorkingDirectory>
|
||||||
@@ -24,8 +24,11 @@
|
|||||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="src\monitorExample.py">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="src\xpc.py" />
|
<Compile Include="src\xpc.py" />
|
||||||
<Compile Include="src\example.py">
|
<Compile Include="src\basicExample.py">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user