This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtrack.py
55 lines (45 loc) · 1.5 KB
/
track.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# ----------------------------------------- #
# track.pyw #
# Speed_Limit75 #
# #
# This file is the bridge between xACARS #
# and the flight simulator. This is the #
# only file to use the pyuipc (UIPC API) #
# libary. #
# ----------------------------------------- #
# Import libarys
# import pyuipc
import math
import os
# Opens connection to FSUIPC/XPUIPC, and returns if it was successful.
def beginTrack():
# try:
# pyuipc.open(0)
# return True
# except pyuipc.FSUIPCException as e:
# return "UIPC Connection Error: " + str(e.errorCode)
# except Exception as e:
# return "ERROR: " + str(e)
return True
def endTrack(): # Closes connection to FSUIPC/XPUIPC.
# pyuipc.close()
pass
def posUpdate(): # Update input folder with latest data from FSUIPC/XPUIPC.
# lat = pyuipc.read([(0x6010, "f")])
# lat = float(lat[0])
# long = pyuipc.read([(0x6018, "f")])
# long = float(long[0])
# hdg = pyuipc.read([(0x6040, "f")])
# hdg = float(hdg[0])
# hdg = hdg*180/math.pi
# vs = pyuipc.read([(0x0842, "h")])
# vs = float(vs[0])
# vs = vs * -3.28084
# alt = pyuipc.read([(0x6020, "f")])
# alt = float(alt[0])
# alt = alt*3.28084
# gs = pyuipc.read([(0x6030, "f")])
# gs = float(gs[0])
# gs = gs*3600/1852
# return lat, long, hdg, vs, alt, gs
return 0, 0, 0, 0, 0, 0