Next step of folder restructure

This commit is contained in:
kaltokri
2024-01-01 22:41:16 +01:00
parent 5aa1e1a63a
commit 286d2ed571
288 changed files with 6049 additions and 6049 deletions

View File

@@ -0,0 +1,24 @@
---
-- Name: DET-001 - Detection Areas
-- Author: FlightControl
-- Date Created: 04 Feb 2017
--
-- # Situation:
--
-- A small blue vehicle with laser detection methods is detecting targets.
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other.
--
-- # Test cases:
--
-- 1. Observe the flaring of the areas formed
-- 2. Observe the smoking of the units detected
-- 3. Observe the areas being flexibly changed very detection run.
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
-- 5. While driving in between the areas, it will have a separate area.
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection:__Start( 5 )

View File

@@ -0,0 +1,24 @@
---
-- Name: DET-001 - Detection Areas
-- Author: FlightControl
-- Date Created: 04 Feb 2017
--
-- # Situation:
--
-- A small blue vehicle with laser detection methods is detecting targets.
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other.
--
-- # Test cases:
--
-- 1. Observe the flaring of the areas formed
-- 2. Observe the smoking of the units detected
-- 3. Observe the areas being flexibly changed very detection run.
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
-- 5. While driving in between the areas, it will have a separate area.
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection:__Start( 5 )

View File

@@ -0,0 +1,56 @@
---
-- Name: DET-100 - Detection Probability Distance
-- Author: FlightControl
-- Date Created: 04 Feb 2017
--
-- # Situation:
--
-- Demonstrates the DistanceProbability factor during the detection of units.
--
-- Two JTAC are detecting 4 units, which are 10 km away.
-- The first JTAC has no DistanceProbability set.
-- The second JTAC has a DistanceProbability set.
--
-- # Test cases:
--
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
-- 2. Eventually all units should be detected by both JTAC.
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
RecceDetection1:Start()
RecceDetection2:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection1:OnAfterDetect(From,Event,To)
local DetectionReport = RecceDetection1:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
end
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection2:OnAfterDetect(From,Event,To)
local DetectionReport = RecceDetection2:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
end

View File

@@ -0,0 +1,9 @@
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 1000, 250 )
SeadClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
DestroyClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
FACReporting = FAC_REPORTING:New( FACClientSet, FACDetection )

View File

@@ -0,0 +1,62 @@
---
-- Name: DET-120 - Detection Probability Zones
-- Author: FlightControl
-- Date Created: 04 Feb 2017
--
-- # Situation:
--
-- Demonstrates the DistanceProbability factor during the detection of units.
--
-- Two JTAC are detecting 4 units, which are 10 km away.
-- The first JTAC has no DistanceProbability set.
-- The second JTAC has a DistanceProbability set.
--
-- # Test cases:
--
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
-- 2. Eventually all units should be detected by both JTAC.
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
ForestZone = ZONE_POLYGON:New( "ForestZone", GROUP:FindByName( "ForestZone" ) )
RecceDetection2:SetZoneProbability( { { ForestZone, 0.1 } } ) -- Set a 10% probability that a vehicle can be detected within the forest.
RecceDetection1:Start()
RecceDetection2:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection1:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No Zone Probability" )
end
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection2:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Forest Zone Probability" )
end
garbagecollect()

View File

@@ -0,0 +1,42 @@
---
-- Name: DET-200 - Detection UNITS
-- Author: FlightControl
-- Date Created: 13 Feb 2017
--
-- # Situation:
--
-- Demonstrates the detection of units.
--
-- A Set of Recce are detecting a large group of units, which are 5 km away.
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
-- The enemy is approaching.
--
-- # Test cases:
--
-- 1. Observe the detection reporting of both the Recce.
-- 2. Eventually all units should be detected by both Recce.
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
self:E("Detect")
local DetectionReport = RecceDetection:DetectedReportDetailed()
CC:MessageToAll( DetectionReport, 15, "" )
end

View File

