mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'master' into develop
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
-- * Option to present information in imperial or metric units
|
||||
-- * Runway length and airfield elevation (optional)
|
||||
-- * Frequencies/channels of nav aids (ILS, VOR, NDB, TACAN, PRMG, RSBN) (optional)
|
||||
-- * SRS Simple-Text-To-Speech (STTS) integration (no sound files necessary)
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -34,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)
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -59,7 +60,7 @@
|
||||
-- @field #number frequency Radio frequency in MHz.
|
||||
-- @field #number modulation Radio modulation 0=AM or 1=FM.
|
||||
-- @field #number power Radio power in Watts. Default 100 W.
|
||||
-- @field Core.RadioQueue#RADIOQUEUE radioqueue Radio queue for broadcasing messages.
|
||||
-- @field Sound.RadioQueue#RADIOQUEUE radioqueue Radio queue for broadcasing messages.
|
||||
-- @field #string soundpath Path to sound files.
|
||||
-- @field #string relayunitname Name of the radio relay unit.
|
||||
-- @field #table towerfrequency Table with tower frequencies.
|
||||
@@ -88,6 +89,9 @@
|
||||
-- @field #boolean usemarker Use mark on the F10 map.
|
||||
-- @field #number markerid Numerical ID of the F10 map mark point.
|
||||
-- @field #number relHumidity Relative humidity (used to approximately calculate the dew point).
|
||||
-- @field #boolean useSRS If true, use SRS for transmission.
|
||||
-- @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
|
||||
|
||||
--- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde
|
||||
@@ -252,6 +256,16 @@
|
||||
-- # Marks on the F10 Map
|
||||
--
|
||||
-- You can place marks on the F10 map via the @{#ATIS.SetMapMarks}() function. These will contain info about the ATIS frequency, the currently active runway and some basic info about the weather (wind, pressure and temperature).
|
||||
--
|
||||
-- # 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.
|
||||
-- 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.
|
||||
--
|
||||
-- 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
|
||||
--
|
||||
@@ -283,7 +297,14 @@
|
||||
-- atisAbuDhabi:SetTowerFrequencies({250.5, 119.2})
|
||||
-- atisAbuDhabi:SetVOR(114.25)
|
||||
-- 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
|
||||
ATIS = {
|
||||
@@ -368,6 +389,7 @@ ATIS.Alphabet = {
|
||||
-- @field #number PersianGulf +2° (East).
|
||||
-- @field #number TheChannel -10° (West).
|
||||
-- @field #number Syria +5° (East).
|
||||
-- @field #number MarianaIslands +2° (East).
|
||||
ATIS.RunwayM2T={
|
||||
Caucasus=0,
|
||||
Nevada=12,
|
||||
@@ -375,6 +397,7 @@ ATIS.RunwayM2T={
|
||||
PersianGulf=2,
|
||||
TheChannel=-10,
|
||||
Syria=5,
|
||||
MarianaIslands=2,
|
||||
}
|
||||
|
||||
--- Whether ICAO phraseology is used for ATIS broadcasts.
|
||||
@@ -385,6 +408,7 @@ ATIS.RunwayM2T={
|
||||
-- @field #boolean PersianGulf true.
|
||||
-- @field #boolean TheChannel true.
|
||||
-- @field #boolean Syria true.
|
||||
-- @field #boolean MarianaIslands true.
|
||||
ATIS.ICAOPhraseology={
|
||||
Caucasus=true,
|
||||
Nevada=false,
|
||||
@@ -392,6 +416,7 @@ ATIS.ICAOPhraseology={
|
||||
PersianGulf=true,
|
||||
TheChannel=true,
|
||||
Syria=true,
|
||||
MarianaIslands=true,
|
||||
}
|
||||
|
||||
--- Nav point data.
|
||||
@@ -564,7 +589,7 @@ _ATIS={}
|
||||
|
||||
--- ATIS class version.
|
||||
-- @field #string version
|
||||
ATIS.version="0.9.1"
|
||||
ATIS.version="0.9.5"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -628,6 +653,7 @@ function ATIS:New(airbasename, frequency, modulation)
|
||||
self:SetAltimeterQNH(true)
|
||||
self:SetMapMarks(false)
|
||||
self:SetRelativeHumidity()
|
||||
self:SetQueueUpdateTime()
|
||||
|
||||
-- Start State.
|
||||
self:SetStartState("Stopped")
|
||||
@@ -955,7 +981,9 @@ end
|
||||
-- * 170° on the Normany 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 #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}.
|
||||
@@ -1100,6 +1128,35 @@ function ATIS:MarkRunways(markall)
|
||||
end
|
||||
end
|
||||
|
||||
--- Use SRS Simple-Text-To-Speech for transmissions. No sound files necessary.
|
||||
-- @param #ATIS self
|
||||
-- @param #string PathToSRS Path to SRS directory.
|
||||
-- @param #string Gender Gender: "male" or "female" (default).
|
||||
-- @param #string Culture Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Port SRS port. Default 5002.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port)
|
||||
self.useSRS=true
|
||||
self.msrs=MSRS:New(PathToSRS, self.frequency, self.modulation)
|
||||
self.msrs:SetGender(Gender)
|
||||
self.msrs:SetCulture(Culture)
|
||||
self.msrs:SetVoice(Voice)
|
||||
self.msrs:SetPort(Port)
|
||||
if self.dTQueueCheck<=10 then
|
||||
self:SetQueueUpdateTime(90)
|
||||
end
|
||||
return self
|
||||
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
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -1171,7 +1228,13 @@ function ATIS:onafterStatus(From, Event, To)
|
||||
end
|
||||
|
||||
-- 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:__Status(-60)
|
||||
@@ -1188,15 +1251,25 @@ end
|
||||
-- @param #string To To state.
|
||||
function ATIS:onafterCheckQueue(From, Event, To)
|
||||
|
||||
if #self.radioqueue.queue==0 then
|
||||
self:T(self.lid..string.format("Radio queue empty. Repeating message."))
|
||||
if self.useSRS then
|
||||
|
||||
self:Broadcast()
|
||||
|
||||
else
|
||||
self:T2(self.lid..string.format("Radio queue %d transmissions queued.", #self.radioqueue.queue))
|
||||
|
||||
if #self.radioqueue.queue==0 then
|
||||
self:T(self.lid..string.format("Radio queue empty. Repeating message."))
|
||||
self:Broadcast()
|
||||
else
|
||||
self:T2(self.lid..string.format("Radio queue %d transmissions queued.", #self.radioqueue.queue))
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
-- Check back in 5 seconds.
|
||||
self:__CheckQueue(-5)
|
||||
-- Check back in 5 seconds.
|
||||
self:__CheckQueue(-math.abs(self.dTQueueCheck))
|
||||
end
|
||||
|
||||
--- Broadcast ATIS radio message.
|
||||
@@ -1322,11 +1395,14 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
|
||||
if time < 0 then
|
||||
time = 24*60*60 + time --avoid negative time around midnight
|
||||
end
|
||||
end
|
||||
|
||||
local clock=UTILS.SecondsToClock(time)
|
||||
local zulu=UTILS.Split(clock, ":")
|
||||
local ZULU=string.format("%s%s", zulu[1], zulu[2])
|
||||
if self.useSRS then
|
||||
ZULU=string.format("%s hours", zulu[1])
|
||||
end
|
||||
|
||||
|
||||
-- NATO time stamp. 0=Alfa, 1=Bravo, 2=Charlie, etc.
|
||||
@@ -1346,10 +1422,17 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
local sunrise=coord:GetSunrise()
|
||||
sunrise=UTILS.Split(sunrise, ":")
|
||||
local SUNRISE=string.format("%s%s", sunrise[1], sunrise[2])
|
||||
if self.useSRS then
|
||||
SUNRISE=string.format("%s %s hours", sunrise[1], sunrise[2])
|
||||
end
|
||||
|
||||
local sunset=coord:GetSunset()
|
||||
sunset=UTILS.Split(sunset, ":")
|
||||
local SUNSET=string.format("%s%s", sunset[1], sunset[2])
|
||||
if self.useSRS then
|
||||
SUNSET=string.format("%s %s hours", sunset[1], sunset[2])
|
||||
end
|
||||
|
||||
|
||||
---------------------------------
|
||||
--- Temperature and Dew Point ---
|
||||
@@ -1591,36 +1674,46 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
if self.airbasename:find("AFB")==nil and self.airbasename:find("Airport")==nil and self.airbasename:find("Airstrip")==nil and self.airbasename:find("airfield")==nil and self.airbasename:find("AB")==nil then
|
||||
subtitle=subtitle.." Airport"
|
||||
end
|
||||
self.radioqueue:NewTransmission(string.format("%s/%s.ogg", self.theatre, self.airbasename), 3.0, self.soundpath, nil, nil, subtitle, self.subduration)
|
||||
if not self.useSRS then
|
||||
self.radioqueue:NewTransmission(string.format("%s/%s.ogg", self.theatre, self.airbasename), 3.0, self.soundpath, nil, nil, subtitle, self.subduration)
|
||||
end
|
||||
local alltext=subtitle
|
||||
|
||||
-- Information tag
|
||||
subtitle=string.format("Information %s", NATO)
|
||||
local _INFORMATION=subtitle
|
||||
self:Transmission(ATIS.Sound.Information, 0.5, subtitle)
|
||||
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.Information, 0.5, subtitle)
|
||||
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
-- Zulu Time
|
||||
subtitle=string.format("%s Zulu", ZULU)
|
||||
self.radioqueue:Number2Transmission(ZULU, nil, 0.5)
|
||||
self:Transmission(ATIS.Sound.Zulu, 0.2, subtitle)
|
||||
if not self.useSRS then
|
||||
self.radioqueue:Number2Transmission(ZULU, nil, 0.5)
|
||||
self:Transmission(ATIS.Sound.Zulu, 0.2, subtitle)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
if not self.zulutimeonly then
|
||||
|
||||
-- Sunrise Time
|
||||
subtitle=string.format("Sunrise at %s local time", SUNRISE)
|
||||
self:Transmission(ATIS.Sound.SunriseAt, 0.5, subtitle)
|
||||
self.radioqueue:Number2Transmission(SUNRISE, nil, 0.2)
|
||||
self:Transmission(ATIS.Sound.TimeLocal, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.SunriseAt, 0.5, subtitle)
|
||||
self.radioqueue:Number2Transmission(SUNRISE, nil, 0.2)
|
||||
self:Transmission(ATIS.Sound.TimeLocal, 0.2)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
-- Sunset Time
|
||||
subtitle=string.format("Sunset at %s local time", SUNSET)
|
||||
self:Transmission(ATIS.Sound.SunsetAt, 0.5, subtitle)
|
||||
self.radioqueue:Number2Transmission(SUNSET, nil, 0.5)
|
||||
self:Transmission(ATIS.Sound.TimeLocal, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.SunsetAt, 0.5, subtitle)
|
||||
self.radioqueue:Number2Transmission(SUNSET, nil, 0.5)
|
||||
self:Transmission(ATIS.Sound.TimeLocal, 0.2)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
@@ -1634,17 +1727,19 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
subtitle=subtitle..", gusting"
|
||||
end
|
||||
local _WIND=subtitle
|
||||
self:Transmission(ATIS.Sound.WindFrom, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(WINDFROM)
|
||||
self:Transmission(ATIS.Sound.At, 0.2)
|
||||
self.radioqueue:Number2Transmission(WINDSPEED)
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.MetersPerSecond, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Knots, 0.2)
|
||||
end
|
||||
if turbulence>0 then
|
||||
self:Transmission(ATIS.Sound.Gusting, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.WindFrom, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(WINDFROM)
|
||||
self:Transmission(ATIS.Sound.At, 0.2)
|
||||
self.radioqueue:Number2Transmission(WINDSPEED)
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.MetersPerSecond, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Knots, 0.2)
|
||||
end
|
||||
if turbulence>0 then
|
||||
self:Transmission(ATIS.Sound.Gusting, 0.2)
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
@@ -1654,12 +1749,14 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
else
|
||||
subtitle=string.format("Visibility %s SM", VISIBILITY)
|
||||
end
|
||||
self:Transmission(ATIS.Sound.Visibilty, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(VISIBILITY)
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Kilometers, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.StatuteMiles, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.Visibilty, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(VISIBILITY)
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Kilometers, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.StatuteMiles, 0.2)
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
@@ -1699,57 +1796,67 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
-- Actual output
|
||||
if wp then
|
||||
subtitle=string.format("Weather phenomena:%s", wpsub)
|
||||
self:Transmission(ATIS.Sound.WeatherPhenomena, 1.0, subtitle)
|
||||
if precepitation==1 then
|
||||
self:Transmission(ATIS.Sound.Rain, 0.5)
|
||||
elseif precepitation==2 then
|
||||
self:Transmission(ATIS.Sound.ThunderStorm, 0.5)
|
||||
elseif precepitation==3 then
|
||||
self:Transmission(ATIS.Sound.Snow, 0.5)
|
||||
elseif precepitation==4 then
|
||||
self:Transmission(ATIS.Sound.SnowStorm, 0.5)
|
||||
end
|
||||
if fog then
|
||||
self:Transmission(ATIS.Sound.Fog, 0.5)
|
||||
end
|
||||
if dust then
|
||||
self:Transmission(ATIS.Sound.Dust, 0.5)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.WeatherPhenomena, 1.0, subtitle)
|
||||
if precepitation==1 then
|
||||
self:Transmission(ATIS.Sound.Rain, 0.5)
|
||||
elseif precepitation==2 then
|
||||
self:Transmission(ATIS.Sound.ThunderStorm, 0.5)
|
||||
elseif precepitation==3 then
|
||||
self:Transmission(ATIS.Sound.Snow, 0.5)
|
||||
elseif precepitation==4 then
|
||||
self:Transmission(ATIS.Sound.SnowStorm, 0.5)
|
||||
end
|
||||
if fog then
|
||||
self:Transmission(ATIS.Sound.Fog, 0.5)
|
||||
end
|
||||
if dust then
|
||||
self:Transmission(ATIS.Sound.Dust, 0.5)
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- Cloud base
|
||||
self:Transmission(CloudCover, 1.0, CLOUDSsub)
|
||||
if not self.useSRS then
|
||||
self:Transmission(CloudCover, 1.0, CLOUDSsub)
|
||||
end
|
||||
if CLOUDBASE and static then
|
||||
-- Base
|
||||
local cbase=tostring(tonumber(CLOUDBASE1000)*1000+tonumber(CLOUDBASE0100)*100)
|
||||
local cceil=tostring(tonumber(CLOUDCEIL1000)*1000+tonumber(CLOUDCEIL0100)*100)
|
||||
if self.metric then
|
||||
subtitle=string.format("Cloudbase %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
|
||||
subtitle=string.format("Cloudbase %s, ceiling %s ft", 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
|
||||
self:Transmission(ATIS.Sound.CloudBase, 1.0, subtitle)
|
||||
if tonumber(CLOUDBASE1000)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDBASE1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
end
|
||||
if tonumber(CLOUDBASE0100)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDBASE0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
-- Ceiling
|
||||
self:Transmission(ATIS.Sound.CloudCeiling, 0.5)
|
||||
if tonumber(CLOUDCEIL1000)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDCEIL1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
end
|
||||
if tonumber(CLOUDCEIL0100)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDCEIL0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Meters, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.CloudBase, 1.0, subtitle)
|
||||
if tonumber(CLOUDBASE1000)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDBASE1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
end
|
||||
if tonumber(CLOUDBASE0100)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDBASE0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
-- Ceiling
|
||||
self:Transmission(ATIS.Sound.CloudCeiling, 0.5)
|
||||
if tonumber(CLOUDCEIL1000)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDCEIL1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
end
|
||||
if tonumber(CLOUDCEIL0100)>0 then
|
||||
self.radioqueue:Number2Transmission(CLOUDCEIL0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Meters, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||
end
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
@@ -1769,15 +1876,17 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
end
|
||||
end
|
||||
local _TEMPERATURE=subtitle
|
||||
self:Transmission(ATIS.Sound.Temperature, 1.0, subtitle)
|
||||
if temperature<0 then
|
||||
self:Transmission(ATIS.Sound.Minus, 0.2)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(TEMPERATURE)
|
||||
if self.TDegF then
|
||||
self:Transmission(ATIS.Sound.DegreesFahrenheit, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.DegreesCelsius, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.Temperature, 1.0, subtitle)
|
||||
if temperature<0 then
|
||||
self:Transmission(ATIS.Sound.Minus, 0.2)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(TEMPERATURE)
|
||||
if self.TDegF then
|
||||
self:Transmission(ATIS.Sound.DegreesFahrenheit, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.DegreesCelsius, 0.2)
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
@@ -1796,15 +1905,17 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
end
|
||||
end
|
||||
local _DEWPOINT=subtitle
|
||||
self:Transmission(ATIS.Sound.DewPoint, 1.0, subtitle)
|
||||
if dewpoint<0 then
|
||||
self:Transmission(ATIS.Sound.Minus, 0.2)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(DEWPOINT)
|
||||
if self.TDegF then
|
||||
self:Transmission(ATIS.Sound.DegreesFahrenheit, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.DegreesCelsius, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.DewPoint, 1.0, subtitle)
|
||||
if dewpoint<0 then
|
||||
self:Transmission(ATIS.Sound.Minus, 0.2)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(DEWPOINT)
|
||||
if self.TDegF then
|
||||
self:Transmission(ATIS.Sound.DegreesFahrenheit, 0.2)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.DegreesCelsius, 0.2)
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
@@ -1813,51 +1924,53 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
if self.qnhonly then
|
||||
subtitle=string.format("Altimeter %s.%s mmHg", QNH[1], QNH[2])
|
||||
else
|
||||
subtitle=string.format("Altimeter QNH %s.%s, QFE %s.%s mmHg", QNH[1], QNH[2], QFE[1], QFE[2])
|
||||
subtitle=string.format("Altimeter: QNH %s.%s, QFE %s.%s mmHg", QNH[1], QNH[2], QFE[1], QFE[2])
|
||||
end
|
||||
else
|
||||
if self.metric then
|
||||
if self.qnhonly then
|
||||
subtitle=string.format("Altimeter %s.%s hPa", QNH[1], QNH[2])
|
||||
else
|
||||
subtitle=string.format("Altimeter QNH %s.%s, QFE %s.%s hPa", QNH[1], QNH[2], QFE[1], QFE[2])
|
||||
subtitle=string.format("Altimeter: QNH %s.%s, QFE %s.%s hPa", QNH[1], QNH[2], QFE[1], QFE[2])
|
||||
end
|
||||
else
|
||||
if self.qnhonly then
|
||||
subtitle=string.format("Altimeter %s.%s inHg", QNH[1], QNH[2])
|
||||
else
|
||||
subtitle=string.format("Altimeter QNH %s.%s, QFE %s.%s inHg", QNH[1], QNH[2], QFE[1], QFE[2])
|
||||
subtitle=string.format("Altimeter: QNH %s.%s, QFE %s.%s inHg", QNH[1], QNH[2], QFE[1], QFE[2])
|
||||
end
|
||||
end
|
||||
end
|
||||
local _ALTIMETER=subtitle
|
||||
self:Transmission(ATIS.Sound.Altimeter, 1.0, subtitle)
|
||||
if not self.qnhonly then
|
||||
self:Transmission(ATIS.Sound.QNH, 0.5)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(QNH[1])
|
||||
|
||||
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(QNH[2])
|
||||
|
||||
if not self.qnhonly then
|
||||
self:Transmission(ATIS.Sound.QFE, 0.75)
|
||||
self.radioqueue:Number2Transmission(QFE[1])
|
||||
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.Altimeter, 1.0, subtitle)
|
||||
if not self.qnhonly then
|
||||
self:Transmission(ATIS.Sound.QNH, 0.5)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(QFE[2])
|
||||
end
|
||||
self.radioqueue:Number2Transmission(QNH[1])
|
||||
|
||||
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(QNH[2])
|
||||
|
||||
if self.PmmHg then
|
||||
self:Transmission(ATIS.Sound.MillimetersOfMercury, 0.1)
|
||||
else
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.HectoPascal, 0.1)
|
||||
if not self.qnhonly then
|
||||
self:Transmission(ATIS.Sound.QFE, 0.75)
|
||||
self.radioqueue:Number2Transmission(QFE[1])
|
||||
if ATIS.ICAOPhraseology[UTILS.GetDCSMap()] then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
end
|
||||
self.radioqueue:Number2Transmission(QFE[2])
|
||||
end
|
||||
|
||||
if self.PmmHg then
|
||||
self:Transmission(ATIS.Sound.MillimetersOfMercury, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.InchesOfMercury, 0.1)
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.HectoPascal, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.InchesOfMercury, 0.1)
|
||||
end
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
@@ -1870,12 +1983,14 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
subtitle=subtitle.." Right"
|
||||
end
|
||||
local _RUNACT=subtitle
|
||||
self:Transmission(ATIS.Sound.ActiveRunway, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(runway)
|
||||
if rwyLeft==true then
|
||||
self:Transmission(ATIS.Sound.Left, 0.2)
|
||||
elseif rwyLeft==false then
|
||||
self:Transmission(ATIS.Sound.Right, 0.2)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.ActiveRunway, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(runway)
|
||||
if rwyLeft==true then
|
||||
self:Transmission(ATIS.Sound.Left, 0.2)
|
||||
elseif rwyLeft==false then
|
||||
self:Transmission(ATIS.Sound.Right, 0.2)
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
@@ -1900,21 +2015,22 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
end
|
||||
|
||||
-- Transmit.
|
||||
self:Transmission(ATIS.Sound.RunwayLength, 1.0, subtitle)
|
||||
if tonumber(L1000)>0 then
|
||||
self.radioqueue:Number2Transmission(L1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.RunwayLength, 1.0, subtitle)
|
||||
if tonumber(L1000)>0 then
|
||||
self.radioqueue:Number2Transmission(L1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
end
|
||||
if tonumber(L0100)>0 then
|
||||
self.radioqueue:Number2Transmission(L0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Meters, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||
end
|
||||
end
|
||||
if tonumber(L0100)>0 then
|
||||
self.radioqueue:Number2Transmission(L0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Meters, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||
end
|
||||
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
@@ -1937,22 +2053,23 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
subtitle=subtitle.." feet"
|
||||
end
|
||||
|
||||
-- Transmitt.
|
||||
self:Transmission(ATIS.Sound.Elevation, 1.0, subtitle)
|
||||
if tonumber(L1000)>0 then
|
||||
self.radioqueue:Number2Transmission(L1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
-- Transmit.
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.Elevation, 1.0, subtitle)
|
||||
if tonumber(L1000)>0 then
|
||||
self.radioqueue:Number2Transmission(L1000)
|
||||
self:Transmission(ATIS.Sound.Thousand, 0.1)
|
||||
end
|
||||
if tonumber(L0100)>0 then
|
||||
self.radioqueue:Number2Transmission(L0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Meters, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||
end
|
||||
end
|
||||
if tonumber(L0100)>0 then
|
||||
self.radioqueue:Number2Transmission(L0100)
|
||||
self:Transmission(ATIS.Sound.Hundred, 0.1)
|
||||
end
|
||||
if self.metric then
|
||||
self:Transmission(ATIS.Sound.Meters, 0.1)
|
||||
else
|
||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||
end
|
||||
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
@@ -1966,9 +2083,47 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
end
|
||||
end
|
||||
subtitle=string.format("Tower frequency %s", freqs)
|
||||
self:Transmission(ATIS.Sound.TowerFrequency, 1.0, subtitle)
|
||||
for _,freq in pairs(self.towerfrequency) do
|
||||
local f=string.format("%.3f", freq)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.TowerFrequency, 1.0, subtitle)
|
||||
for _,freq in pairs(self.towerfrequency) do
|
||||
local f=string.format("%.3f", freq)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
end
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- ILS
|
||||
local ils=self:GetNavPoint(self.ils, runway, rwyLeft)
|
||||
if ils then
|
||||
subtitle=string.format("ILS frequency %.2f MHz", ils.frequency)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.ILSFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", ils.frequency)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- Outer NDB
|
||||
local ndb=self:GetNavPoint(self.ndbouter, runway, rwyLeft)
|
||||
if ndb then
|
||||
subtitle=string.format("Outer NDB frequency %.2f MHz", ndb.frequency)
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.OuterNDBFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", ndb.frequency)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
@@ -1977,41 +2132,6 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
end
|
||||
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- ILS
|
||||
local ils=self:GetNavPoint(self.ils, runway, rwyLeft)
|
||||
if ils then
|
||||
subtitle=string.format("ILS frequency %.2f MHz", ils.frequency)
|
||||
self:Transmission(ATIS.Sound.ILSFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", ils.frequency)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- Outer NDB
|
||||
local ndb=self:GetNavPoint(self.ndbouter, runway, rwyLeft)
|
||||
if ndb then
|
||||
subtitle=string.format("Outer NDB frequency %.2f MHz", ndb.frequency)
|
||||
self:Transmission(ATIS.Sound.OuterNDBFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", ndb.frequency)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
@@ -2019,51 +2139,58 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
local ndb=self:GetNavPoint(self.ndbinner, runway, rwyLeft)
|
||||
if ndb then
|
||||
subtitle=string.format("Inner NDB frequency %.2f MHz", ndb.frequency)
|
||||
self:Transmission(ATIS.Sound.InnerNDBFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", ndb.frequency)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.InnerNDBFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", ndb.frequency)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- VOR
|
||||
if self.vor then
|
||||
subtitle=string.format("VOR frequency %.2f MHz", self.vor)
|
||||
self:Transmission(ATIS.Sound.VORFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", self.vor)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
if self.useSRS then
|
||||
subtitle=string.format("V O R frequency %.2f MHz", self.vor)
|
||||
end
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.VORFrequency, 1.0, subtitle)
|
||||
local f=string.format("%.2f", self.vor)
|
||||
f=UTILS.Split(f, ".")
|
||||
self.radioqueue:Number2Transmission(f[1], nil, 0.5)
|
||||
if tonumber(f[2])>0 then
|
||||
self:Transmission(ATIS.Sound.Decimal, 0.2)
|
||||
self.radioqueue:Number2Transmission(f[2])
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
end
|
||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- TACAN
|
||||
if self.tacan then
|
||||
subtitle=string.format("TACAN channel %dX", self.tacan)
|
||||
self:Transmission(ATIS.Sound.TACANChannel, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(tostring(self.tacan), nil, 0.2)
|
||||
self.radioqueue:NewTransmission("NATO Alphabet/Xray.ogg", 0.75, self.soundpath, nil, 0.2)
|
||||
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.TACANChannel, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(tostring(self.tacan), nil, 0.2)
|
||||
self.radioqueue:NewTransmission("NATO Alphabet/Xray.ogg", 0.75, self.soundpath, nil, 0.2)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- RSBN
|
||||
if self.rsbn then
|
||||
subtitle=string.format("RSBN channel %d", self.rsbn)
|
||||
self:Transmission(ATIS.Sound.RSBNChannel, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(tostring(self.rsbn), nil, 0.2)
|
||||
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.RSBNChannel, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(tostring(self.rsbn), nil, 0.2)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
@@ -2071,17 +2198,19 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
local ndb=self:GetNavPoint(self.prmg, runway, rwyLeft)
|
||||
if ndb then
|
||||
subtitle=string.format("PRMG channel %d", ndb.frequency)
|
||||
self:Transmission(ATIS.Sound.PRMGChannel, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(tostring(ndb.frequency), nil, 0.5)
|
||||
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.PRMGChannel, 1.0, subtitle)
|
||||
self.radioqueue:Number2Transmission(tostring(ndb.frequency), nil, 0.5)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
end
|
||||
|
||||
-- Advice on initial...
|
||||
subtitle=string.format("Advise on initial contact, you have information %s", NATO)
|
||||
self:Transmission(ATIS.Sound.AdviceOnInitial, 0.5, subtitle)
|
||||
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
||||
|
||||
if not self.useSRS then
|
||||
self:Transmission(ATIS.Sound.AdviceOnInitial, 0.5, subtitle)
|
||||
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
||||
end
|
||||
alltext=alltext..";\n"..subtitle
|
||||
|
||||
-- Report ATIS text.
|
||||
@@ -2102,6 +2231,32 @@ end
|
||||
-- @param #string Text Report text.
|
||||
function ATIS:onafterReport(From, Event, To, Text)
|
||||
self:T(self.lid..string.format("Report:\n%s", Text))
|
||||
|
||||
if self.useSRS and self.msrs then
|
||||
|
||||
-- Remove line breaks
|
||||
local text=string.gsub(Text, "[\r\n]", "")
|
||||
|
||||
-- Replace other stuff.
|
||||
local text=string.gsub(text, "SM", "statute miles")
|
||||
local text=string.gsub(text, "°C", "degrees Celsius")
|
||||
local text=string.gsub(text, "°F", "degrees Fahrenheit")
|
||||
local text=string.gsub(text, "inHg", "inches of Mercury")
|
||||
local text=string.gsub(text, "mmHg", "millimeters of Mercury")
|
||||
local text=string.gsub(text, "hPa", "hecto Pascals")
|
||||
local text=string.gsub(text, "m/s", "meters per second")
|
||||
|
||||
-- Replace ";" by "."
|
||||
local text=string.gsub(text, ";", " . ")
|
||||
|
||||
--Debug output.
|
||||
self:T("SRS TTS: "..text)
|
||||
|
||||
-- Play text-to-speech report.
|
||||
self.msrs:PlayText(text)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user