mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilib] Fix usage reporting for static classes (#6090)
This commit is contained in:
@@ -30,12 +30,17 @@ ShuffleboardInstance::ShuffleboardInstance(nt::NetworkTableInstance ntInstance)
|
||||
m_impl->selectedTabPub =
|
||||
m_impl->rootMetaTable->GetStringTopic("Selected")
|
||||
.Publish(nt::PubSubOptions{.keepDuplicates = true});
|
||||
HAL_Report(HALUsageReporting::kResourceType_Shuffleboard, 0);
|
||||
}
|
||||
|
||||
ShuffleboardInstance::~ShuffleboardInstance() = default;
|
||||
|
||||
static bool gReported = false;
|
||||
|
||||
frc::ShuffleboardTab& ShuffleboardInstance::GetTab(std::string_view title) {
|
||||
if (!gReported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_Shuffleboard, 0);
|
||||
gReported = true;
|
||||
}
|
||||
if (m_impl->tabs.find(title) == m_impl->tabs.end()) {
|
||||
m_impl->tabs.try_emplace(title,
|
||||
std::make_unique<ShuffleboardTab>(*this, title));
|
||||
|
||||
Reference in New Issue
Block a user