diff --git a/backend/api/Controllers/Models/MissionRunQueryStringParameters.cs b/backend/api/Controllers/Models/MissionRunQueryStringParameters.cs index af7b7a65d..2bc165811 100644 --- a/backend/api/Controllers/Models/MissionRunQueryStringParameters.cs +++ b/backend/api/Controllers/Models/MissionRunQueryStringParameters.cs @@ -61,14 +61,14 @@ public MissionRunQueryStringParameters() public List? InspectionTypes { get; set; } /// - /// Filter for whether the result should include localisation missions. The default is false + /// Filter for whether the result should exclude localisation missions. The default is false /// - public bool IncludeLocalisation { get; set; } + public bool ExcludeLocalisation { get; set; } /// - /// Filter for whether the result should include return to home missions. The default is false + /// Filter for whether the result should exclude return to home missions. The default is false /// - public bool IncludeReturnToHome { get; set; } + public bool ExcludeReturnToHome { get; set; } #region Time Filters diff --git a/backend/api/Services/MissionRunService.cs b/backend/api/Services/MissionRunService.cs index a40927794..e16925263 100644 --- a/backend/api/Services/MissionRunService.cs +++ b/backend/api/Services/MissionRunService.cs @@ -279,6 +279,8 @@ private static void SearchByTag(ref IQueryable missionRuns, string? /// , /// , /// , + /// , + /// , /// , /// , /// , @@ -331,11 +333,11 @@ MissionRunQueryStringParameters parameters ) ); - Expression> localisationFilter = parameters.IncludeLocalisation + Expression> localisationFilter = !parameters.ExcludeLocalisation ? missionRun => true : missionRun => !(missionRun.Tasks.Count() == 1 && missionRun.Tasks.All(task => task.Type == MissionTaskType.Localization)); - Expression> returnTohomeFilter = parameters.IncludeReturnToHome + Expression> returnTohomeFilter = !parameters.ExcludeReturnToHome ? missionRun => true : missionRun => !(missionRun.Tasks.Count() == 1 && missionRun.Tasks.All(task => task.Type == MissionTaskType.DriveTo)); diff --git a/frontend/src/api/ApiCaller.tsx b/frontend/src/api/ApiCaller.tsx index 0e0b29af0..e372e4e45 100644 --- a/frontend/src/api/ApiCaller.tsx +++ b/frontend/src/api/ApiCaller.tsx @@ -177,6 +177,8 @@ export class BackendAPICaller { if (parameters.nameSearch) path = path + 'NameSearch=' + parameters.nameSearch + '&' if (parameters.robotNameSearch) path = path + 'RobotNameSearch=' + parameters.robotNameSearch + '&' if (parameters.tagSearch) path = path + 'TagSearch=' + parameters.tagSearch + '&' + if (parameters.excludeLocalisation) path = path + 'ExcludeLocalisation=' + parameters.excludeLocalisation + '&' + if (parameters.excludeReturnToHome) path = path + 'ExcludeReturnToHome=' + parameters.excludeReturnToHome + '&' if (parameters.minStartTime) path = path + 'MinStartTime=' + parameters.minStartTime + '&' if (parameters.maxStartTime) path = path + 'MaxStartTime=' + parameters.maxStartTime + '&' if (parameters.minEndTime) path = path + 'MinEndTime=' + parameters.minEndTime + '&' diff --git a/frontend/src/models/MissionRunQueryParameters.ts b/frontend/src/models/MissionRunQueryParameters.ts index d278d2da4..131bbab7a 100644 --- a/frontend/src/models/MissionRunQueryParameters.ts +++ b/frontend/src/models/MissionRunQueryParameters.ts @@ -10,6 +10,8 @@ export interface MissionRunQueryParameters { tagSearch?: string inspectionTypes?: InspectionType[] area?: string + excludeLocalisation?: boolean + excludeReturnToHome?: boolean minStartTime?: number maxStartTime?: number minEndTime?: number