RobotCore
1.0
WPILib port to raspberry Pi
Toggle main menu visibility
Loading...
Searching...
No Matches
TunableBase.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.tunable;
6
8
@SuppressWarnings(
"PMD.AbstractClassWithoutAbstractMethod"
)
9
public abstract class
TunableBase
{
10
private
final
TunableConfig
m_config;
11
private
final
boolean
m_supportsChangeNotification;
12
17
protected
boolean
m_changed
;
18
24
protected
TunableBase
(
TunableConfig
config) {
25
this
(config,
false
);
26
}
27
37
protected
TunableBase
(
TunableConfig
config,
boolean
supportsChangeNotification
) {
38
m_config = config;
39
m_supportsChangeNotification =
supportsChangeNotification
;
40
}
41
48
public
boolean
isRobust
() {
49
return
m_config !=
null
&& m_config.isRobust();
50
}
51
58
public
String
getProperties
() {
59
return
m_config ==
null
?
"{}"
: m_config.getProperties();
60
}
61
67
public
TunableConfig
getConfig
() {
68
return
m_config;
69
}
70
76
public
boolean
hasChanged
() {
77
return
m_changed
;
78
}
79
85
public
boolean
supportsChangeNotification
() {
86
return
m_supportsChangeNotification;
87
}
88
90
protected
void
markChanged
() {
91
if
(!
m_changed
) {
92
m_changed
=
true
;
93
if
(m_supportsChangeNotification) {
94
TunableRegistry
.notifyChanged(
this
);
95
}
96
}
97
}
98
100
public
void
resetChanged
() {
101
m_changed
=
false
;
102
}
103
}
org.wpilib.tunable.TunableBase.TunableBase
TunableBase(TunableConfig config, boolean supportsChangeNotification)
Definition
TunableBase.java:37
org.wpilib.tunable.TunableBase.isRobust
boolean isRobust()
Definition
TunableBase.java:48
org.wpilib.tunable.TunableBase.getProperties
String getProperties()
Definition
TunableBase.java:58
org.wpilib.tunable.TunableBase.supportsChangeNotification
boolean supportsChangeNotification()
Definition
TunableBase.java:85
org.wpilib.tunable.TunableBase.markChanged
void markChanged()
Definition
TunableBase.java:90
org.wpilib.tunable.TunableBase.hasChanged
boolean hasChanged()
Definition
TunableBase.java:76
org.wpilib.tunable.TunableBase.resetChanged
void resetChanged()
Definition
TunableBase.java:100
org.wpilib.tunable.TunableBase.TunableBase
TunableBase(TunableConfig config)
Definition
TunableBase.java:24
org.wpilib.tunable.TunableBase.getConfig
TunableConfig getConfig()
Definition
TunableBase.java:67
org.wpilib.tunable.TunableBase.m_changed
boolean m_changed
Definition
TunableBase.java:17
org.wpilib.tunable.TunableConfig
Definition
TunableConfig.java:15
org.wpilib.tunable.TunableRegistry
Definition
TunableRegistry.java:26
org
wpilib
tunable
TunableBase.java
Generated by
1.18.0