RobotCore
1.0
WPILib port to raspberry Pi
Toggle main menu visibility
Loading...
Searching...
No Matches
Alert.java
1
// Copyright (c) FIRST and other WPILib contributors.
2
// Open Source Software; you can modify and/or share it under the terms of
3
// the WPILib BSD license file in the root directory of this project.
4
5
package
org.wpilib.util;
6
34
public
class
Alert
implements
AutoCloseable {
36
public
enum
Level {
41
HIGH
(
AlertDataJNI
.
LEVEL_HIGH
),
42
48
MEDIUM
(
AlertDataJNI
.
LEVEL_MEDIUM
),
49
55
LOW
(
AlertDataJNI
.
LEVEL_LOW
);
56
57
private
final
int
m_value;
58
59
Level(
int
value) {
60
m_value = value;
61
}
62
68
public
int
getValue
() {
69
return
m_value;
70
}
71
}
72
73
private
final
Level m_level;
74
private
int
m_handle;
75
83
public
Alert
(String
id
, String text,
Level
level) {
84
this
(
"Alerts"
, id, text, level);
85
}
86
95
public
Alert
(String group, String
id
, String text,
Level
level) {
96
m_level = level;
97
m_handle =
WPIUtilJNI
.createAlert(group,
id
, text, level.m_value);
98
}
99
106
public
void
set
(
boolean
active) {
107
WPIUtilJNI
.setAlertActive(m_handle, active);
108
}
109
115
public
boolean
get
() {
116
return
WPIUtilJNI
.isAlertActive(m_handle);
117
}
118
125
public
void
setText
(String text) {
126
WPIUtilJNI
.setAlertText(m_handle, text);
127
}
128
134
public
String
getText
() {
135
return
WPIUtilJNI
.getAlertText(m_handle);
136
}
137
143
public
Level
getLevel
() {
144
return
m_level;
145
}
146
147
@Override
148
public
void
close() {
149
if
(m_handle != 0) {
150
WPIUtilJNI
.destroyAlert(m_handle);
151
m_handle = 0;
152
}
153
}
154
}
org.wpilib.util.AlertDataJNI
Definition
AlertDataJNI.java:8
org.wpilib.util.AlertDataJNI.LEVEL_LOW
static final int LEVEL_LOW
Definition
AlertDataJNI.java:27
org.wpilib.util.AlertDataJNI.LEVEL_HIGH
static final int LEVEL_HIGH
Definition
AlertDataJNI.java:13
org.wpilib.util.AlertDataJNI.LEVEL_MEDIUM
static final int LEVEL_MEDIUM
Definition
AlertDataJNI.java:20
org.wpilib.util.Alert.Alert
Alert(String id, String text, Level level)
Definition
Alert.java:83
org.wpilib.util.Alert.setText
void setText(String text)
Definition
Alert.java:125
org.wpilib.util.Alert.Alert
Alert(String group, String id, String text, Level level)
Definition
Alert.java:95
org.wpilib.util.Alert.getLevel
Level getLevel()
Definition
Alert.java:143
org.wpilib.util.Alert.getText
String getText()
Definition
Alert.java:134
org.wpilib.util.WPIUtilJNI
Definition
WPIUtilJNI.java:17
org.wpilib.util.Alert.Level
Definition
Alert.java:36
org.wpilib.util.Alert.Level.HIGH
HIGH
Definition
Alert.java:41
org.wpilib.util.Alert.Level.LOW
LOW
Definition
Alert.java:55
org.wpilib.util.Alert.Level.MEDIUM
MEDIUM
Definition
Alert.java:48
org.wpilib.util.Alert.Level.getValue
int getValue()
Definition
Alert.java:68
org
wpilib
util
Alert.java
Generated by
1.18.0