Namespacing and Lib for files
This commit is contained in:
@@ -8,13 +8,13 @@ add_library(germanairlinesva_xplugin SHARED
|
||||
)
|
||||
|
||||
target_include_directories(germanairlinesva_xplugin PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/ixwebsocket/include
|
||||
${CMAKE_SOURCE_DIR}/file/include
|
||||
${CMAKE_SOURCE_DIR}/simdata/include
|
||||
${CMAKE_SOURCE_DIR}/websocket/include
|
||||
${CMAKE_SOURCE_DIR}/utilities/include
|
||||
${CMAKE_SOURCE_DIR}/ixwebsocket/include
|
||||
${CMAKE_SOURCE_DIR}/nlohmann/include
|
||||
${CMAKE_SOURCE_DIR}/XPSDK/CHeaders
|
||||
${CMAKE_SOURCE_DIR}/file
|
||||
)
|
||||
|
||||
set_target_properties(germanairlinesva_xplugin PROPERTIES
|
||||
@@ -24,7 +24,6 @@ set_target_properties(germanairlinesva_xplugin PROPERTIES
|
||||
target_compile_definitions(germanairlinesva_xplugin PRIVATE
|
||||
XPLM200
|
||||
XPLM210
|
||||
_USE_MATH_DEFINES
|
||||
)
|
||||
target_compile_options(germanairlinesva_xplugin PRIVATE
|
||||
-Wall
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define GERMANAIRLINESVA_GACONNECTOR_XPLUGIN_MAIN_H
|
||||
|
||||
#include "config.hpp"
|
||||
#include "recordingPath.hpp"
|
||||
#include "pathRecording.h"
|
||||
#include "simdata.h"
|
||||
#include "simulatorDatabase.hpp"
|
||||
#include "websocket.h"
|
||||
@@ -17,6 +17,8 @@
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <sstream>
|
||||
|
||||
+14
-7
@@ -47,7 +47,7 @@ XPLMDataRef roll;
|
||||
XPLMDataRef quaternion;
|
||||
|
||||
germanairlinesva_websocket::data toSend;
|
||||
Path p;
|
||||
germanairlinesva_recording::PathRecording p;
|
||||
|
||||
/*
|
||||
* Callbacks
|
||||
@@ -266,7 +266,8 @@ void recordingWorker()
|
||||
{
|
||||
germanairlinesva_util::setThreadName("GARecordingWorker");
|
||||
|
||||
PathSegment lastPath;
|
||||
germanairlinesva_recording::PathSegment lastPath;
|
||||
std::uint32_t segment = 0;
|
||||
|
||||
while (!wantsExit) {
|
||||
germanairlinesva_websocket::data copy;
|
||||
@@ -276,23 +277,29 @@ void recordingWorker()
|
||||
memcpy(©, &toSend, sizeof(germanairlinesva_websocket::data));
|
||||
}
|
||||
|
||||
PathSegment currentPath(static_cast<std::uint16_t>(copy.alt),
|
||||
static_cast<std::uint16_t>(copy.gs),
|
||||
copy.lat,
|
||||
copy.lon);
|
||||
germanairlinesva_recording::PathSegment currentPath(
|
||||
segment,
|
||||
static_cast<std::uint16_t>(copy.alt),
|
||||
static_cast<std::uint16_t>(copy.gs),
|
||||
{copy.lat, copy.lon});
|
||||
|
||||
if (strcmp(copy.path, "") != 0 && copy.pause && lastPath != currentPath) {
|
||||
p.addSegment(currentPath);
|
||||
lastPath = currentPath;
|
||||
}
|
||||
|
||||
segment++;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
}
|
||||
}
|
||||
|
||||
void toLog(const std::string &message)
|
||||
{
|
||||
std::time_t utc = std::time(nullptr);
|
||||
std::tm *time = std::gmtime(&utc);
|
||||
std::stringstream msg;
|
||||
msg << "German Airlines VA: " << message << std::endl;
|
||||
msg << std::put_time(time, "%Y-%m-%d %H:%M:%S UTC ")
|
||||
<< "German Airlines VA: " << message << std::endl;
|
||||
XPLMDebugString(msg.str().c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user