mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Merge branch 'main' into 2027
This commit is contained in:
@@ -197,7 +197,7 @@ void Command::InitSendable(wpi::SendableBuilder& builder) {
|
||||
[this](bool value) {
|
||||
bool isScheduled = IsScheduled();
|
||||
if (value && !isScheduled) {
|
||||
Schedule();
|
||||
CommandScheduler::GetInstance().Schedule(this);
|
||||
} else if (!value && isScheduled) {
|
||||
Cancel();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ ProxyCommand::ProxyCommand(std::unique_ptr<Command> command) {
|
||||
|
||||
void ProxyCommand::Initialize() {
|
||||
m_command = m_supplier();
|
||||
m_command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(m_command);
|
||||
}
|
||||
|
||||
void ProxyCommand::End(bool interrupted) {
|
||||
|
||||
@@ -18,7 +18,7 @@ ScheduleCommand::ScheduleCommand(Command* toSchedule) {
|
||||
|
||||
void ScheduleCommand::Initialize() {
|
||||
for (auto command : m_toSchedule) {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ void Trigger::AddBinding(wpi::unique_function<void(bool, bool)>&& body) {
|
||||
Trigger Trigger::OnChange(Command* command) {
|
||||
AddBinding([command](bool previous, bool current) {
|
||||
if (previous != current) {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
});
|
||||
return *this;
|
||||
@@ -38,7 +38,7 @@ Trigger Trigger::OnChange(Command* command) {
|
||||
Trigger Trigger::OnChange(CommandPtr&& command) {
|
||||
AddBinding([command = std::move(command)](bool previous, bool current) {
|
||||
if (previous != current) {
|
||||
command.Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
});
|
||||
return *this;
|
||||
@@ -47,7 +47,7 @@ Trigger Trigger::OnChange(CommandPtr&& command) {
|
||||
Trigger Trigger::OnTrue(Command* command) {
|
||||
AddBinding([command](bool previous, bool current) {
|
||||
if (!previous && current) {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
});
|
||||
return *this;
|
||||
@@ -56,7 +56,7 @@ Trigger Trigger::OnTrue(Command* command) {
|
||||
Trigger Trigger::OnTrue(CommandPtr&& command) {
|
||||
AddBinding([command = std::move(command)](bool previous, bool current) {
|
||||
if (!previous && current) {
|
||||
command.Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
});
|
||||
return *this;
|
||||
@@ -65,7 +65,7 @@ Trigger Trigger::OnTrue(CommandPtr&& command) {
|
||||
Trigger Trigger::OnFalse(Command* command) {
|
||||
AddBinding([command](bool previous, bool current) {
|
||||
if (previous && !current) {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
});
|
||||
return *this;
|
||||
@@ -74,7 +74,7 @@ Trigger Trigger::OnFalse(Command* command) {
|
||||
Trigger Trigger::OnFalse(CommandPtr&& command) {
|
||||
AddBinding([command = std::move(command)](bool previous, bool current) {
|
||||
if (previous && !current) {
|
||||
command.Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
});
|
||||
return *this;
|
||||
@@ -83,7 +83,7 @@ Trigger Trigger::OnFalse(CommandPtr&& command) {
|
||||
Trigger Trigger::WhileTrue(Command* command) {
|
||||
AddBinding([command](bool previous, bool current) {
|
||||
if (!previous && current) {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
} else if (previous && !current) {
|
||||
command->Cancel();
|
||||
}
|
||||
@@ -94,7 +94,7 @@ Trigger Trigger::WhileTrue(Command* command) {
|
||||
Trigger Trigger::WhileTrue(CommandPtr&& command) {
|
||||
AddBinding([command = std::move(command)](bool previous, bool current) {
|
||||
if (!previous && current) {
|
||||
command.Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
} else if (previous && !current) {
|
||||
command.Cancel();
|
||||
}
|
||||
@@ -105,7 +105,7 @@ Trigger Trigger::WhileTrue(CommandPtr&& command) {
|
||||
Trigger Trigger::WhileFalse(Command* command) {
|
||||
AddBinding([command](bool previous, bool current) {
|
||||
if (previous && !current) {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
} else if (!previous && current) {
|
||||
command->Cancel();
|
||||
}
|
||||
@@ -116,7 +116,7 @@ Trigger Trigger::WhileFalse(Command* command) {
|
||||
Trigger Trigger::WhileFalse(CommandPtr&& command) {
|
||||
AddBinding([command = std::move(command)](bool previous, bool current) {
|
||||
if (!previous && current) {
|
||||
command.Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
} else if (previous && !current) {
|
||||
command.Cancel();
|
||||
}
|
||||
@@ -130,7 +130,7 @@ Trigger Trigger::ToggleOnTrue(Command* command) {
|
||||
if (command->IsScheduled()) {
|
||||
command->Cancel();
|
||||
} else {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -143,7 +143,7 @@ Trigger Trigger::ToggleOnTrue(CommandPtr&& command) {
|
||||
if (command.IsScheduled()) {
|
||||
command.Cancel();
|
||||
} else {
|
||||
command.Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -156,7 +156,7 @@ Trigger Trigger::ToggleOnFalse(Command* command) {
|
||||
if (command->IsScheduled()) {
|
||||
command->Cancel();
|
||||
} else {
|
||||
command->Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -169,7 +169,7 @@ Trigger Trigger::ToggleOnFalse(CommandPtr&& command) {
|
||||
if (command.IsScheduled()) {
|
||||
command.Cancel();
|
||||
} else {
|
||||
command.Schedule();
|
||||
frc2::CommandScheduler::GetInstance().Schedule(command);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user