From 408f9d9c0ccd52fd6501fecfc9bbf96d9d390024 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 2 Nov 2023 18:16:30 +0100 Subject: [PATCH] #ATIS and #SRS --- Moose Development/Moose/Ops/ATIS.lua | 23 +++++++++++++++++-- Moose Development/Moose/Ops/FlightControl.lua | 6 ++++- Moose Development/Moose/Ops/OpsGroup.lua | 4 ++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 94bd002fc..e906c5219 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -353,6 +353,7 @@ -- DEWPOINT = "Taupunkt", -- ALTIMETER = "Hoehenmesser", -- ACTIVERUN = "Aktive Startbahn", +-- ACTIVELANDING = "Aktive Landebahn", -- LEFT = "Links", -- RIGHT = "Rechts", -- RWYLENGTH = "Startbahn", @@ -721,7 +722,8 @@ ATIS.Messages = { TEMPERATURE = "Temperature", DEWPOINT = "Dew point", ALTIMETER = "Altimeter", - ACTIVERUN = "Active runway", + ACTIVERUN = "Active runway take off", + ACTIVELANDING = "Active runway landing", LEFT = "Left", RIGHT = "Right", RWYLENGTH = "Runway length", @@ -781,6 +783,7 @@ ATIS.Messages = { DEWPOINT = "Taupunkt", ALTIMETER = "Hoehenmesser", ACTIVERUN = "Aktive Startbahn", + ACTIVELANDING = "Aktive Landebahn", LEFT = "Links", RIGHT = "Rechts", RWYLENGTH = "Startbahn", @@ -841,6 +844,7 @@ ATIS.Messages = { DEWPOINT = "Punto de rocio", ALTIMETER = "Altímetro", ACTIVERUN = "Pista activa", + ACTIVELANDING = "Pista de aterrizaje activa", LEFT = "Izquierda", RIGHT = "Derecha", RWYLENGTH = "Longitud de pista", @@ -880,7 +884,7 @@ _ATIS = {} --- ATIS class version. -- @field #string version -ATIS.version = "0.10.2" +ATIS.version = "0.10.3" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -902,6 +906,7 @@ ATIS.version = "0.10.2" -- DONE: Set magnetic variation. -- DONE: New DCS 2.7 weather presets. -- DONE: Added TextAndSound localization +-- DONE: Added SRS spelling out both take off and landing runway ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Constructor @@ -1534,6 +1539,7 @@ function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey) self.msrs:SetCoalition(self:GetCoalition()) self.msrs:SetLabel("ATIS") self.msrs:SetGoogle(GoogleKey) + self.msrs:SetCoordinate(self.airbase:GetCoordinate()) self.msrsQ = MSRSQUEUE:New("ATIS") self.msrsQ:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers) if self.dTQueueCheck<=10 then @@ -2508,6 +2514,19 @@ function ATIS:onafterBroadcast( From, Event, To ) -- Active runway. local subtitle if runwayLanding then + local actrun = self.gettext:GetEntry("ACTIVELANDING",self.locale) + --subtitle=string.format("Active runway landing %s", runwayLanding) + subtitle=string.format("%s %s", actrun, runwayTakeoff) + if rwyTakeoffLeft==true then + --subtitle=subtitle.." Left" + subtitle=subtitle.." "..self.gettext:GetEntry("LEFT",self.locale) + elseif rwyTakeoffLeft==false then + --subtitle=subtitle.." Right" + subtitle=subtitle.." "..self.gettext:GetEntry("RIGHT",self.locale) + end + alltext = alltext .. ";\n" .. subtitle + end + if runwayTakeoff then local actrun = self.gettext:GetEntry("ACTIVERUN",self.locale) --subtitle=string.format("Active runway %s", runwayLanding) subtitle=string.format("%s %s", actrun, runwayLanding) diff --git a/Moose Development/Moose/Ops/FlightControl.lua b/Moose Development/Moose/Ops/FlightControl.lua index 905b3d3fa..6d26c78f6 100644 --- a/Moose Development/Moose/Ops/FlightControl.lua +++ b/Moose Development/Moose/Ops/FlightControl.lua @@ -424,12 +424,14 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port, self.msrsTower=MSRS:New(PathToSRS, Frequency, Modulation) self.msrsTower:SetPort(self.Port) self.msrsTower:SetGoogle(GoogleKey) + self.msrsTower:SetCoordinate(self:GetCoordinate()) self:SetSRSTower() -- SRS for Pilot. self.msrsPilot=MSRS:New(PathToSRS, Frequency, Modulation) self.msrsPilot:SetPort(self.Port) self.msrsPilot:SetGoogle(GoogleKey) + self.msrsTower:SetCoordinate(self:GetCoordinate()) self:SetSRSPilot() -- Wait at least 10 seconds after last radio message before calling the next status update. @@ -4341,7 +4343,7 @@ function FLIGHTCONTROL:TransmissionPilot(Text, Flight, Delay) local text=self:_GetTextForSpeech(Text) -- MSRS instance to use. - local msrs=self.msrsPilot + local msrs=self.msrsPilot -- Sound.SRS#MSRS if Flight.useSRS and Flight.msrs then @@ -4361,6 +4363,8 @@ function FLIGHTCONTROL:TransmissionPilot(Text, Flight, Delay) end -- Add transmission to msrsqueue. + local coordinate = Flight:GetCoordinate(true) + msrs:SetCoordinate() self.msrsqueue:NewTransmission(text, nil, msrs, nil, 1, subgroups, Text, nil, self.frequency, self.modulation) end diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 3ae97c282..b5eb4079c 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -2345,6 +2345,10 @@ function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign, Frequency) local freq, modu, radioon=self:GetRadio() + local coord = self:GetCoordinate() + + self.msrs:SetCoordinate(coord) + if Frequency then self.msrs:SetFrequencies(Frequency) else