[datalog] Move all DataLog functionality to new datalog library (#7641)

Currently the major DataLog backend API (reading and writing) is split between wpiutil and glass. In the interest of allowing code that wants to use these APIs to not need to link to glass and declutter wpiutil, all of those APIs are moved to a new library named "datalog".

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
This commit is contained in:
DeltaDizzy
2025-02-19 23:08:17 -06:00
committed by GitHub
parent ac1705ae2b
commit da47f06d70
99 changed files with 778 additions and 330 deletions

View File

@@ -20,7 +20,6 @@
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <glass/Storage.h>
#include <glass/support/DataLogReaderThread.h>
#include <imgui.h>
#include <imgui_internal.h>
#include <imgui_stdlib.h>
@@ -30,6 +29,7 @@
#include <wpi/SmallVector.h>
#include <wpi/SpanExtras.h>
#include <wpi/StringExtras.h>
#include <wpi/datalog/DataLogReaderThread.h>
#include <wpi/fmt/raw_ostream.h>
#include <wpi/fs.h>
#include <wpi/mutex.h>
@@ -40,7 +40,7 @@
namespace {
struct InputFile {
explicit InputFile(std::unique_ptr<glass::DataLogReaderThread> datalog);
explicit InputFile(std::unique_ptr<wpi::log::DataLogReaderThread> datalog);
InputFile(std::string_view filename, std::string_view status)
: filename{filename},
@@ -51,7 +51,7 @@ struct InputFile {
std::string filename;
std::string stem;
std::unique_ptr<glass::DataLogReaderThread> datalog;
std::unique_ptr<wpi::log::DataLogReaderThread> datalog;
std::string status;
bool highlight = false;
};
@@ -140,7 +140,7 @@ static void RebuildEntryTree() {
}
}
InputFile::InputFile(std::unique_ptr<glass::DataLogReaderThread> datalog_)
InputFile::InputFile(std::unique_ptr<wpi::log::DataLogReaderThread> datalog_)
: filename{datalog_->GetBufferIdentifier()},
stem{fs::path{filename}.stem().string()},
datalog{std::move(datalog_)} {
@@ -196,7 +196,7 @@ static std::unique_ptr<InputFile> LoadDataLog(std::string_view filename) {
}
return std::make_unique<InputFile>(
std::make_unique<glass::DataLogReaderThread>(std::move(reader)));
std::make_unique<wpi::log::DataLogReaderThread>(std::move(reader)));
}
void DisplayInputFiles() {