mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
MSRS additions
This commit is contained in:
parent
406dbb707a
commit
06c3ca0079
@ -1416,6 +1416,7 @@ function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number)
|
|||||||
if self.PathToGoogleKey then
|
if self.PathToGoogleKey then
|
||||||
--self.TacticalSRS:SetGoogle(self.PathToGoogleKey)
|
--self.TacticalSRS:SetGoogle(self.PathToGoogleKey)
|
||||||
self.TacticalSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
self.TacticalSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
||||||
|
self.TacticalSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
self.TacticalSRSQ = MSRSQUEUE:New("Tactical AWACS")
|
self.TacticalSRSQ = MSRSQUEUE:New("Tactical AWACS")
|
||||||
end
|
end
|
||||||
@ -2104,9 +2105,10 @@ function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey
|
|||||||
if self.PathToGoogleKey then
|
if self.PathToGoogleKey then
|
||||||
--self.AwacsSRS:SetGoogle(self.PathToGoogleKey)
|
--self.AwacsSRS:SetGoogle(self.PathToGoogleKey)
|
||||||
self.AwacsSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
self.AwacsSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
||||||
|
self.AwacsSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
-- Pre-configured Google?
|
-- Pre-configured Google?
|
||||||
if self.AwacsSRS:GetProvider() == MSRS.Provider.GOOGLE then
|
if (not PathToGoogleKey) and self.AwacsSRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||||
self.PathToGoogleKey = MSRS.poptions.gcloud.credentials
|
self.PathToGoogleKey = MSRS.poptions.gcloud.credentials
|
||||||
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
||||||
self.AccessKey = AccessKey or MSRS.poptions.gcloud.key
|
self.AccessKey = AccessKey or MSRS.poptions.gcloud.key
|
||||||
@ -3524,7 +3526,7 @@ function AWACS:_Showtask(Group)
|
|||||||
local targetstatus = currenttask.Target:GetState()
|
local targetstatus = currenttask.Target:GetState()
|
||||||
local ToDo = currenttask.ToDo
|
local ToDo = currenttask.ToDo
|
||||||
local description = currenttask.ScreenText
|
local description = currenttask.ScreenText
|
||||||
local descTTS = currenttask.ScreenText
|
local descTTS = currenttask.ScreenText
|
||||||
local callsign = Callsign
|
local callsign = Callsign
|
||||||
|
|
||||||
if self.debug then
|
if self.debug then
|
||||||
@ -3545,7 +3547,7 @@ function AWACS:_Showtask(Group)
|
|||||||
local alti = currenttask.Cluster.altitude or currenttask.Contact.altitude or currenttask.Contact.group:GetAltitude()
|
local alti = currenttask.Cluster.altitude or currenttask.Contact.altitude or currenttask.Contact.group:GetAltitude()
|
||||||
local direction, direcTTS = self:_ToStringBRA(pposition,targetpos,alti)
|
local direction, direcTTS = self:_ToStringBRA(pposition,targetpos,alti)
|
||||||
description = description .. "\nBRA "..direction
|
description = description .. "\nBRA "..direction
|
||||||
descTTS = descTTS ..";BRA "..direcTTS
|
descTTS = descTTS ..";BRA "..direcTTS
|
||||||
end
|
end
|
||||||
elseif currenttask.ToDo == AWACS.TaskDescription.ANCHOR or currenttask.ToDo == AWACS.TaskDescription.REANCHOR then
|
elseif currenttask.ToDo == AWACS.TaskDescription.ANCHOR or currenttask.ToDo == AWACS.TaskDescription.REANCHOR then
|
||||||
local targetpos = currenttask.Target:GetCoordinate()
|
local targetpos = currenttask.Target:GetCoordinate()
|
||||||
|
|||||||
@ -411,26 +411,36 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port,
|
|||||||
self:SetRunwayRepairtime()
|
self:SetRunwayRepairtime()
|
||||||
self.nosubs = false
|
self.nosubs = false
|
||||||
|
|
||||||
-- Set SRS Port
|
|
||||||
self:SetSRSPort(Port or 5002)
|
|
||||||
|
|
||||||
-- Set Callsign Options
|
-- Set Callsign Options
|
||||||
self:SetCallSignOptions(true,true)
|
self:SetCallSignOptions(true,true)
|
||||||
|
|
||||||
-- Init msrs queue.
|
-- Init msrs queue.
|
||||||
self.msrsqueue=MSRSQUEUE:New(self.alias)
|
self.msrsqueue=MSRSQUEUE:New(self.alias)
|
||||||
|
|
||||||
|
-- Init msrs bases
|
||||||
|
local path = PathToSRS or MSRS.path
|
||||||
|
local port = Port or MSRS.port or 5002
|
||||||
|
|
||||||
|
-- Set SRS Port
|
||||||
|
self:SetSRSPort(port)
|
||||||
|
|
||||||
-- SRS for Tower.
|
-- SRS for Tower.
|
||||||
self.msrsTower=MSRS:New(PathToSRS, Frequency, Modulation)
|
self.msrsTower=MSRS:New(path, Frequency, Modulation)
|
||||||
self.msrsTower:SetPort(self.Port)
|
self.msrsTower:SetPort(port)
|
||||||
self.msrsTower:SetGoogle(GoogleKey)
|
if GoogleKey then
|
||||||
|
self.msrsTower:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
||||||
|
self.msrsTower:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
|
end
|
||||||
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
||||||
self:SetSRSTower()
|
self:SetSRSTower()
|
||||||
|
|
||||||
-- SRS for Pilot.
|
-- SRS for Pilot.
|
||||||
self.msrsPilot=MSRS:New(PathToSRS, Frequency, Modulation)
|
self.msrsPilot=MSRS:New(PathToSRS, Frequency, Modulation)
|
||||||
self.msrsPilot:SetPort(self.Port)
|
self.msrsPilot:SetPort(self.Port)
|
||||||
self.msrsPilot:SetGoogle(GoogleKey)
|
if GoogleKey then
|
||||||
|
self.msrsPilot:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
||||||
|
self.msrsPilot:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
|
end
|
||||||
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
||||||
self:SetSRSPilot()
|
self:SetSRSPilot()
|
||||||
|
|
||||||
@ -633,7 +643,6 @@ function FLIGHTCONTROL:_SetSRSOptions(msrs, Gender, Culture, Voice, Volume, Labe
|
|||||||
msrs:SetVoice(Voice)
|
msrs:SetVoice(Voice)
|
||||||
msrs:SetVolume(Volume)
|
msrs:SetVolume(Volume)
|
||||||
msrs:SetLabel(Label)
|
msrs:SetLabel(Label)
|
||||||
msrs:SetGoogle(PathToGoogleCredentials)
|
|
||||||
msrs:SetCoalition(self:GetCoalition())
|
msrs:SetCoalition(self:GetCoalition())
|
||||||
msrs:SetPort(Port or self.Port or 5002)
|
msrs:SetPort(Port or self.Port or 5002)
|
||||||
end
|
end
|
||||||
@ -648,12 +657,11 @@ end
|
|||||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. See [Google Voices](https://cloud.google.com/text-to-speech/docs/voices).
|
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. See [Google Voices](https://cloud.google.com/text-to-speech/docs/voices).
|
||||||
-- @param #number Volume Volume. Default 1.0.
|
-- @param #number Volume Volume. Default 1.0.
|
||||||
-- @param #string Label Name under which SRS transmits. Default `self.alias`.
|
-- @param #string Label Name under which SRS transmits. Default `self.alias`.
|
||||||
-- @param #string PathToGoogleCredentials Path to google credentials json file.
|
|
||||||
-- @return #FLIGHTCONTROL self
|
-- @return #FLIGHTCONTROL self
|
||||||
function FLIGHTCONTROL:SetSRSTower(Gender, Culture, Voice, Volume, Label, PathToGoogleCredentials)
|
function FLIGHTCONTROL:SetSRSTower(Gender, Culture, Voice, Volume, Label)
|
||||||
|
|
||||||
if self.msrsTower then
|
if self.msrsTower then
|
||||||
self:_SetSRSOptions(self.msrsTower, Gender or "female", Culture or "en-GB", Voice, Volume, Label or self.alias, PathToGoogleCredentials)
|
self:_SetSRSOptions(self.msrsTower, Gender or "female", Culture or "en-GB", Voice, Volume, Label or self.alias)
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@ -666,12 +674,11 @@ end
|
|||||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||||
-- @param #number Volume Volume. Default 1.0.
|
-- @param #number Volume Volume. Default 1.0.
|
||||||
-- @param #string Label Name under which SRS transmits. Default "Pilot".
|
-- @param #string Label Name under which SRS transmits. Default "Pilot".
|
||||||
-- @param #string PathToGoogleCredentials Path to google credentials json file.
|
|
||||||
-- @return #FLIGHTCONTROL self
|
-- @return #FLIGHTCONTROL self
|
||||||
function FLIGHTCONTROL:SetSRSPilot(Gender, Culture, Voice, Volume, Label, PathToGoogleCredentials)
|
function FLIGHTCONTROL:SetSRSPilot(Gender, Culture, Voice, Volume, Label)
|
||||||
|
|
||||||
if self.msrsPilot then
|
if self.msrsPilot then
|
||||||
self:_SetSRSOptions(self.msrsPilot, Gender or "male", Culture or "en-US", Voice, Volume, Label or "Pilot", PathToGoogleCredentials)
|
self:_SetSRSOptions(self.msrsPilot, Gender or "male", Culture or "en-US", Voice, Volume, Label or "Pilot")
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@ -876,7 +883,7 @@ end
|
|||||||
|
|
||||||
--- Set ATIS.
|
--- Set ATIS.
|
||||||
-- @param #FLIGHTCONTROL self
|
-- @param #FLIGHTCONTROL self
|
||||||
-- @param Ops.ATIS#ATIS ATIS ATIS.
|
-- @param Ops.ATIS#ATIS Atis ATIS.
|
||||||
-- @return #FLIGHTCONTROL self
|
-- @return #FLIGHTCONTROL self
|
||||||
function FLIGHTCONTROL:SetATIS(Atis)
|
function FLIGHTCONTROL:SetATIS(Atis)
|
||||||
self.atis=Atis
|
self.atis=Atis
|
||||||
|
|||||||
@ -2314,14 +2314,17 @@ end
|
|||||||
-- @return #OPSGROUP self
|
-- @return #OPSGROUP self
|
||||||
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume)
|
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume)
|
||||||
self.useSRS=true
|
self.useSRS=true
|
||||||
self.msrs=MSRS:New(PathToSRS, self.frequency, self.modulation)
|
local path = PathToSRS or MSRS.path
|
||||||
|
local port = Port or MSRS.port
|
||||||
|
self.msrs=MSRS:New(path, self.frequency, self.modulation)
|
||||||
self.msrs:SetGender(Gender)
|
self.msrs:SetGender(Gender)
|
||||||
self.msrs:SetCulture(Culture)
|
self.msrs:SetCulture(Culture)
|
||||||
self.msrs:SetVoice(Voice)
|
self.msrs:SetVoice(Voice)
|
||||||
self.msrs:SetPort(Port)
|
self.msrs:SetPort(port)
|
||||||
self.msrs:SetLabel(Label)
|
self.msrs:SetLabel(Label)
|
||||||
if PathToGoogleKey then
|
if PathToGoogleKey then
|
||||||
self.msrs:SetGoogle(PathToGoogleKey)
|
self.msrs:SetProviderOptionsGoogle(PathToGoogleKey,PathToGoogleKey)
|
||||||
|
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
self.msrs:SetCoalition(self:GetCoalition())
|
self.msrs:SetCoalition(self:GetCoalition())
|
||||||
self.msrs:SetVolume(Volume)
|
self.msrs:SetVolume(Volume)
|
||||||
|
|||||||
@ -1517,7 +1517,13 @@ function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,V
|
|||||||
self.SRS:SetVoice(self.Voice)
|
self.SRS:SetVoice(self.Voice)
|
||||||
self.SRS:SetVolume(self.Volume)
|
self.SRS:SetVolume(self.Volume)
|
||||||
if self.PathToGoogleKey then
|
if self.PathToGoogleKey then
|
||||||
self.SRS:SetGoogle(self.PathToGoogleKey)
|
self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.PathToGoogleKey)
|
||||||
|
self.SRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
|
end
|
||||||
|
-- Pre-configured Google?
|
||||||
|
if (not PathToGoogleKey) and self.AwacsSRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||||
|
self.PathToGoogleKey = MSRS.poptions.gcloud.credentials
|
||||||
|
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
||||||
end
|
end
|
||||||
self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name)
|
self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name)
|
||||||
self.SRSQueue:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
|
self.SRSQueue:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
|
||||||
|
|||||||
@ -4034,9 +4034,10 @@ function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Cultu
|
|||||||
if self.PathToGoogleKey then
|
if self.PathToGoogleKey then
|
||||||
--self.SRS:SetGoogle(self.PathToGoogleKey)
|
--self.SRS:SetGoogle(self.PathToGoogleKey)
|
||||||
self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
||||||
|
self.SRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
-- Pre-configured Google?
|
-- Pre-configured Google?
|
||||||
if self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
|
if (not PathToGoogleKey) and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||||
self.PathToGoogleKey = MSRS.poptions.gcloud.credentials
|
self.PathToGoogleKey = MSRS.poptions.gcloud.credentials
|
||||||
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
||||||
self.AccessKey = AccessKey or MSRS.poptions.gcloud.key
|
self.AccessKey = AccessKey or MSRS.poptions.gcloud.key
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user