Every RADIO Setter is tested

This commit is contained in:
Grey-Echo 2017-03-10 23:34:42 +01:00
parent 894ed41374
commit 4b45476105
2 changed files with 5 additions and 12 deletions

View File

@ -121,10 +121,8 @@ end
function RADIO:SetPower(power)
self:F(power)
if type(power) == "number" then
if math.floor(math.abs(power)) == power then
self.Power = power --TODO Find what is the maximum power allowed by DCS and limit power to that
return self
end
self.Power = math.floor(math.abs(power)) --TODO Find what is the maximum power allowed by DCS and limit power to that
return self
end
self:E({"Power is invalid. Power unchanged.", self.Power})
return self
@ -169,6 +167,7 @@ function RADIO:SetSubtitle(subtitle, subtitleDuration)
self.SubtitleDuration = 0
self:E({"SubtitleDuration is invalid. SubtitleDuration reset.", self.SubtitleDuration})
end
--- Create a new transmission, that is to say, populate the RADIO with relevant data
-- @param self
-- @param #string Filename

View File

@ -10,13 +10,7 @@ local Static = STATIC:FindByName("CommandCenter")
local Transmiter = UNIT:FindByName("Transmiter")
local Radio = Transmiter:GetRadio()
Radio:SetFrequency(25)
Radio:SetFrequency(89)
Radio:SetFrequency(152)
Radio:SetFrequency(500)
Radio:SetFrequency("a")
Radio:SetFrequency(225)
Radio:SetFrequency(251.3)
Radio:SetSubtitle(6, "tes")
Radio:SetFileName("Noise.ogg")
Radio:SetFrequency(251.3)
Radio:Broadcast()