mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Modified implementation of RADIO:NewTransmission() to make parameters optional
This commit is contained in:
parent
2437e45eec
commit
1a45b2bd44
@ -30,15 +30,17 @@ MESSAGE = {
|
|||||||
SubtitleDuration = ""
|
SubtitleDuration = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- @TODO Manage Trace in all functions below
|
||||||
|
|
||||||
--- Create a new RADIO Object. This doesn't broadcast a transmission, though, use @{Radio#RADIO.Broadcast} to actually broadcast
|
--- Create a new RADIO Object. This doesn't broadcast a transmission, though, use @{Radio#RADIO.Broadcast} to actually broadcast
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param
|
-- @param #IDENTIFIABLE Identifiable
|
||||||
-- @return #RADIO
|
-- @return self
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- If you want to create a RADIO, you probably should use @{Identifiable#IDENIFIABLE.GetRadio}
|
-- -- If you want to create a RADIO, you probably should use @{Identifiable#IDENIFIABLE.GetRadio}
|
||||||
function RADIO:New(identifiable)
|
function RADIO:New(identifiable)
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
self:F( { MessageText, MessageDuration, MessageCategory } )
|
-- self:F( { MessageText, MessageDuration, MessageCategory } )
|
||||||
|
|
||||||
self.Identifiable = identifiable
|
self.Identifiable = identifiable
|
||||||
return self
|
return self
|
||||||
@ -57,21 +59,28 @@ function RADIO.VerifyFileName(filename)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Create a new transmission, that is to say, populate the RADIO with relevant data
|
--- Create a new transmission, that is to say, populate the RADIO with relevant data
|
||||||
|
-- @param self
|
||||||
-- @param #string Filename
|
-- @param #string Filename
|
||||||
-- @param #number Frequency in kHz
|
-- @param #number Frequency in kHz
|
||||||
-- @param #number Modulation
|
-- @param #number Modulation
|
||||||
-- @param #number Power
|
-- @param #number Power in W
|
||||||
-- @return self
|
-- @return self
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- In this function the data is especially relevant if the broadcaster is anything but a UNIT or a GROUP,
|
-- -- In this function the data is especially relevant if the broadcaster is anything but a UNIT or a GROUP,
|
||||||
-- -- but it will work with a UNIT or a GROUP anyway
|
-- -- but it will work with a UNIT or a GROUP anyway
|
||||||
|
-- -- Only the RADIO and the Filename are mandatory
|
||||||
function RADIO:NewTransmission(filename, frequency, mod, power)
|
function RADIO:NewTransmission(filename, frequency, mod, power)
|
||||||
self.FileName = RADIO.VerifyFile(filename)
|
self.FileName = RADIO.VerifyFile(filename)
|
||||||
|
if frequency ~= nil then
|
||||||
self.Frequecy = frequency * 1000 -- Convert to Hz
|
self.Frequecy = frequency * 1000 -- Convert to Hz
|
||||||
|
end
|
||||||
|
if mod ~= nil then
|
||||||
self.Modulation = mod
|
self.Modulation = mod
|
||||||
|
end
|
||||||
|
if power ~= nil then
|
||||||
self.Power = power
|
self.Power = power
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user