mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-22 06:45:20 +00:00
Update FlightGroup.lua
This commit is contained in:
@@ -2211,10 +2211,14 @@ function FLIGHTGROUP:_UpdateRoute(n)
|
|||||||
|
|
||||||
local wp={}
|
local wp={}
|
||||||
|
|
||||||
|
-- Set current waypoint or we get problem that the _PassingWaypoint function is triggered too early, i.e. right now and not when passing the next WP.
|
||||||
|
local current=self.group:GetCoordinate():WaypointAir(nil,COORDINATE.WaypointType.TurningPoint,COORDINATE.WaypointAction.TurningPoint, 350, true, nil, {}, "Current")
|
||||||
|
table.insert(wp, current)
|
||||||
|
|
||||||
-- Set "remaining" waypoits.
|
-- Set "remaining" waypoits.
|
||||||
for i=n, #self.waypoints do
|
for i=n, #self.waypoints do
|
||||||
local w=self.waypoints[i]
|
local w=self.waypoints[i]
|
||||||
self:GetWaypointCoordinate(w):MarkToAll(string.format("Waypoint %d", i))
|
self:GetWaypointCoordinate(w):MarkToAll(string.format("UpdateRoute Waypoint %d", i))
|
||||||
table.insert(wp, w)
|
table.insert(wp, w)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2354,7 +2358,7 @@ function FLIGHTGROUP:InitWaypoints(waypoints)
|
|||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
if self.Debug then
|
if self.Debug then
|
||||||
coord:MarkToAll(string.format("Flight %s waypoint %d, Speed=%.1f knots", self.groupname, i, UTILS.MpsToKnots(point.speed)))
|
--coord:MarkToAll(string.format("Flight %s waypoint %d, Speed=%.1f knots", self.groupname, i, UTILS.MpsToKnots(point.speed)))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -2383,7 +2387,7 @@ function FLIGHTGROUP:AddWaypointAir(wpnumber, coordinate, speed)
|
|||||||
local wp=coordinate:WaypointAir(COORDINATE.WaypointAltType.BARO, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, speedkmh, true)
|
local wp=coordinate:WaypointAir(COORDINATE.WaypointAltType.BARO, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, speedkmh, true)
|
||||||
|
|
||||||
local text=string.format("Adding waypoint %d, speed=%.1f knots", wpnumber, speed)
|
local text=string.format("Adding waypoint %d, speed=%.1f knots", wpnumber, speed)
|
||||||
coordinate:MarkToAll(text)
|
--coordinate:MarkToAll(text)
|
||||||
|
|
||||||
-- Add to table.
|
-- Add to table.
|
||||||
table.insert(self.waypoints, wpnumber, wp)
|
table.insert(self.waypoints, wpnumber, wp)
|
||||||
@@ -2452,7 +2456,7 @@ function FLIGHTGROUP:_AllSimilarStatus(status)
|
|||||||
for _,_element in pairs(self.elements) do
|
for _,_element in pairs(self.elements) do
|
||||||
local element=_element --#FLIGHTGROUP.Element
|
local element=_element --#FLIGHTGROUP.Element
|
||||||
|
|
||||||
self:I(string.format("FF status=%s, element %s status=%s", status, element.name, element.status))
|
self:T(self.sid..string.format("Status=%s, element %s status=%s", status, element.name, element.status))
|
||||||
|
|
||||||
-- Dead units dont count ==> We wont return false for those.
|
-- Dead units dont count ==> We wont return false for those.
|
||||||
if element.status~=FLIGHTGROUP.ElementStatus.DEAD then
|
if element.status~=FLIGHTGROUP.ElementStatus.DEAD then
|
||||||
@@ -2492,7 +2496,7 @@ function FLIGHTGROUP:_AllSimilarStatus(status)
|
|||||||
(element.status==FLIGHTGROUP.ElementStatus.SPAWNED or
|
(element.status==FLIGHTGROUP.ElementStatus.SPAWNED or
|
||||||
element.status==FLIGHTGROUP.ElementStatus.PARKING or
|
element.status==FLIGHTGROUP.ElementStatus.PARKING or
|
||||||
element.status==FLIGHTGROUP.ElementStatus.TAXIING) then
|
element.status==FLIGHTGROUP.ElementStatus.TAXIING) then
|
||||||
self:I(string.format("FF status=%s, element %s status=%s ==> returning FALSE", status, element.name, element.status))
|
self:T(self.sid..string.format("Status=%s, element %s status=%s ==> returning FALSE", status, element.name, element.status))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2534,10 +2538,8 @@ function FLIGHTGROUP:_AllSimilarStatus(status)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self:I(string.format("FF status=%s ==> returning TRUE", status))
|
self:T(self.sid..string.format("Status=%s ==> returning TRUE", status))
|
||||||
if status==FLIGHTGROUP.ElementStatus.TAKEOFF then
|
|
||||||
--self:I(string.format("FF returning true"))
|
|
||||||
end
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user