mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
@@ -239,6 +239,13 @@ AIRBASE.Nevada = {
|
||||
-- * AIRBASE.Normandy.Broglie
|
||||
-- * AIRBASE.Normandy.Bernay_Saint_Martin
|
||||
-- * AIRBASE.Normandy.Saint_Andre_de_lEure
|
||||
-- * AIRBASE.Normandy.Biggin_Hill
|
||||
-- * AIRBASE.Normandy.Manston
|
||||
-- * AIRBASE.Normandy.Detling
|
||||
-- * AIRBASE.Normandy.Lympne
|
||||
-- * AIRBASE.Normandy.Abbeville_Drucat
|
||||
-- * AIRBASE.Normandy.Merville_Calonne
|
||||
-- * AIRBASE.Normandy.Saint_Omer_Wizernes
|
||||
--
|
||||
-- @field Normandy
|
||||
AIRBASE.Normandy = {
|
||||
@@ -311,7 +318,14 @@ AIRBASE.Normandy = {
|
||||
["Beaumont_le_Roger"] = "Beaumont-le-Roger",
|
||||
["Broglie"] = "Broglie",
|
||||
["Bernay_Saint_Martin"] = "Bernay Saint Martin",
|
||||
["Saint_Andre_de_lEure"] = "Saint-Andre-de-lEure",
|
||||
["Saint_Andre_de_lEure"] = "Saint-Andre-de-lEure",
|
||||
["Biggin_Hill"] = "Biggin Hill",
|
||||
["Manston"] = "Manston",
|
||||
["Detling"] = "Detling",
|
||||
["Lympne"] = "Lympne",
|
||||
["Abbeville_Drucat"] = "Abbeville Drucat",
|
||||
["Merville_Calonne"] = "Merville Calonne",
|
||||
["Saint_Omer_Wizernes"] = "Saint-Omer Wizernes",
|
||||
}
|
||||
|
||||
--- Airbases of the Persion Gulf Map:
|
||||
|
||||
@@ -3974,7 +3974,7 @@ function CONTROLLABLE:OptionAAAttackRange( range )
|
||||
local Controller = self:_GetController()
|
||||
if Controller then
|
||||
if self:IsAir() then
|
||||
self:SetOption( AI.Option.Air.val.MISSILE_ATTACK, range )
|
||||
self:SetOption( AI.Option.Air.id.MISSILE_ATTACK, range )
|
||||
end
|
||||
end
|
||||
return self
|
||||
|
||||
@@ -2924,7 +2924,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.
|
||||
@@ -2950,3 +2950,37 @@ 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
|
||||
|
||||
|
||||
@@ -1659,3 +1659,36 @@ function UNIT:GetSkill()
|
||||
local skill = _DATABASE.Templates.Units[name].Template.skill or "Random"
|
||||
return skill
|
||||
end
|
||||
|
||||
--- Get Link16 STN or SADL TN and other datalink info from Unit, if any.
|
||||
-- @param #UNIT self
|
||||
-- @return #string STN STN or TN Octal as string, or nil if not set/capable.
|
||||
-- @return #string VCL Voice Callsign Label or nil if not set/capable.
|
||||
-- @return #string VCN Voice Callsign Number or nil if not set/capable.
|
||||
-- @return #string Lead If true, unit is Flight Lead, else false or nil.
|
||||
function UNIT:GetSTN()
|
||||
self:F2(self.UnitName)
|
||||
local STN = nil -- STN/TN
|
||||
local VCL = nil -- VoiceCallsignLabel
|
||||
local VCN = nil -- VoiceCallsignNumber
|
||||
local FGL = false -- FlightGroupLeader
|
||||
local template = self:GetTemplate()
|
||||
if template.AddPropAircraft then
|
||||
if template.AddPropAircraft.STN_L16 then
|
||||
STN = template.AddPropAircraft.STN_L16
|
||||
elseif template.AddPropAircraft.SADL_TN then
|
||||
STN = template.AddPropAircraft.SADL_TN
|
||||
end
|
||||
VCN = template.AddPropAircraft.VoiceCallsignNumber
|
||||
VCL = template.AddPropAircraft.VoiceCallsignLabel
|
||||
end
|
||||
if template.datalinks and template.datalinks.Link16 and template.datalinks.Link16.settings then
|
||||
FGL = template.datalinks.Link16.settings.flightLead
|
||||
end
|
||||
-- A10CII
|
||||
if template.datalinks and template.datalinks.SADL and template.datalinks.SADL.settings then
|
||||
FGL = template.datalinks.SADL.settings.flightLead
|
||||
end
|
||||
|
||||
return STN, VCL, VCN, FGL
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user