mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Update UsageReporting enums and their uses for 2019 (#1218)
This commit is contained in:
committed by
Peter Johnson
parent
8aac46542d
commit
d54c2665dc
@@ -21,7 +21,7 @@ CAN::CAN(int deviceId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// HAL_Report(HALUsageReporting::kResourceType_CAN, deviceId);
|
||||
HAL_Report(HALUsageReporting::kResourceType_CAN, deviceId);
|
||||
}
|
||||
|
||||
CAN::~CAN() {
|
||||
|
||||
@@ -31,6 +31,6 @@ DMC60::DMC60(int channel) : PWMSpeedController(channel) {
|
||||
SetSpeed(0.0);
|
||||
SetZeroLatch();
|
||||
|
||||
// HAL_Report(HALUsageReporting::kResourceType_VictorSP, GetChannel());
|
||||
HAL_Report(HALUsageReporting::kResourceType_DigilentDMC60, GetChannel());
|
||||
SetName("DMC60", GetChannel());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ DigitalGlitchFilter::DigitalGlitchFilter() {
|
||||
m_channelIndex = std::distance(m_filterAllocated.begin(), index);
|
||||
*index = true;
|
||||
|
||||
HAL_Report(HALUsageReporting::kResourceType_DigitalFilter, m_channelIndex);
|
||||
HAL_Report(HALUsageReporting::kResourceType_DigitalGlitchFilter,
|
||||
m_channelIndex);
|
||||
SetName("DigitalGlitchFilter", m_channelIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,6 @@ PWMVictorSPX::PWMVictorSPX(int channel) : PWMSpeedController(channel) {
|
||||
SetSpeed(0.0);
|
||||
SetZeroLatch();
|
||||
|
||||
// HAL_Report(HALUsageReporting::kResourceType_PWMVictorSPX, GetChannel());
|
||||
HAL_Report(HALUsageReporting::kResourceType_PWMVictorSPX, GetChannel());
|
||||
SetName("PWMVictorSPX", GetChannel());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace {
|
||||
class WPILibCameraServerShared : public frc::CameraServerShared {
|
||||
public:
|
||||
void ReportUsbCamera(int id) override {
|
||||
HAL_Report(HALUsageReporting::kResourceType_PCVideoServer, id);
|
||||
HAL_Report(HALUsageReporting::kResourceType_UsbCamera, id);
|
||||
}
|
||||
void ReportAxisCamera(int id) override {
|
||||
HAL_Report(HALUsageReporting::kResourceType_AxisCamera, id);
|
||||
|
||||
@@ -48,10 +48,8 @@ TimedRobot::TimedRobot(double period) : IterativeRobotBase(period) {
|
||||
m_notifier = HAL_InitializeNotifier(&status);
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
|
||||
// HAL_Report(HALUsageReporting::kResourceType_Framework,
|
||||
// HALUsageReporting::kFramework_Periodic);
|
||||
HAL_Report(HALUsageReporting::kResourceType_Framework,
|
||||
HALUsageReporting::kFramework_Iterative);
|
||||
HALUsageReporting::kFramework_Timed);
|
||||
}
|
||||
|
||||
TimedRobot::~TimedRobot() {
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
using namespace frc;
|
||||
|
||||
XboxController::XboxController(int port) : GenericHID(port) {
|
||||
// HAL_Report(HALUsageReporting::kResourceType_XboxController, port);
|
||||
HAL_Report(HALUsageReporting::kResourceType_Joystick, port);
|
||||
HAL_Report(HALUsageReporting::kResourceType_XboxController, port);
|
||||
}
|
||||
|
||||
double XboxController::GetX(JoystickHand hand) const {
|
||||
|
||||
@@ -32,7 +32,7 @@ void DifferentialDrive::ArcadeDrive(double xSpeed, double zRotation,
|
||||
static bool reported = false;
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 2,
|
||||
HALUsageReporting::kRobotDrive_ArcadeStandard);
|
||||
HALUsageReporting::kRobotDrive2_DifferentialArcade);
|
||||
reported = true;
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ void DifferentialDrive::CurvatureDrive(double xSpeed, double zRotation,
|
||||
bool isQuickTurn) {
|
||||
static bool reported = false;
|
||||
if (!reported) {
|
||||
// HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 2,
|
||||
// HALUsageReporting::kRobotDrive_Curvature);
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 2,
|
||||
HALUsageReporting::kRobotDrive2_DifferentialCurvature);
|
||||
reported = true;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ void DifferentialDrive::TankDrive(double leftSpeed, double rightSpeed,
|
||||
static bool reported = false;
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 2,
|
||||
HALUsageReporting::kRobotDrive_Tank);
|
||||
HALUsageReporting::kRobotDrive2_DifferentialTank);
|
||||
reported = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ KilloughDrive::KilloughDrive(SpeedController& leftMotor,
|
||||
void KilloughDrive::DriveCartesian(double ySpeed, double xSpeed,
|
||||
double zRotation, double gyroAngle) {
|
||||
if (!reported) {
|
||||
// HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 3,
|
||||
// HALUsageReporting::kRobotDrive_KilloughCartesian);
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 3,
|
||||
HALUsageReporting::kRobotDrive2_KilloughCartesian);
|
||||
reported = true;
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ void KilloughDrive::DriveCartesian(double ySpeed, double xSpeed,
|
||||
void KilloughDrive::DrivePolar(double magnitude, double angle,
|
||||
double zRotation) {
|
||||
if (!reported) {
|
||||
// HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 3,
|
||||
// HALUsageReporting::kRobotDrive_KilloughPolar);
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 3,
|
||||
HALUsageReporting::kRobotDrive2_KilloughPolar);
|
||||
reported = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void MecanumDrive::DriveCartesian(double ySpeed, double xSpeed,
|
||||
double zRotation, double gyroAngle) {
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 4,
|
||||
HALUsageReporting::kRobotDrive_MecanumCartesian);
|
||||
HALUsageReporting::kRobotDrive2_MecanumCartesian);
|
||||
reported = true;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void MecanumDrive::DrivePolar(double magnitude, double angle,
|
||||
double zRotation) {
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 4,
|
||||
HALUsageReporting::kRobotDrive_MecanumPolar);
|
||||
HALUsageReporting::kRobotDrive2_MecanumPolar);
|
||||
reported = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include <hal/HAL.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
LinearDigitalFilter::LinearDigitalFilter(PIDSource& source,
|
||||
@@ -19,7 +21,11 @@ LinearDigitalFilter::LinearDigitalFilter(PIDSource& source,
|
||||
m_inputs(ffGains.size()),
|
||||
m_outputs(fbGains.size()),
|
||||
m_inputGains(ffGains),
|
||||
m_outputGains(fbGains) {}
|
||||
m_outputGains(fbGains) {
|
||||
static int instances = 0;
|
||||
instances++;
|
||||
HAL_Report(HALUsageReporting::kResourceType_LinearFilter, instances);
|
||||
}
|
||||
|
||||
LinearDigitalFilter::LinearDigitalFilter(std::shared_ptr<PIDSource> source,
|
||||
wpi::ArrayRef<double> ffGains,
|
||||
@@ -28,7 +34,11 @@ LinearDigitalFilter::LinearDigitalFilter(std::shared_ptr<PIDSource> source,
|
||||
m_inputs(ffGains.size()),
|
||||
m_outputs(fbGains.size()),
|
||||
m_inputGains(ffGains),
|
||||
m_outputGains(fbGains) {}
|
||||
m_outputGains(fbGains) {
|
||||
static int instances = 0;
|
||||
instances++;
|
||||
HAL_Report(HALUsageReporting::kResourceType_LinearFilter, instances);
|
||||
}
|
||||
|
||||
LinearDigitalFilter LinearDigitalFilter::SinglePoleIIR(PIDSource& source,
|
||||
double timeConstant,
|
||||
|
||||
Reference in New Issue
Block a user