Made the TargetController refuse commands that require the target to be stopped, when the target is running

This commit is contained in:
Nav
2022-04-30 15:52:59 +01:00
parent 29cc4bf60b
commit 8fa8cf48d9

View File

@@ -289,7 +289,7 @@ namespace Bloom::TargetController
} }
if (command->requiresStoppedTargetState() && this->lastTargetState != TargetState::STOPPED) { if (command->requiresStoppedTargetState() && this->lastTargetState != TargetState::STOPPED) {
this->target->stop(); throw Exception("Illegal target state - command requires target to be stopped");
} }
this->registerCommandResponse( this->registerCommandResponse(
@@ -494,6 +494,7 @@ namespace Bloom::TargetController
if (this->target->getState() != TargetState::RUNNING) { if (this->target->getState() != TargetState::RUNNING) {
this->target->run(); this->target->run();
this->lastTargetState = TargetState::RUNNING;
} }
} }