Future proofed file read/write
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#ifndef GERMANAIRLINESVA_GACONNECTOR_XPLUGIN_MAIN_H
|
||||
#define GERMANAIRLINESVA_GACONNECTOR_XPLUGIN_MAIN_H
|
||||
|
||||
#include "config.hpp"
|
||||
#include "config/config.hpp"
|
||||
#include "constants.h"
|
||||
#include "logbook.h"
|
||||
#include "pathRecording.h"
|
||||
#include "logbook/logbook.h"
|
||||
#include "recording/recording.h"
|
||||
#include "simdata.h"
|
||||
#include "simulatorDatabase.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
+9
-8
@@ -47,7 +47,7 @@ XPLMDataRef roll;
|
||||
XPLMDataRef quaternion;
|
||||
|
||||
struct germanairlinesva_websocket::data toSend;
|
||||
germanairlinesva_recording::PathRecording p;
|
||||
germanairlinesva::file::recording::Recording p;
|
||||
|
||||
/*
|
||||
* Callbacks
|
||||
@@ -114,8 +114,8 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc)
|
||||
roll = XPLMFindDataRef("sim/flightmodel/position/phi"); // FLOAT
|
||||
quaternion = XPLMFindDataRef("sim/flightmodel/position/q"); // FLOAT[4]
|
||||
|
||||
configuration =
|
||||
germanairlinesva_config::readConfig(XPLANE_PLUGIN_DIRECTORY CONFIG);
|
||||
configuration = germanairlinesva::file::config::readConfig(
|
||||
XPLANE_PLUGIN_DIRECTORY CONFIG);
|
||||
toLog("Config loaded");
|
||||
|
||||
try {
|
||||
@@ -145,8 +145,9 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc)
|
||||
XPLANE_PLUGIN_DIRECTORY SIMDATABASE);
|
||||
|
||||
configuration["scenery"] = hash;
|
||||
germanairlinesva_config::writeConfig(configuration,
|
||||
XPLANE_PLUGIN_DIRECTORY CONFIG);
|
||||
germanairlinesva::file::config::writeConfig(
|
||||
configuration,
|
||||
XPLANE_PLUGIN_DIRECTORY CONFIG);
|
||||
toLog("Sim Database updated");
|
||||
} else {
|
||||
airports = germanairlinesva_simdata::fromFile(
|
||||
@@ -170,7 +171,7 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc)
|
||||
toLog("Workers started");
|
||||
|
||||
toLog("Logbook Test");
|
||||
germanairlinesva_logbook::Logbook logbook;
|
||||
germanairlinesva::file::logbook::Logbook logbook;
|
||||
logbook.addEntry("08.09.2022",
|
||||
"1000",
|
||||
"L049",
|
||||
@@ -298,7 +299,7 @@ void recordingWorker()
|
||||
{
|
||||
germanairlinesva_util::setThreadName("GARecordingWorker");
|
||||
|
||||
germanairlinesva_recording::PathSegment lastPath;
|
||||
germanairlinesva::file::recording::RecordingEntry lastPath;
|
||||
std::uint32_t segment = 0;
|
||||
|
||||
while (!wantsExit) {
|
||||
@@ -309,7 +310,7 @@ void recordingWorker()
|
||||
std::memcpy(©, &toSend, sizeof(germanairlinesva_websocket::data));
|
||||
}
|
||||
|
||||
germanairlinesva_recording::PathSegment currentPath(
|
||||
germanairlinesva::file::recording::RecordingEntry currentPath(
|
||||
segment,
|
||||
static_cast<std::uint16_t>(copy.alt),
|
||||
static_cast<std::uint16_t>(copy.gs),
|
||||
|
||||
Reference in New Issue
Block a user