Merge branch 'FF/Ops' into FF/OpsDev

This commit is contained in:
Frank
2024-06-19 07:53:54 +02:00
29 changed files with 1396 additions and 638 deletions

View File

@@ -722,6 +722,39 @@ AIRBASE.Sinai = {
["Wadi_al_Jandali"] = "Wadi al Jandali",
}
--- Airbases of the Kola map
--
-- * AIRBASE.Kola.Banak
-- * AIRBASE.Kola.Bas_100
-- * AIRBASE.Kola.Bodo
-- * AIRBASE.Kola.Jokkmokk
-- * AIRBASE.Kola.Kalixfors
-- * AIRBASE.Kola.Kemi_Tornio
-- * AIRBASE.Kola.Kiruna
-- * AIRBASE.Kola.Monchegorsk
-- * AIRBASE.Kola.Murmansk_International
-- * AIRBASE.Kola.Olenya
-- * AIRBASE.Kola.Rovaniemi
-- * AIRBASE.Kola.Severomorsk_1
-- * AIRBASE.Kola.Severomorsk_3
--
-- @field Kola
AIRBASE.Kola = {
["Banak"] = "Banak",
["Bas_100"] = "Bas 100",
["Bodo"] = "Bodo",
["Jokkmokk"] = "Jokkmokk",
["Kalixfors"] = "Kalixfors",
["Kemi_Tornio"] = "Kemi Tornio",
["Kiruna"] = "Kiruna",
["Monchegorsk"] = "Monchegorsk",
["Murmansk_International"] = "Murmansk International",
["Olenya"] = "Olenya",
["Rovaniemi"] = "Rovaniemi",
["Severomorsk_1"] = "Severomorsk-1",
["Severomorsk_3"] = "Severomorsk-3",
}
--- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".
-- @type AIRBASE.ParkingSpot
-- @field Core.Point#COORDINATE Coordinate Coordinate of the parking spot.

View File

@@ -367,7 +367,7 @@ function GROUP:GetDCSObject()
return DCSGroup
end
self:E(string.format("ERROR: Could not get DCS group object of group %s because DCS object could not be found!", tostring(self.GroupName)))
self:T2(string.format("ERROR: Could not get DCS group object of group %s because DCS object could not be found!", tostring(self.GroupName)))
return nil
end
@@ -1228,15 +1228,17 @@ function GROUP:GetCoordinate()
-- no luck, try the API way
local DCSGroup = Group.getByName(self.GroupName)
local DCSUnits = DCSGroup:getUnits() or {}
for _,_unit in pairs(DCSUnits) do
if Object.isExist(_unit) then
local position = _unit:getPosition()
local point = position.p ~= nil and position.p or _unit:GetPoint()
if point then
--self:I(point)
local coord = COORDINATE:NewFromVec3(point)
return coord
if DCSGroup then
local DCSUnits = DCSGroup:getUnits() or {}
for _,_unit in pairs(DCSUnits) do
if Object.isExist(_unit) then
local position = _unit:getPosition()
local point = position.p ~= nil and position.p or _unit:GetPoint()
if point then
--self:I(point)
local coord = COORDINATE:NewFromVec3(point)
return coord
end
end
end
end
@@ -1794,10 +1796,14 @@ end
--- Returns the group template from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).
-- @param #GROUP self
-- @return #table
-- @return #table Template table.
function GROUP:GetTemplate()
local GroupName = self:GetName()
return UTILS.DeepCopy( _DATABASE:GetGroupTemplate( GroupName ) )
local template=_DATABASE:GetGroupTemplate( GroupName )
if template then
return UTILS.DeepCopy( template )
end
return nil
end
--- Returns the group template route.points[] (the waypoints) from the global _DATABASE object (an instance of @{Core.Database#DATABASE}).

View File

@@ -40,6 +40,7 @@
-- @field #number coalition Coalition ID.
-- @field #number country Country ID.
-- @field DCS#Desc desc Descriptor table.
-- @field DCS#Desc guidance Missile guidance descriptor.
-- @field DCS#Unit launcher Launcher DCS unit.
-- @field Wrapper.Unit#UNIT launcherUnit Launcher Unit.
-- @field #string launcherName Name of launcher unit.
@@ -196,6 +197,9 @@ function WEAPON:New(WeaponObject)
if self:IsMissile() and self.desc.missileCategory then
self.categoryMissile=self.desc.missileCategory
if self.desc.guidance then
self.guidance = self.desc.guidance
end
end
-- Get type name.
@@ -667,6 +671,26 @@ function WEAPON:IsTorpedo()
return self.category==Weapon.Category.TORPEDO
end
--- Check if weapon is a Fox One missile (Radar Semi-Active).
-- @param #WEAPON self
-- @return #boolean If `true`, is a Fox One.
function WEAPON:IsFoxOne()
return self.guidance==Weapon.GuidanceType.RADAR_SEMI_ACTIVE
end
--- Check if weapon is a Fox Two missile (IR guided).
-- @param #WEAPON self
-- @return #boolean If `true`, is a Fox Two.
function WEAPON:IsFoxTwo()
return self.guidance==Weapon.GuidanceType.IR
end
--- Check if weapon is a Fox Three missile (Radar Active).
-- @param #WEAPON self
-- @return #boolean If `true`, is a Fox Three.
function WEAPON:IsFoxThree()
return self.guidance==Weapon.GuidanceType.RADAR_ACTIVE
end
--- Destroy the weapon object.
-- @param #WEAPON self