mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #1301 from FlightControl-Master/FF/Develop
ATIS and WAREHOUSE
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,19 +4,20 @@
|
|||||||
--
|
--
|
||||||
-- **Main Features:**
|
-- **Main Features:**
|
||||||
--
|
--
|
||||||
-- * Wind direction and speed,
|
-- * Wind direction and speed
|
||||||
-- * Visibility,
|
-- * Visibility
|
||||||
-- * Cloud coverage, base and ceiling,
|
-- * Cloud coverage, base and ceiling
|
||||||
-- * Temprature,
|
-- * Temprature
|
||||||
-- * Pressure QNH/QFE,
|
-- * Dew point (approximate as there is no relative humidity in DCS yet)
|
||||||
-- * Weather phenomena: rain, thunderstorm, fog, dust,
|
-- * Pressure QNH/QFE
|
||||||
-- * Active runway based on wind direction,
|
-- * Weather phenomena: rain, thunderstorm, fog, dust
|
||||||
-- * Tower frequencies,
|
-- * Active runway based on wind direction
|
||||||
-- * More than 180 voice overs,
|
-- * Tower frequencies
|
||||||
-- * Airbase names pronounced in locale accent (russian, US, french, arabic),
|
-- * More than 180 voice overs
|
||||||
-- * Option to present information in imperial or metric units,
|
-- * Airbase names pronounced in locale accent (russian, US, french, arabic)
|
||||||
-- * Runway length and airfield elevation (optional),
|
-- * Option to present information in imperial or metric units
|
||||||
-- * Frequencies/channels of nav aids (ILS, VOR, NDB, TACAN, PRMG, RSBN) (optional).
|
-- * Runway length and airfield elevation (optional)
|
||||||
|
-- * Frequencies/channels of nav aids (ILS, VOR, NDB, TACAN, PRMG, RSBN) (optional)
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
@@ -84,6 +85,7 @@
|
|||||||
-- @field #boolean altimeterQNH Report altimeter QNH.
|
-- @field #boolean altimeterQNH Report altimeter QNH.
|
||||||
-- @field #boolean usemarker Use mark on the F10 map.
|
-- @field #boolean usemarker Use mark on the F10 map.
|
||||||
-- @field #number markerid Numerical ID of the F10 map mark point.
|
-- @field #number markerid Numerical ID of the F10 map mark point.
|
||||||
|
-- @field #number relHumidity Relative humidity (used to approximately calculate the dew point).
|
||||||
-- @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
|
||||||
@@ -318,6 +320,7 @@ ATIS = {
|
|||||||
altimeterQNH = nil,
|
altimeterQNH = nil,
|
||||||
usemarker = nil,
|
usemarker = nil,
|
||||||
markerid = nil,
|
markerid = nil,
|
||||||
|
relHumidity = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- NATO alphabet.
|
--- NATO alphabet.
|
||||||
@@ -380,6 +383,7 @@ ATIS.RunwayM2T={
|
|||||||
--- Sound files.
|
--- Sound files.
|
||||||
-- @type ATIS.Sound
|
-- @type ATIS.Sound
|
||||||
-- @field #ATIS.Soundfile ActiveRunway
|
-- @field #ATIS.Soundfile ActiveRunway
|
||||||
|
-- @field #ATIS.Soundfile AdviceOnInitial
|
||||||
-- @field #ATIS.Soundfile Airport
|
-- @field #ATIS.Soundfile Airport
|
||||||
-- @field #ATIS.Soundfile Altimeter
|
-- @field #ATIS.Soundfile Altimeter
|
||||||
-- @field #ATIS.Soundfile At
|
-- @field #ATIS.Soundfile At
|
||||||
@@ -394,6 +398,7 @@ ATIS.RunwayM2T={
|
|||||||
-- @field #ATIS.Soundfile Decimal
|
-- @field #ATIS.Soundfile Decimal
|
||||||
-- @field #ATIS.Soundfile DegreesCelsius
|
-- @field #ATIS.Soundfile DegreesCelsius
|
||||||
-- @field #ATIS.Soundfile DegreesFahrenheit
|
-- @field #ATIS.Soundfile DegreesFahrenheit
|
||||||
|
-- @field #ATIS.Soundfile DewPoint
|
||||||
-- @field #ATIS.Soundfile Dust
|
-- @field #ATIS.Soundfile Dust
|
||||||
-- @field #ATIS.Soundfile Elevation
|
-- @field #ATIS.Soundfile Elevation
|
||||||
-- @field #ATIS.Soundfile EndOfInformation
|
-- @field #ATIS.Soundfile EndOfInformation
|
||||||
@@ -448,6 +453,7 @@ ATIS.RunwayM2T={
|
|||||||
-- @field #ATIS.Soundfile VORFrequency
|
-- @field #ATIS.Soundfile VORFrequency
|
||||||
ATIS.Sound = {
|
ATIS.Sound = {
|
||||||
ActiveRunway={filename="ActiveRunway.ogg", duration=0.99},
|
ActiveRunway={filename="ActiveRunway.ogg", duration=0.99},
|
||||||
|
AdviceOnInitial={filename="AdviceOnInitial.ogg", duration=3.00},
|
||||||
Airport={filename="Airport.ogg", duration=0.66},
|
Airport={filename="Airport.ogg", duration=0.66},
|
||||||
Altimeter={filename="Altimeter.ogg", duration=0.68},
|
Altimeter={filename="Altimeter.ogg", duration=0.68},
|
||||||
At={filename="At.ogg", duration=0.41},
|
At={filename="At.ogg", duration=0.41},
|
||||||
@@ -462,6 +468,7 @@ ATIS.Sound = {
|
|||||||
Decimal={filename="Decimal.ogg", duration=0.54},
|
Decimal={filename="Decimal.ogg", duration=0.54},
|
||||||
DegreesCelsius={filename="DegreesCelsius.ogg", duration=1.27},
|
DegreesCelsius={filename="DegreesCelsius.ogg", duration=1.27},
|
||||||
DegreesFahrenheit={filename="DegreesFahrenheit.ogg", duration=1.23},
|
DegreesFahrenheit={filename="DegreesFahrenheit.ogg", duration=1.23},
|
||||||
|
DewPoint={filename="DewPoint.ogg", duration=0.65},
|
||||||
Dust={filename="Dust.ogg", duration=0.54},
|
Dust={filename="Dust.ogg", duration=0.54},
|
||||||
Elevation={filename="Elevation.ogg", duration=0.78},
|
Elevation={filename="Elevation.ogg", duration=0.78},
|
||||||
EndOfInformation={filename="EndOfInformation.ogg", duration=1.15},
|
EndOfInformation={filename="EndOfInformation.ogg", duration=1.15},
|
||||||
@@ -524,15 +531,19 @@ _ATIS={}
|
|||||||
|
|
||||||
--- ATIS class version.
|
--- ATIS class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
ATIS.version="0.6.4"
|
ATIS.version="0.7.0"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- TODO: Add stop/pause FMS functions.
|
-- TODO: Add new Normany airfields.
|
||||||
|
-- TODO: Zulu time --> Zulu in output.
|
||||||
-- TODO: Correct fog for elevation.
|
-- TODO: Correct fog for elevation.
|
||||||
-- TODO: Use local time.
|
-- DONE: Add text report for output.
|
||||||
|
-- DONE: Add stop FMS functions.
|
||||||
|
-- NOGO: Use local time. Not realisitc!
|
||||||
|
-- DONE: Dew point. Approx. done.
|
||||||
-- DONE: Metric units.
|
-- DONE: Metric units.
|
||||||
-- DONE: Set UTC correction.
|
-- DONE: Set UTC correction.
|
||||||
-- DONE: Set magnetic variation.
|
-- DONE: Set magnetic variation.
|
||||||
@@ -545,7 +556,7 @@ ATIS.version="0.6.4"
|
|||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @param #string airbasename Name of the airbase.
|
-- @param #string airbasename Name of the airbase.
|
||||||
-- @param #number frequency Radio frequency in MHz. Default 143.00 MHz.
|
-- @param #number frequency Radio frequency in MHz. Default 143.00 MHz.
|
||||||
-- @param #number modulation 0=AM, 1=FM. Default 0=AM.
|
-- @param #number modulation Radio modulation: 0=AM, 1=FM. Default 0=AM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators
|
||||||
-- @return #ATIS self
|
-- @return #ATIS self
|
||||||
function ATIS:New(airbasename, frequency, modulation)
|
function ATIS:New(airbasename, frequency, modulation)
|
||||||
|
|
||||||
@@ -557,6 +568,7 @@ function ATIS:New(airbasename, frequency, modulation)
|
|||||||
|
|
||||||
if self.airbase==nil then
|
if self.airbase==nil then
|
||||||
self:E("ERROR: Airbase %s for ATIS could not be found!", tostring(airbasename))
|
self:E("ERROR: Airbase %s for ATIS could not be found!", tostring(airbasename))
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Default freq and modulation.
|
-- Default freq and modulation.
|
||||||
@@ -580,6 +592,7 @@ function ATIS:New(airbasename, frequency, modulation)
|
|||||||
self:SetRadioPower()
|
self:SetRadioPower()
|
||||||
self:SetAltimeterQNH(true)
|
self:SetAltimeterQNH(true)
|
||||||
self:SetMapMarks(false)
|
self:SetMapMarks(false)
|
||||||
|
self:SetRelativeHumidity()
|
||||||
|
|
||||||
-- Start State.
|
-- Start State.
|
||||||
self:SetStartState("Stopped")
|
self:SetStartState("Stopped")
|
||||||
@@ -587,9 +600,11 @@ function ATIS:New(airbasename, frequency, modulation)
|
|||||||
-- Add FSM transitions.
|
-- Add FSM transitions.
|
||||||
-- From State --> Event --> To State
|
-- From State --> Event --> To State
|
||||||
self:AddTransition("Stopped", "Start", "Running") -- Start FSM.
|
self:AddTransition("Stopped", "Start", "Running") -- Start FSM.
|
||||||
self:AddTransition("*", "Status", "*") -- Update status.
|
self:AddTransition("*", "Status", "*") -- Update status.
|
||||||
self:AddTransition("*", "Broadcast", "*") -- Broadcast ATIS message.
|
self:AddTransition("*", "Broadcast", "*") -- Broadcast ATIS message.
|
||||||
self:AddTransition("*", "CheckQueue", "*") -- Check if radio queue is empty.
|
self:AddTransition("*", "CheckQueue", "*") -- Check if radio queue is empty.
|
||||||
|
self:AddTransition("*", "Report", "*") -- Report ATIS text.
|
||||||
|
self:AddTransition("*", "Stop", "Stopped") -- Stop.
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
--- Pseudo Functions ---
|
--- Pseudo Functions ---
|
||||||
@@ -604,7 +619,9 @@ 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
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
|
|
||||||
--- Triggers the FSM event "Stop" after a delay.
|
--- Triggers the FSM event "Stop" after a delay.
|
||||||
@@ -612,6 +629,57 @@ 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".
|
||||||
|
-- @function [parent=#ATIS] Status
|
||||||
|
-- @param #ATIS self
|
||||||
|
|
||||||
|
--- Triggers the FSM event "Status" after a delay.
|
||||||
|
-- @function [parent=#ATIS] __Status
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #number delay Delay in seconds.
|
||||||
|
|
||||||
|
|
||||||
|
--- Triggers the FSM event "Broadcast".
|
||||||
|
-- @function [parent=#ATIS] Broadcast
|
||||||
|
-- @param #ATIS self
|
||||||
|
|
||||||
|
--- Triggers the FSM event "Broadcast" after a delay.
|
||||||
|
-- @function [parent=#ATIS] __Broadcast
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #number delay Delay in seconds.
|
||||||
|
|
||||||
|
|
||||||
|
--- Triggers the FSM event "CheckQueue".
|
||||||
|
-- @function [parent=#ATIS] CheckQueue
|
||||||
|
-- @param #ATIS self
|
||||||
|
|
||||||
|
--- Triggers the FSM event "CheckQueue" after a delay.
|
||||||
|
-- @function [parent=#ATIS] __CheckQueue
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #number delay Delay in seconds.
|
||||||
|
|
||||||
|
|
||||||
|
--- Triggers the FSM event "Report".
|
||||||
|
-- @function [parent=#ATIS] Report
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string Text Report text.
|
||||||
|
|
||||||
|
--- Triggers the FSM event "Report" after a delay.
|
||||||
|
-- @function [parent=#ATIS] __Report
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #number delay Delay in seconds.
|
||||||
|
-- @param #string Text Report text.
|
||||||
|
|
||||||
|
--- On after "Report" event user function.
|
||||||
|
-- @function [parent=#ATIS] OnAfterReport
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param #string Text Report text.
|
||||||
|
|
||||||
|
|
||||||
-- Debug trace.
|
-- Debug trace.
|
||||||
if false then
|
if false then
|
||||||
self.Debug=true
|
self.Debug=true
|
||||||
@@ -801,6 +869,16 @@ function ATIS:SetTemperatureFahrenheit()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set relative humidity. This is used to approximately calculate the dew point.
|
||||||
|
-- Note that the dew point is only an artificial information as DCS does not have an atmospheric model that includes humidity (yet).
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #number Humidity Relative Humidity, i.e. a number between 0 and 100 %. Default is 50 %.
|
||||||
|
-- @return #ATIS self
|
||||||
|
function ATIS:SetRelativeHumidity(Humidity)
|
||||||
|
self.relHumidity=Humidity or 50
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Report altimeter QNH.
|
--- Report altimeter QNH.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @param #boolean switch If true or nil, report altimeter QHN. If false, report QFF.
|
-- @param #boolean switch If true or nil, report altimeter QHN. If false, report QFF.
|
||||||
@@ -976,6 +1054,9 @@ end
|
|||||||
|
|
||||||
--- Start ATIS FSM.
|
--- Start ATIS FSM.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
function ATIS:onafterStart(From, Event, To)
|
function ATIS:onafterStart(From, Event, To)
|
||||||
|
|
||||||
-- Check that this is an airdrome.
|
-- Check that this is an airdrome.
|
||||||
@@ -1021,6 +1102,9 @@ end
|
|||||||
|
|
||||||
--- Update status.
|
--- Update status.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
function ATIS:onafterStatus(From, Event, To)
|
function ATIS:onafterStatus(From, Event, To)
|
||||||
|
|
||||||
-- Get FSM state.
|
-- Get FSM state.
|
||||||
@@ -1047,6 +1131,9 @@ end
|
|||||||
|
|
||||||
--- Check if radio queue is empty. If so, start broadcasting the message again.
|
--- Check if radio queue is empty. If so, start broadcasting the message again.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
function ATIS:onafterCheckQueue(From, Event, To)
|
function ATIS:onafterCheckQueue(From, Event, To)
|
||||||
|
|
||||||
if #self.radioqueue.queue==0 then
|
if #self.radioqueue.queue==0 then
|
||||||
@@ -1062,6 +1149,9 @@ end
|
|||||||
|
|
||||||
--- Broadcast ATIS radio message.
|
--- Broadcast ATIS radio message.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
function ATIS:onafterBroadcast(From, Event, To)
|
function ATIS:onafterBroadcast(From, Event, To)
|
||||||
|
|
||||||
-- Get current coordinate.
|
-- Get current coordinate.
|
||||||
@@ -1194,19 +1284,24 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self:T3(string.format("ZULU =%s", tostring(ZULU)))
|
self:T3(string.format("ZULU =%s", tostring(ZULU)))
|
||||||
self:T3(string.format("NATO =%s", tostring(NATO)))
|
self:T3(string.format("NATO =%s", tostring(NATO)))
|
||||||
|
|
||||||
-------------------
|
---------------------------------
|
||||||
--- Temperature ---
|
--- Temperature and Dew Point ---
|
||||||
-------------------
|
---------------------------------
|
||||||
|
|
||||||
-- Temperature in °C (or °F).
|
-- Temperature in °C.
|
||||||
local temperature=coord:GetTemperature(height+5)
|
local temperature=coord:GetTemperature(height+5)
|
||||||
|
|
||||||
|
-- Dew point in °C.
|
||||||
|
local dewpoint=temperature-(100-self.relHumidity)/5
|
||||||
|
|
||||||
-- Convert to °F.
|
-- Convert to °F.
|
||||||
if self.TDegF then
|
if self.TDegF then
|
||||||
temperature=UTILS.CelciusToFarenheit(temperature)
|
temperature=UTILS.CelciusToFarenheit(temperature)
|
||||||
|
dewpoint=UTILS.CelciusToFarenheit(dewpoint)
|
||||||
end
|
end
|
||||||
|
|
||||||
local TEMPERATURE=string.format("%d", math.abs(temperature))
|
local TEMPERATURE=string.format("%d", math.abs(temperature))
|
||||||
|
local DEWPOINT=string.format("%d", math.abs(dewpoint))
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
--- Weather ---
|
--- Weather ---
|
||||||
@@ -1325,17 +1420,20 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
subtitle=subtitle.." Airport"
|
subtitle=subtitle.." Airport"
|
||||||
end
|
end
|
||||||
self.radioqueue:NewTransmission(string.format("%s/%s.ogg", self.theatre, self.airbasename), 3.0, self.soundpath, nil, nil, subtitle, self.subduration)
|
self.radioqueue:NewTransmission(string.format("%s/%s.ogg", self.theatre, self.airbasename), 3.0, self.soundpath, nil, nil, subtitle, self.subduration)
|
||||||
|
local alltext=subtitle
|
||||||
|
|
||||||
-- Information tag
|
-- Information tag
|
||||||
subtitle=string.format("Information %s", NATO)
|
subtitle=string.format("Information %s", NATO)
|
||||||
local _INFORMATION=subtitle
|
local _INFORMATION=subtitle
|
||||||
self:Transmission(ATIS.Sound.Information, 0.5, subtitle)
|
self:Transmission(ATIS.Sound.Information, 0.5, subtitle)
|
||||||
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Zulu Time
|
-- Zulu Time
|
||||||
subtitle=string.format("%s Zulu Time", ZULU)
|
subtitle=string.format("%s Zulu", ZULU)
|
||||||
self.radioqueue:Number2Transmission(ZULU, nil, 0.5)
|
self.radioqueue:Number2Transmission(ZULU, nil, 0.5)
|
||||||
self:Transmission(ATIS.Sound.TimeZulu, 0.2, subtitle)
|
self:Transmission(ATIS.Sound.TimeZulu, 0.2, subtitle)
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Visibility
|
-- Visibility
|
||||||
if self.metric then
|
if self.metric then
|
||||||
@@ -1350,6 +1448,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
else
|
else
|
||||||
self:Transmission(ATIS.Sound.NauticalMiles, 0.2)
|
self:Transmission(ATIS.Sound.NauticalMiles, 0.2)
|
||||||
end
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Cloud base
|
-- Cloud base
|
||||||
self:Transmission(CloudCover, 1.0, CLOUDSsub)
|
self:Transmission(CloudCover, 1.0, CLOUDSsub)
|
||||||
@@ -1385,6 +1484,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Weather phenomena
|
-- Weather phenomena
|
||||||
local wp=false
|
local wp=false
|
||||||
@@ -1438,6 +1538,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
if dust then
|
if dust then
|
||||||
self:Transmission(ATIS.Sound.Dust, 0.5)
|
self:Transmission(ATIS.Sound.Dust, 0.5)
|
||||||
end
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Altimeter QNH/QFE.
|
-- Altimeter QNH/QFE.
|
||||||
@@ -1469,6 +1570,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self:Transmission(ATIS.Sound.InchesOfMercury, 0.1)
|
self:Transmission(ATIS.Sound.InchesOfMercury, 0.1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Temperature
|
-- Temperature
|
||||||
if self.TDegF then
|
if self.TDegF then
|
||||||
@@ -1495,6 +1597,34 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
else
|
else
|
||||||
self:Transmission(ATIS.Sound.DegreesCelsius, 0.2)
|
self:Transmission(ATIS.Sound.DegreesCelsius, 0.2)
|
||||||
end
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
|
-- Dew point
|
||||||
|
if self.TDegF then
|
||||||
|
if dewpoint<0 then
|
||||||
|
subtitle=string.format("Dew point -%s °F", DEWPOINT)
|
||||||
|
else
|
||||||
|
subtitle=string.format("Dew point %s °F", DEWPOINT)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if dewpoint<0 then
|
||||||
|
subtitle=string.format("Dew point -%s °C", DEWPOINT)
|
||||||
|
else
|
||||||
|
subtitle=string.format("Dew point %s °C", DEWPOINT)
|
||||||
|
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)
|
||||||
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Wind
|
-- Wind
|
||||||
if self.metric then
|
if self.metric then
|
||||||
@@ -1518,6 +1648,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
if turbulence>0 then
|
if turbulence>0 then
|
||||||
self:Transmission(ATIS.Sound.Gusting, 0.2)
|
self:Transmission(ATIS.Sound.Gusting, 0.2)
|
||||||
end
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Active runway.
|
-- Active runway.
|
||||||
local subtitle=string.format("Active runway %s", runway)
|
local subtitle=string.format("Active runway %s", runway)
|
||||||
@@ -1534,6 +1665,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
elseif rwyLeft==false then
|
elseif rwyLeft==false then
|
||||||
self:Transmission(ATIS.Sound.Right, 0.2)
|
self:Transmission(ATIS.Sound.Right, 0.2)
|
||||||
end
|
end
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
-- Runway length.
|
-- Runway length.
|
||||||
if self.rwylength then
|
if self.rwylength then
|
||||||
@@ -1571,6 +1703,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Airfield elevation
|
-- Airfield elevation
|
||||||
@@ -1608,6 +1741,7 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self:Transmission(ATIS.Sound.Feet, 0.1)
|
self:Transmission(ATIS.Sound.Feet, 0.1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Tower frequency.
|
-- Tower frequency.
|
||||||
@@ -1631,6 +1765,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
end
|
end
|
||||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ILS
|
-- ILS
|
||||||
@@ -1646,6 +1782,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self.radioqueue:Number2Transmission(f[2])
|
self.radioqueue:Number2Transmission(f[2])
|
||||||
end
|
end
|
||||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Outer NDB
|
-- Outer NDB
|
||||||
@@ -1661,6 +1799,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self.radioqueue:Number2Transmission(f[2])
|
self.radioqueue:Number2Transmission(f[2])
|
||||||
end
|
end
|
||||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Inner NDB
|
-- Inner NDB
|
||||||
@@ -1676,6 +1816,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self.radioqueue:Number2Transmission(f[2])
|
self.radioqueue:Number2Transmission(f[2])
|
||||||
end
|
end
|
||||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- VOR
|
-- VOR
|
||||||
@@ -1690,6 +1832,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self.radioqueue:Number2Transmission(f[2])
|
self.radioqueue:Number2Transmission(f[2])
|
||||||
end
|
end
|
||||||
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
self:Transmission(ATIS.Sound.MegaHertz, 0.2)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TACAN
|
-- TACAN
|
||||||
@@ -1698,6 +1842,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
self:Transmission(ATIS.Sound.TACANChannel, 1.0, subtitle)
|
self:Transmission(ATIS.Sound.TACANChannel, 1.0, subtitle)
|
||||||
self.radioqueue:Number2Transmission(tostring(self.tacan), nil, 0.2)
|
self.radioqueue:Number2Transmission(tostring(self.tacan), nil, 0.2)
|
||||||
self.radioqueue:NewTransmission("NATO Alphabet/Xray.ogg", 0.75, self.soundpath, nil, 0.2)
|
self.radioqueue:NewTransmission("NATO Alphabet/Xray.ogg", 0.75, self.soundpath, nil, 0.2)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- RSBN
|
-- RSBN
|
||||||
@@ -1705,6 +1851,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
subtitle=string.format("RSBN channel %d", self.rsbn)
|
subtitle=string.format("RSBN channel %d", self.rsbn)
|
||||||
self:Transmission(ATIS.Sound.RSBNChannel, 1.0, subtitle)
|
self:Transmission(ATIS.Sound.RSBNChannel, 1.0, subtitle)
|
||||||
self.radioqueue:Number2Transmission(tostring(self.rsbn), nil, 0.2)
|
self.radioqueue:Number2Transmission(tostring(self.rsbn), nil, 0.2)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
-- PRMG
|
-- PRMG
|
||||||
@@ -1713,12 +1861,26 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
subtitle=string.format("PRMG channel %d", ndb.frequency)
|
subtitle=string.format("PRMG channel %d", ndb.frequency)
|
||||||
self:Transmission(ATIS.Sound.PRMGChannel, 1.0, subtitle)
|
self:Transmission(ATIS.Sound.PRMGChannel, 1.0, subtitle)
|
||||||
self.radioqueue:Number2Transmission(tostring(ndb.frequency), nil, 0.5)
|
self.radioqueue:Number2Transmission(tostring(ndb.frequency), nil, 0.5)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--[[
|
||||||
-- End of Information Alpha, Bravo, ...
|
-- End of Information Alpha, Bravo, ...
|
||||||
subtitle=string.format("End of information %s", NATO)
|
subtitle=string.format("End of information %s", NATO)
|
||||||
self:Transmission(ATIS.Sound.EndOfInformation, 0.5, subtitle)
|
self:Transmission(ATIS.Sound.EndOfInformation, 0.5, subtitle)
|
||||||
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
self.radioqueue:NewTransmission(string.format("NATO Alphabet/%s.ogg", NATO), 0.75, self.soundpath)
|
||||||
|
--]]
|
||||||
|
|
||||||
|
-- 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)
|
||||||
|
|
||||||
|
alltext=alltext..";\n"..subtitle
|
||||||
|
|
||||||
|
-- Report ATIS text.
|
||||||
|
self:Report(alltext)
|
||||||
|
|
||||||
-- Update F10 marker.
|
-- Update F10 marker.
|
||||||
if self.usemarker then
|
if self.usemarker then
|
||||||
@@ -1727,6 +1889,20 @@ function ATIS:onafterBroadcast(From, Event, To)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Text report of ATIS information. Information delimitor is a semicolon ";" and a line break "\n".
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param #string Text Report text.
|
||||||
|
function ATIS:onafterReport(From, Event, To, Text)
|
||||||
|
self:T(self.lid..string.format("Report:\n%s", Text))
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
-- Misc Functions
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
--- Update F10 map marker.
|
--- Update F10 map marker.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @param #string information Information tag text.
|
-- @param #string information Information tag text.
|
||||||
@@ -1754,10 +1930,6 @@ function ATIS:UpdateMarker(information, runact, wind, altimeter, temperature)
|
|||||||
return self.markerid
|
return self.markerid
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
-- Misc Functions
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
--- Get active runway runway.
|
--- Get active runway runway.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @return #string Active runway, e.g. "31" for 310 deg.
|
-- @return #string Active runway, e.g. "31" for 310 deg.
|
||||||
|
|||||||
Reference in New Issue
Block a user