@@ -0,0 +1,43 @@
---
-- Name: DET-201 - Detection UNITS - Air
-- Author: FlightControl
-- Date Created: 03 May 2017
--
-- # Situation:
--
-- Demonstrates the detection of units.
--
-- A Set of Recce are detecting a approaching airplanes.
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
-- The enemy is approaching.
--
-- # Test cases:
--
-- 1. Observe the detection reporting of both the Recce.
-- 2. Eventually all units should be detected by both Recce.
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
RecceDetection:InitDetectRadar(true)
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
self:E("Detect")
local DetectionReport = RecceDetection:DetectedReportDetailed()
CC:MessageToAll( DetectionReport, 15, "" )
end

View File

@@ -0,0 +1,42 @@
---
-- Name: DET-210 - Detection TYPES
-- Author: FlightControl
-- Date Created: 13 Feb 2017
--
-- # Situation:
--
-- Demonstrates the detection of units.
--
-- A Set of Recce are detecting a large group of units, which are 5 km away.
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
-- The enemy is approaching.
--
-- The blue Recce will report the detected units grouped per vehicle type!
--
-- # Test cases:
--
-- 1. Observe the detection reporting of both the Recce.
-- 2. Eventually all units should be detected by both Recce.
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = RecceDetection:DetectedReportDetailed()
CC:MessageToAll( DetectionReport, 15, "" )
end

View File

@@ -0,0 +1,58 @@
---
-- Name: DET-100 - Detection Probability Distance
-- Author: FlightControl
-- Date Created: 04 Feb 2017
--
-- # Situation:
--
-- Demonstrates the DistanceProbability factor during the detection of units.
--
-- Two JTAC are detecting 4 units, which are 10 km away.
-- The first JTAC has no DistanceProbability set.
-- The second JTAC has a DistanceProbability set.
--
-- # Test cases:
--
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
-- 2. Eventually all units should be detected by both JTAC.
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection1 = DETECTION_AREAS:New( RecceSetGroup1, 1000 )
RecceDetection1:BoundDetectedZones()
RecceDetection2 = DETECTION_AREAS:New( RecceSetGroup2, 1000 )
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
RecceDetection1:BoundDetectedZones()
RecceDetection1:Start()
RecceDetection2:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection1:OnAfterDetect(From,Event,To)
local DetectionReport = RecceDetection1:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
end
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection2:OnAfterDetect(From,Event,To)
local DetectionReport = RecceDetection2:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
end

View File

@@ -0,0 +1,46 @@
---
-- Name: DET-255 - Detection AEAS with Destroys
-- Author: FlightControl
-- Date Created: 06 Mar 2017
--
-- # Situation:
--
-- A small blue vehicle with laser detection methods is detecting targets.
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
-- This demo will group red vehicles in areas. One vehicle is diving from one group to the other.
-- After 30 seconds, one vehicle is destroyed in a zone.
-- After 60 seconds, a vehicle is destroyed that is a leader of a zone.
-- After 90 seconds, all vehicles are destroyed in a zone.
--
-- # Test cases:
--
-- 1. Observe the flaring of the areas formed
-- 2. Observe the smoking of the units detected
-- 3. Observe the areas being flexibly changed very detection run.
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
-- 5. While driving in between the areas, it will have a separate area.
-- 6. Observe the correct removal or relocation of the ZONEs.
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection:__Start( 5 )
SCHEDULER:New( nil,function()
local Target = UNIT:FindByName( "Target #004")
Target:Destroy()
end, {}, 30
)
SCHEDULER:New( nil,function()
local Target = UNIT:FindByName( "Target #006")
Target:Destroy()
end, {}, 60
)
SCHEDULER:New( nil,function()
local Target = UNIT:FindByName( "Target #007")
Target:Destroy()
end, {}, 90
)

View File

@@ -0,0 +1,36 @@
---
-- Name: DET-300 - Dectection Filter AIRPLANE
-- Author: FlightControl
-- Date Created: 12 Apr 2017
--
-- # Situation:
--
-- Demonstrates the filtering of detections.
--
-- # Test cases:
--
-- 1. Observe the reporting only detecting the airplane, not the other units.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.AIRPLANE )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
end
garbagecollect()

View File

@@ -0,0 +1,36 @@
---
-- Name: DET-301 - Dectection Filter GROUND_UNIT
-- Author: FlightControl
-- Date Created: 12 Apr 2017
--
-- # Situation:
--
-- Demonstrates the filtering of detections.
--
-- # Test cases:
--
-- 1. Observe the reporting only detecting the ground unit, not the other units.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.GROUND_UNIT )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
end
garbagecollect()

