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