From eef8b362d218b006d00eb6991af458c655d8da04 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 19 Jul 2022 08:29:43 +0200 Subject: [PATCH] Beacon - added deactivate Link4 --- Moose Development/Moose/Core/Beacon.lua | 3 ++- .../Moose/Wrapper/Controllable.lua | 24 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Core/Beacon.lua b/Moose Development/Moose/Core/Beacon.lua index 23094ea88..d4c3c2ebd 100644 --- a/Moose Development/Moose/Core/Beacon.lua +++ b/Moose Development/Moose/Core/Beacon.lua @@ -265,12 +265,13 @@ 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:DeactivateLink4(Duration) end return self end + --- DEPRECATED: Please use @{BEACON:ActivateTACAN}() instead. -- Activates a TACAN BEACON on an Aircraft. -- @param #BEACON self diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index cd7d812eb..5a59a28e2 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -700,9 +700,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) @@ -735,7 +735,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 @@ -761,6 +761,24 @@ function CONTROLLABLE:CommandDeactivateICLS( 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 + --- Set callsign of the CONTROLLABLE. See [DCS command setCallsign](https://wiki.hoggitworld.com/view/DCS_command_setCallsign) -- @param #CONTROLLABLE self -- @param DCS#CALLSIGN CallName Number corresponding the the callsign identifier you wish this group to be called.