mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
MSRS additions
This commit is contained in:
@@ -505,6 +505,7 @@ function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,G
|
|||||||
|
|
||||||
if PathToCredentials then
|
if PathToCredentials then
|
||||||
_MESSAGESRS.MSRS:SetProviderOptionsGoogle(PathToCredentials)
|
_MESSAGESRS.MSRS:SetProviderOptionsGoogle(PathToCredentials)
|
||||||
|
_MESSAGESRS.MSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
|
|
||||||
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
|
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
|
||||||
|
|||||||
@@ -1553,9 +1553,10 @@ function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
|||||||
self.msrs:SetLabel("ATIS")
|
self.msrs:SetLabel("ATIS")
|
||||||
if GoogleKey then
|
if GoogleKey then
|
||||||
self.msrs:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
self.msrs:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
||||||
|
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
-- Pre-configured Google?
|
-- Pre-configured Google?
|
||||||
if self.msrs:GetProvider() == MSRS.Provider.GOOGLE then
|
if (not GoogleKey) and self.msrs:GetProvider() == MSRS.Provider.GOOGLE then
|
||||||
voice = Voice or MSRS.poptions.gcloud.voice
|
voice = Voice or MSRS.poptions.gcloud.voice
|
||||||
end
|
end
|
||||||
self.msrs:SetVoice(voice)
|
self.msrs:SetVoice(voice)
|
||||||
@@ -1571,6 +1572,20 @@ function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set an alternative provider to the one set in your MSRS configuration file.
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @param #string Provider The provider to use. Known providers are: `MSRS.Provider.WINDOWS` and `MSRS.Provider.GOOGLE`
|
||||||
|
-- @return #ATIS self
|
||||||
|
function ATIS:SetSRSProvider(Provider)
|
||||||
|
self:T(self.lid.."SetSRSProvider")
|
||||||
|
if self.msrs then
|
||||||
|
self.msrs:SetProvider(Provider)
|
||||||
|
else
|
||||||
|
MESSAGE:New(self.lid.."Set up SRS first before trying to change the provider!",30,"ATIS"):ToAll():ToLog()
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set the time interval between radio queue updates.
|
--- Set the time interval between radio queue updates.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @param #number TimeInterval Interval in seconds. Default 5 sec.
|
-- @param #number TimeInterval Interval in seconds. Default 5 sec.
|
||||||
|
|||||||
@@ -183,8 +183,10 @@ end
|
|||||||
-- @param #number Port SRS port. Default 5002.
|
-- @param #number Port SRS port. Default 5002.
|
||||||
-- @return #RADIOQUEUE self The RADIOQUEUE object.
|
-- @return #RADIOQUEUE self The RADIOQUEUE object.
|
||||||
function RADIOQUEUE:SetSRS(PathToSRS, Port)
|
function RADIOQUEUE:SetSRS(PathToSRS, Port)
|
||||||
self.msrs=MSRS:New(PathToSRS, self.frequency/1000000, self.modulation)
|
local path = PathToSRS or MSRS.path
|
||||||
self.msrs:SetPort(Port)
|
local port = Port or MSRS.port
|
||||||
|
self.msrs=MSRS:New(path, self.frequency/1000000, self.modulation)
|
||||||
|
self.msrs:SetPort(port)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -918,12 +918,16 @@ end
|
|||||||
-- @param #string Provider
|
-- @param #string Provider
|
||||||
-- @return #MSRS self
|
-- @return #MSRS self
|
||||||
function MSRS:SetProvider(Provider)
|
function MSRS:SetProvider(Provider)
|
||||||
self:F( {Provider=Provider} )
|
BASE:F( {Provider=Provider} )
|
||||||
self.provider = Provider or MSRS.Provider.WINDOWS
|
if self then
|
||||||
return self
|
self.provider = Provider or MSRS.Provider.WINDOWS
|
||||||
|
return self
|
||||||
|
else
|
||||||
|
MSRS.provider = Provider or MSRS.Provider.WINDOWS
|
||||||
|
end
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Get provider.
|
--- Get provider.
|
||||||
-- @param #MSRS self
|
-- @param #MSRS self
|
||||||
-- @return #MSRS self
|
-- @return #MSRS self
|
||||||
@@ -940,7 +944,7 @@ end
|
|||||||
-- @param #string Region Region to use.
|
-- @param #string Region Region to use.
|
||||||
-- @return #MSRS.ProviderOptions Provider optionas table.
|
-- @return #MSRS.ProviderOptions Provider optionas table.
|
||||||
function MSRS:SetProviderOptions(Provider, CredentialsFile, AccessKey, SecretKey, Region)
|
function MSRS:SetProviderOptions(Provider, CredentialsFile, AccessKey, SecretKey, Region)
|
||||||
self:F( {Provider, CredentialsFile, AccessKey, SecretKey, Region} )
|
BASE:F( {Provider, CredentialsFile, AccessKey, SecretKey, Region} )
|
||||||
local option=MSRS._CreateProviderOptions(Provider, CredentialsFile, AccessKey, SecretKey, Region)
|
local option=MSRS._CreateProviderOptions(Provider, CredentialsFile, AccessKey, SecretKey, Region)
|
||||||
|
|
||||||
if self then
|
if self then
|
||||||
|
|||||||
Reference in New Issue
Block a user