Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aeshub committed Nov 14, 2023
1 parent d630122 commit 8e35736
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 34 deletions.
60 changes: 30 additions & 30 deletions backend/api/Controllers/EchoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@ public EchoController(ILogger<EchoController> logger, IEchoService echoService,
_robotService = robotService;
}

/// <summary>
/// List all available Echo missions for the installation
/// </summary>
/// <remarks>
/// These missions are created in the Echo mission planner
/// </remarks>
[HttpGet]
[Route("available-missions/{plantCode}")]
[ProducesResponseType(typeof(List<CondensedEchoMissionDefinition>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
[ProducesResponseType(StatusCodes.Status502BadGateway)]
public async Task<ActionResult<IList<CondensedEchoMissionDefinition>>> GetAvailableEchoMissions([FromRoute] string? plantCode)
{
try
{
var missions = await _echoService.GetAvailableMissions(plantCode);
return Ok(missions);
}
catch (HttpRequestException e)
{
_logger.LogError(e, "Error retrieving missions from Echo");
return new StatusCodeResult(StatusCodes.Status502BadGateway);
}
catch (JsonException e)
/// <summary>
/// List all available Echo missions for the installation
/// </summary>
/// <remarks>
/// These missions are created in the Echo mission planner
/// </remarks>
[HttpGet]
[Route("available-missions/{plantCode}")]
[ProducesResponseType(typeof(List<CondensedEchoMissionDefinition>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
[ProducesResponseType(StatusCodes.Status502BadGateway)]
public async Task<ActionResult<IList<CondensedEchoMissionDefinition>>> GetAvailableEchoMissions([FromRoute] string? plantCode)
{
_logger.LogError(e, "Error retrieving missions from Echo");
return new StatusCodeResult(StatusCodes.Status500InternalServerError);
try
{
var missions = await _echoService.GetAvailableMissions(plantCode);
return Ok(missions);
}
catch (HttpRequestException e)
{
_logger.LogError(e, "Error retrieving missions from Echo");
return new StatusCodeResult(StatusCodes.Status502BadGateway);
}
catch (JsonException e)
{
_logger.LogError(e, "Error retrieving missions from Echo");
return new StatusCodeResult(StatusCodes.Status500InternalServerError);
}
}
}

/// <summary>
/// Lookup Echo mission by Id
Expand Down
2 changes: 1 addition & 1 deletion backend/api/Controllers/Models/EchoInspection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public bool Equals(EchoInspection? e1, EchoInspection? e2)

public int GetHashCode(EchoInspection e)
{
// We cannot incorporate TimeInSeconds here are SQL queries do not handle
// We cannot incorporate TimeInSeconds here as SQL queries do not handle
// nullables even with short circuiting logic
return (int)e.InspectionType;
}
Expand Down
5 changes: 4 additions & 1 deletion backend/api/Database/Models/Pose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ public Orientation AxisAngleToQuaternion(float echoAngle)

var quaternion = new Orientation
{
X = 0, Y = 0, Z = MathF.Sin(angle / 2), W = MathF.Cos(angle / 2)
X = 0,
Y = 0,
Z = MathF.Sin(angle / 2),
W = MathF.Cos(angle / 2)
};

return quaternion;
Expand Down
7 changes: 5 additions & 2 deletions backend/api/Services/EchoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ private List<CondensedEchoMissionDefinition> ProcessAvailableEchoMission(List<Ec
{
var condensedEchoMissionDefinition = new CondensedEchoMissionDefinition
{
EchoMissionId = echoMission.Id, Name = echoMission.Name, InstallationCode = echoMission.InstallationCode
EchoMissionId = echoMission.Id,
Name = echoMission.Name,
InstallationCode = echoMission.InstallationCode
};
availableMissions.Add(condensedEchoMissionDefinition);
}
Expand Down Expand Up @@ -206,7 +208,8 @@ List<EchoPlantInfoResponse> echoPlantInfoResponse

var echoPlantInfo = new EchoPlantInfo
{
PlantCode = plant.InstallationCode, ProjectDescription = plant.ProjectDescription
PlantCode = plant.InstallationCode,
ProjectDescription = plant.ProjectDescription
};

echoPlantInfos.Add(echoPlantInfo);
Expand Down

0 comments on commit 8e35736

Please sign in to comment.