Merge branch 'develop' into FF/Ops

This commit is contained in:
Frank
2025-06-10 21:58:38 +02:00
84 changed files with 1563 additions and 800 deletions

View File

@@ -12,27 +12,35 @@
-- @module Utilities.Utils
-- @image MOOSE.JPG
---
--- Smoke color enum `trigger.smokeColor`.
-- @type SMOKECOLOR
-- @field Green
-- @field Red
-- @field White
-- @field Orange
-- @field Blue
-- @field #number Green Green smoke (0)
-- @field #number Red Red smoke (1)
-- @field #number White White smoke (2)
-- @field #number Orange Orange smoke (3)
-- @field #number Blue Blue smoke (4)
SMOKECOLOR = trigger.smokeColor -- #SMOKECOLOR
---
--- Flare colur enum `trigger.flareColor`.
-- @type FLARECOLOR
-- @field Green
-- @field Red
-- @field White
-- @field Yellow
-- @field #number Green (0)
-- @field #number Red Red flare (1)
-- @field #number White White flare (2)
-- @field #number Yellow Yellow flare (3)
FLARECOLOR = trigger.flareColor -- #FLARECOLOR
--- Big smoke preset enum.
-- @type BIGSMOKEPRESET
-- @field #number SmallSmokeAndFire Small moke and fire (1)
-- @field #number MediumSmokeAndFire Medium smoke and fire (2)
-- @field #number LargeSmokeAndFire Large smoke and fire (3)
-- @field #number HugeSmokeAndFire Huge smoke and fire (4)
-- @field #number SmallSmoke Small smoke (5)
-- @field #number MediumSmoke Medium smoke (6)
-- @field #number LargeSmoke Large smoke (7)
-- @field #number HugeSmoke Huge smoke (8)
BIGSMOKEPRESET = {
SmallSmokeAndFire=1,
MediumSmokeAndFire=2,
@@ -351,7 +359,7 @@ end
-- @return #string Table as a string.
UTILS.OneLineSerialize = function( tbl ) -- serialization of a table all on a single line, no comments, made to replace old get_table_string function
lookup_table = {}
local lookup_table = {}
local function _Serialize( tbl )
@@ -490,7 +498,7 @@ end
--- Counts the number of elements in a table.
-- @param #table T Table to count
-- @return #int Number of elements in the table
-- @return #number Number of elements in the table
function UTILS.TableLength(T)
local count = 0
for _ in pairs(T or {}) do count = count + 1 end
@@ -1905,6 +1913,13 @@ end
function UTILS.GetReportingName(Typename)
local typename = string.lower(Typename)
-- special cases - Shark and Manstay have "A-50" in the name
if string.find(typename,"ka-50",1,true) then
return "Shark"
elseif string.find(typename,"a-50",1,true) then
return "Mainstay"
end
for name, value in pairs(ENUMS.ReportingName.NATO) do
local svalue = string.lower(value)
@@ -2137,9 +2152,9 @@ function UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, Rising, Tlocal)
local cosH = (cos(zenith) - (sinDec * sin(latitude))) / (cosDec * cos(latitude))
if rising and cosH > 1 then
return "N/S" -- The sun never rises on this location on the specified date
return "N/R" -- The sun never rises on this location on the specified date
elseif cosH < -1 then
return "N/R" -- The sun never sets on this location on the specified date
return "N/S" -- The sun never sets on this location on the specified date
end
-- Finish calculating H and convert into hours