RobotCore 1.0
WPILib port to raspberry Pi
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
5package org.wpilib.hardware.hal;
6
8public 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
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}
static long makeId(RobotMode mode, long hash)
OpModeOption(long id, String name, String group, String description, int textColor, int backgroundColor)
static RobotMode fromInt(int value)