mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#GROUP
STNs
This commit is contained in:
parent
76493fb6d7
commit
73a62d3a1a
@ -2922,7 +2922,7 @@ function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations)
|
||||
return callsign
|
||||
end
|
||||
|
||||
---
|
||||
--- Set a GROUP to act as recovery tanker
|
||||
-- @param #GROUP self
|
||||
-- @param Wrapper.Group#GROUP CarrierGroup.
|
||||
-- @param #number Speed Speed in knots.
|
||||
@ -2948,3 +2948,36 @@ function GROUP:SetAsRecoveryTanker(CarrierGroup,Speed,ToKIAS,Altitude,Delay,Last
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get a list of Link16 S/TN data from a GROUP. Can (as of Nov 2023) be obtained from F-18, F-16, F-15E (not the user flyable one) and A-10C-II groups.
|
||||
-- @param #GROUP self
|
||||
-- @return #table Table of data entries, indexed by unit name, each entry is a table containing STN, VCL (voice call label), VCN (voice call number), and Lead (#boolean, if true it's the flight lead)
|
||||
-- @return #string Report Formatted report of all data
|
||||
function GROUP:GetGroupSTN()
|
||||
local tSTN = {} -- table
|
||||
local units = self:GetUnits()
|
||||
local gname = self:GetName()
|
||||
gname = string.gsub(gname,"(#%d+)$","")
|
||||
local report = REPORT:New()
|
||||
report:Add("Link16 S/TN Report")
|
||||
report:Add("Group: "..gname)
|
||||
report:Add("==================")
|
||||
for _,_unit in pairs(units) do
|
||||
local unit = _unit -- Wrapper.Unit#UNIT
|
||||
if unit and unit:IsAlive() then
|
||||
local STN, VCL, VCN, Lead = unit:GetSTN()
|
||||
local name = unit:GetName()
|
||||
tSTN[name] = {
|
||||
STN=STN,
|
||||
VCL=VCL,
|
||||
VCN=VCN,
|
||||
Lead=Lead,
|
||||
}
|
||||
local lead = Lead == true and "(*)" or ""
|
||||
report:Add(string.format("| %s%s %s %s",tostring(VCL),tostring(VCN),tostring(STN),lead))
|
||||
end
|
||||
end
|
||||
report:Add("==================")
|
||||
local text = report:Text()
|
||||
return tSTN,text
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user