File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,11 @@ public bool IsEmergencyMission()
146146 {
147147 return MissionRunType == MissionRunType . Emergency ;
148148 }
149+
150+ public bool IsReturnHomeOrEmergencyMission ( )
151+ {
152+ return IsReturnHomeMission ( ) || IsEmergencyMission ( ) ;
153+ }
149154 }
150155
151156 public enum MissionStatus
Original file line number Diff line number Diff line change @@ -10,10 +10,7 @@ public static bool TheSystemIsAvailableToRunAMission(
1010 ILogger logger
1111 )
1212 {
13- if (
14- robot . MissionQueueFrozen
15- && ! ( missionRun . IsEmergencyMission ( ) || missionRun . IsReturnHomeMission ( ) )
16- )
13+ if ( robot . MissionQueueFrozen && ! missionRun . IsReturnHomeOrEmergencyMission ( ) )
1714 {
1815 logger . LogInformation (
1916 "Mission run {MissionRunId} was not started as the mission run queue for robot {RobotName} is frozen" ,
Original file line number Diff line number Diff line change @@ -65,10 +65,7 @@ public async Task StartNextMissionRunIfSystemIsAvailable(Robot robot)
6565 if ( missionRun == null )
6666 return ;
6767
68- if (
69- robot . MissionQueueFrozen
70- && ! ( missionRun . IsEmergencyMission ( ) || missionRun . IsReturnHomeMission ( ) )
71- )
68+ if ( robot . MissionQueueFrozen && ! missionRun . IsReturnHomeOrEmergencyMission ( ) )
7269 {
7370 logger . LogInformation (
7471 "Robot {robotName} is ready to start a mission but its mission queue is frozen" ,
@@ -110,7 +107,7 @@ await robotService.UpdateCurrentInspectionArea(
110107 robot . CurrentInspectionArea = missionRun . InspectionArea ! ;
111108 }
112109 else if (
113- ! missionRun . IsReturnHomeMission ( )
110+ ! missionRun . IsReturnHomeOrEmergencyMission ( )
114111 && ! inspectionAreaService . MissionTasksAreInsideInspectionAreaPolygon (
115112 ( List < MissionTask > ) missionRun . Tasks ,
116113 missionRun . InspectionArea
@@ -145,7 +142,8 @@ await AbortAllScheduledNormalMissions(
145142
146143 if (
147144 ( robot . IsRobotPressureTooLow ( ) || robot . IsRobotBatteryTooLow ( ) )
148- && ! ( missionRun . IsReturnHomeMission ( ) || missionRun . IsEmergencyMission ( ) )
145+ && ! missionRun . IsReturnHomeOrEmergencyMission ( )
146+ || missionRun . IsEmergencyMission ( )
149147 )
150148 {
151149 await HandleBatteryAndPressureLevel ( robot ) ;
You can’t perform that action at this time.
0 commit comments