[wpilib] Report LiveWindow-enabled-in-test (#6158)

This commit is contained in:
Starlight220
2024-01-05 21:57:14 +02:00
committed by GitHub
parent 707cb06105
commit 4595f84719
5 changed files with 19 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
#include <fmt/format.h>
#include <hal/DriverStation.h>
#include <hal/FRCUsageReporting.h>
#include <networktables/NetworkTableInstance.h>
#include "frc/DSControlWord.h"
@@ -97,10 +98,16 @@ void IterativeRobotBase::SetNetworkTablesFlushEnabled(bool enabled) {
}
void IterativeRobotBase::EnableLiveWindowInTest(bool testLW) {
static bool hasReported;
if (IsTestEnabled()) {
throw FRC_MakeError(err::IncompatibleMode,
"Can't configure test mode while in test mode!");
}
if (!hasReported && testLW) {
HAL_Report(HALUsageReporting::kResourceType_SmartDashboard,
HALUsageReporting::kSmartDashboard_LiveWindow);
hasReported = true;
}
m_lwEnabledInTest = testLW;
}