mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Add usage reporting for the Shuffleboard API (#1685)
This commit is contained in:
committed by
Peter Johnson
parent
e25e515f2e
commit
4a00cd77bb
@@ -57,8 +57,6 @@ public final class Shuffleboard {
|
||||
private static final RecordingController recordingController =
|
||||
new RecordingController(NetworkTableInstance.getDefault());
|
||||
|
||||
// TODO usage reporting
|
||||
|
||||
private Shuffleboard() {
|
||||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import edu.wpi.first.hal.FRCNetComm.tResourceType;
|
||||
import edu.wpi.first.hal.HAL;
|
||||
import edu.wpi.first.networktables.NetworkTable;
|
||||
import edu.wpi.first.networktables.NetworkTableEntry;
|
||||
import edu.wpi.first.networktables.NetworkTableInstance;
|
||||
@@ -24,11 +26,17 @@ final class ShuffleboardInstance implements ShuffleboardRoot {
|
||||
private final NetworkTable m_rootMetaTable;
|
||||
private final NetworkTableEntry m_selectedTabEntry;
|
||||
|
||||
/**
|
||||
* Creates a new Shuffleboard instance.
|
||||
*
|
||||
* @param ntInstance the NetworkTables instance to use
|
||||
*/
|
||||
ShuffleboardInstance(NetworkTableInstance ntInstance) {
|
||||
Objects.requireNonNull(ntInstance, "NetworkTable instance cannot be null");
|
||||
m_rootTable = ntInstance.getTable(Shuffleboard.kBaseTableName);
|
||||
m_rootMetaTable = m_rootTable.getSubTable(".metadata");
|
||||
m_selectedTabEntry = m_rootMetaTable.getEntry("Selected");
|
||||
HAL.report(tResourceType.kResourceType_Shuffleboard, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user