Code formatting, spelling and documentation fixes. (#1661)

* Update Point.lua

Minor code formatting fix.

* Update Airboss.lua

Minor code formatting and documentation fixes.

* Update Set.lua

Code formatting, spelling and documentation fixes.

* Update ATIS.lua

Code formatting, spelling and documentation fixes.

* Update Task_A2A_Dispatcher.lua

Minor code formatting and documentation fixes. Added TODO re. possible unused variables.
This commit is contained in:
TommyC81 2021-12-09 20:51:38 +04:00 committed by GitHub
parent a4ca4bdc99
commit a59343b987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1366 additions and 1570 deletions

View File

@ -395,8 +395,8 @@ do -- COORDINATE
id = world.VolumeType.SPHERE, id = world.VolumeType.SPHERE,
params = { params = {
point = self:GetVec3(), point = self:GetVec3(),
radius = radius radius = radius,
} },
} }
-- Defaults -- Defaults

File diff suppressed because it is too large Load Diff

View File

@ -45,10 +45,10 @@
-- === -- ===
-- --
-- ### Author: **funkyfranky** -- ### Author: **funkyfranky**
--
-- @module Ops.Atis -- @module Ops.Atis
-- @image OPS_ATIS.png -- @image OPS_ATIS.png
--- ATIS class. --- ATIS class.
-- @type ATIS -- @type ATIS
-- @field #string ClassName Name of the class. -- @field #string ClassName Name of the class.
@ -126,7 +126,7 @@
-- ## Subtitles -- ## Subtitles
-- --
-- Currently, DCS allows for displaying subtitles of radio transmissions only from airborne units, *i.e.* airplanes and helicopters. Therefore, if you want to have subtitles, it is necessary to place an -- Currently, DCS allows for displaying subtitles of radio transmissions only from airborne units, *i.e.* airplanes and helicopters. Therefore, if you want to have subtitles, it is necessary to place an
-- additonal aircraft on the ATIS airport and set it to uncontrolled. This unit can then function as a radio relay to transmit messages with subtitles. These subtitles will only be displayed, if the -- additional aircraft on the ATIS airport and set it to uncontrolled. This unit can then function as a radio relay to transmit messages with subtitles. These subtitles will only be displayed, if the
-- player has tuned in the correct ATIS frequency. -- player has tuned in the correct ATIS frequency.
-- --
-- Radio transmissions via an airborne unit can be set via the @{#ATIS.SetRadioRelayUnitName}(*unitname*) function, where the parameter *unitname* is the name of the unit passed as string, *e.g.* -- Radio transmissions via an airborne unit can be set via the @{#ATIS.SetRadioRelayUnitName}(*unitname*) function, where the parameter *unitname* is the name of the unit passed as string, *e.g.*
@ -142,7 +142,7 @@
-- --
-- ## Active Runway -- ## Active Runway
-- --
-- By default, the currently active runway is determined automatically by analysing the wind direction. Therefore, you should obviously set the wind speed to be greater zero in your mission. -- By default, the currently active runway is determined automatically by analyzing the wind direction. Therefore, you should obviously set the wind speed to be greater zero in your mission.
-- --
-- Note however, there are a few special cases, where automatic detection does not yield the correct or desired result. -- Note however, there are a few special cases, where automatic detection does not yield the correct or desired result.
-- For example, there are airports with more than one runway facing in the same direction (usually denoted left and right). In this case, there is obviously no *unique* result depending on the wind vector. -- For example, there are airports with more than one runway facing in the same direction (usually denoted left and right). In this case, there is obviously no *unique* result depending on the wind vector.
@ -170,7 +170,7 @@
-- --
-- ## Nav Aids -- ## Nav Aids
-- --
-- Frequencies or channels of navigation aids can be specified by the user and are then provided as additional information. Unfortunately, it is **not possible** to aquire this information via the DCS API -- Frequencies or channels of navigation aids can be specified by the user and are then provided as additional information. Unfortunately, it is **not possible** to acquire this information via the DCS API
-- we have access to. -- we have access to.
-- --
-- As they say, all road lead to Rome but (for me) the easiest way to obtain the available nav aids data of an airport, is to start a mission and click on an airport symbol. -- As they say, all road lead to Rome but (for me) the easiest way to obtain the available nav aids data of an airport, is to start a mission and click on an airport symbol.
@ -259,7 +259,7 @@
-- --
-- # Text-To-Speech -- # Text-To-Speech
-- --
-- You can enable text-to-speech ATIS information with the @{#ATIS.SetSRS}() function. This uses [SRS](http://dcssimpleradio.com/) (Version >= 1.9.6.0) for broadcasing. -- You can enable text-to-speech ATIS information with the @{#ATIS.SetSRS}() function. This uses [SRS](http://dcssimpleradio.com/) (Version >= 1.9.6.0) for broadcasting.
-- Advantages are that **no sound files** or radio relay units are necessary. Also the issue that FC3 aircraft hear all transmissions will be circumvented. -- Advantages are that **no sound files** or radio relay units are necessary. Also the issue that FC3 aircraft hear all transmissions will be circumvented.
-- --
-- The @{#ATIS.SetSRS}() requires you to specify the path to the SRS install directory or more specifically the path to the DCS-SR-ExternalAudio.exe file. -- The @{#ATIS.SetSRS}() requires you to specify the path to the SRS install directory or more specifically the path to the DCS-SR-ExternalAudio.exe file.
@ -416,7 +416,7 @@ ATIS.ICAOPhraseology={
PersianGulf = true, PersianGulf = true,
TheChannel = true, TheChannel = true,
Syria = true, Syria = true,
MarianaIslands=true, MarianaIslands = true
} }
--- Nav point data. --- Nav point data.
@ -582,7 +582,6 @@ ATIS.Sound = {
Zulu = { filename = "Zulu.ogg", duration = 0.62 }, Zulu = { filename = "Zulu.ogg", duration = 0.62 },
} }
--- ATIS table containing all defined ATISes. --- ATIS table containing all defined ATISes.
-- @field #table _ATIS -- @field #table _ATIS
_ATIS = {} _ATIS = {}
@ -680,7 +679,6 @@ function ATIS:New(airbasename, frequency, modulation)
-- @param #ATIS self -- @param #ATIS self
-- @param #number delay Delay in seconds. -- @param #number delay Delay in seconds.
--- Triggers the FSM event "Stop". Stops the ATIS. --- Triggers the FSM event "Stop". Stops the ATIS.
-- @function [parent=#ATIS] Stop -- @function [parent=#ATIS] Stop
-- @param #ATIS self -- @param #ATIS self
@ -690,7 +688,6 @@ function ATIS:New(airbasename, frequency, modulation)
-- @param #ATIS self -- @param #ATIS self
-- @param #number delay Delay in seconds. -- @param #number delay Delay in seconds.
--- Triggers the FSM event "Status". --- Triggers the FSM event "Status".
-- @function [parent=#ATIS] Status -- @function [parent=#ATIS] Status
-- @param #ATIS self -- @param #ATIS self
@ -700,7 +697,6 @@ function ATIS:New(airbasename, frequency, modulation)
-- @param #ATIS self -- @param #ATIS self
-- @param #number delay Delay in seconds. -- @param #number delay Delay in seconds.
--- Triggers the FSM event "Broadcast". --- Triggers the FSM event "Broadcast".
-- @function [parent=#ATIS] Broadcast -- @function [parent=#ATIS] Broadcast
-- @param #ATIS self -- @param #ATIS self
@ -710,7 +706,6 @@ function ATIS:New(airbasename, frequency, modulation)
-- @param #ATIS self -- @param #ATIS self
-- @param #number delay Delay in seconds. -- @param #number delay Delay in seconds.
--- Triggers the FSM event "CheckQueue". --- Triggers the FSM event "CheckQueue".
-- @function [parent=#ATIS] CheckQueue -- @function [parent=#ATIS] CheckQueue
-- @param #ATIS self -- @param #ATIS self
@ -720,7 +715,6 @@ function ATIS:New(airbasename, frequency, modulation)
-- @param #ATIS self -- @param #ATIS self
-- @param #number delay Delay in seconds. -- @param #number delay Delay in seconds.
--- Triggers the FSM event "Report". --- Triggers the FSM event "Report".
-- @function [parent=#ATIS] Report -- @function [parent=#ATIS] Report
-- @param #ATIS self -- @param #ATIS self
@ -740,7 +734,6 @@ function ATIS:New(airbasename, frequency, modulation)
-- @param #string To To state. -- @param #string To To state.
-- @param #string Text Report text. -- @param #string Text Report text.
-- Debug trace. -- Debug trace.
if false then if false then
self.Debug = true self.Debug = true
@ -1114,7 +1107,6 @@ function ATIS:AddPRMG(channel, runway)
return self return self
end end
--- Place marks with runway data on the F10 map. --- Place marks with runway data on the F10 map.
-- @param #ATIS self -- @param #ATIS self
-- @param #boolean markall If true, mark all runways of the map. By default only the current ATIS runways are marked. -- @param #boolean markall If true, mark all runways of the map. By default only the current ATIS runways are marked.
@ -1243,8 +1235,7 @@ function ATIS:onafterStatus(From, Event, To)
-- Info text. -- Info text.
local text = string.format( "State %s: Freq=%.3f MHz %s", fsmstate, self.frequency, UTILS.GetModulationName( self.modulation ) ) local text = string.format( "State %s: Freq=%.3f MHz %s", fsmstate, self.frequency, UTILS.GetModulationName( self.modulation ) )
if self.useSRS then if self.useSRS then
text=text..string.format(", SRS path=%s (%s), gender=%s, culture=%s, voice=%s", text = text .. string.format( ", SRS path=%s (%s), gender=%s, culture=%s, voice=%s", tostring( self.msrs.path ), tostring( self.msrs.port ), tostring( self.msrs.gender ), tostring( self.msrs.culture ), tostring( self.msrs.voice ) )
tostring(self.msrs.path), tostring(self.msrs.port), tostring(self.msrs.gender), tostring(self.msrs.culture), tostring(self.msrs.voice))
else else
text = text .. string.format( ", Relay unit=%s (alive=%s)", tostring( self.relayunitname ), relayunitstatus ) text = text .. string.format( ", Relay unit=%s (alive=%s)", tostring( self.relayunitname ), relayunitstatus )
end end
@ -1277,8 +1268,6 @@ function ATIS:onafterCheckQueue(From, Event, To)
self:T2( self.lid .. string.format( "Radio queue %d transmissions queued.", #self.radioqueue.queue ) ) self:T2( self.lid .. string.format( "Radio queue %d transmissions queued.", #self.radioqueue.queue ) )
end end
end end
-- Check back in 5 seconds. -- Check back in 5 seconds.
@ -1322,7 +1311,6 @@ function ATIS:onafterBroadcast(From, Event, To)
local Q = P / (1 + L * height / TS) ^ (-g * M / (R * L)) -- Altimeter QNH local Q = P / (1 + L * height / TS) ^ (-g * M / (R * L)) -- Altimeter QNH
local A = (T0 / L) * ((P / q) ^ (((-R * L) / (g * M))) - 1) -- Altitude check local A = (T0 / L) * ((P / q) ^ (((-R * L) / (g * M))) - 1) -- Altitude check
-- Debug aoutput -- Debug aoutput
self:T2( self.lid .. string.format( "height=%.1f, A=%.1f, T0=%.1f, QFE=%.1f, QNH=%.1f, P=%.1f, Q=%.1f hPa = %.2f", height, A, T0 - 273.15, qfe, qnh, P / 100, Q / 100, UTILS.hPa2inHg( Q / 100 ) ) ) self:T2( self.lid .. string.format( "height=%.1f, A=%.1f, T0=%.1f, QFE=%.1f, QNH=%.1f, P=%.1f, Q=%.1f hPa = %.2f", height, A, T0 - 273.15, qfe, qnh, P / 100, Q / 100, UTILS.hPa2inHg( Q / 100 ) ) )
@ -1331,7 +1319,6 @@ function ATIS:onafterBroadcast(From, Event, To)
end end
-- Convert to inHg. -- Convert to inHg.
if self.PmmHg then if self.PmmHg then
qfe = UTILS.hPa2mmHg( qfe ) qfe = UTILS.hPa2mmHg( qfe )
@ -1417,7 +1404,6 @@ function ATIS:onafterBroadcast(From, Event, To)
ZULU = string.format( "%s hours", zulu[1] ) ZULU = string.format( "%s hours", zulu[1] )
end end
-- NATO time stamp. 0=Alfa, 1=Bravo, 2=Charlie, etc. -- NATO time stamp. 0=Alfa, 1=Bravo, 2=Charlie, etc.
local NATO = ATIS.Alphabet[tonumber( zulu[1] ) + 1] local NATO = ATIS.Alphabet[tonumber( zulu[1] ) + 1]
@ -1446,7 +1432,6 @@ function ATIS:onafterBroadcast(From, Event, To)
SUNSET = string.format( "%s %s hours", sunset[1], sunset[2] ) SUNSET = string.format( "%s %s hours", sunset[1], sunset[2] )
end end
--------------------------------- ---------------------------------
--- Temperature and Dew Point --- --- Temperature and Dew Point ---
--------------------------------- ---------------------------------
@ -2572,7 +2557,6 @@ function ATIS:GetMissionWeather()
return clouds, visibility, turbulence, fog, dust, static return clouds, visibility, turbulence, fog, dust, static
end end
--- Get thousands of a number. --- Get thousands of a number.
-- @param #ATIS self -- @param #ATIS self
-- @param #number n Number, *e.g.* 4359. -- @param #number n Number, *e.g.* 4359.

View File

@ -303,7 +303,6 @@
-- The AV-8B Harrier pattern is very similar, the only differences are as there is no angled deck there is no wake check. from the ninety you wil fly a straight approach offset 26 ft to port (left) of the tram line. -- The AV-8B Harrier pattern is very similar, the only differences are as there is no angled deck there is no wake check. from the ninety you wil fly a straight approach offset 26 ft to port (left) of the tram line.
-- The aim is to arrive abeam the landing spot in a stable hover at 120 ft with forward speed matched to the boat. From there the LSO will call "cleared to land". You then level cross to the tram line at the designated landing spot at land vertcally. When you stabalise over the landing spot LSO will call Stabalise to indicate you are centered at the correct spot. -- The aim is to arrive abeam the landing spot in a stable hover at 120 ft with forward speed matched to the boat. From there the LSO will call "cleared to land". You then level cross to the tram line at the designated landing spot at land vertcally. When you stabalise over the landing spot LSO will call Stabalise to indicate you are centered at the correct spot.
-- --
--
-- ## CASE III -- ## CASE III
-- --
-- ![Banner Image](..\Presentations\AIRBOSS\Airboss_Case3.png) -- ![Banner Image](..\Presentations\AIRBOSS\Airboss_Case3.png)
@ -958,8 +957,6 @@
-- --
-- Again, changing the file name, subtitle, subtitle duration is not required if you name the file exactly like the original one, which is this case would be "LSO-RogerBall.ogg". -- Again, changing the file name, subtitle, subtitle duration is not required if you name the file exactly like the original one, which is this case would be "LSO-RogerBall.ogg".
-- --
--
--
-- ## The Radio Dilemma -- ## The Radio Dilemma
-- --
-- DCS offers two (actually three) ways to send radio messages. Each one has its advantages and disadvantages and it is important to understand the differences. -- DCS offers two (actually three) ways to send radio messages. Each one has its advantages and disadvantages and it is important to understand the differences.

View File

@ -182,7 +182,7 @@ do -- TASK_A2A_DISPATCHER
Mission = nil, Mission = nil,
Detection = nil, Detection = nil,
Tasks = {}, Tasks = {},
SweepZones = {} SweepZones = {},
} }
--- TASK_A2A_DISPATCHER constructor. --- TASK_A2A_DISPATCHER constructor.
@ -292,7 +292,7 @@ do -- TASK_A2A_DISPATCHER
self:F( { DetectedItem.ItemID } ) self:F( { DetectedItem.ItemID } )
local DetectedSet = DetectedItem.Set local DetectedSet = DetectedItem.Set
local DetectedZone = DetectedItem.Zone local DetectedZone = DetectedItem.Zone -- TODO: This seems unused, remove?
if DetectedItem.IsDetected == false then if DetectedItem.IsDetected == false then
@ -316,7 +316,7 @@ do -- TASK_A2A_DISPATCHER
self:F( { DetectedItem.ItemID } ) self:F( { DetectedItem.ItemID } )
local DetectedSet = DetectedItem.Set local DetectedSet = DetectedItem.Set
local DetectedZone = DetectedItem.Zone local DetectedZone = DetectedItem.Zone -- TODO: This seems unused, remove?
local PlayersCount, PlayersReport = self:GetPlayerFriendliesNearBy( DetectedItem ) local PlayersCount, PlayersReport = self:GetPlayerFriendliesNearBy( DetectedItem )