mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpimath] Remove unit suffixes from variable names (#7529)
* Move units into API docs instead because suffixes make user code verbose and hard to read * Rename trackWidth to trackwidth * Make ultrasonic classes use meters instead of a mix of m, cm, mm, ft, and inches
This commit is contained in:
@@ -2085,9 +2085,9 @@ Java_edu_wpi_first_cscore_CameraServerJNI_runMainRunLoop
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_cscore_CameraServerJNI_runMainRunLoopTimeout
|
||||
(JNIEnv*, jclass, jdouble timeoutSeconds)
|
||||
(JNIEnv*, jclass, jdouble timeout)
|
||||
{
|
||||
return cs::RunMainRunLoopTimeout(timeoutSeconds);
|
||||
return cs::RunMainRunLoopTimeout(timeout);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -5,7 +5,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace cs {
|
||||
|
||||
void RunMainRunLoop();
|
||||
int RunMainRunLoopTimeout(double timeoutSeconds);
|
||||
|
||||
/**
|
||||
* Runs main run loop with timeout.
|
||||
*
|
||||
* @param timeout Timeout in seconds.
|
||||
*/
|
||||
int RunMainRunLoopTimeout(double timeout);
|
||||
|
||||
void StopMainRunLoop();
|
||||
|
||||
} // namespace cs
|
||||
|
||||
@@ -12,16 +12,16 @@ static wpi::Event& GetInstance() {
|
||||
}
|
||||
|
||||
namespace cs {
|
||||
|
||||
void RunMainRunLoop() {
|
||||
wpi::Event& event = GetInstance();
|
||||
wpi::WaitForObject(event.GetHandle());
|
||||
}
|
||||
|
||||
int RunMainRunLoopTimeout(double timeoutSeconds) {
|
||||
int RunMainRunLoopTimeout(double timeout) {
|
||||
wpi::Event& event = GetInstance();
|
||||
bool timedOut = false;
|
||||
bool signaled =
|
||||
wpi::WaitForObject(event.GetHandle(), timeoutSeconds, &timedOut);
|
||||
bool signaled = wpi::WaitForObject(event.GetHandle(), timeout, &timedOut);
|
||||
if (timedOut) {
|
||||
return 3;
|
||||
}
|
||||
@@ -35,4 +35,5 @@ void StopMainRunLoop() {
|
||||
wpi::Event& event = GetInstance();
|
||||
event.Set();
|
||||
}
|
||||
|
||||
} // namespace cs
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
namespace cs {
|
||||
|
||||
void RunMainRunLoop() {
|
||||
if (CFRunLoopGetMain() != CFRunLoopGetCurrent()) {
|
||||
NSLog(@"This method can only be called from the main thread");
|
||||
@@ -16,15 +17,16 @@ void RunMainRunLoop() {
|
||||
CFRunLoopRun();
|
||||
}
|
||||
|
||||
int RunMainRunLoopTimeout(double timeoutSeconds) {
|
||||
int RunMainRunLoopTimeout(double timeout) {
|
||||
if (CFRunLoopGetMain() != CFRunLoopGetCurrent()) {
|
||||
NSLog(@"This method can only be called from the main thread");
|
||||
return -1;
|
||||
}
|
||||
return CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeoutSeconds, false);
|
||||
return CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeout, false);
|
||||
}
|
||||
|
||||
void StopMainRunLoop() {
|
||||
CFRunLoopStop(CFRunLoopGetMain());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,16 +12,16 @@ static wpi::Event& GetInstance() {
|
||||
}
|
||||
|
||||
namespace cs {
|
||||
|
||||
void RunMainRunLoop() {
|
||||
wpi::Event& event = GetInstance();
|
||||
wpi::WaitForObject(event.GetHandle());
|
||||
}
|
||||
|
||||
int RunMainRunLoopTimeout(double timeoutSeconds) {
|
||||
int RunMainRunLoopTimeout(double timeout) {
|
||||
wpi::Event& event = GetInstance();
|
||||
bool timedOut = false;
|
||||
bool signaled =
|
||||
wpi::WaitForObject(event.GetHandle(), timeoutSeconds, &timedOut);
|
||||
bool signaled = wpi::WaitForObject(event.GetHandle(), timeout, &timedOut);
|
||||
if (timedOut) {
|
||||
return 3;
|
||||
}
|
||||
@@ -35,4 +35,5 @@ void StopMainRunLoop() {
|
||||
wpi::Event& event = GetInstance();
|
||||
event.Set();
|
||||
}
|
||||
|
||||
} // namespace cs
|
||||
|
||||
Reference in New Issue
Block a user