This commit is contained in:
2022-09-11 21:20:13 +02:00
8 changed files with 58 additions and 84 deletions
+9 -49
View File
@@ -146,61 +146,17 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc)
ap2.first.size() == 0 ? toLog(" SUCCESS") : toLog(" ERROR");
}
// Thread for sending data to websocket
serverThread = std::thread(&serverWorker);
recordingThread = std::thread(&recordingWorker);
toLog("Workers started");
toLog("Logbook Test");
germanairlinesva::file::logbook::Logbook logbook;
logbook.addEntry("08.09.2022",
"1000",
"L049",
"D-ALFA",
"John F. Kennedy International Aiport / EDDF",
"A1",
"14L",
"Gander International Airport / CYQX",
"10",
"03",
"10:00",
"10:20",
"13:20",
"13:30",
210.5,
20.1,
5012.4156,
8.87,
5041.3856,
7.1,
971.14,
2.41,
980.65,
-165.23,
1,
1.2012,
"2022-09-08_VGA1000",
5.5,
1);
logbook.toFile();
return 1;
}
PLUGIN_API void XPluginStop(void)
{
/* Flight Loop */
XPLMUnregisterFlightLoopCallback(flightLoop, nullptr);
/* End threads */
wantsExit = true;
serverThread.join();
recordingThread.join();
delete connector.release();
delete database.release();
delete configuration.release();
delete connector.release();
delete database.release();
delete configuration.release();
p.toFile("flight.rec");
toLog("Plugin stopped");
}
PLUGIN_API void XPluginDisable(void) {}
@@ -273,6 +229,8 @@ void serverWorker()
std::this_thread::sleep_for(std::chrono::milliseconds(250));
}
toLog("Server thread stopped");
}
void recordingWorker()
@@ -305,6 +263,8 @@ void recordingWorker()
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}
toLog("Recording thread stopped");
}
void toLog(const std::string &message)