mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Report LiveWindow-enabled-in-test (#6158)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user