From f19740e376d485431d9f68e1cf792c03f8a77851 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 19 Jul 2022 08:30:09 +0200 Subject: [PATCH] Beacon - added deactivate Link4 --- Moose Development/Moose/Core/Beacon.lua | 2 +- .../Moose/Wrapper/Controllable.lua | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Core/Beacon.lua b/Moose Development/Moose/Core/Beacon.lua index e7cb4be80..eee6503df 100644 --- a/Moose Development/Moose/Core/Beacon.lua +++ b/Moose Development/Moose/Core/Beacon.lua @@ -265,7 +265,7 @@ function BEACON:ActivateLink4(Frequency, Morse, Duration) -- Stop sheduler if Duration then -- Schedule the stop of the BEACON if asked by the MD - self.Positionable:DeactivateBeacon(Duration) + self.Positionable:CommandDeactivateLink4(Duration) end return self diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index b1d7e37b6..4f6fb0e88 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -681,7 +681,7 @@ end --- Activate ICLS system of the CONTROLLABLE. The controllable should be an aircraft carrier! -- @param #CONTROLLABLE self -- @param #number Channel ICLS channel. --- @param #number UnitID The ID of the unit the ICLS system is attached to. Useful if more units are in one group. +-- @param #number UnitID The DCS UNIT ID of the unit the ICLS system is attached to. Useful if more units are in one group. -- @param #string Callsign Morse code identification callsign. -- @param #number Delay (Optional) Delay in seconds before the ICLS is deactivated. -- @return #CONTROLLABLE self @@ -710,9 +710,9 @@ end --- Activate LINK4 system of the CONTROLLABLE. The controllable should be an aircraft carrier! -- @param #CONTROLLABLE self -- @param #number Frequency Link4 Frequency in MHz, e.g. 336 --- @param #number UnitID The ID of the unit the ICLS system is attached to. Useful if more units are in one group. +-- @param #number UnitID The DCS UNIT ID of the unit the LINK4 system is attached to. Useful if more units are in one group. -- @param #string Callsign Morse code identification callsign. --- @param #number Delay (Optional) Delay in seconds before the ICLS is deactivated. +-- @param #number Delay (Optional) Delay in seconds before the LINK4 is deactivated. -- @return #CONTROLLABLE self function CONTROLLABLE:CommandActivateLink4(Frequency, UnitID, Callsign, Delay) @@ -745,7 +745,7 @@ function CONTROLLABLE:CommandDeactivateBeacon(Delay) local CommandDeactivateBeacon={id='DeactivateBeacon', params={}} if Delay and Delay>0 then - SCHEDULER:New(nil, self.CommandActivateBeacon, {self}, Delay) + SCHEDULER:New(nil, self.CommandDeactivateBeacon, {self}, Delay) else self:SetCommand(CommandDeactivateBeacon) end @@ -753,6 +753,24 @@ function CONTROLLABLE:CommandDeactivateBeacon(Delay) return self end +--- Deactivate the active Link4 of the CONTROLLABLE. +-- @param #CONTROLLABLE self +-- @param #number Delay (Optional) Delay in seconds before the Link4 is deactivated. +-- @return #CONTROLLABLE self +function CONTROLLABLE:CommandDeactivateLink4(Delay) + + -- Command to deactivate + local CommandDeactivateLink4={id='DeactivateLink4', params={}} + + if Delay and Delay>0 then + SCHEDULER:New(nil, self.CommandDeactivateLink4, {self}, Delay) + else + self:SetCommand(CommandDeactivateLink4) + end + + return self +end + --- Deactivate the ICLS of the CONTROLLABLE. -- @param #CONTROLLABLE self -- @param #number Delay (Optional) Delay in seconds before the ICLS is deactivated.