Skip to content

Commit

Permalink
Add offline and isarConnected prechecks
Browse files Browse the repository at this point in the history
  • Loading branch information
prasm313 committed Jun 14, 2024
1 parent 5b07a3b commit 51fb3b2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions backend/api/Services/MissionSchedulingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,20 @@ public async Task<Robot> GetRobotWithPreCheck(string robotId)
throw new RobotNotFoundException(errorMessage);
}

if (robot.Status == RobotStatus.Offline)
{
string errorMessage = $"The robot with ID {robotId} is Offline";
logger.LogError("{Message}", errorMessage);
throw new RobotPreCheckFailedException(errorMessage);
}

if (robot.IsarConnected == false)
{
string errorMessage = $"The robot with ID {robotId} has connection issues. Isar not connected.";
logger.LogError("{Message}", errorMessage);
throw new RobotPreCheckFailedException(errorMessage);
}

if (!robot.IsRobotPressureTooLow())
{
string errorMessage = $"The robot pressure on {robot.Name} is too low to start a mission";
Expand Down

0 comments on commit 51fb3b2

Please sign in to comment.