Added requiresStoppedTargetState() member function to TargetController command classes.

The TargetController will use this to determine whether to stop the target before handling a given command.
This commit is contained in:
Nav
2022-04-29 22:06:05 +01:00
parent 80405057f6
commit 3fc558f3e8
7 changed files with 28 additions and 0 deletions

View File

@@ -285,6 +285,10 @@ namespace Bloom::TargetController
throw Exception("No handler registered for this command.");
}
if (command->requiresStoppedTargetState() && this->lastTargetState != TargetState::STOPPED) {
this->target->stop();
}
this->registerCommandResponse(
commandId,
this->commandHandlersByCommandType.at(commandType)(*(command.get()))