summaryrefslogtreecommitdiffhomepage
path: root/proto-simconnect
diff options
context:
space:
mode:
Diffstat (limited to 'proto-simconnect')
-rw-r--r--proto-simconnect/CMakeLists.txt2
-rw-r--r--proto-simconnect/fsx_p3d_sp2_xpack.manifest (renamed from proto-simconnect/scserver.manifest)5
-rw-r--r--proto-simconnect/fsx_rtm.manifest8
-rw-r--r--proto-simconnect/fsx_sp1.manifest8
-rw-r--r--proto-simconnect/fsx_sp2.manifest8
-rw-r--r--proto-simconnect/fsx_steam_last.manifest8
-rw-r--r--proto-simconnect/fsx_steam_orig.manifest8
-rw-r--r--proto-simconnect/ftnoir-protocol-sc.rc11
-rw-r--r--proto-simconnect/ftnoir_protocol_sc.cpp233
-rw-r--r--proto-simconnect/ftnoir_protocol_sc.h100
-rw-r--r--proto-simconnect/ftnoir_protocol_sc_dialog.cpp10
-rw-r--r--proto-simconnect/ftnoir_sccontrols.ui21
-rw-r--r--proto-simconnect/lang/nl_NL.ts44
-rw-r--r--proto-simconnect/lang/ru_RU.ts44
-rw-r--r--proto-simconnect/lang/stub.ts44
-rw-r--r--proto-simconnect/lang/zh_CN.ts69
-rw-r--r--proto-simconnect/manifest-template.in8
-rw-r--r--proto-simconnect/scserver_acceleration.manifest13
-rw-r--r--proto-simconnect/scserver_sp2.manifest13
-rw-r--r--proto-simconnect/simconnect versions.txt20
20 files changed, 429 insertions, 248 deletions
diff --git a/proto-simconnect/CMakeLists.txt b/proto-simconnect/CMakeLists.txt
index 26047b6f..f5cec5ac 100644
--- a/proto-simconnect/CMakeLists.txt
+++ b/proto-simconnect/CMakeLists.txt
@@ -1,3 +1,3 @@
-if(WIN32)
+if(WIN32 AND opentrack-intel)
otr_module(proto-simconnect)
endif()
diff --git a/proto-simconnect/scserver.manifest b/proto-simconnect/fsx_p3d_sp2_xpack.manifest
index d342cfda..25a62765 100644
--- a/proto-simconnect/scserver.manifest
+++ b/proto-simconnect/fsx_p3d_sp2_xpack.manifest
@@ -5,9 +5,4 @@
<assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect' version='10.0.61259.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
</dependentAssembly>
</dependency>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
- </dependentAssembly>
- </dependency>
</assembly>
diff --git a/proto-simconnect/fsx_rtm.manifest b/proto-simconnect/fsx_rtm.manifest
new file mode 100644
index 00000000..760de973
--- /dev/null
+++ b/proto-simconnect/fsx_rtm.manifest
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect' version='10.0.60905.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/proto-simconnect/fsx_sp1.manifest b/proto-simconnect/fsx_sp1.manifest
new file mode 100644
index 00000000..ee746740
--- /dev/null
+++ b/proto-simconnect/fsx_sp1.manifest
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect' version='10.0.61242.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/proto-simconnect/fsx_sp2.manifest b/proto-simconnect/fsx_sp2.manifest
new file mode 100644
index 00000000..25a62765
--- /dev/null
+++ b/proto-simconnect/fsx_sp2.manifest
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect' version='10.0.61259.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/proto-simconnect/fsx_steam_last.manifest b/proto-simconnect/fsx_steam_last.manifest
new file mode 100644
index 00000000..b8cbaca4
--- /dev/null
+++ b/proto-simconnect/fsx_steam_last.manifest
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect' version='10.0.62615.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/proto-simconnect/fsx_steam_orig.manifest b/proto-simconnect/fsx_steam_orig.manifest
new file mode 100644
index 00000000..f1b3314c
--- /dev/null
+++ b/proto-simconnect/fsx_steam_orig.manifest
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect' version='10.0.62607.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/proto-simconnect/ftnoir-protocol-sc.rc b/proto-simconnect/ftnoir-protocol-sc.rc
index c89eb9a7..0d501812 100644
--- a/proto-simconnect/ftnoir-protocol-sc.rc
+++ b/proto-simconnect/ftnoir-protocol-sc.rc
@@ -1,4 +1,7 @@
-#include <winuser.h>
-142 RT_MANIFEST scserver.manifest
-143 RT_MANIFEST scserver_sp2.manifest
-144 RT_MANIFEST scserver_acceleration.manifest \ No newline at end of file
+#define RT_MANIFEST 24
+142 RT_MANIFEST fsx_p3d_sp2_xpack.manifest
+143 RT_MANIFEST fsx_rtm.manifest
+144 RT_MANIFEST fsx_sp1.manifest
+145 RT_MANIFEST fsx_sp2.manifest
+146 RT_MANIFEST fsx_steam_orig.manifest
+147 RT_MANIFEST fsx_steam_last.manifest
diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp
index c8df0443..ca76e0ce 100644
--- a/proto-simconnect/ftnoir_protocol_sc.cpp
+++ b/proto-simconnect/ftnoir_protocol_sc.cpp
@@ -2,8 +2,8 @@
* *
* ISC License (ISC) *
* *
- * Copyright (c) 2015, Wim Vriend
- * Copyright (c) 2014, Stanislaw Halik <sthalik@misaki.pl>
+ * Copyright (c) 2015, Wim Vriend *
+ * Copyright (c) 2014, 2017, 2019 Stanislaw Halik *
* *
* Permission to use, copy, modify, and/or distribute this software for any *
* purpose with or without fee is hereby granted, provided that the above *
@@ -11,172 +11,145 @@
*/
#include "ftnoir_protocol_sc.h"
#include "api/plugin-api.hpp"
-#include "opentrack-library-path.h"
-
-simconnect::simconnect() : should_stop(false), hSimConnect(nullptr)
-{
-}
+#include "compat/timer.hpp"
+#include "compat/library-path.hpp"
+#include "compat/activation-context.hpp"
simconnect::~simconnect()
{
- should_stop = true;
+ requestInterruption();
wait();
}
void simconnect::run()
{
- HANDLE event = CreateEvent(NULL, FALSE, FALSE, nullptr);
+ HANDLE event = CreateEventA(nullptr, FALSE, FALSE, nullptr);
if (event == nullptr)
{
- qDebug() << "simconnect: event create" << GetLastError();
+ qDebug() << "fsx: create event failed, error code" << GetLastError();
return;
}
- while (!should_stop)
+ constexpr unsigned sleep_time = 5;
+
+ while (!isInterruptionRequested())
{
- if (SUCCEEDED(simconnect_open(&hSimConnect, "opentrack", NULL, 0, event, 0)))
- {
- simconnect_subscribetosystemevent(hSimConnect, 0, "Frame");
+ HRESULT hr;
+ reconnect = false;
+ handle = nullptr;
- while (!should_stop)
+ if (!SUCCEEDED(hr = simconnect_open(&handle, "opentrack", nullptr, 0, event, 0)))
+ qDebug() << "fsx: connect failed, retry in" << sleep_time << "seconds...";
+ else
+ {
+ if (!SUCCEEDED(hr = simconnect_subscribe(handle, 0, "1sec")))
+ qDebug() << "fsx: can't subscribe to frame event:" << (void*)hr;
+ else
{
- if (WaitForSingleObject(event, 10) == WAIT_OBJECT_0)
+ while (!isInterruptionRequested())
{
- if (FAILED(simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, reinterpret_cast<void*>(this))))
+ constexpr int max_idle_ms = 2000;
+
+ if (WaitForSingleObject(event, max_idle_ms) != WAIT_OBJECT_0)
+ {
+ qDebug() << "fsx: timeout reached, reconnecting";
break;
- }
+ }
+
+ if (reconnect.load(std::memory_order_relaxed))
+ break;
+
+ if (!SUCCEEDED(hr = simconnect_calldispatch(handle, event_handler, (void*)this)))
+ {
+ qDebug() << "fsx: calldispatch failed:" << (void*)hr;
+ break;
+ }
+ }
}
- (void) simconnect_close(hSimConnect);
+ QMutexLocker l(&mtx);
+ (void)simconnect_close(handle);
+ handle = nullptr;
}
- if (!should_stop)
- Sleep(100);
+ for (unsigned k = 0; k < sleep_time * 25; k++)
+ {
+ if (isInterruptionRequested())
+ break;
+ Sleep(1000 / 25);
+ }
}
+ qDebug() << "simconnect: exit";
+
CloseHandle(event);
}
-void simconnect::pose( const double *headpose ) {
- // euler degrees
- virtSCRotX = float(-headpose[Pitch]);
- virtSCRotY = float(headpose[Yaw]);
- virtSCRotZ = float(headpose[Roll]);
-
- // cm to meters
- virtSCPosX = float(-headpose[TX]/100);
- virtSCPosY = float(headpose[TY]/100);
- virtSCPosZ = float(-headpose[TZ]/100);
+void simconnect::pose(const double* pose, const double*)
+{
+ data[Pitch] = (float)-pose[Pitch];
+ data[Yaw] = (float)pose[Yaw];
+ data[Roll] = (float)pose[Roll];
+
+ constexpr float to_meters = 1e-2f;
+ data[TX] = (float)-pose[TX] * to_meters;
+ data[TY] = (float)pose[TY] * to_meters;
+ data[TZ] = (float)-pose[TZ] * to_meters;
+
+ QMutexLocker l(&mtx);
+ if (handle)
+ (void)simconnect_set6DOF(handle,
+ data[TX], data[TY], data[TZ],
+ data[Pitch], data[Roll], data[Yaw]);
}
-#ifdef __GNUC__
-# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-#endif
-
-class ActivationContext {
-public:
- ActivationContext(const int resid) : ok(false) {
- hactctx = INVALID_HANDLE_VALUE;
- actctx_cookie = 0;
- ACTCTXA actx = {0};
- actx.cbSize = sizeof(ACTCTXA);
- actx.lpResourceName = MAKEINTRESOURCEA(resid);
- actx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;
-#ifdef _MSC_VER
-# define PREFIX ""
-#else
-# define PREFIX "lib"
-#endif
- static const QString prefix = OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH;
- QString path = prefix + PREFIX "opentrack-proto-simconnect.dll";
- QByteArray name = QFile::encodeName(path);
- actx.lpSource = name.constData();
- hactctx = CreateActCtxA(&actx);
- actctx_cookie = 0;
- if (hactctx != INVALID_HANDLE_VALUE) {
- if (!ActivateActCtx(hactctx, &actctx_cookie)) {
- qDebug() << "SC: can't set win32 activation context" << GetLastError();
- ReleaseActCtx(hactctx);
- hactctx = INVALID_HANDLE_VALUE;
- }
- else
- ok = true;
- } else {
- qDebug() << "SC: can't create win32 activation context" << GetLastError();
- }
- }
- ~ActivationContext() {
- if (hactctx != INVALID_HANDLE_VALUE)
- {
- DeactivateActCtx(0, actctx_cookie);
- ReleaseActCtx(hactctx);
- }
- }
- bool is_ok() { return ok; }
-private:
- ULONG_PTR actctx_cookie;
- HANDLE hactctx;
- bool ok;
-};
-
-bool simconnect::correct()
+module_status simconnect::initialize()
{
- if (!SCClientLib.isLoaded())
+ if (!library.isLoaded())
{
- ActivationContext ctx(142 + static_cast<int>(s.sxs_manifest));
+ constexpr int resource_offset = 142;
+ activation_context ctx("opentrack-proto-simconnect" "." OPENTRACK_LIBRARY_EXTENSION,
+ resource_offset + s.sxs_manifest);
- if (ctx.is_ok())
+ if (ctx)
{
- SCClientLib.setFileName("SimConnect.dll");
- if (!SCClientLib.load()) {
- qDebug() << "SC load" << SCClientLib.errorString();
- return false;
- }
+ library.setFileName("SimConnect.dll");
+ library.setLoadHints(QLibrary::PreventUnloadHint | QLibrary::ResolveAllSymbolsHint);
+ if (!library.load())
+ return error(tr("dll load failed: %1").arg(library.errorString()));
}
else
- return false;
+ // XXX TODO add instructions for fsx and p3d -sh 20190128
+ return error(tr("Install FSX/Prepar3D SimConnect SDK."));
}
- simconnect_open = (importSimConnect_Open) SCClientLib.resolve("SimConnect_Open");
- if (simconnect_open == NULL) {
- qDebug() << "simconnect::correct() says: SimConnect_Open function not found in DLL!";
- return false;
- }
- simconnect_set6DOF = (importSimConnect_CameraSetRelative6DOF) SCClientLib.resolve("SimConnect_CameraSetRelative6DOF");
- if (simconnect_set6DOF == NULL) {
- qDebug() << "simconnect::correct() says: SimConnect_CameraSetRelative6DOF function not found in DLL!";
- return false;
- }
- simconnect_close = (importSimConnect_Close) SCClientLib.resolve("SimConnect_Close");
- if (simconnect_close == NULL) {
- qDebug() << "simconnect::correct() says: SimConnect_Close function not found in DLL!";
- return false;
- }
+ using ptr = decltype(library.resolve(""));
- simconnect_calldispatch = (importSimConnect_CallDispatch) SCClientLib.resolve("SimConnect_CallDispatch");
- if (simconnect_calldispatch == NULL) {
- qDebug() << "simconnect::correct() says: SimConnect_CallDispatch function not found in DLL!";
- return false;
- }
+ struct {
+ const char* name;
+ ptr& place;
+ } list[] = {
+ { "SimConnect_Open", (ptr&)simconnect_open },
+ { "SimConnect_CameraSetRelative6DOF", (ptr&)simconnect_set6DOF },
+ { "SimConnect_Close", (ptr&)simconnect_close },
+ { "SimConnect_CallDispatch", (ptr&)simconnect_calldispatch },
+ { "SimConnect_SubscribeToSystemEvent", (ptr&)simconnect_subscribe },
+ };
- simconnect_subscribetosystemevent = (importSimConnect_SubscribeToSystemEvent) SCClientLib.resolve("SimConnect_SubscribeToSystemEvent");
- if (simconnect_subscribetosystemevent == NULL) {
- qDebug() << "simconnect::correct() says: SimConnect_SubscribeToSystemEvent function not found in DLL!";
- return false;
+ for (auto& x : list)
+ {
+ x.place = library.resolve(x.name);
+ if (!x.place)
+ return error(tr("can't import %1: %2").arg(x.name, library.errorString()));
}
start();
- return true;
-}
-
-void simconnect::handle()
-{
- (void) simconnect_set6DOF(hSimConnect, virtSCPosX, virtSCPosY, virtSCPosZ, virtSCRotX, virtSCRotZ, virtSCRotY);
+ return {};
}
-void CALLBACK simconnect::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD, void *self_)
+void simconnect::event_handler(SIMCONNECT_RECV* pData, DWORD, void* self_)
{
simconnect& self = *reinterpret_cast<simconnect*>(self_);
@@ -184,10 +157,20 @@ void CALLBACK simconnect::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWO
{
default:
break;
- case SIMCONNECT_RECV_ID_EVENT_FRAME:
- self.handle();
+ case SIMCONNECT_RECV_ID_EXCEPTION:
+ // CAVEAT: can't reconnect here, it breaks Prepar3D.
+ // the timer on the event handle will take care of failures.
+ break;
+ case SIMCONNECT_RECV_ID_QUIT:
+ qDebug() << "fsx: got quit event";
+ self.reconnect = true;
break;
}
}
-OPENTRACK_DECLARE_PROTOCOL(simconnect, SCControls, simconnectDll)
+QString simconnect::game_name()
+{
+ return tr("FSX / Prepar3D");
+}
+
+OPENTRACK_DECLARE_PROTOCOL(simconnect, simconnect_ui, simconnect_metadata)
diff --git a/proto-simconnect/ftnoir_protocol_sc.h b/proto-simconnect/ftnoir_protocol_sc.h
index ff664351..df3a538d 100644
--- a/proto-simconnect/ftnoir_protocol_sc.h
+++ b/proto-simconnect/ftnoir_protocol_sc.h
@@ -3,7 +3,7 @@
* ISC License (ISC) *
* *
* Copyright (c) 2015, Wim Vriend *
- * Copyright (c) 2014, Stanislaw Halik *
+ * Copyright (c) 2014, 2017, 2019 Stanislaw Halik *
* *
* Permission to use, copy, modify, and/or distribute this software for any *
* purpose with or without fee is hereby granted, provided that the above *
@@ -11,9 +11,12 @@
*/
#pragma once
#include "api/plugin-api.hpp"
-
#include "ui_ftnoir_sccontrols.h"
+
+#include <atomic>
+
#include <QThread>
+#include <QMutex>
#include <QMessageBox>
#include <QSettings>
#include <QLibrary>
@@ -28,81 +31,80 @@ struct settings : opts {
value<int> sxs_manifest;
settings() :
opts("proto-simconnect"),
- sxs_manifest(b, "sxs-manifest-version", 0)
+ sxs_manifest(b, "simconnect-manifest", 0)
{}
};
-class simconnect : public IProtocol, private QThread
+class simconnect : private QThread, public IProtocol
{
+ Q_OBJECT
public:
- simconnect();
+ simconnect() = default;
~simconnect() override;
- bool correct();
- void pose(const double* headpose);
- void handle();
- QString game_name() {
- return "FS2004/FSX";
- }
+ module_status initialize() override;
+ void pose(const double* headpose, const double*) override;
+ QString game_name() override;
+ void run() override;
+
private:
- enum { SIMCONNECT_RECV_ID_EVENT_FRAME = 7 };
+ enum {
+ SIMCONNECT_RECV_ID_EXCEPTION = 2,
+ SIMCONNECT_RECV_ID_QUIT = 3,
+ SIMCONNECT_RECV_ID_EVENT_FRAME = 7,
+ };
- #pragma pack(push, 1)
struct SIMCONNECT_RECV
{
DWORD dwSize;
DWORD dwVersion;
DWORD dwID;
};
- #pragma pack(pop)
- typedef void (CALLBACK *DispatchProc)(SIMCONNECT_RECV*, DWORD, void*);
+ typedef void (CALLBACK *SC_DispatchProc)(SIMCONNECT_RECV*, DWORD, void*);
- typedef HRESULT (WINAPI *importSimConnect_Open)(HANDLE * phSimConnect, LPCSTR szName, HWND hWnd, DWORD UserEventWin32, HANDLE hEventHandle, DWORD ConfigIndex);
- typedef HRESULT (WINAPI *importSimConnect_Close)(HANDLE hSimConnect);
- typedef HRESULT (WINAPI *importSimConnect_CameraSetRelative6DOF)(HANDLE hSimConnect, float fDeltaX, float fDeltaY, float fDeltaZ, float fPitchDeg, float fBankDeg, float fHeadingDeg);
- typedef HRESULT (WINAPI *importSimConnect_CallDispatch)(HANDLE hSimConnect, DispatchProc pfcnDispatch, void * pContext);
- typedef HRESULT (WINAPI *importSimConnect_SubscribeToSystemEvent)(HANDLE hSimConnect, DWORD EventID, const char * SystemEventName);
+ typedef HRESULT (WINAPI *SC_Open)(HANDLE* phSimConnect, LPCSTR szName, HWND hWnd, DWORD UserEventWin32, HANDLE hEventHandle, DWORD ConfigIndex);
+ typedef HRESULT (WINAPI *SC_Close)(HANDLE hSimConnect);
+ typedef HRESULT (WINAPI *SC_CameraSetRelative6DOF)(HANDLE hSimConnect, float fDeltaX, float fDeltaY, float fDeltaZ, float fPitchDeg, float fBankDeg, float fHeadingDeg);
+ typedef HRESULT (WINAPI *SC_CallDispatch)(HANDLE hSimConnect, SC_DispatchProc pfcnDispatch, void * pContext);
+ typedef HRESULT (WINAPI *SC_SubscribeToSystemEvent)(HANDLE hSimConnect, DWORD EventID, const char * SystemEventName);
- void run() override;
- volatile bool should_stop;
-
- volatile float virtSCPosX;
- volatile float virtSCPosY;
- volatile float virtSCPosZ;
- volatile float virtSCRotX;
- volatile float virtSCRotY;
- volatile float virtSCRotZ;
-
- importSimConnect_Open simconnect_open;
- importSimConnect_Close simconnect_close;
- importSimConnect_CameraSetRelative6DOF simconnect_set6DOF;
- importSimConnect_CallDispatch simconnect_calldispatch;
- importSimConnect_SubscribeToSystemEvent simconnect_subscribetosystemevent;
-
- HANDLE hSimConnect;
- static void CALLBACK processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext);
+ float data[6] {};
+ QMutex mtx;
+
+ SC_Open simconnect_open = nullptr;
+ SC_Close simconnect_close = nullptr;
+ SC_CameraSetRelative6DOF simconnect_set6DOF = nullptr;
+ SC_CallDispatch simconnect_calldispatch = nullptr;
+ SC_SubscribeToSystemEvent simconnect_subscribe = nullptr;
+
+ HANDLE handle = nullptr;
+ std::atomic<bool> reconnect = false;
+ static void CALLBACK event_handler(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext);
settings s;
- QLibrary SCClientLib;
+ QLibrary library;
};
-class SCControls: public IProtocolDialog
+class simconnect_ui: public IProtocolDialog
{
Q_OBJECT
-public:
- SCControls();
- void register_protocol(IProtocol *) {}
- void unregister_protocol() {}
-private:
+
Ui::UICSCControls ui;
settings s;
+
+public:
+ simconnect_ui();
+ void register_protocol(IProtocol *) override {}
+ void unregister_protocol() override {}
+
private slots:
void doOK();
void doCancel();
};
-class simconnectDll : public Metadata
+class simconnect_metadata : public Metadata
{
-public:
- QString name() { return QString(QCoreApplication::translate("simconnectDll", "Microsoft FSX SimConnect")); }
- QIcon icon() { return QIcon(":/images/fsx.png"); }
+ Q_OBJECT
+
+ QString name() override { return tr("Microsoft FSX SimConnect"); }
+ QIcon icon() override { return QIcon(":/images/fsx.png"); }
};
diff --git a/proto-simconnect/ftnoir_protocol_sc_dialog.cpp b/proto-simconnect/ftnoir_protocol_sc_dialog.cpp
index a14c6b44..c329e75d 100644
--- a/proto-simconnect/ftnoir_protocol_sc_dialog.cpp
+++ b/proto-simconnect/ftnoir_protocol_sc_dialog.cpp
@@ -12,23 +12,23 @@
#include <QDebug>
#include "api/plugin-api.hpp"
-SCControls::SCControls()
+simconnect_ui::simconnect_ui()
{
- ui.setupUi( this );
+ ui.setupUi(this);
- // Connect Qt signals to member-functions
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
tie_setting(s.sxs_manifest, ui.comboBox);
}
-void SCControls::doOK() {
+void simconnect_ui::doOK()
+{
s.b->save();
close();
}
-void SCControls::doCancel()
+void simconnect_ui::doCancel()
{
close();
}
diff --git a/proto-simconnect/ftnoir_sccontrols.ui b/proto-simconnect/ftnoir_sccontrols.ui
index 887d6d80..c272d5da 100644
--- a/proto-simconnect/ftnoir_sccontrols.ui
+++ b/proto-simconnect/ftnoir_sccontrols.ui
@@ -18,7 +18,7 @@
</property>
<property name="windowIcon">
<iconset>
- <normaloff>images/FaceTrackNoIR.png</normaloff>images/FaceTrackNoIR.png</iconset>
+ <normaloff>images/opentrack.png</normaloff>images/opentrack.png</iconset>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
@@ -53,17 +53,32 @@
</property>
<item>
<property name="text">
+ <string>Prepar3d / SP2 XPACK</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>RTM</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
<string>SP1</string>
</property>
</item>
<item>
<property name="text">
- <string>SP2</string>
+ <string>SP2 -- Acceleration</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Steam FSX (older)</string>
</property>
</item>
<item>
<property name="text">
- <string>Acceleration</string>
+ <string>Steam FSX (newer)</string>
</property>
</item>
</widget>
diff --git a/proto-simconnect/lang/nl_NL.ts b/proto-simconnect/lang/nl_NL.ts
index f01f6d88..5b9acbb3 100644
--- a/proto-simconnect/lang/nl_NL.ts
+++ b/proto-simconnect/lang/nl_NL.ts
@@ -4,40 +4,64 @@
<context>
<name>UICSCControls</name>
<message>
- <location filename="../ftnoir_sccontrols.ui" line="+17"/>
<source>Protocol settings</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+25"/>
<source>FSX version</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+14"/>
+ <source>RTM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>SP1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+5"/>
- <source>SP2</source>
+ <source>SP2 -- Acceleration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+5"/>
- <source>Acceleration</source>
+ <source>Steam FSX (older)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+17"/>
<source>You need to install SimConnect SDK for your FSX version. For the Steam version, choose SP1 in the above combo box.</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Prepar3d / SP2 XPACK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steam FSX (newer)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>simconnect</name>
+ <message>
+ <source>dll load failed: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>can&apos;t import %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Install FSX/Prepar3D SimConnect SDK.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FSX / Prepar3D</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>simconnectDll</name>
+ <name>simconnect_metadata</name>
<message>
- <location filename="../ftnoir_protocol_sc.h" line="+106"/>
<source>Microsoft FSX SimConnect</source>
<translation type="unfinished"></translation>
</message>
diff --git a/proto-simconnect/lang/ru_RU.ts b/proto-simconnect/lang/ru_RU.ts
index 3d49c8b8..0d5bb1c3 100644
--- a/proto-simconnect/lang/ru_RU.ts
+++ b/proto-simconnect/lang/ru_RU.ts
@@ -4,40 +4,64 @@
<context>
<name>UICSCControls</name>
<message>
- <location filename="../ftnoir_sccontrols.ui" line="+17"/>
<source>Protocol settings</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+25"/>
<source>FSX version</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+14"/>
+ <source>RTM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>SP1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+5"/>
- <source>SP2</source>
+ <source>SP2 -- Acceleration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+5"/>
- <source>Acceleration</source>
+ <source>Steam FSX (older)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+17"/>
<source>You need to install SimConnect SDK for your FSX version. For the Steam version, choose SP1 in the above combo box.</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Prepar3d / SP2 XPACK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steam FSX (newer)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>simconnect</name>
+ <message>
+ <source>dll load failed: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>can&apos;t import %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Install FSX/Prepar3D SimConnect SDK.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FSX / Prepar3D</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>simconnectDll</name>
+ <name>simconnect_metadata</name>
<message>
- <location filename="../ftnoir_protocol_sc.h" line="+106"/>
<source>Microsoft FSX SimConnect</source>
<translation type="unfinished"></translation>
</message>
diff --git a/proto-simconnect/lang/stub.ts b/proto-simconnect/lang/stub.ts
index 522fc4e8..50d0fa8a 100644
--- a/proto-simconnect/lang/stub.ts
+++ b/proto-simconnect/lang/stub.ts
@@ -4,40 +4,64 @@
<context>
<name>UICSCControls</name>
<message>
- <location filename="../ftnoir_sccontrols.ui" line="+17"/>
<source>Protocol settings</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+25"/>
<source>FSX version</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+14"/>
+ <source>RTM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>SP1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+5"/>
- <source>SP2</source>
+ <source>SP2 -- Acceleration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+5"/>
- <source>Acceleration</source>
+ <source>Steam FSX (older)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+17"/>
<source>You need to install SimConnect SDK for your FSX version. For the Steam version, choose SP1 in the above combo box.</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Prepar3d / SP2 XPACK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steam FSX (newer)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>simconnect</name>
+ <message>
+ <source>dll load failed: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>can&apos;t import %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Install FSX/Prepar3D SimConnect SDK.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FSX / Prepar3D</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>simconnectDll</name>
+ <name>simconnect_metadata</name>
<message>
- <location filename="../ftnoir_protocol_sc.h" line="+106"/>
<source>Microsoft FSX SimConnect</source>
<translation type="unfinished"></translation>
</message>
diff --git a/proto-simconnect/lang/zh_CN.ts b/proto-simconnect/lang/zh_CN.ts
new file mode 100644
index 00000000..86e487f2
--- /dev/null
+++ b/proto-simconnect/lang/zh_CN.ts
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="zh_CN">
+<context>
+ <name>UICSCControls</name>
+ <message>
+ <source>Protocol settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FSX version</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>RTM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SP1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SP2 -- Acceleration</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steam FSX (older)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>You need to install SimConnect SDK for your FSX version. For the Steam version, choose SP1 in the above combo box.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Prepar3d / SP2 XPACK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Steam FSX (newer)</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>simconnect</name>
+ <message>
+ <source>dll load failed: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>can&apos;t import %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Install FSX/Prepar3D SimConnect SDK.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FSX / Prepar3D</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>simconnect_metadata</name>
+ <message>
+ <source>Microsoft FSX SimConnect</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/proto-simconnect/manifest-template.in b/proto-simconnect/manifest-template.in
new file mode 100644
index 00000000..69966102
--- /dev/null
+++ b/proto-simconnect/manifest-template.in
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect' version='VERSION' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/proto-simconnect/scserver_acceleration.manifest b/proto-simconnect/scserver_acceleration.manifest
deleted file mode 100644
index 06459587..00000000
--- a/proto-simconnect/scserver_acceleration.manifest
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect ' version='10.0.61242.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
- </dependentAssembly>
- </dependency>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
- </dependentAssembly>
- </dependency>
-</assembly>
diff --git a/proto-simconnect/scserver_sp2.manifest b/proto-simconnect/scserver_sp2.manifest
deleted file mode 100644
index 3020d16c..00000000
--- a/proto-simconnect/scserver_sp2.manifest
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect ' version='10.0.60905.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
- </dependentAssembly>
- </dependency>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
- </dependentAssembly>
- </dependency>
-</assembly>
diff --git a/proto-simconnect/simconnect versions.txt b/proto-simconnect/simconnect versions.txt
new file mode 100644
index 00000000..dde71f8f
--- /dev/null
+++ b/proto-simconnect/simconnect versions.txt
@@ -0,0 +1,20 @@
+#define LVERS_ORIG "10.0.60905.0"
+#define LVERS_SP1B1 "10.0.61232.0"
+#define LVERS_SP1B2 "10.0.61233.0"
+#define LVERS_SP1B3 "10.0.61234.0"
+#define LVERS_SP1B4 "10.0.61240.0"
+#define LVERS_SP1 "10.0.61242.0"
+#define LVERS_ACCA1 "10.0.61245.0"
+#define LVERS_ACCB1 "10.0.61246.0"
+#define LVERS_ACCB2 "10.0.61247.0"
+#define LVERS_ACCB3 "10.0.61248.0"
+#define LVERS_ACCSP2 "10.0.61259.0"
+#define LVERS_STEAM "10.0.62607.0"
+#define LVERS_STEAM2 "10.0.62608.0"
+#define LVERS_STEAM3 "10.0.62609.0"
+#define LVERS_STEAM4 "10.0.62610.0"
+#define LVERS_STEAM5 "10.0.62611.0"
+#define LVERS_STEAM6 "10.0.62612.0"
+#define LVERS_STEAM7 "10.0.62613.0"
+#define LVERS_STEAM8 "10.0.62614.0"
+#define LVERS_STEAM9 "10.0.62615.0"