RobotCore
1.0
WPILib port to raspberry Pi
Toggle main menu visibility
Loading...
Searching...
No Matches
OpModeOption.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.hardware.hal;
6
8
public
class
OpModeOption
{
10
public
final
long
id
;
11
12
public
final
String name;
13
14
public
final
String group;
15
16
public
final
String description;
17
18
public
final
int
textColor;
19
20
public
final
int
backgroundColor;
21
32
public
OpModeOption
(
33
long
id
, String name, String group, String description,
int
textColor,
int
backgroundColor) {
34
this.id =
id
;
35
this.name = name;
36
this.group = group;
37
this.description = description;
38
this.textColor = textColor;
39
this.backgroundColor = backgroundColor;
40
}
41
47
public
RobotMode
getMode
() {
48
return
RobotMode
.
fromInt
((
int
) ((
id
>> 56) & 0x3));
49
}
50
58
public
static
long
makeId
(
RobotMode
mode,
long
hash) {
59
return
((mode.
getValue
() & 0x3L) << 56) | (hash & 0x00FFFFFFFFFFFFFFL);
60
}
61
}
org.wpilib.hardware.hal.OpModeOption.makeId
static long makeId(RobotMode mode, long hash)
Definition
OpModeOption.java:58
org.wpilib.hardware.hal.OpModeOption.id
final long id
Definition
OpModeOption.java:10
org.wpilib.hardware.hal.OpModeOption.OpModeOption
OpModeOption(long id, String name, String group, String description, int textColor, int backgroundColor)
Definition
OpModeOption.java:32
org.wpilib.hardware.hal.OpModeOption.getMode
RobotMode getMode()
Definition
OpModeOption.java:47
org.wpilib.hardware.hal.RobotMode
Definition
RobotMode.java:8
org.wpilib.hardware.hal.RobotMode.getValue
int getValue()
Definition
RobotMode.java:29
org.wpilib.hardware.hal.RobotMode.fromInt
static RobotMode fromInt(int value)
Definition
RobotMode.java:34
org
wpilib
hardware
hal
OpModeOption.java
Generated by
1.18.0