mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
[wpilib] DataLogManager: Warn user if logging to RoboRIO 1 internal storage (#5617)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "frc/DriverStation.h"
|
||||
#include "frc/Filesystem.h"
|
||||
#include "frc/RobotBase.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -69,6 +70,11 @@ static std::string MakeLogDir(std::string_view dir) {
|
||||
(s.permissions() & fs::perms::others_write) != fs::perms::none) {
|
||||
return std::string{usbDir};
|
||||
}
|
||||
if (frc::RobotBase::GetRuntimeType() == kRoboRIO) {
|
||||
FRC_ReportError(warn::Warning,
|
||||
"DataLogManager: Logging to RoboRIO 1 internal storage is "
|
||||
"not recommended! Plug in a FAT32 formatted flash drive!");
|
||||
}
|
||||
#endif
|
||||
return frc::filesystem::GetOperatingDirectory();
|
||||
}
|
||||
|
||||
@@ -204,8 +204,13 @@ public final class DataLogManager {
|
||||
} catch (IOException ex) {
|
||||
// ignored
|
||||
}
|
||||
if (RobotBase.getRuntimeType() == RuntimeType.kRoboRIO) {
|
||||
DriverStation.reportWarning(
|
||||
"DataLogManager: Logging to RoboRIO 1 internal storage is not recommended!"
|
||||
+ " Plug in a FAT32 formatted flash drive!",
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
return Filesystem.getOperatingDirectory().getAbsolutePath();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user