mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-07-20 22:03:25 +00:00
Ops
This commit is contained in:
@@ -2726,6 +2726,29 @@ function AUFTRAG:GetMissionTypesText(MissionTypes)
|
||||
return text
|
||||
end
|
||||
|
||||
--- Get coordinate of target. First unit/group of the set is used.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Wrapper.Group#GROUP group Group.
|
||||
-- @return Core.Point#COORDINATE Coordinate where the mission is executed.
|
||||
function AUFTRAG:GetMissionWaypointCoord(group)
|
||||
|
||||
-- Create waypoint coordinate half way between us and the target.
|
||||
local waypointcoord=group:GetCoordinate():GetIntermediateCoordinate(self:GetTargetCoordinate(), self.missionFraction)
|
||||
local alt=waypointcoord.y
|
||||
|
||||
-- Add some randomization.
|
||||
waypointcoord=ZONE_RADIUS:New("Temp", waypointcoord:GetVec2(), 1000):GetRandomCoordinate():SetAltitude(alt, false)
|
||||
|
||||
-- Set altitude of mission waypoint.
|
||||
if self.missionAltitude then
|
||||
waypointcoord:SetAltitude(self.missionAltitude, true)
|
||||
end
|
||||
env.info(string.format("FF mission alt=%d meters", waypointcoord.y))
|
||||
|
||||
return waypointcoord
|
||||
end
|
||||
|
||||
|
||||
--- Set log ID string.
|
||||
-- @param #AUFTRAG self
|
||||
-- @return #AUFTRAG self
|
||||
|
||||
@@ -371,7 +371,7 @@ function NAVYGROUP:onafterUpdateRoute(From, Event, To, n, Speed, Depth)
|
||||
|
||||
-- Set speed.
|
||||
wp.speed=UTILS.KmphToMps(speed)
|
||||
wp.alt=-depth
|
||||
wp.alt=-depth --Depth and -Depth or wp.alt
|
||||
|
||||
-- Add waypoint.
|
||||
table.insert(waypoints, wp)
|
||||
|
||||
@@ -1630,18 +1630,8 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
-- Next waypoint.
|
||||
local nextwaypoint=self.currentwp+1
|
||||
|
||||
-- Create waypoint coordinate half way between us and the target.
|
||||
local waypointcoord=self.group:GetCoordinate():GetIntermediateCoordinate(mission:GetTargetCoordinate(), mission.missionFraction)
|
||||
local alt=waypointcoord.y
|
||||
|
||||
-- Add some randomization.
|
||||
waypointcoord=ZONE_RADIUS:New("Temp", waypointcoord:GetVec2(), 1000):GetRandomCoordinate():SetAltitude(alt, false)
|
||||
|
||||
-- Set altitude of mission waypoint.
|
||||
if mission.missionAltitude then
|
||||
waypointcoord:SetAltitude(mission.missionAltitude, true)
|
||||
end
|
||||
env.info(string.format("FF mission alt=%d meters", waypointcoord.y))
|
||||
-- Get coordinate where the mission is executed.
|
||||
local waypointcoord=mission:GetMissionWaypointCoord(self.group)
|
||||
|
||||
-- Add enroute tasks.
|
||||
for _,task in pairs(mission.enrouteTasks) do
|
||||
|
||||
Reference in New Issue
Block a user