mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
SCRIPT: wpiformat
This commit is contained in:
committed by
Peter Johnson
parent
ae6bdc9d25
commit
2109161534
@@ -145,14 +145,15 @@ void Application(std::string_view saveDir) {
|
||||
|
||||
wpi::glass::SetStorageName("datalogtool");
|
||||
wpi::glass::SetStorageDir(saveDir.empty() ? gui::GetPlatformSaveFileDir()
|
||||
: saveDir);
|
||||
: saveDir);
|
||||
|
||||
gui::AddWindowScaler([](float scale) { gDefaultScale = scale; });
|
||||
gui::AddLateExecute(DisplayGui);
|
||||
gui::Initialize("Datalog Tool", 925, 510);
|
||||
|
||||
gDownloadVisible =
|
||||
&wpi::glass::GetStorageRoot().GetChild("download").GetBool("visible", true);
|
||||
gDownloadVisible = &wpi::glass::GetStorageRoot()
|
||||
.GetChild("download")
|
||||
.GetBool("visible", true);
|
||||
|
||||
gui::Main();
|
||||
|
||||
|
||||
@@ -286,7 +286,8 @@ void Downloader::ThreadMain() {
|
||||
try {
|
||||
switch (m_state) {
|
||||
case kConnecting:
|
||||
if (auto team = wpi::util::parse_integer<unsigned int>(m_serverTeam, 10)) {
|
||||
if (auto team =
|
||||
wpi::util::parse_integer<unsigned int>(m_serverTeam, 10)) {
|
||||
// team number
|
||||
session = std::make_unique<sftp::Session>(
|
||||
fmt::format("roborio-{}-frc.local", team.value()), 22,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace wpi::glass {
|
||||
class Storage;
|
||||
} // namespace glass
|
||||
} // namespace wpi::glass
|
||||
|
||||
namespace pfd {
|
||||
class select_folder;
|
||||
|
||||
@@ -103,7 +103,7 @@ static void RebuildEntryTree() {
|
||||
parts.emplace_back(prefix);
|
||||
}
|
||||
wpi::util::split(mainpart, '/', -1, false,
|
||||
[&](auto part) { parts.emplace_back(part); });
|
||||
[&](auto part) { parts.emplace_back(part); });
|
||||
|
||||
// ignore a raw "/" key
|
||||
if (parts.empty()) {
|
||||
@@ -112,7 +112,8 @@ static void RebuildEntryTree() {
|
||||
|
||||
// get to leaf
|
||||
auto nodes = &gEntryTree;
|
||||
for (auto part : wpi::util::drop_back(std::span{parts.begin(), parts.end()})) {
|
||||
for (auto part :
|
||||
wpi::util::drop_back(std::span{parts.begin(), parts.end()})) {
|
||||
auto it =
|
||||
std::find_if(nodes->begin(), nodes->end(),
|
||||
[&](const auto& node) { return node.name == part; });
|
||||
@@ -439,7 +440,8 @@ void DisplayEntries() {
|
||||
static wpi::util::mutex gExportMutex;
|
||||
static std::vector<std::string> gExportErrors;
|
||||
|
||||
static void PrintEscapedCsvString(wpi::util::raw_ostream& os, std::string_view str) {
|
||||
static void PrintEscapedCsvString(wpi::util::raw_ostream& os,
|
||||
std::string_view str) {
|
||||
auto s = str;
|
||||
while (!s.empty()) {
|
||||
std::string_view fragment;
|
||||
@@ -461,8 +463,8 @@ static void ValueToCsv(wpi::util::raw_ostream& os, const Entry& entry,
|
||||
int64_t val;
|
||||
if (record.GetInteger(&val)) {
|
||||
std::time_t timeval = val / 1000000;
|
||||
wpi::util::print(os, "{:%Y-%m-%d %H:%M:%S}.{:06}", *std::localtime(&timeval),
|
||||
val % 1000000);
|
||||
wpi::util::print(os, "{:%Y-%m-%d %H:%M:%S}.{:06}",
|
||||
*std::localtime(&timeval), val % 1000000);
|
||||
return;
|
||||
}
|
||||
} else if (entry.type == "double") {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace wpi::glass {
|
||||
class Storage;
|
||||
} // namespace glass
|
||||
} // namespace wpi::glass
|
||||
|
||||
void DisplayInputFiles();
|
||||
void DisplayEntries();
|
||||
|
||||
Reference in New Issue
Block a user