Class AlertJNI
java.lang.Object
org.wpilib.hardware.hal.JNIWrapper
org.wpilib.hardware.hal.AlertJNI
The AlertJNI class directly wraps the C++ HAL Alert.
This class is not meant for direct use by teams. Instead, the org.wpilib.driverstation.Alert class, which corresponds to the C++ Alert class, should be used.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JNIWrapper
JNIWrapper.Helper -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHigh priority alert - displayed first with a red "X" symbol.static final intLow priority alert - displayed last with a green "i" symbol.static final intMedium priority alert - displayed second with a yellow "!" symbol. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcreateAlert(String group, String text, int level) Creates an alert.static voiddestroyAlert(int alertHandle) Destroys an alert.static StringgetAlertText(int alertHandle) Gets the text of the alert.static booleanisAlertActive(int alertHandle) Checks if an alert is active.static voidsetAlertActive(int alertHandle, boolean active) Sets whether the alert should be displayed.static voidsetAlertText(int alertHandle, String text) Sets the text of the alert.Methods inherited from class JNIWrapper
forceLoad, suppressUnused
-
Field Details
-
LEVEL_HIGH
High priority alert - displayed first with a red "X" symbol. Use this type for problems which will seriously affect the robot's functionality and thus require immediate attention.- See Also:
-
LEVEL_MEDIUM
Medium priority alert - displayed second with a yellow "!" symbol. Use this type for problems which could affect the robot's functionality but do not necessarily require immediate attention.- See Also:
-
LEVEL_LOW
Low priority alert - displayed last with a green "i" symbol. Use this type for problems which are unlikely to affect the robot's functionality, or any other alerts which do not fall under the other categories.- See Also:
-
-
Method Details
-
createAlert
Creates an alert.- Parameters:
group- Group identifiertext- Text to be displayed when the alert is activelevel- Alert urgency level (LEVEL_HIGH, LEVEL_MEDIUM, LEVEL_LOW)- Returns:
- the created alert handle
- See Also:
-
destroyAlert
Destroys an alert.- Parameters:
alertHandle- the alert handle- See Also:
-
setAlertActive
Sets whether the alert should be displayed. This method can be safely be called periodically.- Parameters:
alertHandle- the alert handleactive- true to display the alert, false to hide it- See Also:
-
isAlertActive
Checks if an alert is active.- Parameters:
alertHandle- the alert handle- Returns:
- true if the alert is active
- See Also:
-
setAlertText
Sets the text of the alert. Use this method to dynamically change the displayed alert, such as including more details about the detected problem.- Parameters:
alertHandle- Alert handle.text- new text to be displayed when the alert is active- See Also:
-
getAlertText
Gets the text of the alert.- Parameters:
alertHandle- Alert handle.- Returns:
- the text displayed when the alert is active
- See Also:
-