From 1e1e0758f848d8e2bbb6238237c64d2a7f4e8844 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 11 Aug 2019 18:28:57 +0200 Subject: [PATCH] Update FlightGroup.lua --- Moose Development/Moose/Ops/FlightGroup.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index b5e82a8c6..9702a8f0e 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -62,6 +62,7 @@ FLIGHTGROUP.ElementStatus={ TAXIING="taxiing", AIRBORNE="airborne", LANDED="landed", + ARRIVED="arrived", DEAD="dead", } @@ -119,7 +120,7 @@ function FLIGHTGROUP:New(groupname) self.groupname=tostring(groupname) -- Set some string id for output to DCS.log file. - self.sid=string.format("FLIGHTGROUP %s |", self.groupname) + self.sid=string.format("FLIGHTGROUP %s | ", self.groupname) -- Start State. self:SetStartState("Stopped") @@ -201,6 +202,17 @@ function FLIGHTGROUP:New(groupname) return self end +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +-- User functions +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +--- Get set of decteded units. +-- @param #FLIGHTGROUP self +-- @return Core.Set#SET_UNIT Set of detected units. +function FLIGHTGROUP:GetDetectedUnits() + return self.detectedunits +end + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Start & Status ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -275,6 +287,7 @@ function FLIGHTGROUP:onafterFlightStatus(From, Event, To) local unitname=unit:GetName() if self.detectedunits:FindUnit(unitname) then -- Unit is already in the detected unit set. + self:I(self.sid..string.format("Detected unit %s is already known.", unitname)) else self:AddDetectedUnit(unit) end @@ -443,6 +456,7 @@ end -- @parma #string assignment The (optional) assignment for the asset. function FLIGHTGROUP:onafterAddDetectedUnit(From, Event, To, Unit) self:I(self.sid..string.format("Detected unit %s.", Unit:GetName())) + self.detectedunits:AddUnit(Unit) end