Skip to content

Commit

Permalink
Fetch mission definition map info if null
Browse files Browse the repository at this point in the history
  • Loading branch information
mrica-equinor committed Jan 9, 2025
1 parent 20dd1aa commit 2d5e773
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions backend/api/Controllers/MissionSchedulingController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,17 +548,14 @@ [FromBody] CustomMissionQuery customMissionQuery
InspectionFrequency = customMissionQuery.InspectionFrequency,
InstallationCode = customMissionQuery.InstallationCode,
InspectionArea = inspectionArea,
Map = new MapMetadata(),
};

if (existingMissionDefinition == null)
{
customMissionDefinition.Map = await mapService.ChooseMapFromPositions(
customMissionDefinition.Map ??= await mapService.ChooseMapFromPositions(
missionTasks.Select(t => t.RobotPose.Position).ToList(),
customMissionQuery.InstallationCode
);
await missionDefinitionService.Create(customMissionDefinition);
}

if (existingMissionDefinition == null) { await missionDefinitionService.Create(customMissionDefinition); }
}
catch (SourceException e)
{
Expand Down

0 comments on commit 2d5e773

Please sign in to comment.