Merge pull request #2263 from FlightControl-Master/master

ATIS
This commit is contained in:
Thomas 2025-03-03 14:21:02 +01:00 committed by GitHub
commit e129eb97a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2049,12 +2049,14 @@ function ATIS:onafterBroadcast( From, Event, To )
local sunrise = coord:GetSunrise()
--self:I(sunrise)
local SUNRISE = "no time"
local NorthPolar = true
if tostring(sunrise) ~= "N/S" and tostring(sunrise) ~= "N/R" then
sunrise = UTILS.Split( sunrise, ":" )
SUNRISE = string.format( "%s%s", sunrise[1], sunrise[2] )
if self.useSRS then
SUNRISE = string.format( "%s %s %s", sunrise[1], sunrise[2], hours )
end
NorthPolar = false
end
local sunset = coord:GetSunset()
@ -2066,6 +2068,7 @@ function ATIS:onafterBroadcast( From, Event, To )
if self.useSRS then
SUNSET = string.format( "%s %s %s", sunset[1], sunset[2], hours )
end
NorthPolar = false
end
---------------------------------
@ -2405,7 +2408,7 @@ function ATIS:onafterBroadcast( From, Event, To )
local sunrise = self.gettext:GetEntry("SUNRISEAT",self.locale)
--subtitle = string.format( "Sunrise at %s local time", SUNRISE )
subtitle = string.format( sunrise, SUNRISE )
if not self.useSRS then
if not self.useSRS and NorthPolar == false then
self:Transmission( self.Sound.SunriseAt, 0.5, subtitle )
self.radioqueue:Number2Transmission( SUNRISE, nil, 0.2 )
self:Transmission( self.Sound.TimeLocal, 0.2 )
@ -2416,7 +2419,7 @@ function ATIS:onafterBroadcast( From, Event, To )
local sunset = self.gettext:GetEntry("SUNSETAT",self.locale)
--subtitle = string.format( "Sunset at %s local time", SUNSET )
subtitle = string.format( sunset, SUNSET )
if not self.useSRS then
if not self.useSRS and NorthPolar == false then
self:Transmission( self.Sound.SunsetAt, 0.5, subtitle )
self.radioqueue:Number2Transmission( SUNSET, nil, 0.5 )
self:Transmission( self.Sound.TimeLocal, 0.2 )