mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Major Changes in BEACON
After tests, the beacon functionnality is even more limited in DCS than what I thought. Those changes accomode the new data from these tests.
This commit is contained in:
parent
bbcf6c4717
commit
adfe811291
@ -400,48 +400,38 @@ end
|
|||||||
|
|
||||||
--- Activates a AATACAN BEACON
|
--- Activates a AATACAN BEACON
|
||||||
-- @param #BEACON self
|
-- @param #BEACON self
|
||||||
-- @param #number TACANChannel (the "10" part in "10X")
|
-- @param #number TACANChannel (the "10" part in "10Y"). Note that AA TACAN are only available on Y Channels
|
||||||
-- @param #string TACANMode (the "X" part in "10X")
|
|
||||||
-- @param #string Message The Message that is going to be coded in Morse and broadcasted by the beacon
|
-- @param #string Message The Message that is going to be coded in Morse and broadcasted by the beacon
|
||||||
-- @param #boolean Bearing Is the beacon can be homed on ?
|
-- @param #boolean Bearing Can the BEACON be homed on ?
|
||||||
-- @param #boolean Tanker
|
|
||||||
-- @param #number BeaconDuration
|
-- @param #number BeaconDuration
|
||||||
-- @return #BEACON self
|
-- @return #BEACON self
|
||||||
function BEACON:AATACAN(TACANChannel, TACANMode, Message, Bearing, Tanker, BeaconDuration)
|
function BEACON:AATACAN(TACANChannel, Message, Bearing, BeaconDuration)
|
||||||
self:F({TACANChannel, TACANMode, Tanker})
|
self:F({TACANChannel, Message, Bearing, BeaconDuration})
|
||||||
|
|
||||||
local IsValid = 1
|
local IsValid = true
|
||||||
|
|
||||||
if not self.Positionable:IsAir() then
|
if not self.Positionable:IsAir() then
|
||||||
self:E({"The POSITIONABLE you want to attach the AA Tacan Beacon is not an aircraft ! The BEACON is not emitting", self.Positionable})
|
self:E({"The POSITIONABLE you want to attach the AA Tacan Beacon is not an aircraft ! The BEACON is not emitting", self.Positionable})
|
||||||
IsValid = 0
|
IsValid = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local Frequency = self:_TACANToFrequency(TACANChannel, TACANMode)
|
local Frequency = self:_TACANToFrequency(TACANChannel, "Y")
|
||||||
if not Frequency then
|
if not Frequency then
|
||||||
self:E({"The passed TACAN channel is invalid, the BEACON is not emitting"})
|
self:E({"The passed TACAN channel is invalid, the BEACON is not emitting"})
|
||||||
IsValid = 0
|
IsValid = false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Contrary to appearances, the values for the type and system params in the ActivateBeacon command aren't pulled from my butt,
|
-- I'm using the beacon type 4 (BEACON_TYPE_TACAN). For System, I'm using 5 (TACAN_TANKER_MODE_Y) if the bearing shows its bearing
|
||||||
-- they are found in DCS World\Scripts\World\Radio\BeaconTypes.lua and DCS World\Scripts\World\Radio\BeaconSites.lua
|
-- or 14 (TACAN_AA_MODE_Y) if it does not
|
||||||
local System
|
local System
|
||||||
if Tanker then
|
if Bearing then
|
||||||
if TACANMode == "X" then
|
System = 5
|
||||||
System = 4
|
else
|
||||||
else
|
System = 14
|
||||||
System = 5
|
|
||||||
end
|
|
||||||
else -- Not a Tanker
|
|
||||||
if TACANMode == "X" then
|
|
||||||
System = 13
|
|
||||||
else
|
|
||||||
System = 14
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if IsValid then -- Starts the BEACON
|
if IsValid then -- Starts the BEACON
|
||||||
self:T2({"AA TACAN BEACON started, type is ", System})
|
self:T2({"AA TACAN BEACON started !"})
|
||||||
self.Positionable:SetCommand({
|
self.Positionable:SetCommand({
|
||||||
id = "ActivateBeacon",
|
id = "ActivateBeacon",
|
||||||
params = {
|
params = {
|
||||||
@ -449,7 +439,6 @@ function BEACON:AATACAN(TACANChannel, TACANMode, Message, Bearing, Tanker, Beaco
|
|||||||
system = System,
|
system = System,
|
||||||
callsign = Message,
|
callsign = Message,
|
||||||
frequency = Frequency,
|
frequency = Frequency,
|
||||||
bearing = Bearing
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -468,6 +457,7 @@ end
|
|||||||
-- @param #BEACON self
|
-- @param #BEACON self
|
||||||
-- @return #BEACON self
|
-- @return #BEACON self
|
||||||
function BEACON:StopAATACAN()
|
function BEACON:StopAATACAN()
|
||||||
|
self:F()
|
||||||
if not self.Positionable then
|
if not self.Positionable then
|
||||||
self:E({"Start the beacon first before stoping it !"})
|
self:E({"Start the beacon first before stoping it !"})
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user