mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#CONTROLLABLE
* Added CommandActivateACLS() * Added CommandDeactivateACLS()
This commit is contained in:
commit
2ec8d94e38
@ -668,12 +668,61 @@ function CONTROLLABLE:CommandActivateBeacon( Type, System, Frequency, UnitID, Ch
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Activate ACLS system of the CONTROLLABLE. The controllable should be an aircraft carrier! Also needs Link4 to work.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @param #number UnitID (Optional) The DCS UNIT ID of the unit the ACLS system is attached to. Defaults to the UNIT itself.
|
||||||
|
-- @param #string Name (Optional) Name of the ACLS Beacon
|
||||||
|
-- @param #number Delay (Optional) Delay in seconds before the ICLS is activated.
|
||||||
|
-- @return #CONTROLLABLE self
|
||||||
|
function CONTROLLABLE:CommandActivateACLS( UnitID, Name, Delay )
|
||||||
|
|
||||||
|
-- Command to activate ACLS system.
|
||||||
|
local CommandActivateACLS= {
|
||||||
|
id = 'ActivateACLS',
|
||||||
|
params = {
|
||||||
|
unitId = UnitID or self:GetID(),
|
||||||
|
name = Name or "ACL",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self:T({CommandActivateACLS})
|
||||||
|
|
||||||
|
if Delay and Delay > 0 then
|
||||||
|
SCHEDULER:New( nil, self.CommandActivateACLS, { self, UnitID, Name }, Delay )
|
||||||
|
else
|
||||||
|
self:SetCommand( CommandActivateACLS )
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Deactivate ACLS system of the CONTROLLABLE. The controllable should be an aircraft carrier!
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @param #number Delay (Optional) Delay in seconds before the ICLS is deactivated.
|
||||||
|
-- @return #CONTROLLABLE self
|
||||||
|
function CONTROLLABLE:CommandDeactivateACLS( Delay )
|
||||||
|
|
||||||
|
-- Command to activate ACLS system.
|
||||||
|
local CommandDeactivateACLS= {
|
||||||
|
id = 'DeactivateACLS',
|
||||||
|
params = { }
|
||||||
|
}
|
||||||
|
|
||||||
|
if Delay and Delay > 0 then
|
||||||
|
SCHEDULER:New( nil, self.CommandDeactivateACLS, { self }, Delay )
|
||||||
|
else
|
||||||
|
self:SetCommand( CommandDeactivateACLS )
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Activate ICLS system of the CONTROLLABLE. The controllable should be an aircraft carrier!
|
--- Activate ICLS system of the CONTROLLABLE. The controllable should be an aircraft carrier!
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #number Channel ICLS channel.
|
-- @param #number Channel ICLS channel.
|
||||||
-- @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 #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 #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 ICLS is activated.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:CommandActivateICLS( Channel, UnitID, Callsign, Delay )
|
function CONTROLLABLE:CommandActivateICLS( Channel, UnitID, Callsign, Delay )
|
||||||
|
|
||||||
@ -683,13 +732,13 @@ function CONTROLLABLE:CommandActivateICLS( Channel, UnitID, Callsign, Delay )
|
|||||||
params = {
|
params = {
|
||||||
["type"] = BEACON.Type.ICLS,
|
["type"] = BEACON.Type.ICLS,
|
||||||
["channel"] = Channel,
|
["channel"] = Channel,
|
||||||
["unitId"] = UnitID,
|
["unitId"] = UnitID or self:GetID(),
|
||||||
["callsign"] = Callsign,
|
["callsign"] = Callsign,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if Delay and Delay > 0 then
|
if Delay and Delay > 0 then
|
||||||
SCHEDULER:New( nil, self.CommandActivateICLS, { self }, Delay )
|
SCHEDULER:New( nil, self.CommandActivateICLS, { self, Channel, UnitID, Callsign }, Delay )
|
||||||
else
|
else
|
||||||
self:SetCommand( CommandActivateICLS )
|
self:SetCommand( CommandActivateICLS )
|
||||||
end
|
end
|
||||||
@ -699,53 +748,29 @@ end
|
|||||||
|
|
||||||
--- Activate LINK4 system of the CONTROLLABLE. The controllable should be an aircraft carrier!
|
--- Activate LINK4 system of the CONTROLLABLE. The controllable should be an aircraft carrier!
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #number Frequency Link4 Frequency in MHz, e.g. 336
|
-- @param #number Frequency Link4 Frequency in MHz, e.g. 336 (defaults to 336 MHz)
|
||||||
-- @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 #number UnitID (Optional) The DCS UNIT ID of the unit the LINK4 system is attached to. Defaults to the UNIT itself.
|
||||||
-- @param #string Callsign Morse code identification callsign.
|
-- @param #string Callsign (Optional) Morse code identification callsign.
|
||||||
-- @param #number Delay (Optional) Delay in seconds before the LINK4 is deactivated.
|
-- @param #number Delay (Optional) Delay in seconds before the LINK4 is activated.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:CommandActivateLink4(Frequency, UnitID, Callsign, Delay)
|
function CONTROLLABLE:CommandActivateLink4(Frequency, UnitID, Callsign, Delay)
|
||||||
|
|
||||||
|
local freq = Frequency or 336
|
||||||
|
|
||||||
-- Command to activate Link4 system.
|
-- Command to activate Link4 system.
|
||||||
local CommandActivateLink4= {
|
local CommandActivateLink4= {
|
||||||
id = "ActivateLink4",
|
id = "ActivateLink4",
|
||||||
params= {
|
params= {
|
||||||
["frequency "] = Frequency*1000,
|
["frequency "] = freq*1000000,
|
||||||
["unitId"] = UnitID,
|
["unitId"] = UnitID or self:GetID(),
|
||||||
["name"] = Callsign,
|
["name"] = Callsign or "LNK",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self:T({CommandActivateLink4})
|
||||||
|
|
||||||
if Delay and Delay>0 then
|
if Delay and Delay>0 then
|
||||||
SCHEDULER:New(nil, self.CommandActivateLink4, {self}, Delay)
|
SCHEDULER:New(nil, self.CommandActivateLink4, {self, Frequency, UnitID, Callsign}, Delay)
|
||||||
else
|
|
||||||
self:SetCommand(CommandActivateLink4)
|
|
||||||
end
|
|
||||||
|
|
||||||
return self
|
|
||||||
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 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 LINK4 is deactivated.
|
|
||||||
-- @return #CONTROLLABLE self
|
|
||||||
function CONTROLLABLE:CommandActivateLink4(Frequency, UnitID, Callsign, Delay)
|
|
||||||
|
|
||||||
-- Command to activate Link4 system.
|
|
||||||
local CommandActivateLink4= {
|
|
||||||
id = "ActivateLink4",
|
|
||||||
params= {
|
|
||||||
["frequency "] = Frequency*1000,
|
|
||||||
["unitId"] = UnitID,
|
|
||||||
["name"] = Callsign,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if Delay and Delay>0 then
|
|
||||||
SCHEDULER:New(nil, self.CommandActivateLink4, {self}, Delay)
|
|
||||||
else
|
else
|
||||||
self:SetCommand(CommandActivateLink4)
|
self:SetCommand(CommandActivateLink4)
|
||||||
end
|
end
|
||||||
@ -809,24 +834,6 @@ function CONTROLLABLE:CommandDeactivateICLS( Delay )
|
|||||||
return self
|
return self
|
||||||
end
|
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)
|
--- Set callsign of the CONTROLLABLE. See [DCS command setCallsign](https://wiki.hoggitworld.com/view/DCS_command_setCallsign)
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCS#CALLSIGN CallName Number corresponding the the callsign identifier you wish this group to be called.
|
-- @param DCS#CALLSIGN CallName Number corresponding the the callsign identifier you wish this group to be called.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user