mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
commit
f8e5efc874
@ -98,6 +98,7 @@ INTEL = {
|
|||||||
clusterradius = 15000,
|
clusterradius = 15000,
|
||||||
clusteranalysis = true,
|
clusteranalysis = true,
|
||||||
clustermarkers = false,
|
clustermarkers = false,
|
||||||
|
clusterarrows = false,
|
||||||
prediction = 300,
|
prediction = 300,
|
||||||
detectStatics = false,
|
detectStatics = false,
|
||||||
}
|
}
|
||||||
@ -528,10 +529,12 @@ end
|
|||||||
-- @param #INTEL self
|
-- @param #INTEL self
|
||||||
-- @param #boolean Switch If true, enable cluster analysis.
|
-- @param #boolean Switch If true, enable cluster analysis.
|
||||||
-- @param #boolean Markers If true, place markers on F10 map.
|
-- @param #boolean Markers If true, place markers on F10 map.
|
||||||
|
-- @param #boolean Arrows If true, draws arrows on F10 map.
|
||||||
-- @return #INTEL self
|
-- @return #INTEL self
|
||||||
function INTEL:SetClusterAnalysis(Switch, Markers)
|
function INTEL:SetClusterAnalysis(Switch, Markers, Arrows)
|
||||||
self.clusteranalysis=Switch
|
self.clusteranalysis=Switch
|
||||||
self.clustermarkers=Markers
|
self.clustermarkers=Markers
|
||||||
|
self.clusterarrows=Arrows
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1760,7 +1763,7 @@ function INTEL:CalcClusterFuturePosition(cluster, seconds)
|
|||||||
local futureposition=COORDINATE:NewFromVec3(Vec3)
|
local futureposition=COORDINATE:NewFromVec3(Vec3)
|
||||||
|
|
||||||
-- Create an arrow pointing in the direction of the movement.
|
-- Create an arrow pointing in the direction of the movement.
|
||||||
if self.clustermarkers and self.verbose>1 then
|
if self.clustermarkers and self.clusterarrows then
|
||||||
if cluster.markerID then
|
if cluster.markerID then
|
||||||
COORDINATE:RemoveMark(cluster.markerID)
|
COORDINATE:RemoveMark(cluster.markerID)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -702,14 +702,25 @@ function GROUP:GetUnit( UnitNumber )
|
|||||||
|
|
||||||
if DCSGroup then
|
if DCSGroup then
|
||||||
|
|
||||||
local DCSUnit = DCSGroup:getUnit( UnitNumber )
|
local UnitFound = nil
|
||||||
|
-- 2.7.1 dead event bug, return the first alive unit instead
|
||||||
|
local units = DCSGroup:getUnits() or {}
|
||||||
|
|
||||||
local UnitFound = UNIT:Find(DCSUnit)
|
for _,_unit in pairs(units) do
|
||||||
|
|
||||||
|
local UnitFound = UNIT:Find(_unit)
|
||||||
|
|
||||||
|
if UnitFound then
|
||||||
|
|
||||||
|
return UnitFound
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return UnitFound
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the DCS Unit with number UnitNumber.
|
--- Returns the DCS Unit with number UnitNumber.
|
||||||
@ -1105,11 +1116,11 @@ function GROUP:GetHeading()
|
|||||||
|
|
||||||
local GroupSize = self:GetSize()
|
local GroupSize = self:GetSize()
|
||||||
local HeadingAccumulator = 0
|
local HeadingAccumulator = 0
|
||||||
|
|
||||||
local n=0
|
local n=0
|
||||||
|
local Units = self:GetUnits()
|
||||||
|
|
||||||
if GroupSize then
|
if GroupSize then
|
||||||
for i = 1, GroupSize do
|
for _,unit in pairs(Units) do
|
||||||
local unit=self:GetUnit(i)
|
|
||||||
if unit and unit:IsAlive() then
|
if unit and unit:IsAlive() then
|
||||||
HeadingAccumulator = HeadingAccumulator + unit:GetHeading()
|
HeadingAccumulator = HeadingAccumulator + unit:GetHeading()
|
||||||
n=n+1
|
n=n+1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user