SCRIPT: FRC_ replacements

This commit is contained in:
PJ Reiniger
2025-11-07 20:00:43 -05:00
committed by Peter Johnson
parent 824f36f63a
commit 928ff20695
143 changed files with 477 additions and 477 deletions

View File

@@ -37,7 +37,7 @@ CommandPtr::CommandPtr(CommandPtr&& rhs) {
void CommandPtr::AssertValid() const {
if (!m_ptr) {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Moved-from CommandPtr object used!\nMoved out at:\n{}",
m_moveOutSite);
}

View File

@@ -284,7 +284,7 @@ void CommandScheduler::UnregisterAllSubsystems() {
void CommandScheduler::SetDefaultCommand(Subsystem* subsystem,
CommandPtr&& defaultCommand) {
if (!defaultCommand.get()->HasRequirement(subsystem)) {
throw FRC_MakeError(wpi::err::CommandIllegalUse, "{}",
throw WPILIB_MakeError(wpi::err::CommandIllegalUse, "{}",
"Default commands must require their subsystem!");
}
RequireUngrouped(defaultCommand.get());
@@ -430,7 +430,7 @@ void CommandScheduler::OnCommandFinish(Action action) {
void CommandScheduler::RequireUngrouped(const Command* command) {
auto stacktrace = command->GetPreviousCompositionSite();
if (stacktrace.has_value()) {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Commands that have been composed may not be added to "
"another composition or scheduled individually!"
"\nOriginally composed at:\n{}",
@@ -454,7 +454,7 @@ void CommandScheduler::RequireUngrouped(
void CommandScheduler::RequireUngroupedAndUnscheduled(const Command* command) {
if (IsScheduled(command)) {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Commands that have been scheduled individually may "
"not be added to another composition!");
}

View File

@@ -69,7 +69,7 @@ void ParallelCommandGroup::AddCommands(
CommandScheduler::GetInstance().RequireUngroupedAndUnscheduled(commands);
if (isRunning) {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Commands cannot be added to a CommandGroup "
"while the group is running");
}
@@ -85,7 +85,7 @@ void ParallelCommandGroup::AddCommands(
}
m_commands.emplace_back(std::move(command), false);
} else {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Multiple commands in a parallel group cannot "
"require the same subsystems");
}

View File

@@ -69,7 +69,7 @@ void ParallelDeadlineGroup::AddCommands(
CommandScheduler::GetInstance().RequireUngroupedAndUnscheduled(commands);
if (!m_finished) {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Commands cannot be added to a CommandGroup "
"while the group is running");
}
@@ -85,7 +85,7 @@ void ParallelDeadlineGroup::AddCommands(
}
m_commands.emplace_back(std::move(command), false);
} else {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Multiple commands in a parallel group cannot "
"require the same subsystems");
}

View File

@@ -56,7 +56,7 @@ void ParallelRaceGroup::AddCommands(
CommandScheduler::GetInstance().RequireUngroupedAndUnscheduled(commands);
if (isRunning) {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Commands cannot be added to a CommandGroup "
"while the group is running");
}
@@ -72,7 +72,7 @@ void ParallelRaceGroup::AddCommands(
}
m_commands.emplace_back(std::move(command));
} else {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Multiple commands in a parallel group cannot "
"require the same subsystems");
}

View File

@@ -68,7 +68,7 @@ void SequentialCommandGroup::AddCommands(
CommandScheduler::GetInstance().RequireUngroupedAndUnscheduled(commands);
if (m_currentCommandIndex != invalid_index) {
throw FRC_MakeError(wpi::err::CommandIllegalUse,
throw WPILIB_MakeError(wpi::err::CommandIllegalUse,
"Commands cannot be added to a CommandGroup "
"while the group is running");
}