Merge branch 'master' into develop

This commit is contained in:
Frank 2020-12-22 09:49:08 +01:00
commit 2175e9c0d6
2 changed files with 45 additions and 9 deletions

View File

@ -61,20 +61,35 @@
-- Set up your EWR system in the mission editor. Name the groups with common prefix like "Red EWR". Can be e.g. AWACS or a combination of AWACS and Search Radars like e.g. EWR 1L13 etc. -- Set up your EWR system in the mission editor. Name the groups with common prefix like "Red EWR". Can be e.g. AWACS or a combination of AWACS and Search Radars like e.g. EWR 1L13 etc.
-- [optional] Set up your HQ. Can be any group, e.g. a command vehicle. -- [optional] Set up your HQ. Can be any group, e.g. a command vehicle.
-- --
-- Start up your MANTIS -- # 1. Start up your MANTIS
-- --
-- `myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR",nil,"red",false)` -- `myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR",nil,"red",false)`
-- --
-- [optional] Use -- [optional] Use
--
-- * `MANTIS:SetEWRGrouping(radius)` -- * `MANTIS:SetEWRGrouping(radius)`
-- * `MANTIS:SetEWRRange(radius)` -- * `MANTIS:SetEWRRange(radius)`
-- * `MANTIS:SetSAMRadius(radius)` -- * `MANTIS:SetSAMRadius(radius)`
-- * `MANTIS:SetDetectInterval(interval)` -- * `MANTIS:SetDetectInterval(interval)`
-- * `MANTIS:SetAutoRelocate(hq, ewr)` -- * `MANTIS:SetAutoRelocate(hq, ewr)`
--
-- to fine-tune your setup. -- to fine-tune your setup.
-- --
-- `myredmantis:Start()` -- `myredmantis:Start()`
-- --
-- # 2. Default settings
--
-- By default, the following settings are active:
--
-- * checkradius = 25000 (meters) - SAMs will engage enemy flights, if they are within a 25km around each SAM site - `MANTIS:SetSAMRadius(radius)`
-- * grouping = 5000 (meters) - Detection (EWR) will group enemy flights to areas of 5km for tracking - `MANTIS:SetEWRGrouping(radius)`
-- * acceptrange = 80000 (meters) - Detection (EWR) will on consider flights inside a 80km radius - `MANTIS:SetEWRRange(radius)`
-- * detectinterval = 30 (seconds) - MANTIS will decide every 30 seconds which SAM to activate - `MANTIS:SetDetectInterval(interval)`
-- * engagerange = 75 (percent) - SAMs will only fire if flights are inside of a 75% radius of their max firerange - `MANTIS:SetSAMRange(range)`
-- * dynamic = false - Group filtering is set to once, i.e. newly added groups will not be part of the setup by default - `MANTIS:New(name,samprefix,ewrprefix,hq,coaltion,dynamic)`
-- * autorelocate = false - HQ and (mobile) EWR system will not relocate in random intervals between 30mins and 1 hour - `MANTIS:SetAutoRelocate(hq, ewr)`
-- * debug = false - Debugging reports on screen are set to off - `MANTIS:Debug(onoff)`
--
-- --
-- @field #MANTIS -- @field #MANTIS
MANTIS = { MANTIS = {
@ -115,7 +130,7 @@ do
--@return #MANTIS self --@return #MANTIS self
function MANTIS:New(name,samprefix,ewrprefix,hq,coaltion,dynamic) function MANTIS:New(name,samprefix,ewrprefix,hq,coaltion,dynamic)
-- TODO: Create some user functions for these -- DONE: Create some user functions for these
-- TODO: Make HQ useful -- TODO: Make HQ useful
-- TODO: Set SAMs to auto if EWR dies -- TODO: Set SAMs to auto if EWR dies
@ -136,7 +151,7 @@ do
self.verbose = false self.verbose = false
-- @field #string version -- @field #string version
self.version="0.2.5" self.version="0.2.6"
env.info(string.format("***** Starting MANTIS Version %s *****", self.version)) env.info(string.format("***** Starting MANTIS Version %s *****", self.version))
-- Set the string id for output to DCS.log file. -- Set the string id for output to DCS.log file.
@ -219,7 +234,7 @@ do
--- Function to set SAM firing engage range, 0-100 percent, e.g. 75 --- Function to set SAM firing engage range, 0-100 percent, e.g. 75
-- @param #MANTIS self -- @param #MANTIS self
-- @param #number range Percent of the max fire range -- @param #number range Percent of the max fire range
function MANTIS:SetSAMRadius(range) function MANTIS:SetSAMRange(range)
local range = range or 75 local range = range or 75
if range < 0 or range > 100 then if range < 0 or range > 100 then
range = 75 range = 75

View File

@ -15,7 +15,9 @@
-- --
-- === -- ===
-- --
-- ### Authors: **FlightControl** -- ### Authors: **FlightControl**, **applevangelist**
--
-- Last Update: Dec 2020
-- --
-- === -- ===
-- --
@ -52,7 +54,7 @@ SEAD = {
--- Creates the main object which is handling defensive actions for SA sites or moving SA vehicles. --- Creates the main object which is handling defensive actions for SA sites or moving SA vehicles.
-- When an anti radiation missile is fired (KH-58, KH-31P, KH-31A, KH-25MPU, HARM missiles), the SA will shut down their radars and will take evasive actions... -- When an anti radiation missile is fired (KH-58, KH-31P, KH-31A, KH-25MPU, HARM missiles), the SA will shut down their radars and will take evasive actions...
-- Chances are big that the missile will miss. -- Chances are big that the missile will miss.
-- @param table{string,...}|string SEADGroupPrefixes which is a table of Prefixes of the SA Groups in the DCSRTE on which evasive actions need to be taken. -- @param table{string,...}|string SEADGroupPrefixes which is a table of Prefixes of the SA Groups in the DCS mission editor on which evasive actions need to be taken.
-- @return SEAD -- @return SEAD
-- @usage -- @usage
-- -- CCCP SEAD Defenses -- -- CCCP SEAD Defenses
@ -68,14 +70,33 @@ function SEAD:New( SEADGroupPrefixes )
self.SEADGroupPrefixes[SEADGroupPrefix] = SEADGroupPrefix self.SEADGroupPrefixes[SEADGroupPrefix] = SEADGroupPrefix
end end
else else
self.SEADGroupNames[SEADGroupPrefixes] = SEADGroupPrefixes self.SEADGroupPrefixes[SEADGroupPrefixes] = SEADGroupPrefixes
end end
self:HandleEvent( EVENTS.Shot ) self:HandleEvent( EVENTS.Shot )
self:I("*** SEAD - Started Version 0.2.0") self:I("*** SEAD - Started Version 0.2.2")
return self return self
end end
--- Update the active SEAD Set
-- @param #SEAD self
-- @param #table SEADGroupPrefixes The prefixes to add, note: can also be a single #string
-- @return #SEAD self
function SEAD:UpdateSet( SEADGroupPrefixes )
self:F( SEADGroupPrefixes )
if type( SEADGroupPrefixes ) == 'table' then
for SEADGroupPrefixID, SEADGroupPrefix in pairs( SEADGroupPrefixes ) do
self.SEADGroupPrefixes[SEADGroupPrefix] = SEADGroupPrefix
end
else
self.SEADGroupPrefixes[SEADGroupPrefixes] = SEADGroupPrefixes
end
return self
end
--- Sets the engagement range of the SAMs. Defaults to 75% to make it more deadly. Feature Request #1355 --- Sets the engagement range of the SAMs. Defaults to 75% to make it more deadly. Feature Request #1355
-- @param #SEAD self -- @param #SEAD self
-- @param #number range Set the engagement range in percent, e.g. 50 -- @param #number range Set the engagement range in percent, e.g. 50