mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #1118 from FlightControl-Master/FF/Develop
AIRBOSS v0.9.3
This commit is contained in:
commit
3a49f2258b
@ -110,6 +110,7 @@
|
|||||||
-- @field #AIRBOSS.Radio MarshalRadio Radio for carrier calls.
|
-- @field #AIRBOSS.Radio MarshalRadio Radio for carrier calls.
|
||||||
-- @field #number MarshalFreq Marshal radio frequency in MHz.
|
-- @field #number MarshalFreq Marshal radio frequency in MHz.
|
||||||
-- @field #string MarshalModu Marshal radio modulation "AM" or "FM".
|
-- @field #string MarshalModu Marshal radio modulation "AM" or "FM".
|
||||||
|
-- @field #number TowerFreq Tower radio frequency in MHz.
|
||||||
-- @field Core.Scheduler#SCHEDULER radiotimer Radio queue scheduler.
|
-- @field Core.Scheduler#SCHEDULER radiotimer Radio queue scheduler.
|
||||||
-- @field Core.Zone#ZONE_UNIT zoneCCA Carrier controlled area (CCA), i.e. a zone of 50 NM radius around the carrier.
|
-- @field Core.Zone#ZONE_UNIT zoneCCA Carrier controlled area (CCA), i.e. a zone of 50 NM radius around the carrier.
|
||||||
-- @field Core.Zone#ZONE_UNIT zoneCCZ Carrier controlled zone (CCZ), i.e. a zone of 5 NM radius around the carrier.
|
-- @field Core.Zone#ZONE_UNIT zoneCCZ Carrier controlled zone (CCZ), i.e. a zone of 5 NM radius around the carrier.
|
||||||
@ -172,6 +173,7 @@
|
|||||||
-- @field #boolean detour If true, carrier is currently making a detour from its path along the ME waypoints.
|
-- @field #boolean detour If true, carrier is currently making a detour from its path along the ME waypoints.
|
||||||
-- @field Core.Point#COORDINATE Creturnto Position to return to after turn into the wind leg is over.
|
-- @field Core.Point#COORDINATE Creturnto Position to return to after turn into the wind leg is over.
|
||||||
-- @field Core.Set#SET_GROUP squadsetAI AI groups in this set will be handled by the airboss.
|
-- @field Core.Set#SET_GROUP squadsetAI AI groups in this set will be handled by the airboss.
|
||||||
|
-- @field Core.Set#SET_GROUP excludesetAI AI groups in this set will be explicitly excluded from handling by the airboss and not forced into the Marshal pattern.
|
||||||
-- @field #boolean menusingle If true, menu is optimized for a single carrier.
|
-- @field #boolean menusingle If true, menu is optimized for a single carrier.
|
||||||
-- @field #number collisiondist Distance up to which collision checks are done.
|
-- @field #number collisiondist Distance up to which collision checks are done.
|
||||||
-- @field #number Tmessage Default duration in seconds messages are displayed to players.
|
-- @field #number Tmessage Default duration in seconds messages are displayed to players.
|
||||||
@ -836,6 +838,7 @@ AIRBOSS = {
|
|||||||
MarshalRadio = nil,
|
MarshalRadio = nil,
|
||||||
MarshalFreq = nil,
|
MarshalFreq = nil,
|
||||||
MarshalModu = nil,
|
MarshalModu = nil,
|
||||||
|
TowerFreq = nil,
|
||||||
radiotimer = nil,
|
radiotimer = nil,
|
||||||
zoneCCA = nil,
|
zoneCCA = nil,
|
||||||
zoneCCZ = nil,
|
zoneCCZ = nil,
|
||||||
@ -897,6 +900,7 @@ AIRBOSS = {
|
|||||||
turnintowind = nil,
|
turnintowind = nil,
|
||||||
detour = nil,
|
detour = nil,
|
||||||
squadsetAI = nil,
|
squadsetAI = nil,
|
||||||
|
excludesetAI = nil,
|
||||||
menusingle = nil,
|
menusingle = nil,
|
||||||
collisiondist = nil,
|
collisiondist = nil,
|
||||||
Tmessage = nil,
|
Tmessage = nil,
|
||||||
@ -1681,6 +1685,9 @@ function AIRBOSS:New(carriername, alias)
|
|||||||
-- Create carrier beacon.
|
-- Create carrier beacon.
|
||||||
self.beacon=BEACON:New(self.carrier)
|
self.beacon=BEACON:New(self.carrier)
|
||||||
|
|
||||||
|
-- Set Tower Frequency of carrier.
|
||||||
|
self:_GetTowerFrequency()
|
||||||
|
|
||||||
-- Init player scores table.
|
-- Init player scores table.
|
||||||
self.playerscores={}
|
self.playerscores={}
|
||||||
|
|
||||||
@ -2217,6 +2224,15 @@ function AIRBOSS:SetSquadronAI(setgroup)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Define a set of AI groups that excluded from AI handling. Members of this set will be left allone by the airboss and not forced into the Marshal pattern.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
-- @param Core.Set#SET_GROUP setgroup The set of AI groups which are excluded.
|
||||||
|
-- @return #AIRBOSS self
|
||||||
|
function AIRBOSS:SetExcludeAI(setgroup)
|
||||||
|
self.excludesetAI=setgroup
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Close currently running recovery window and stop recovery ops. Recovery window is deleted.
|
--- Close currently running recovery window and stop recovery ops. Recovery window is deleted.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
-- @param #number delay (Optional) Delay in seconds before the window is deleted.
|
-- @param #number delay (Optional) Delay in seconds before the window is deleted.
|
||||||
@ -4119,8 +4135,10 @@ function AIRBOSS:_ScanCarrierZone()
|
|||||||
-- Check if flight is AI and if we want to handle it at all.
|
-- Check if flight is AI and if we want to handle it at all.
|
||||||
if knownflight.ai and self.handleai then
|
if knownflight.ai and self.handleai then
|
||||||
|
|
||||||
-- Check if AI group is part of the group set if a set was defined.
|
-- Defines if AI group should be handled by the airboss.
|
||||||
local iscarriersquad=true
|
local iscarriersquad=true
|
||||||
|
|
||||||
|
-- Check if AI group is part of the group set if a set was defined.
|
||||||
if self.squadsetAI then
|
if self.squadsetAI then
|
||||||
local group=self.squadsetAI:FindGroup(groupname)
|
local group=self.squadsetAI:FindGroup(groupname)
|
||||||
if group then
|
if group then
|
||||||
@ -4129,6 +4147,15 @@ function AIRBOSS:_ScanCarrierZone()
|
|||||||
iscarriersquad=false
|
iscarriersquad=false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check if group was explicitly excluded.
|
||||||
|
if self.excludesetAI then
|
||||||
|
local group=self.excludesetAI:FindGroup(groupname)
|
||||||
|
if group then
|
||||||
|
iscarriersquad=false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Get distance to carrier.
|
-- Get distance to carrier.
|
||||||
local dist=knownflight.group:GetCoordinate():Get2DDistance(self:GetCoordinate())
|
local dist=knownflight.group:GetCoordinate():Get2DDistance(self:GetCoordinate())
|
||||||
@ -10449,6 +10476,25 @@ function AIRBOSS:_GetOnboardNumbers(group, playeronly)
|
|||||||
return numbers
|
return numbers
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get Tower frequency of carrier.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
function AIRBOSS:_GetTowerFrequency()
|
||||||
|
|
||||||
|
-- Tower frequency in MHz
|
||||||
|
self.TowerFreq=0
|
||||||
|
|
||||||
|
-- Get Template of Strike Group
|
||||||
|
local striketemplate=self.carrier:GetGroup():GetTemplate()
|
||||||
|
|
||||||
|
-- Find the carrier unit.
|
||||||
|
for _,unit in pairs(striketemplate.units) do
|
||||||
|
if self.carrier:GetName()==unit.name then
|
||||||
|
self.TowerFreq=unit.frequency/1000000
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- Check if aircraft is capable of landing on an aircraft carrier.
|
--- Check if aircraft is capable of landing on an aircraft carrier.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
-- @param Wrapper.Unit#UNIT unit Aircraft unit. (Will also work with groups as given parameter.)
|
-- @param Wrapper.Unit#UNIT unit Aircraft unit. (Will also work with groups as given parameter.)
|
||||||
@ -12268,6 +12314,8 @@ function AIRBOSS:_DisplayQueue(_unitname, queue, qname)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Report information about carrier.
|
--- Report information about carrier.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
-- @param #string _unitname Name of the player unit.
|
-- @param #string _unitname Name of the player unit.
|
||||||
@ -12292,7 +12340,7 @@ function AIRBOSS:_DisplayCarrierInfo(_unitname)
|
|||||||
local carrierheading=self.carrier:GetHeading()
|
local carrierheading=self.carrier:GetHeading()
|
||||||
local carrierspeed=UTILS.MpsToKnots(self.carrier:GetVelocityMPS())
|
local carrierspeed=UTILS.MpsToKnots(self.carrier:GetVelocityMPS())
|
||||||
|
|
||||||
-- Tacan/ICLS.
|
-- TACAN/ICLS.
|
||||||
local tacan="unknown"
|
local tacan="unknown"
|
||||||
local icls="unknown"
|
local icls="unknown"
|
||||||
if self.TACANon and self.TACANchannel~=nil then
|
if self.TACANon and self.TACANchannel~=nil then
|
||||||
@ -12357,6 +12405,7 @@ function AIRBOSS:_DisplayCarrierInfo(_unitname)
|
|||||||
text=text..string.format("BRC %03d°\n", self:GetBRC())
|
text=text..string.format("BRC %03d°\n", self:GetBRC())
|
||||||
text=text..string.format("FB %03d°\n", self:GetFinalBearing(true))
|
text=text..string.format("FB %03d°\n", self:GetFinalBearing(true))
|
||||||
text=text..string.format("Speed %d kts\n", carrierspeed)
|
text=text..string.format("Speed %d kts\n", carrierspeed)
|
||||||
|
text=text..string.format("Tower frequency %.3f MHz\n", self.TowerFreq)
|
||||||
text=text..string.format("Marshal radio %.3f MHz\n", self.MarshalFreq)
|
text=text..string.format("Marshal radio %.3f MHz\n", self.MarshalFreq)
|
||||||
text=text..string.format("LSO radio %.3f MHz\n", self.LSOFreq)
|
text=text..string.format("LSO radio %.3f MHz\n", self.LSOFreq)
|
||||||
text=text..string.format("TACAN Channel %s\n", tacan)
|
text=text..string.format("TACAN Channel %s\n", tacan)
|
||||||
|
|||||||
@ -59,10 +59,6 @@ DCSMAP = {
|
|||||||
|
|
||||||
--- See [DCS_enum_callsigns](https://wiki.hoggitworld.com/view/DCS_enum_callsigns)
|
--- See [DCS_enum_callsigns](https://wiki.hoggitworld.com/view/DCS_enum_callsigns)
|
||||||
-- @type CALLSIGN
|
-- @type CALLSIGN
|
||||||
-- @field #table Aircraft Aircraft callsigns.
|
|
||||||
-- @field #table AWACS AWACS callsigns.
|
|
||||||
-- @field #table Tanker Tanker callsigns.
|
|
||||||
-- @field #table JTAC JTAC callsigns.
|
|
||||||
CALLSIGN={
|
CALLSIGN={
|
||||||
-- Aircraft
|
-- Aircraft
|
||||||
Aircraft={
|
Aircraft={
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user