mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
baf7123364
@ -1744,7 +1744,7 @@ end
|
||||
function CTLD:_GenerateUHFrequencies()
|
||||
self:T(self.lid .. " _GenerateUHFrequencies")
|
||||
self.FreeUHFFrequencies = {}
|
||||
self.FreeUHFFrequencies = UTILS.GenerateUHFrequencies()
|
||||
self.FreeUHFFrequencies = UTILS.GenerateUHFrequencies(243,320)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@ -2271,20 +2271,36 @@ function UTILS.GenerateVHFrequencies()
|
||||
return FreeVHFFrequencies
|
||||
end
|
||||
|
||||
--- Function to generate valid UHF Frequencies in mHz (AM).
|
||||
--- Function to generate valid UHF Frequencies in mHz (AM). Can be between 220 and 399 mHz. 243 is auto-excluded.
|
||||
-- @param Start (Optional) Avoid frequencies between Start and End in mHz, e.g. 244
|
||||
-- @param End (Optional) Avoid frequencies between Start and End in mHz, e.g. 320
|
||||
-- @return #table UHF Frequencies
|
||||
function UTILS.GenerateUHFrequencies()
|
||||
function UTILS.GenerateUHFrequencies(Start,End)
|
||||
|
||||
local FreeUHFFrequencies = {}
|
||||
local _start = 220000000
|
||||
|
||||
while _start < 399000000 do
|
||||
if _start ~= 243000000 then
|
||||
table.insert(FreeUHFFrequencies, _start)
|
||||
end
|
||||
_start = _start + 500000
|
||||
if not Start then
|
||||
while _start < 399000000 do
|
||||
if _start ~= 243000000 then
|
||||
table.insert(FreeUHFFrequencies, _start)
|
||||
end
|
||||
_start = _start + 500000
|
||||
end
|
||||
else
|
||||
local End = End*1000000 or 399000000
|
||||
local Start = Start*1000000 or 220000000
|
||||
|
||||
while _start < 399000000 do
|
||||
if _start ~= 243000000 and _start < Start and _start > End then
|
||||
table.insert(FreeUHFFrequencies, _start)
|
||||
end
|
||||
_start = _start + 500000
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
return FreeUHFFrequencies
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user