mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Enhance Command Sendable implementations (#4822)
This commit is contained in:
@@ -64,4 +64,21 @@ void CommandBase::InitSendable(wpi::SendableBuilder& builder) {
|
||||
Cancel();
|
||||
}
|
||||
});
|
||||
builder.AddBooleanProperty(
|
||||
".isParented", [this] { return IsComposed(); }, nullptr);
|
||||
builder.AddStringProperty(
|
||||
"interruptBehavior",
|
||||
[this] {
|
||||
switch (GetInterruptionBehavior()) {
|
||||
case Command::InterruptionBehavior::kCancelIncoming:
|
||||
return "kCancelIncoming";
|
||||
case Command::InterruptionBehavior::kCancelSelf:
|
||||
return "kCancelSelf";
|
||||
default:
|
||||
return "Invalid";
|
||||
}
|
||||
},
|
||||
nullptr);
|
||||
builder.AddBooleanProperty(
|
||||
"runsWhenDisabled", [this] { return RunsWhenDisabled(); }, nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user