mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-14 23:17:56 +00:00
Update FlightGroup.lua
This commit is contained in:
@@ -62,6 +62,7 @@ FLIGHTGROUP.ElementStatus={
|
|||||||
TAXIING="taxiing",
|
TAXIING="taxiing",
|
||||||
AIRBORNE="airborne",
|
AIRBORNE="airborne",
|
||||||
LANDED="landed",
|
LANDED="landed",
|
||||||
|
ARRIVED="arrived",
|
||||||
DEAD="dead",
|
DEAD="dead",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +120,7 @@ function FLIGHTGROUP:New(groupname)
|
|||||||
self.groupname=tostring(groupname)
|
self.groupname=tostring(groupname)
|
||||||
|
|
||||||
-- Set some string id for output to DCS.log file.
|
-- 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.
|
-- Start State.
|
||||||
self:SetStartState("Stopped")
|
self:SetStartState("Stopped")
|
||||||
@@ -201,6 +202,17 @@ function FLIGHTGROUP:New(groupname)
|
|||||||
return self
|
return self
|
||||||
end
|
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
|
-- Start & Status
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -275,6 +287,7 @@ function FLIGHTGROUP:onafterFlightStatus(From, Event, To)
|
|||||||
local unitname=unit:GetName()
|
local unitname=unit:GetName()
|
||||||
if self.detectedunits:FindUnit(unitname) then
|
if self.detectedunits:FindUnit(unitname) then
|
||||||
-- Unit is already in the detected unit set.
|
-- Unit is already in the detected unit set.
|
||||||
|
self:I(self.sid..string.format("Detected unit %s is already known.", unitname))
|
||||||
else
|
else
|
||||||
self:AddDetectedUnit(unit)
|
self:AddDetectedUnit(unit)
|
||||||
end
|
end
|
||||||
@@ -443,6 +456,7 @@ end
|
|||||||
-- @parma #string assignment The (optional) assignment for the asset.
|
-- @parma #string assignment The (optional) assignment for the asset.
|
||||||
function FLIGHTGROUP:onafterAddDetectedUnit(From, Event, To, Unit)
|
function FLIGHTGROUP:onafterAddDetectedUnit(From, Event, To, Unit)
|
||||||
self:I(self.sid..string.format("Detected unit %s.", Unit:GetName()))
|
self:I(self.sid..string.format("Detected unit %s.", Unit:GetName()))
|
||||||
|
self.detectedunits:AddUnit(Unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user