View File

@@ -0,0 +1,36 @@
---
-- Name: DET-302 - Dectection Filter HELICOPTER
-- Author: FlightControl
-- Date Created: 12 Apr 2017
--
-- # Situation:
--
-- Demonstrates the filtering of detections.
--
-- # Test cases:
--
-- 1. Observe the reporting only detecting the helicopter, not the other units.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.HELICOPTER )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
end
garbagecollect()

View File

@@ -0,0 +1,36 @@
---
-- Name: DET-303 - Dectection Filter SHIP
-- Author: FlightControl
-- Date Created: 12 Apr 2017
--
-- # Situation:
--
-- Demonstrates the filtering of detections.
--
-- # Test cases:
--
-- 1. Observe the reporting only detecting the ship, not the other units.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.SHIP )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
end
garbagecollect()

View File

@@ -0,0 +1,36 @@
---
-- Name: DET-304 - Dectection Filter STRUCTURE
-- Author: FlightControl
-- Date Created: 12 Apr 2017
--
-- # Situation:
--
-- Demonstrates the filtering of detections.
--
-- # Test cases:
--
-- 1. Observe the reporting only detecting the structure, not the other units.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.STRUCTURE )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
end
collectgarbage()

View File

@@ -0,0 +1,44 @@
---
-- Name: DET-305 - Dectection Filter ALL
-- Author: FlightControl
-- Date Created: 12 Apr 2017
--
-- # Situation:
--
-- Demonstrates the filtering of detections.
--
-- # Test cases:
--
-- 1. Observe the reporting detecting all the units regardless of the type.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS
:New( SetGroup )
:FilterCategories( {
Unit.Category.AIRPLANE,
Unit.Category.GROUND_UNIT,
Unit.Category.HELICOPTER,
Unit.Category.SHIP,
Unit.Category.STRUCTURE
} )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
end
garbagecollect()

View File

@@ -0,0 +1,40 @@
---
-- Name: DET-310 - EWR - Line Of Sight
-- Author: FlightControl
-- Date Created: 12 Sep 2018
--
-- # Situation:
--
-- Demonstrates the lost of line of sight using an airplane.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS
:New( SetGroup )
:FilterCategories( {
Unit.Category.AIRPLANE,
Unit.Category.GROUND_UNIT,
Unit.Category.HELICOPTER,
Unit.Category.SHIP,
Unit.Category.STRUCTURE
} )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
end
garbagecollect()

View File

@@ -0,0 +1,57 @@
---
-- Name: DET-310 - EWR - Line Of Sight
-- Author: FlightControl
-- Date Created: 12 Sep 2018
--
-- # Situation:
--
-- Demonstrates the lost of line of sight using an airplane.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_AREAS
:New( SetGroup, 1500 )
:FilterCategories( { Unit.Category.AIRPLANE } )
:InitDetectRWR(true)
local Zones = {
ZONE:New( "Zone1" ),
ZONE:New( "Zone2" )
}
local Sams = {
GROUP:FindByName( "SAM1" ),
GROUP:FindByName( "SAM2" )
}
RecceDetection:Start()
--- OnAfter Transition Handler for Event DetectedItem.
-- @param RecceDetection self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem)
local DetectionReport = self:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection" )
if DetectedItem.IsDetected then
local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE
for ZoneID, ZoneData in pairs( Zones ) do
local Zone = ZoneData -- Core.Zone#ZONE
if Zone:IsCoordinateInZone(Coordinate) then
Sams[ZoneID]:Activate()
end
end
end
end
garbagecollect()

View File

@@ -0,0 +1,49 @@
---
-- Name: DET-310 - EWR - Line Of Sight
-- Author: FlightControl
-- Date Created: 12 Sep 2018
--
-- # Situation:
--
-- Demonstrates the lost of line of sight using an airplane.
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_AREAS
:New( SetGroup, 1500 )
:FilterCategories( { Unit.Category.AIRPLANE } )
--:InitDetectVisual( true )
:InitDetectIRST( true )
:InitDetectRadar( true )
:InitDetectRWR( true )
:InitDetectOptical( true )
RecceDetection:Start()
_SETTINGS:SetA2A_BRAA()
_SETTINGS:SetA2G_BR()
--- OnAfter Transition Handler for Event DetectedItem.
-- @param Functional.Detection#DETECTION_AREAS RecceDetection self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem)
local DetectionReport = self:DetectedReportDetailed( SetGroup:GetFirst() )
HQ:MessageToAll( DetectionReport, 15, "Detection" )
if DetectedItem.IsDetected then
local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE
HQ:MessageToAll( "Detected", 15, "Detection" )
end
end
garbagecollect()

