public final class DriverStation
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
m_dataSem |
private static DriverStation |
m_instance |
private ILogger |
m_log |
private int |
m_modeInt |
private int |
m_modeNewInt |
private boolean |
m_newControlData |
private java.nio.ByteBuffer |
m_packetDataAvailableMutex |
private java.nio.ByteBuffer |
m_packetDataAvailableSem |
private java.lang.Thread |
m_thread |
private boolean |
m_thread_exit_error |
private boolean |
m_thread_keepAlive |
| Modifier | Constructor and Description |
|---|---|
private |
DriverStation() |
| Modifier and Type | Method and Description |
|---|---|
void |
exit() |
void |
exitNoError() |
static GameMode |
getGameMode()
Get the current driver station indicated mode.
|
static DriverStation |
getInstance() |
protected static void |
initialize() |
static boolean |
isAutonomous()
Determine if the robot is currently in Autonomous mode.
|
static boolean |
isBrownedOut()
Check if the system is browned out.
|
static boolean |
isDisabled()
Determine if the Robot is currently disabled.
|
static boolean |
isDSAttached()
Check if the Driver Station is attached to the robot
|
static boolean |
isEnabled()
Determine if the Robot is currently enabled.
|
static boolean |
isEStopped()
Determine if the robot is currently Emergency stopped.
|
static boolean |
isFMSAttached()
Check if the Field Management System is attached to the DS
|
protected boolean |
isNewControlData()
Has a new control packet from the driver station arrived since the last time this function was called?
|
static boolean |
isOperatorControl()
Determine if the robot is currently in Operator Control mode.
|
static boolean |
isSysActive()
Check on the overall status of the system.
|
static boolean |
isTest()
Determine if the robot is currently in Test mode.
|
protected boolean |
modeChanged() |
static void |
reportError(java.lang.String err)
Report an error to the Driver Station
|
void |
run()
Task run by the Robot to get DS data.
|
protected void |
startThread() |
void |
waitForData()
Wait for new data from the driver station.
|
void |
waitForData(long timeout)
Wait for new data or for timeout, which ever comes first.
|
private final java.lang.Thread m_thread
private final java.lang.Object m_dataSem
private volatile boolean m_thread_keepAlive
private volatile boolean m_thread_exit_error
private boolean m_newControlData
private final java.nio.ByteBuffer m_packetDataAvailableMutex
private final java.nio.ByteBuffer m_packetDataAvailableSem
private final ILogger m_log
private static DriverStation m_instance
private int m_modeInt
private int m_modeNewInt
protected static void initialize()
public static final DriverStation getInstance()
public void run()
run in interface java.lang.Runnableprotected void startThread()
public void exitNoError()
public void exit()
public void waitForData()
public void waitForData(long timeout)
timeout - The maximum time in milliseconds to wait.protected boolean isNewControlData()
protected boolean modeChanged()
public static boolean isDisabled()
public static boolean isEnabled()
public static boolean isAutonomous()
public static boolean isTest()
public static boolean isEStopped()
public static boolean isFMSAttached()
public static boolean isDSAttached()
public static boolean isOperatorControl()
public static boolean isSysActive()
public static boolean isBrownedOut()
public static GameMode getGameMode()
GameModepublic static void reportError(java.lang.String err)
err -