Class ChoreoAlert
java.lang.Object
choreo.util.ChoreoAlert
A utility class for creating alerts under the "Choreo Alerts" group.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn alert that can have multiple causes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.wpilib.util.AlertAn alert to be used when alliance-dependent logic is called before an alliance has been determined. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.wpilib.util.AlertCreates an alert under the "Choreo" group.static org.wpilib.util.AlertCreates an alert under the "Choreo" group, using the name as the displayed text.static ChoreoAlert.MultiAlertmultiAlert(String name, Function<List<String>, String> textGenerator, org.wpilib.util.Alert.Level level) Creates aChoreoAlert.MultiAlertunder the "Choreo" group.static ChoreoAlert.MultiAlertmultiAlert(Function<List<String>, String> textGenerator, org.wpilib.util.Alert.Level level) Creates aChoreoAlert.MultiAlertunder the "Choreo" group, using the text generated from an empty list of causes as the name.
-
Field Details
-
allianceNotReady
An alert to be used when alliance-dependent logic is called before an alliance has been determined.
-
-
Method Details
-
alert
Creates an alert under the "Choreo" group, using the name as the displayed text.- Parameters:
name- The name of the alert; this must be unique within the grouplevel- The level of alert- Returns:
- an Alert published under the "Choreo" group
-
alert
public static org.wpilib.util.Alert alert(String name, String text, org.wpilib.util.Alert.Level level) Creates an alert under the "Choreo" group.- Parameters:
name- The name of the alert; this must be unique within the grouptext- The text to display when the alert is activelevel- The level of alert- Returns:
- an Alert published under the "Choreo" group
-
multiAlert
public static ChoreoAlert.MultiAlert multiAlert(Function<List<String>, String> textGenerator, org.wpilib.util.Alert.Level level) Creates aChoreoAlert.MultiAlertunder the "Choreo" group, using the text generated from an empty list of causes as the name.- Parameters:
textGenerator- A function that accepts a list of causes and returns an alert messagelevel- The level of alert- Returns:
- a MultiAlert published under the "Choreo" group
-
multiAlert
public static ChoreoAlert.MultiAlert multiAlert(String name, Function<List<String>, String> textGenerator, org.wpilib.util.Alert.Level level) Creates aChoreoAlert.MultiAlertunder the "Choreo" group.- Parameters:
name- The name of the alert; this must be unique within the grouptextGenerator- A function that accepts a list of causes and returns an alert messagelevel- The level of alert- Returns:
- a MultiAlert published under the "Choreo" group
-