mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[wpilib] Correct SmartDashboard usage reporting (#6157)
This commit is contained in:
@@ -72,7 +72,8 @@ bool SmartDashboard::IsPersistent(std::string_view key) {
|
||||
|
||||
nt::NetworkTableEntry SmartDashboard::GetEntry(std::string_view key) {
|
||||
if (!gReported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_SmartDashboard, 0);
|
||||
HAL_Report(HALUsageReporting::kResourceType_SmartDashboard,
|
||||
HALUsageReporting::kSmartDashboard_Instance);
|
||||
gReported = true;
|
||||
}
|
||||
return GetInstance().table->GetEntry(key);
|
||||
@@ -83,7 +84,8 @@ void SmartDashboard::PutData(std::string_view key, wpi::Sendable* data) {
|
||||
throw FRC_MakeError(err::NullParameter, "value");
|
||||
}
|
||||
if (!gReported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_SmartDashboard, 0);
|
||||
HAL_Report(HALUsageReporting::kResourceType_SmartDashboard,
|
||||
HALUsageReporting::kSmartDashboard_Instance);
|
||||
gReported = true;
|
||||
}
|
||||
auto& inst = GetInstance();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.smartdashboard;
|
||||
|
||||
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.NetworkTable;
|
||||
@@ -66,7 +67,7 @@ public final class SmartDashboard {
|
||||
@SuppressWarnings("PMD.CompareObjectsWithEquals")
|
||||
public static synchronized void putData(String key, Sendable data) {
|
||||
if (!m_reported) {
|
||||
HAL.report(tResourceType.kResourceType_SmartDashboard, 0);
|
||||
HAL.report(tResourceType.kResourceType_SmartDashboard, tInstances.kSmartDashboard_Instance);
|
||||
m_reported = true;
|
||||
}
|
||||
Sendable sddata = tablesToData.get(key);
|
||||
@@ -120,7 +121,7 @@ public final class SmartDashboard {
|
||||
*/
|
||||
public static NetworkTableEntry getEntry(String key) {
|
||||
if (!m_reported) {
|
||||
HAL.report(tResourceType.kResourceType_SmartDashboard, 0);
|
||||
HAL.report(tResourceType.kResourceType_SmartDashboard, tInstances.kSmartDashboard_Instance);
|
||||
m_reported = true;
|
||||
}
|
||||
return table.getEntry(key);
|
||||
|
||||
Reference in New Issue
Block a user