View File

@@ -0,0 +1,70 @@
---
-- Name: DET-500 - Handle Detected Event - Govern Artillery Demo
-- Author: FlightControl
-- Date Created: 13 Feb 2017
--
-- # Situation:
--
-- Demonstrates the detection of units.
--
-- A Set of Recces are detecting a large group of units, which are 5 km away.
-- Once the Recces detect the enemy, the artilley units are controlled and will fire a missile to the target.
--
-- # Test cases:
--
-- 1. Observe the detected reporting of the recces.
-- 2. When one Recce group detects a target, it will select an artillery unit and fire a missile.
-- 3. This will run until all Recces have eliminated the targets.
RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart()
ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart()
HQ = GROUP:FindByName( "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
RecceDetection:SetRefreshTimeInterval( 5 )
RecceDetection:Start()
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function RecceDetection:OnAfterDetect(From,Event,To)
local DetectionReport = RecceDetection:DetectedReportDetailed()
CC:GetPositionable():MessageToAll( DetectionReport, 15, "" )
end
local ArtilleryTime = {}
local ArtilleryAim = 180
--- OnAfter Transition Handler for Event Detect.
-- @param Functional.Detection#DETECTION_UNITS self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @param Wrapper.Unit#UNIT DetectedUnits
function RecceDetection:OnAfterDetected( From, Event, To, DetectedUnits )
self:E( { From, Event, To, DetectedUnits } )
for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
local Artillery = ArtillerySetGroup:GetRandom() -- Wrapper.Group#GROUP
if ArtilleryTime[Artillery] and ArtilleryTime[Artillery] <= timer.getTime() - ArtilleryAim then
ArtilleryTime[Artillery] = nil
end
if not ArtilleryTime[Artillery] then
local Task = Artillery:TaskFireAtPoint( DetectedUnit:GetVec2(), 500, 4 ) -- Fire 2 rockets to the target point.
Artillery:SetTask( Task, 0.5 )
ArtilleryTime[Artillery] = timer.getTime()
end
end
end

View File

@@ -0,0 +1,16 @@
---
-- Name: DET-600 - Detection Zones
-- Author: FlightControl
-- Date Created: 15 Mar 2019
--
-- # Situation:
--
-- 2 trigger zones are defined using the mission editor.
-- The detection algorithm will detect the units within the zones and report them.
DetectionSetZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone" } ):FilterOnce()
DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits()
DetectionZones:__Start( 5 )

View File

@@ -0,0 +1,18 @@
---
-- Name: DET-600 - Detection Zones
-- Author: FlightControl
-- Date Created: 15 Mar 2019
--
-- # Situation:
--
-- 2 trigger zones are defined using the mission editor.
-- The detection algorithm will detect the units within the zones and report them.
DetectionSetZones = SET_ZONE_GOAL:New():FilterPrefixes( { "Detection Zone" } ):FilterStart()
DetectionZone1 = ZONE_CAPTURE_COALITION:New( ZONE:New( "Detection Zone 1" ), coalition.side.RED )
DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits()
DetectionZones:__Start( 5 )

View File

@@ -0,0 +1,25 @@
---
-- Name: DET-900 - Detection Test with RED FACA
-- Author: FlightControl
-- Date Created: 06 Mar 2017
--
-- # Situation:
--
-- A red FACA is detecting targets while airborne.
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
-- This demo will group blue vehicles in areas.
-- Upon the detection capabilities of the red FACA, the blue vehicles will be grouped when detected.
-- All blue vehicles have ROE on hold.
--
-- # Test cases:
--
-- 1. Observe the tyres put around the detected areas formed
-- 2. Observe the smoking of the units detected
-- 3. Observe the areas being flexibly changed very detection run.
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 2000, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection:__Start( 5 )