Merge branch 'FF/Ops' into FF/OpsDev

This commit is contained in:
Frank
2024-01-01 21:55:52 +01:00
57 changed files with 3538 additions and 1657 deletions

View File

@@ -302,7 +302,7 @@ end
--- Find the first(!) GROUP matching using patterns. Note that this is **a lot** slower than `:FindByName()`!
-- @param #GROUP self
-- @param #string Pattern The pattern to look for. Refer to [LUA patterns](http://www.easyuo.com/openeuo/wiki/index.php/Lua_Patterns_and_Captures_(Regular_Expressions)) for regular expressions in LUA.
-- @param #string Pattern The pattern to look for. Refer to [LUA patterns](http://www.easyuo.com/openeuo/wiki/index.php/Lua_Patterns_and_Captures_\(Regular_Expressions\)) for regular expressions in LUA.
-- @return #GROUP The GROUP.
-- @usage
-- -- Find a group with a partial group name
@@ -327,7 +327,7 @@ end
--- Find all GROUP objects matching using patterns. Note that this is **a lot** slower than `:FindByName()`!
-- @param #GROUP self
-- @param #string Pattern The pattern to look for. Refer to [LUA patterns](http://www.easyuo.com/openeuo/wiki/index.php/Lua_Patterns_and_Captures_(Regular_Expressions)) for regular expressions in LUA.
-- @param #string Pattern The pattern to look for. Refer to [LUA patterns](http://www.easyuo.com/openeuo/wiki/index.php/Lua_Patterns_and_Captures_\(Regular_Expressions\)) for regular expressions in LUA.
-- @return #table Groups Table of matching #GROUP objects found
-- @usage
-- -- Find all group with a partial group name
@@ -1177,6 +1177,7 @@ function GROUP:GetAverageCoordinate()
local coord = COORDINATE:NewFromVec3(vec3)
local Heading = self:GetHeading()
coord.Heading = Heading
return coord
else
BASE:E( { "Cannot GetAverageCoordinate", Group = self, Alive = self:IsAlive() } )
return nil
@@ -2782,7 +2783,7 @@ end
--- Switch on/off invisible flag for the group.
-- @param #GROUP self
-- @param #boolean switch If true, emission is enabled. If false, emission is disabled.
-- @param #boolean switch If true, Invisible is enabled. If false, Invisible is disabled.
-- @return #GROUP self
function GROUP:SetCommandInvisible(switch)
self:F2( self.GroupName )
@@ -2796,7 +2797,7 @@ end
--- Switch on/off immortal flag for the group.
-- @param #GROUP self
-- @param #boolean switch If true, emission is enabled. If false, emission is disabled.
-- @param #boolean switch If true, Immortal is enabled. If false, Immortal is disabled.
-- @return #GROUP self
function GROUP:SetCommandImmortal(switch)
self:F2( self.GroupName )
@@ -3002,3 +3003,36 @@ function GROUP:GetGroupSTN()
return tSTN,text
end
--- [GROUND] Determine if a GROUP is a SAM unit, i.e. has radar or optical tracker and is no mobile AAA.
-- @param #GROUP self
-- @return #boolean IsSAM True if SAM, else false
function GROUP:IsSAM()
local issam = false
local units = self:GetUnits()
for _,_unit in pairs(units or {}) do
local unit = _unit -- Wrapper.Unit#UNIT
if unit:HasSEAD() and unit:IsGround() and (not unit:HasAttribute("Mobile AAA")) then
issam = true
break
end
end
return issam
end
--- [GROUND] Determine if a GROUP has a AAA unit, i.e. has no radar or optical tracker but the AAA = true or the "Mobile AAA" = true attribute.
-- @param #GROUP self
-- @return #boolean IsSAM True if AAA, else false
function GROUP:IsAAA()
local issam = false
local units = self:GetUnits()
for _,_unit in pairs(units or {}) do
local unit = _unit -- Wrapper.Unit#UNIT
local desc = unit:GetDesc() or {}
local attr = desc.attributes or {}
if unit:HasSEAD() then return false end
if attr["AAA"] or attr["SAM related"] then
issam = true
end
end
return issam
end