Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into develop and other changes for X-Plane 12 compatibility #310

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@ out/
#################
Docs/~$Capability Matrix.xlsx
*.xpl
*.egg-info
build
dist
File renamed without changes.
18 changes: 18 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from setuptools import setup, find_packages


setup(
name="xplaneconnect",
version="1.3rc6",
python_requires=">=3",
packages=find_packages("Python3/src"),
package_dir={"": "Python3/src"},
description="XPlaneConnect (XPC) facilitates communication to and from the XPCPlugin. Note: To use the XPC package, you must first install the XPCPlugin. See https://github.com/nasa/XPlaneConnect/wiki/Getting-Started for instructions on installing the XPCPlugin",
url="https://github.com/nasa/XPlaneConnect/",
project_urls={
"Bug Reports": "https://github.com/nasa/xplaneconnect/issues",
"Organization": "https://www.nasa.gov/content/diagnostics-prognostics",
"Source": "https://github.com/nasa/xplaneconnect",
"Documentation": "https://github.com/nasa/XPlaneConnect/wiki"
}
)
4 changes: 3 additions & 1 deletion xpcPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(SDK/CHeaders/XPLM)
include_directories(../C/src)

add_definitions(-DXPLM200 -DLIN=1)
add_definitions(-DXPLM400 -DXPLM303 -DXPLM302 -DXPLM301 -DXPLM300 -DXPLM210 -DXPLM200 -DLIN=1)

SET(CMAKE_C_COMPILER gcc)
SET(CMAKE_CXX_COMPILER g++)
Expand All @@ -16,6 +16,7 @@ SET(XPC_OUTPUT_DIR "XPlaneConnect")
SET(XPC_OUTPUT_NAME "lin")

add_library(xpc64 SHARED XPCPlugin.cpp
CameraCallbacks.cpp
DataManager.cpp
Drawing.cpp
Log.cpp
Expand All @@ -29,6 +30,7 @@ set_target_properties(xpc64 PROPERTIES OUTPUT_NAME ${XPC_OUTPUT_NAME})
set_target_properties(xpc64 PROPERTIES COMPILE_FLAGS "-m64 -fno-stack-protector" LINK_FLAGS "-shared -rdynamic -nodefaultlibs -undefined_warning -m64 -fno-stack-protector")

add_library(xpc32 SHARED XPCPlugin.cpp
CameraCallbacks.cpp
DataManager.cpp
Drawing.cpp
Log.cpp
Expand Down
8 changes: 4 additions & 4 deletions xpcPlugin/DataManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace XPC
drefs.insert(make_pair(DREF_Pitch, XPLMFindDataRef("sim/flightmodel/position/theta")));
drefs.insert(make_pair(DREF_Roll, XPLMFindDataRef("sim/flightmodel/position/phi")));
drefs.insert(make_pair(DREF_HeadingTrue, XPLMFindDataRef("sim/flightmodel/position/psi")));
drefs.insert(make_pair(DREF_HeadingMag, XPLMFindDataRef("sim/flightmodel/position/magpsi")));
drefs.insert(make_pair(DREF_HeadingMag, XPLMFindDataRef("sim/flightmodel/position/mag_psi")));
drefs.insert(make_pair(DREF_Quaternion, XPLMFindDataRef("sim/flightmodel/position/q")));

drefs.insert(make_pair(DREF_AngleOfAttack, XPLMFindDataRef("sim/flightmodel/position/alpha")));
Expand Down Expand Up @@ -187,11 +187,11 @@ namespace XPC
sprintf(multi, "sim/multiplayer/position/plane%i_throttle", i);
mdrefs[i][DREF_ThrottleActual] = XPLMFindDataRef(multi);
mdrefs[i][DREF_ThrottleSet] = mdrefs[i][DREF_ThrottleActual]; // No throttle set for multiplayer planes.
sprintf(multi, "sim/multiplayer/position/plane%i_yolk_pitch", i);
sprintf(multi, "sim/multiplayer/controls/yolk_pitch_ratio[%i]", i);
mdrefs[i][DREF_YokePitch] = XPLMFindDataRef(multi);
sprintf(multi, "sim/multiplayer/position/plane%i_yolk_roll", i);
sprintf(multi, "sim/multiplayer/controls/yolk_roll_ratio[%i]", i);
mdrefs[i][DREF_YokeRoll] = XPLMFindDataRef(multi);
sprintf(multi, "sim/multiplayer/position/plane%i_yolk_yaw", i);
sprintf(multi, "sim/multiplayer/controls/yolk_heading_ratio[%i]", i);
mdrefs[i][DREF_YokeHeading] = XPLMFindDataRef(multi);
}

Expand Down
4 changes: 2 additions & 2 deletions xpcPlugin/Drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ namespace XPC
numWaypoints = 0;
if (routeEnabled)
{
XPLMUnregisterDrawCallback(RouteDrawCallback, xplm_Phase_Objects, 0, NULL);
XPLMUnregisterDrawCallback(RouteDrawCallback, xplm_Phase_Modern3D, 0, NULL);
}
return;
}
Expand All @@ -256,7 +256,7 @@ namespace XPC

if (!routeEnabled)
{
XPLMRegisterDrawCallback(RouteDrawCallback, xplm_Phase_Objects, 0, NULL);
XPLMRegisterDrawCallback(RouteDrawCallback, xplm_Phase_Modern3D, 0, NULL);
}
if (!planeXref)
{
Expand Down
5 changes: 3 additions & 2 deletions xpcPlugin/MessageHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,10 @@ namespace XPC
// get view type
int view_type;
memcpy(&view_type, buffer + 5, 4);


// Below command has been deprecated. All view modes can be set by using the MessageHandlers::HandleComm command below.
// set view by calling the corresponding key stroke
XPLMCommandKeyStroke(view_type);
// XPLMCommandKeyStroke(view_type);


VIEW_TYPE viewRunway = VIEW_TYPE::XPC_VIEW_RUNWAY;
Expand Down
Loading