mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpilib] Fix Compressor sendable properties (#3269)
This commit is contained in:
committed by
GitHub
parent
10c038d9bf
commit
ffb590bfcc
@@ -236,14 +236,10 @@ int Compressor::GetModule() const {
|
||||
void Compressor::InitSendable(SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("Compressor");
|
||||
builder.AddBooleanProperty(
|
||||
"Enabled", [=]() { return Enabled(); },
|
||||
[=](bool value) {
|
||||
if (value) {
|
||||
Start();
|
||||
} else {
|
||||
Stop();
|
||||
}
|
||||
});
|
||||
"Closed Loop Control", [=]() { return GetClosedLoopControl(); },
|
||||
[=](bool value) { SetClosedLoopControl(value); });
|
||||
builder.AddBooleanProperty(
|
||||
"Enabled", [=] { return Enabled(); }, nullptr);
|
||||
builder.AddBooleanProperty(
|
||||
"Pressure switch", [=]() { return GetPressureSwitchValue(); }, nullptr);
|
||||
}
|
||||
|
||||
@@ -205,15 +205,8 @@ public class Compressor implements Sendable, AutoCloseable {
|
||||
public void initSendable(SendableBuilder builder) {
|
||||
builder.setSmartDashboardType("Compressor");
|
||||
builder.addBooleanProperty(
|
||||
"Enabled",
|
||||
this::enabled,
|
||||
value -> {
|
||||
if (value) {
|
||||
start();
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
});
|
||||
"Closed Loop Control", this::getClosedLoopControl, this::setClosedLoopControl);
|
||||
builder.addBooleanProperty("Enabled", this::enabled, null);
|
||||
builder.addBooleanProperty("Pressure switch", this::getPressureSwitchValue, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user