From 4b45476105d1aa67f4221b177f58d938d57c382e Mon Sep 17 00:00:00 2001 From: Grey-Echo Date: Fri, 10 Mar 2017 23:34:42 +0100 Subject: [PATCH] Every RADIO Setter is tested --- Moose Development/Moose/Core/Radio.lua | 7 +++---- .../RAD-000 - Radio Test Mission.lua | 10 ++-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Moose Development/Moose/Core/Radio.lua b/Moose Development/Moose/Core/Radio.lua index 950403cf0..acef081c0 100644 --- a/Moose Development/Moose/Core/Radio.lua +++ b/Moose Development/Moose/Core/Radio.lua @@ -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 diff --git a/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.lua b/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.lua index d901c108f..4a4b243e5 100644 --- a/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.lua +++ b/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.lua @@ -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() \ No newline at end of file