[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

@@ -5,6 +5,8 @@
package edu.wpi.first.wpilibj;
import edu.wpi.first.hal.DriverStationJNI;
import edu.wpi.first.hal.FRCNetComm.tInstances;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
@@ -257,6 +259,8 @@ public abstract class IterativeRobotBase extends RobotBase {
m_ntFlushEnabled = enabled;
}
private boolean m_reportedLw;
/**
* Sets whether LiveWindow operation is enabled during test mode. Calling
*
@@ -267,6 +271,10 @@ public abstract class IterativeRobotBase extends RobotBase {
if (isTestEnabled()) {
throw new ConcurrentModificationException("Can't configure test mode while in test mode!");
}
if (!m_reportedLw && testLW) {
HAL.report(tResourceType.kResourceType_SmartDashboard, tInstances.kSmartDashboard_LiveWindow);
m_reportedLw = true;
}
m_lwEnabledInTest = testLW;
}