Merge branch 'FF/MasterDevel' into FF/Ops

This commit is contained in:
Frank
2021-06-10 00:19:02 +02:00
6 changed files with 77 additions and 41 deletions

View File

@@ -35,7 +35,7 @@
-- --
-- === -- ===
-- --
-- ## Sound files: Check out the pinned messages in the Moose discord #ops-atis channel. -- ## Sound files: [MOOSE Sound Files](https://github.com/FlightControl-Master/MOOSE_SOUND/releases)
-- --
-- === -- ===
-- --
@@ -91,6 +91,7 @@
-- @field #number relHumidity Relative humidity (used to approximately calculate the dew point). -- @field #number relHumidity Relative humidity (used to approximately calculate the dew point).
-- @field #boolean useSRS If true, use SRS for transmission. -- @field #boolean useSRS If true, use SRS for transmission.
-- @field Sound.SRS#MSRS msrs Moose SRS object. -- @field Sound.SRS#MSRS msrs Moose SRS object.
-- @field #number dTQueueCheck Time interval to check the radio queue. Default 5 sec or 90 sec if SRS is used.
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
--- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde --- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde
@@ -258,10 +259,13 @@
-- --
-- # Text-To-Speech -- # Text-To-Speech
-- --
-- You can enable text-to-speech ATIS information with the @{#ATIS.SetSTTS}() 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 broadcasing.
-- Advantages are that no sound files 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.SetSTTS}() requires you to specify the path to the SRS install directory. -- 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.
--
-- Unfortunately, it is not possible to determine the duration of the complete transmission. So once the transmission is finished, there might be some radio silence before
-- the next iteration begins. You can fine tune the time interval between transmissions with the @{#ATIS.SetQueueUpdateTime}() function. The default interval is 90 seconds.
-- --
-- # Examples -- # Examples
-- --
@@ -293,7 +297,14 @@
-- atisAbuDhabi:SetTowerFrequencies({250.5, 119.2}) -- atisAbuDhabi:SetTowerFrequencies({250.5, 119.2})
-- atisAbuDhabi:SetVOR(114.25) -- atisAbuDhabi:SetVOR(114.25)
-- atisAbuDhabi:Start() -- atisAbuDhabi:Start()
--
-- ## SRS
--
-- atis=ATIS:New("Batumi", 305, radio.modulation.AM)
-- atis:SetSRS("D:\\DCS\\_SRS\\", "male", "en-US")
-- atis:Start()
-- --
-- This uses a male voice with US accent. It requires SRS to be installed in the `D:\DCS\_SRS\` directory. Not that backslashes need to be escaped or simply use slashes (as in linux).
-- --
-- @field #ATIS -- @field #ATIS
ATIS = { ATIS = {
@@ -378,6 +389,7 @@ ATIS.Alphabet = {
-- @field #number PersianGulf +2° (East). -- @field #number PersianGulf +2° (East).
-- @field #number TheChannel -10° (West). -- @field #number TheChannel -10° (West).
-- @field #number Syria +5° (East). -- @field #number Syria +5° (East).
-- @field #number MarianaIslands +2° (East).
ATIS.RunwayM2T={ ATIS.RunwayM2T={
Caucasus=0, Caucasus=0,
Nevada=12, Nevada=12,
@@ -385,6 +397,7 @@ ATIS.RunwayM2T={
PersianGulf=2, PersianGulf=2,
TheChannel=-10, TheChannel=-10,
Syria=5, Syria=5,
MarianaIslands=2,
} }
--- Whether ICAO phraseology is used for ATIS broadcasts. --- Whether ICAO phraseology is used for ATIS broadcasts.
@@ -395,6 +408,7 @@ ATIS.RunwayM2T={
-- @field #boolean PersianGulf true. -- @field #boolean PersianGulf true.
-- @field #boolean TheChannel true. -- @field #boolean TheChannel true.
-- @field #boolean Syria true. -- @field #boolean Syria true.
-- @field #boolean MarianaIslands true.
ATIS.ICAOPhraseology={ ATIS.ICAOPhraseology={
Caucasus=true, Caucasus=true,
Nevada=false, Nevada=false,
@@ -402,6 +416,7 @@ ATIS.ICAOPhraseology={
PersianGulf=true, PersianGulf=true,
TheChannel=true, TheChannel=true,
Syria=true, Syria=true,
MarianaIslands=true,
} }
--- Nav point data. --- Nav point data.
@@ -574,7 +589,7 @@ _ATIS={}
--- ATIS class version. --- ATIS class version.
-- @field #string version -- @field #string version
ATIS.version="0.9.1" ATIS.version="0.9.3"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
@@ -638,6 +653,7 @@ function ATIS:New(airbasename, frequency, modulation)
self:SetAltimeterQNH(true) self:SetAltimeterQNH(true)
self:SetMapMarks(false) self:SetMapMarks(false)
self:SetRelativeHumidity() self:SetRelativeHumidity()
self:SetQueueUpdateTime()
-- Start State. -- Start State.
self:SetStartState("Stopped") self:SetStartState("Stopped")
@@ -965,7 +981,9 @@ end
-- * 170° on the Normany map -- * 170° on the Normany map
-- * 182° on the Persian Gulf map -- * 182° on the Persian Gulf map
-- --
-- Likewise, to convert *magnetic* into *true* heading, one has to substract easterly and add westerly variation. -- Likewise, to convert *true* into *magnetic* heading, one has to substract easterly and add westerly variation.
--
-- Or you make your life simple and just include the sign so you don't have to bother about East/West.
-- --
-- @param #ATIS self -- @param #ATIS self
-- @param #number magvar Magnetic variation in degrees. Positive for easterly and negative for westerly variation. Default is magnatic declinaton of the used map, c.f. @{Utilities.UTils#UTILS.GetMagneticDeclination}. -- @param #number magvar Magnetic variation in degrees. Positive for easterly and negative for westerly variation. Default is magnatic declinaton of the used map, c.f. @{Utilities.UTils#UTILS.GetMagneticDeclination}.
@@ -1125,9 +1143,20 @@ function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port)
self.msrs:SetCulture(Culture) self.msrs:SetCulture(Culture)
self.msrs:SetVoice(Voice) self.msrs:SetVoice(Voice)
self.msrs:SetPort(Port) self.msrs:SetPort(Port)
if self.dTQueueCheck<=10 then
self:SetQueueUpdateTime(90)
end
return self return self
end end
--- Set the time interval between radio queue updates.
-- @param #ATIS self
-- @param #number TimeInterval Interval in seconds. Default 5 sec.
-- @return #ATIS self
function ATIS:SetQueueUpdateTime(TimeInterval)
self.dTQueueCheck=TimeInterval or 5
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Start & Status -- Start & Status
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -1199,7 +1228,13 @@ function ATIS:onafterStatus(From, Event, To)
end end
-- Info text. -- Info text.
local text=string.format("State %s: Freq=%.3f MHz %s, Relay unit=%s (alive=%s)", fsmstate, self.frequency, UTILS.GetModulationName(self.modulation), tostring(self.relayunitname), relayunitstatus) local text=string.format("State %s: Freq=%.3f MHz %s", fsmstate, self.frequency, UTILS.GetModulationName(self.modulation))
if self.useSRS then
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))
else
text=text..string.format(", Relay unit=%s (alive=%s)", tostring(self.relayunitname), relayunitstatus)
end
self:I(self.lid..text) self:I(self.lid..text)
self:__Status(-60) self:__Status(-60)
@@ -1220,8 +1255,6 @@ function ATIS:onafterCheckQueue(From, Event, To)
self:Broadcast() self:Broadcast()
self:__CheckQueue(-120)
else else
if #self.radioqueue.queue==0 then if #self.radioqueue.queue==0 then
@@ -1231,10 +1264,12 @@ 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
-- Check back in 5 seconds.
self:__CheckQueue(-5)
end end
-- Check back in 5 seconds.
self:__CheckQueue(-math.abs(self.dTQueueCheck))
end end
--- Broadcast ATIS radio message. --- Broadcast ATIS radio message.
@@ -1778,10 +1813,14 @@ function ATIS:onafterBroadcast(From, Event, To)
end end
if CLOUDBASE and static then if CLOUDBASE and static then
-- Base -- Base
local cbase=tostring(tonumber(CLOUDBASE1000)*1000+tonumber(CLOUDBASE0100)*100)
local cceil=tostring(tonumber(CLOUDCEIL1000)*1000+tonumber(CLOUDCEIL0100)*100)
if self.metric then if self.metric then
subtitle=string.format("Cloud base %s, ceiling %s meters", CLOUDBASE, CLOUDCEIL) --subtitle=string.format("Cloud base %s, ceiling %s meters", CLOUDBASE, CLOUDCEIL)
subtitle=string.format("Cloud base %s, ceiling %s meters", cbase, cceil)
else else
subtitle=string.format("Cloud base %s, ceiling %s feet", CLOUDBASE, CLOUDCEIL) --subtitle=string.format("Cloud base %s, ceiling %s feet", CLOUDBASE, CLOUDCEIL)
subtitle=string.format("Cloud base %s, ceiling %s feet", cbase, cceil)
end end
if not self.useSRS then if not self.useSRS then
self:Transmission(ATIS.Sound.CloudBase, 1.0, subtitle) self:Transmission(ATIS.Sound.CloudBase, 1.0, subtitle)
@@ -2195,7 +2234,7 @@ function ATIS:onafterReport(From, Event, To, Text)
local text=string.gsub(text, "m/s", "meters per second") local text=string.gsub(text, "m/s", "meters per second")
-- Replace ";" by "." -- Replace ";" by "."
local text=string.gsub(text, ";", ". ") local text=string.gsub(text, ";", " . ")
env.info("FF: "..text) env.info("FF: "..text)
-- Play text-to-speech report. -- Play text-to-speech report.

View File

@@ -11,7 +11,7 @@
-- ### Authors: funkyfranky -- ### Authors: funkyfranky
-- --
-- @module Sound.RadioQueue -- @module Sound.RadioQueue
-- @image Sound_Radio.JPG -- @image Core_Radio.JPG
--- Manages radio transmissions. --- Manages radio transmissions.
-- --

View File

@@ -11,7 +11,7 @@
-- --
-- ### Authors: FlightControl -- ### Authors: FlightControl
-- --
-- @module Core.RadioSpeech -- @module Sound.RadioSpeech
-- @image Core_Radio.JPG -- @image Core_Radio.JPG
--- Makes the radio speak. --- Makes the radio speak.
@@ -162,31 +162,31 @@ RADIOSPEECH.Vocabulary.RU = {
["8000"] = { "8000", 0.92 }, ["8000"] = { "8000", 0.92 },
["9000"] = { "9000", 0.87 }, ["9000"] = { "9000", 0.87 },
["степени"] = { "degrees", 0.5 }, ["Ñ<EFBFBD>Ñепени"] = { "degrees", 0.5 },
["километров"] = { "kilometers", 0.65 }, ["километров"] = { "kilometers", 0.65 },
["km"] = { "kilometers", 0.65 }, ["km"] = { "kilometers", 0.65 },
["миль"] = { "miles", 0.45 }, ["миль"] = { "miles", 0.45 },
["mi"] = { "miles", 0.45 }, ["mi"] = { "miles", 0.45 },
["метры"] = { "meters", 0.41 }, ["метры"] = { "meters", 0.41 },
["m"] = { "meters", 0.41 }, ["m"] = { "meters", 0.41 },
["ноги"] = { "feet", 0.37 }, ["ноги"] = { "feet", 0.37 },
["br"] = { "br", 1.1 }, ["br"] = { "br", 1.1 },
["bra"] = { "bra", 0.3 }, ["bra"] = { "bra", 0.3 },
["возвращаясь на базу"] = { "returning_to_base", 1.40 }, ["возвращаÑ<EFBFBD>Ñ<EFBFBD>ÑŒ на базу"] = { "returning_to_base", 1.40 },
["на пути к наземной цели"] = { "on_route_to_ground_target", 1.45 }, ["на пути к наземной цели"] = { "on_route_to_ground_target", 1.45 },
["перехват самолетов"] = { "intercepting_bogeys", 1.22 }, ["перехват Ñ<>амолеÑов"] = { "intercepting_bogeys", 1.22 },
["поражение наземной цели"] = { "engaging_ground_target", 1.53 }, ["поражение наземной цели"] = { "engaging_ground_target", 1.53 },
["захватывающие самолеты"] = { "engaging_bogeys", 1.68 }, ["захватывающие Ñ<>амолеÑÑ"] = { "engaging_bogeys", 1.68 },
["колеса вверх"] = { "wheels_up", 0.92 }, ["колеÑ<EFBFBD>а вверх"] = { "wheels_up", 0.92 },
["посадка на базу"] = { "landing at base", 1.04 }, ["поÑ<EFBFBD>адка на базу"] = { "landing at base", 1.04 },
["патрулирующий"] = { "patrolling", 0.96 }, ["патрулирующий"] = { "patrolling", 0.96 },
["за"] = { "for", 0.27 }, ["за"] = { "for", 0.27 },
["и"] = { "and", 0.17 }, ["и"] = { "and", 0.17 },
["в"] = { "at", 0.19 }, ["в"] = { "at", 0.19 },
["dot"] = { "dot", 0.51 }, ["dot"] = { "dot", 0.51 },
["defender"] = { "defender", 0.45 }, ["defender"] = { "defender", 0.45 },
} }

View File

@@ -26,8 +26,8 @@
-- === -- ===
-- --
-- ### Author: **funkyfranky** -- ### Author: **funkyfranky**
-- @module Addons.SRS -- @module Sound.MSRS
-- @image Addons_SRS.png -- @image Sound_MSRS.png
--- MSRS class. --- MSRS class.
-- @type MSRS -- @type MSRS
@@ -112,9 +112,6 @@ MSRS = {
altitude = nil, altitude = nil,
} }
--- Counter.
_MSRSuuid=0
--- MSRS class version. --- MSRS class version.
-- @field #string version -- @field #string version
MSRS.version="0.0.3" MSRS.version="0.0.3"

View File

@@ -100,9 +100,6 @@ do -- Sound File
-- --
-- SRS sound files need to be located on your local drive (not inside the miz). Therefore, you need to specify the full path. -- SRS sound files need to be located on your local drive (not inside the miz). Therefore, you need to specify the full path.
-- --
--
-- ## SRS
--
-- @field #SOUNDFILE -- @field #SOUNDFILE
SOUNDFILE={ SOUNDFILE={
ClassName = "SOUNDFILE", ClassName = "SOUNDFILE",

View File

@@ -1287,6 +1287,9 @@ end
-- * NTTR +12 (East), year ~ 2011 -- * NTTR +12 (East), year ~ 2011
-- * Normandy -10 (West), year ~ 1944 -- * Normandy -10 (West), year ~ 1944
-- * Persian Gulf +2 (East), year ~ 2011 -- * Persian Gulf +2 (East), year ~ 2011
-- * The Cannel Map -10 (West)
-- * Syria +5 (East)
-- * Mariana Islands +2 (East)
-- @param #string map (Optional) Map for which the declination is returned. Default is from env.mission.theatre -- @param #string map (Optional) Map for which the declination is returned. Default is from env.mission.theatre
-- @return #number Declination in degrees. -- @return #number Declination in degrees.
function UTILS.GetMagneticDeclination(map) function UTILS.GetMagneticDeclination(map)
@@ -1308,7 +1311,7 @@ function UTILS.GetMagneticDeclination(map)
elseif map==DCSMAP.Syria then elseif map==DCSMAP.Syria then
declination=5 declination=5
elseif map==DCSMAP.MarianaIslands then elseif map==DCSMAP.MarianaIslands then
declination=-2 declination=2
else else
declination=0 declination=0
end end