mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpilibc] DriverStation: Remove ReportError and ReportWarning
Change use cases to directly call FRC_ReportError.
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <hal/DriverStationTypes.h>
|
||||
#include <wpi/Twine.h>
|
||||
#include <wpi/condition_variable.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
@@ -40,28 +40,6 @@ class DriverStation {
|
||||
*/
|
||||
static DriverStation& GetInstance();
|
||||
|
||||
/**
|
||||
* Report an error to the DriverStation messages window.
|
||||
*
|
||||
* The error is also printed to the program console.
|
||||
*/
|
||||
static void ReportError(const wpi::Twine& error);
|
||||
|
||||
/**
|
||||
* Report a warning to the DriverStation messages window.
|
||||
*
|
||||
* The warning is also printed to the program console.
|
||||
*/
|
||||
static void ReportWarning(const wpi::Twine& error);
|
||||
|
||||
/**
|
||||
* Report an error to the DriverStation messages window.
|
||||
*
|
||||
* The error is also printed to the program console.
|
||||
*/
|
||||
static void ReportError(bool isError, int code, const wpi::Twine& error,
|
||||
const wpi::Twine& location, const wpi::Twine& stack);
|
||||
|
||||
static constexpr int kJoystickPorts = 6;
|
||||
|
||||
/**
|
||||
@@ -465,14 +443,28 @@ class DriverStation {
|
||||
*
|
||||
* Throttles the errors so that they don't overwhelm the DS.
|
||||
*/
|
||||
void ReportJoystickUnpluggedError(const wpi::Twine& message);
|
||||
void ReportJoystickUnpluggedErrorV(fmt::string_view format,
|
||||
fmt::format_args args);
|
||||
|
||||
template <typename S, typename... Args>
|
||||
inline void ReportJoystickUnpluggedError(const S& format, Args&&... args) {
|
||||
ReportJoystickUnpluggedErrorV(
|
||||
format, fmt::make_args_checked<Args...>(format, args...));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports errors related to unplugged joysticks.
|
||||
*
|
||||
* Throttles the errors so that they don't overwhelm the DS.
|
||||
*/
|
||||
void ReportJoystickUnpluggedWarning(const wpi::Twine& message);
|
||||
void ReportJoystickUnpluggedWarningV(fmt::string_view format,
|
||||
fmt::format_args args);
|
||||
|
||||
template <typename S, typename... Args>
|
||||
inline void ReportJoystickUnpluggedWarning(const S& format, Args&&... args) {
|
||||
ReportJoystickUnpluggedWarningV(
|
||||
format, fmt::make_args_checked<Args...>(format, args...));
|
||||
}
|
||||
|
||||
void Run();
|
||||
|
||||
|
||||
@@ -59,3 +59,4 @@ S(UnsupportedInSimulation, -80, "Unsupported in simulation")
|
||||
S(CameraServerError, -90, "CameraServer error")
|
||||
S(InvalidParameter, -100, "Invalid parameter value")
|
||||
S(AssertionFailure, -110, "Assertion failed")
|
||||
S(Error, -111, "Error")
|
||||
|
||||
@@ -21,3 +21,4 @@ S(SPIReadNoMISO, 13, "Cannot read from SPI port with no MISO input")
|
||||
S(SPIReadNoData, 14, "No data available to read from SPI")
|
||||
S(IncompatibleState, 15,
|
||||
"Incompatible State: The operation cannot be completed")
|
||||
S(Warning, 16, "Warning")
|
||||
|
||||
Reference in New Issue
Block a user