mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#ATIS
* Fixed SetILS report not working * Use new AIRBASE additions to set takeoff/landing runway * Fixed Visibility is reported twice * Added SetReportmBar() to report for mBar/hpa QNH/QFE even if not metric * Added option to output additional freetext information when using SRS SetAdditionalInformation() #1792
This commit is contained in:
commit
2eeb918c8a
@ -91,6 +91,7 @@
|
|||||||
-- @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.
|
-- @field #number dTQueueCheck Time interval to check the radio queue. Default 5 sec or 90 sec if SRS is used.
|
||||||
|
-- @field #boolean ReportmBar Report mBar/hpa even if not metric, i.e. for Mirage flights
|
||||||
-- @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
|
||||||
@ -344,6 +345,7 @@ ATIS = {
|
|||||||
usemarker = nil,
|
usemarker = nil,
|
||||||
markerid = nil,
|
markerid = nil,
|
||||||
relHumidity = nil,
|
relHumidity = nil,
|
||||||
|
ReportmBar = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- NATO alphabet.
|
--- NATO alphabet.
|
||||||
@ -586,15 +588,18 @@ _ATIS = {}
|
|||||||
|
|
||||||
--- ATIS class version.
|
--- ATIS class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
ATIS.version = "0.9.8"
|
ATIS.version = "0.9.9"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- TODO: Add new Normany airfields.
|
-- TODO: Add new Normandy airfields.
|
||||||
-- TODO: Zulu time --> Zulu in output.
|
-- TODO: Zulu time --> Zulu in output.
|
||||||
-- TODO: Correct fog for elevation.
|
-- TODO: Correct fog for elevation.
|
||||||
|
-- DONE: Use new AIRBASE system to set start/landing runway
|
||||||
|
-- DONE: SetILS doesn't work
|
||||||
|
-- DONE: Visibility reported twice over SRS
|
||||||
-- DONE: Add text report for output.
|
-- DONE: Add text report for output.
|
||||||
-- DONE: Add stop FMS functions.
|
-- DONE: Add stop FMS functions.
|
||||||
-- NOGO: Use local time. Not realisitc!
|
-- NOGO: Use local time. Not realisitc!
|
||||||
@ -651,6 +656,7 @@ function ATIS:New(AirbaseName, Frequency, Modulation)
|
|||||||
self:SetMapMarks( false )
|
self:SetMapMarks( false )
|
||||||
self:SetRelativeHumidity()
|
self:SetRelativeHumidity()
|
||||||
self:SetQueueUpdateTime()
|
self:SetQueueUpdateTime()
|
||||||
|
self:SetReportmBar(false)
|
||||||
|
|
||||||
-- Start State.
|
-- Start State.
|
||||||
self:SetStartState( "Stopped" )
|
self:SetStartState( "Stopped" )
|
||||||
@ -774,13 +780,40 @@ function ATIS:SetTowerFrequencies( freqs )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set active runway. This can be used if the automatic runway determination via the wind direction gives incorrect results.
|
--- Set active runway for **landing** operations. This can be used if the automatic runway determination via the wind direction gives incorrect results.
|
||||||
-- For example, use this if there are two runways with the same directions.
|
-- For example, use this if there are two runways with the same directions.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @param #string runway Active runway, *e.g.* "31L".
|
-- @param #string runway Active runway, *e.g.* "31L".
|
||||||
-- @return #ATIS self
|
-- @return #ATIS self
|
||||||
function ATIS:SetActiveRunway( runway )
|
function ATIS:SetActiveRunway( runway )
|
||||||
self.activerunway = tostring( runway )
|
self.activerunway = tostring( runway )
|
||||||
|
local prefer = nil
|
||||||
|
if string.find(string.lower(runway),"l") then
|
||||||
|
prefer = true
|
||||||
|
elseif string.find(string.lower(runway),"r") then
|
||||||
|
prefer = false
|
||||||
|
end
|
||||||
|
self.airbase:SetActiveRunway(runway,prefer)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Set the active runway for landing.
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string runway : Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||||
|
-- @param #boolean preferleft : If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right.
|
||||||
|
-- @return #ATIS self
|
||||||
|
function ATIS:SetActiveRunwayLanding(runway, preferleft)
|
||||||
|
self.airbase:SetActiveRunwayLanding(runway,preferleft)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Set the active runway for take-off.
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string runway : Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction.
|
||||||
|
-- @param #boolean preferleft : If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right.
|
||||||
|
-- @return #ATIS self
|
||||||
|
function ATIS:SetActiveRunwayTakeoff(runway,preferleft)
|
||||||
|
self.airbase:SetActiveRunwayTakeoff(runway,preferleft)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -947,6 +980,28 @@ function ATIS:SetAltimeterQNH( switch )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Additionally report altimeter QNH/QFE in hPa, even if not set to metric.
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #boolean switch If true or nil, report mBar/hPa in addition.
|
||||||
|
-- @return #ATIS self
|
||||||
|
function ATIS:SetReportmBar(switch)
|
||||||
|
if switch == true or switch == nil then
|
||||||
|
self.ReportmBar = true
|
||||||
|
else
|
||||||
|
self.ReportmBar = false
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Additionally report free text, only working with SRS(!)
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string text The text to report at the end of the ATIS message, e.g. runway closure, warnings, etc.
|
||||||
|
-- @return #ATIS self
|
||||||
|
function ATIS:SetAdditionalInformation(text)
|
||||||
|
self.AdditionalInformation = text
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Suppresses QFE readout. Default is to report both QNH and QFE.
|
--- Suppresses QFE readout. Default is to report both QNH and QFE.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @return #ATIS self
|
-- @return #ATIS self
|
||||||
@ -1328,6 +1383,9 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local mBarqnh = qnh
|
||||||
|
local mBarqfe = qfe
|
||||||
|
|
||||||
-- Convert to inHg.
|
-- Convert to inHg.
|
||||||
if self.PmmHg then
|
if self.PmmHg then
|
||||||
qfe = UTILS.hPa2mmHg( qfe )
|
qfe = UTILS.hPa2mmHg( qfe )
|
||||||
@ -1778,6 +1836,8 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
--self:I("Line 1811")
|
||||||
|
--self:I(alltext)
|
||||||
|
|
||||||
-- Visibility
|
-- Visibility
|
||||||
if self.metric then
|
if self.metric then
|
||||||
@ -1795,7 +1855,10 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
--self:I("Line 1830")
|
||||||
|
--self:I(alltext)
|
||||||
|
|
||||||
|
subtitle = ""
|
||||||
-- Weather phenomena
|
-- Weather phenomena
|
||||||
local wp = false
|
local wp = false
|
||||||
local wpsub = ""
|
local wpsub = ""
|
||||||
@ -1895,8 +1958,11 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
--self:I("Line 1932")
|
||||||
|
|
||||||
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
--self:I(alltext)
|
||||||
|
subtitle = ""
|
||||||
-- Temperature
|
-- Temperature
|
||||||
if self.TDegF then
|
if self.TDegF then
|
||||||
if temperature < 0 then
|
if temperature < 0 then
|
||||||
@ -1924,7 +1990,9 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
self:Transmission( ATIS.Sound.DegreesCelsius, 0.2 )
|
self:Transmission( ATIS.Sound.DegreesCelsius, 0.2 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--self:I("Line 1962")
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
--self:I(alltext)
|
||||||
|
|
||||||
-- Dew point
|
-- Dew point
|
||||||
if self.TDegF then
|
if self.TDegF then
|
||||||
@ -1953,6 +2021,8 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
self:Transmission( ATIS.Sound.DegreesCelsius, 0.2 )
|
self:Transmission( ATIS.Sound.DegreesCelsius, 0.2 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--self:I("Line 1992")
|
||||||
|
--self:I(alltext)
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
-- Altimeter QNH/QFE.
|
-- Altimeter QNH/QFE.
|
||||||
@ -1977,6 +2047,15 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.ReportmBar and not self.metric then
|
||||||
|
if self.qnhonly then
|
||||||
|
subtitle = string.format( "%s;\nAltimeter %d hPa", subtitle, mBarqnh )
|
||||||
|
else
|
||||||
|
subtitle = string.format( "%s;\nAltimeter: QNH %d, QFE %d hPa", subtitle, mBarqnh, mBarqfe)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local _ALTIMETER = subtitle
|
local _ALTIMETER = subtitle
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
self:Transmission( ATIS.Sound.Altimeter, 1.0, subtitle )
|
self:Transmission( ATIS.Sound.Altimeter, 1.0, subtitle )
|
||||||
@ -2009,6 +2088,8 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--self:I("Line 2049")
|
||||||
|
--self:I(alltext)
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
|
||||||
-- Active runway.
|
-- Active runway.
|
||||||
@ -2136,7 +2217,9 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- ILS
|
-- ILS
|
||||||
|
--self:I({ils=self.ils})
|
||||||
local ils=self:GetNavPoint(self.ils, runwayLanding, rwyLandingLeft)
|
local ils=self:GetNavPoint(self.ils, runwayLanding, rwyLandingLeft)
|
||||||
|
--self:I({ils=ils,runwayLanding=runwayLanding, rwyLandingLeft=rwyLandingLeft})
|
||||||
if ils then
|
if ils then
|
||||||
subtitle = string.format( "ILS frequency %.2f MHz", ils.frequency )
|
subtitle = string.format( "ILS frequency %.2f MHz", ils.frequency )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
@ -2151,6 +2234,7 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
self:Transmission( ATIS.Sound.MegaHertz, 0.2 )
|
self:Transmission( ATIS.Sound.MegaHertz, 0.2 )
|
||||||
end
|
end
|
||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
|
--self:I(alltext)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Outer NDB
|
-- Outer NDB
|
||||||
@ -2241,6 +2325,11 @@ function ATIS:onafterBroadcast( From, Event, To )
|
|||||||
alltext = alltext .. ";\n" .. subtitle
|
alltext = alltext .. ";\n" .. subtitle
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- additional info, if any
|
||||||
|
if self.useSRS and self.AdditionalInformation then
|
||||||
|
alltext = alltext .. ";\n"..self.AdditionalInformation
|
||||||
|
end
|
||||||
|
|
||||||
-- Advice on initial...
|
-- Advice on initial...
|
||||||
subtitle = string.format( "Advise on initial contact, you have information %s", NATO )
|
subtitle = string.format( "Advise on initial contact, you have information %s", NATO )
|
||||||
if not self.useSRS then
|
if not self.useSRS then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user