INTEL - add platform type for AIR contacts (Foxbat ... ), defaults to Bogey for AIR and Unknown for everything else

SRS- added option to set a label for the SRS radio overlay
OpsGroup - added options to use said label, and option to override a frequency for an SRS (TTS) sender
This commit is contained in:
Applevangelist
2022-04-24 12:46:11 +02:00
parent fd5a190490
commit d9f409069a
3 changed files with 44 additions and 10 deletions

View File

@@ -123,6 +123,7 @@ INTEL = {
-- @field Ops.Target#TARGET target The Target attached to this contact.
-- @field #string recce The name of the recce unit that detected this contact.
-- @field #string ctype Contact type.
-- @field #string platform [AIR] Contact platform name, e.g. Foxbat, Flanker_E, defaults to Bogey if unknown
--- Cluster info.
-- @type INTEL.Cluster
@@ -153,7 +154,7 @@ INTEL.Ctype={
--- INTEL class version.
-- @field #string version
INTEL.version="0.3.0"
INTEL.version="0.3.1"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ToDo list
@@ -866,7 +867,12 @@ function INTEL:_CreateContact(Positionable, RecceName)
item.isground = group:IsGround() or false
item.isship = group:IsShip() or false
item.isStatic=false
if group:IsAir() then
item.platform=group:GetNatoReportingName()
else
-- TODO optionally add ground types?
item.platform="Unknown"
end
if item.category==Group.Category.AIRPLANE or item.category==Group.Category.HELICOPTER then
item.ctype=INTEL.Ctype.AIRCRAFT
elseif item.category==Group.Category.GROUND or item.category==Group.Category.TRAIN then

View File

@@ -1916,14 +1916,16 @@ end
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
-- @param #number Port SRS port. Default 5002.
-- @param #string PathToGoogleKey Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`.
-- @param #string Label Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed!
-- @return #OPSGROUP self
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey)
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label)
self.useSRS=true
self.msrs=MSRS:New(PathToSRS, self.frequency, self.modulation)
self.msrs:SetGender(Gender)
self.msrs:SetCulture(Culture)
self.msrs:SetVoice(Voice)
self.msrs:SetPort(Port)
self.msrs:SetLabel(Label)
if PathToGoogleKey then
self.msrs:SetGoogle(PathToGoogleKey)
end
@@ -1936,8 +1938,9 @@ end
-- @param #string Text Text of transmission.
-- @param #number Delay Delay in seconds before the transmission is started.
-- @param #boolean SayCallsign If `true`, the callsign is prepended to the given text. Default `false`.
-- @param #number Frequency Override sender frequency, helpful when you need multiple radios from the same sender. Default is the frequency set for the OpsGroup.
-- @return #OPSGROUP self
function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign)
function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign, Frequency)
if Delay and Delay>0 then
self:ScheduleOnce(Delay, OPSGROUP.RadioTransmission, self, Text, 0, SayCallsign)
@@ -1946,8 +1949,12 @@ function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign)
if self.useSRS and self.msrs then
local freq, modu, radioon=self:GetRadio()
self.msrs:SetFrequencies(freq)
if Frequency then
self.msrs:SetFrequencies(Frequency)
else
self.msrs:SetFrequencies(freq)
end
self.msrs:SetModulations(modu)
if SayCallsign then
@@ -1956,7 +1963,7 @@ function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign)
end
-- Debug info.
self:T(self.lid..string.format("Radio transmission on %.3f MHz %s: %s", freq, UTILS.GetModulationName(modu), Text))
self:I(self.lid..string.format("Radio transmission on %.3f MHz %s: %s", freq, UTILS.GetModulationName(modu), Text))
self.msrs:PlayText(Text)
end