mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
SCRIPT: FRC_ replacements
This commit is contained in:
committed by
Peter Johnson
parent
824f36f63a
commit
928ff20695
@@ -38,7 +38,7 @@ void RunRobot(wpi::util::mutex& m, Robot** robot) {
|
||||
theRobot.StartCompetition();
|
||||
} catch (const wpi::RuntimeError& e) {
|
||||
e.Report();
|
||||
FRC_ReportError(
|
||||
WPILIB_ReportError(
|
||||
err::Error,
|
||||
"The robot program quit unexpectedly."
|
||||
" This is usually due to a code error.\n"
|
||||
|
||||
@@ -67,7 +67,7 @@ class MechanismObject2d {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
auto& obj = m_objects[name];
|
||||
if (obj) {
|
||||
throw FRC_MakeError(
|
||||
throw WPILIB_MakeError(
|
||||
err::Error,
|
||||
"MechanismObject names must be unique! `{}` was inserted twice!",
|
||||
name);
|
||||
|
||||
@@ -20,14 +20,14 @@ namespace wpi {
|
||||
* The data file will be saved to a USB flash drive in a folder named "logs" if
|
||||
* one is attached, or to /home/systemcore/logs otherwise.
|
||||
*
|
||||
* Log files are initially named "FRC_TBD_{random}.wpilog" until the DS
|
||||
* Log files are initially named "WPILIB_TBD_{random}.wpilog" until the DS
|
||||
* connects. After the DS connects, the log file is renamed to
|
||||
* "FRC_yyyyMMdd_HHmmss.wpilog" (where the date/time is UTC). If the FMS is
|
||||
* "WPILIB_yyyyMMdd_HHmmss.wpilog" (where the date/time is UTC). If the FMS is
|
||||
* connected and provides a match number, the log file is renamed to
|
||||
* "FRC_yyyyMMdd_HHmmss_{event}_{match}.wpilog".
|
||||
* "WPILIB_yyyyMMdd_HHmmss_{event}_{match}.wpilog".
|
||||
*
|
||||
* On startup, all existing FRC_TBD log files are deleted. If there is less than
|
||||
* 50 MB of free space on the target storage, FRC_ log files are deleted (oldest
|
||||
* On startup, all existing WPILIB_TBD log files are deleted. If there is less than
|
||||
* 50 MB of free space on the target storage, WPILIB_ log files are deleted (oldest
|
||||
* to newest) until there is 50 MB free OR there are 10 files remaining.
|
||||
*
|
||||
* By default, all NetworkTables value changes are stored to the data log.
|
||||
|
||||
@@ -50,7 +50,7 @@ const char* GetErrorMessage(int32_t* code);
|
||||
|
||||
/**
|
||||
* Reports an error to the driver station (using HAL_SendError).
|
||||
* Generally the FRC_ReportError wrapper macro should be used instead.
|
||||
* Generally the WPILIB_ReportError wrapper macro should be used instead.
|
||||
*
|
||||
* @param[out] status error code
|
||||
* @param[in] fileName source file name
|
||||
@@ -65,7 +65,7 @@ void ReportErrorV(int32_t status, const char* fileName, int lineNumber,
|
||||
|
||||
/**
|
||||
* Reports an error to the driver station (using HAL_SendError).
|
||||
* Generally the FRC_ReportError wrapper macro should be used instead.
|
||||
* Generally the WPILIB_ReportError wrapper macro should be used instead.
|
||||
*
|
||||
* @param[out] status error code
|
||||
* @param[in] fileName source file name
|
||||
@@ -84,7 +84,7 @@ inline void ReportError(int32_t status, const char* fileName, int lineNumber,
|
||||
|
||||
/**
|
||||
* Makes a runtime error exception object. This object should be thrown
|
||||
* by the caller. Generally the FRC_MakeError wrapper macro should be used
|
||||
* by the caller. Generally the WPILIB_MakeError wrapper macro should be used
|
||||
* instead.
|
||||
*
|
||||
* @param[out] status error code
|
||||
@@ -134,7 +134,7 @@ namespace warn {
|
||||
* @param[out] status error code
|
||||
* @param[in] format error message format
|
||||
*/
|
||||
#define FRC_ReportError(status, format, ...) \
|
||||
#define WPILIB_ReportError(status, format, ...) \
|
||||
do { \
|
||||
if ((status) != 0) { \
|
||||
::wpi::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
|
||||
@@ -147,7 +147,7 @@ namespace warn {
|
||||
*
|
||||
* @param[in] format error message format
|
||||
*/
|
||||
#define FRC_ReportWarning(format, ...) \
|
||||
#define WPILIB_ReportWarning(format, ...) \
|
||||
do { \
|
||||
::wpi::ReportError(::wpi::warn::Warning, __FILE__, __LINE__, __FUNCTION__, \
|
||||
format __VA_OPT__(, ) __VA_ARGS__); \
|
||||
@@ -161,7 +161,7 @@ namespace warn {
|
||||
* @param[in] format error message format
|
||||
* @return runtime error object
|
||||
*/
|
||||
#define FRC_MakeError(status, format, ...) \
|
||||
#define WPILIB_MakeError(status, format, ...) \
|
||||
::wpi::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
|
||||
format __VA_OPT__(, ) __VA_ARGS__)
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace warn {
|
||||
* @param[out] status error code
|
||||
* @param[in] format error message format
|
||||
*/
|
||||
#define FRC_CheckErrorStatus(status, format, ...) \
|
||||
#define WPILIB_CheckErrorStatus(status, format, ...) \
|
||||
do { \
|
||||
if ((status) < 0) { \
|
||||
throw ::wpi::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
|
||||
@@ -183,7 +183,7 @@ namespace warn {
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define FRC_AssertMessage(condition, format, ...) \
|
||||
#define WPILIB_AssertMessage(condition, format, ...) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
throw ::wpi::MakeError(::wpi::err::AssertionFailure, __FILE__, __LINE__, \
|
||||
@@ -191,4 +191,4 @@ namespace warn {
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define FRC_Assert(condition) FRC_AssertMessage(condition, #condition)
|
||||
#define WPILIB_Assert(condition) WPILIB_AssertMessage(condition, #condition)
|
||||
|
||||
Reference in New Issue
Block a user