Namespacing and Lib for files
This commit is contained in:
1 parent
2510f4968c
commit
3559b124a7
20 files changed
+262
-119
No files matched your search
+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