mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#AUFTRAG, OpsGroup - added speed option for mission hold, ingress and egress wpts
This commit is contained in:
parent
3f632b92e2
commit
21240a60de
@ -5723,7 +5723,7 @@ function AUFTRAG:GetMissionTypesText(MissionTypes)
|
||||
return text
|
||||
end
|
||||
|
||||
--- [NON-AIR] Set the mission waypoint coordinate where the mission is executed. Note that altitude is set via `:SetMissionAltitude`.
|
||||
--- [NON-AIR] Set the mission waypoint coordinate from where the mission is executed. Note that altitude is set via `:SetMissionAltitude`.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate where the mission is executed.
|
||||
-- @return #AUFTRAG self
|
||||
@ -5751,8 +5751,9 @@ end
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Coordinate Egrees coordinate.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
|
||||
-- @param #number Speed (Optional) Speed in knots to reach this waypoint. Defaults to mission speed.
|
||||
-- @return #AUFTRAG self
|
||||
function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude)
|
||||
function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude, Speed)
|
||||
|
||||
-- Obviously a zone was passed. We get the coordinate.
|
||||
if Coordinate:IsInstanceOf("ZONE_BASE") then
|
||||
@ -5765,14 +5766,19 @@ function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude)
|
||||
self.missionEgressCoord.y=UTILS.FeetToMeters(Altitude)
|
||||
self.missionEgressCoordAlt = UTILS.FeetToMeters(Altitude)
|
||||
end
|
||||
|
||||
self.missionEgressCoordSpeed=Speed and Speed or nil
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Air] Set the mission ingress coordinate. This is the coordinate where the assigned group will fly before the actual mission coordinate.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Coordinate Ingrees coordinate.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
|
||||
-- @param #number Speed (Optional) Speed in knots to reach this waypoint. Defaults to mission speed.
|
||||
-- @return #AUFTRAG self
|
||||
function AUFTRAG:SetMissionIngressCoord(Coordinate, Altitude)
|
||||
function AUFTRAG:SetMissionIngressCoord(Coordinate, Altitude, Speed)
|
||||
|
||||
-- Obviously a zone was passed. We get the coordinate.
|
||||
if Coordinate:IsInstanceOf("ZONE_BASE") then
|
||||
@ -5785,15 +5791,20 @@ function AUFTRAG:SetMissionIngressCoord(Coordinate, Altitude)
|
||||
self.missionIngressCoord.y=UTILS.FeetToMeters(Altitude)
|
||||
self.missionIngressCoordAlt = UTILS.FeetToMeters(Altitude or 10000)
|
||||
end
|
||||
|
||||
self.missionIngressCoordSpeed=Speed and Speed or nil
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- [Air] Set the mission holding coordinate. This is the coordinate where the assigned group will fly before the actual mission execution starts. Do not forget to add a push condition, too!
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Coordinate Holding coordinate.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
|
||||
-- @param #number Speed (Optional) Speed in knots to reach this waypoint and hold there. Defaults to mission speed.
|
||||
-- @param #number Duration (Optional) Duration in seconds on how long to hold, defaults to 15 minutes. Mission continues if either a push condition is met or the time is up.
|
||||
-- @return #AUFTRAG self
|
||||
function AUFTRAG:SetMissionHoldingCoord(Coordinate, Altitude, Duration)
|
||||
function AUFTRAG:SetMissionHoldingCoord(Coordinate, Altitude, Speed, Duration)
|
||||
|
||||
-- Obviously a zone was passed. We get the coordinate.
|
||||
if Coordinate:IsInstanceOf("ZONE_BASE") then
|
||||
@ -5807,6 +5818,10 @@ function AUFTRAG:SetMissionHoldingCoord(Coordinate, Altitude, Duration)
|
||||
self.missionHoldingCoord.y=UTILS.FeetToMeters(Altitude)
|
||||
self.missionHoldingCoordAlt = UTILS.FeetToMeters(Altitude or 10000)
|
||||
end
|
||||
|
||||
self.missionHoldingCoordSpeed=Speed and Speed or nil
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get the mission egress coordinate if this was defined.
|
||||
|
||||
@ -6124,11 +6124,11 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
local holdingcoord = mission:GetMissionHoldingCoord()
|
||||
|
||||
if holdingcoord then
|
||||
waypoint=FLIGHTGROUP.AddWaypoint(self, holdingcoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionHoldingCoordAlt or self.altitudeCruise), false)
|
||||
waypoint=FLIGHTGROUP.AddWaypoint(self, holdingcoord, mission.missionHoldingCoordSpeed or SpeedToMission, uid, UTILS.MetersToFeet(mission.missionHoldingCoordAlt or self.altitudeCruise), false)
|
||||
uid=waypoint.uid
|
||||
-- Orbit until flaghold=1 (true) but max 5 min
|
||||
self.flaghold:Set(0)
|
||||
local TaskOrbit = self.group:TaskOrbit(holdingcoord, mission.missionHoldingCoordAlt)
|
||||
local TaskOrbit = self.group:TaskOrbit(holdingcoord, mission.missionHoldingCoordAlt, UTILS.KnotsToMps(mission.missionHoldingCoordSpeed or SpeedToMission))
|
||||
local TaskStop = self.group:TaskCondition(nil, self.flaghold.UserFlagName, 1, nil, mission.missionHoldingDuration or 900)
|
||||
local TaskCntr = self.group:TaskControlled(TaskOrbit, TaskStop)
|
||||
local TaskOver = self.group:TaskFunction("FLIGHTGROUP._FinishedWaiting", self)
|
||||
@ -6140,7 +6140,7 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
end
|
||||
|
||||
if ingresscoord then
|
||||
waypoint=FLIGHTGROUP.AddWaypoint(self, ingresscoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionIngressCoordAlt or self.altitudeCruise), false)
|
||||
waypoint=FLIGHTGROUP.AddWaypoint(self, ingresscoord, mission.missionIngressCoordSpeed or SpeedToMission, uid, UTILS.MetersToFeet(mission.missionIngressCoordAlt or self.altitudeCruise), false)
|
||||
uid=waypoint.uid
|
||||
end
|
||||
|
||||
@ -6182,7 +6182,7 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
if egresscoord then
|
||||
local Ewaypoint=nil --#OPSGROUP.Waypoint
|
||||
if self:IsFlightgroup() then
|
||||
Ewaypoint=FLIGHTGROUP.AddWaypoint(self, egresscoord, SpeedToMission, waypoint.uid, UTILS.MetersToFeet(mission.missionEgressCoordAlt or self.altitudeCruise), false)
|
||||
Ewaypoint=FLIGHTGROUP.AddWaypoint(self, egresscoord, mission.missionEgressCoordSpeed or SpeedToMission, waypoint.uid, UTILS.MetersToFeet(mission.missionEgressCoordAlt or self.altitudeCruise), false)
|
||||
elseif self:IsArmygroup() then
|
||||
Ewaypoint=ARMYGROUP.AddWaypoint(self, egresscoord, SpeedToMission, waypoint.uid, mission.optionFormation, false)
|
||||
elseif self:IsNavygroup() then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user