mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
commit
3f296554ed
@ -433,3 +433,13 @@ function MESSAGE:ToAllIf( Condition )
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Sends a MESSAGE to DCS log file.
|
||||||
|
-- @param #MESSAGE self
|
||||||
|
-- @return #MESSAGE self
|
||||||
|
function MESSAGE:ToLog()
|
||||||
|
|
||||||
|
env.info(self.MessageCategory .. self.MessageText:gsub( "\n$", "" ):gsub( "\n$", "" ))
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|||||||
@ -3038,6 +3038,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2
|
|||||||
if type( Callsign ) ~= "number" then -- blue callsign
|
if type( Callsign ) ~= "number" then -- blue callsign
|
||||||
Callsign[2] = ((SpawnIndex - 1) % 10) + 1
|
Callsign[2] = ((SpawnIndex - 1) % 10) + 1
|
||||||
local CallsignName = SpawnTemplate.units[UnitID].callsign["name"] -- #string
|
local CallsignName = SpawnTemplate.units[UnitID].callsign["name"] -- #string
|
||||||
|
CallsignName = string.match(CallsignName,"^(%a+)") -- 2.8 - only the part w/o numbers
|
||||||
local CallsignLen = CallsignName:len()
|
local CallsignLen = CallsignName:len()
|
||||||
SpawnTemplate.units[UnitID].callsign["name"] = CallsignName:sub( 1, CallsignLen ) .. SpawnTemplate.units[UnitID].callsign[2] .. SpawnTemplate.units[UnitID].callsign[3]
|
SpawnTemplate.units[UnitID].callsign["name"] = CallsignName:sub( 1, CallsignLen ) .. SpawnTemplate.units[UnitID].callsign[2] .. SpawnTemplate.units[UnitID].callsign[3]
|
||||||
else
|
else
|
||||||
|
|||||||
@ -5671,6 +5671,9 @@ function RAT:_ATCClearForLanding(airport, flight)
|
|||||||
|
|
||||||
-- Debug message.
|
-- Debug message.
|
||||||
local text1=string.format("ATC %s: Flight %s cleared for landing (flag=%d).", airport, flight, flagvalue)
|
local text1=string.format("ATC %s: Flight %s cleared for landing (flag=%d).", airport, flight, flagvalue)
|
||||||
|
if string.find(flight,"#") then
|
||||||
|
flight = string.match(flight,"^(.+)#")
|
||||||
|
end
|
||||||
local text2=string.format("ATC %s: Flight %s you are cleared for landing.", airport, flight)
|
local text2=string.format("ATC %s: Flight %s you are cleared for landing.", airport, flight)
|
||||||
BASE:T( RAT.id..text1)
|
BASE:T( RAT.id..text1)
|
||||||
MESSAGE:New(text2, 10):ToAllIf(RAT.ATC.messages)
|
MESSAGE:New(text2, 10):ToAllIf(RAT.ATC.messages)
|
||||||
@ -5713,6 +5716,9 @@ function RAT:_ATCFlightLanded(name)
|
|||||||
local text1=string.format("ATC %s: Flight %s landed. Tholding = %i:%02d, Tfinal = %i:%02d.", dest, name, Thold/60, Thold%60, Tfinal/60, Tfinal%60)
|
local text1=string.format("ATC %s: Flight %s landed. Tholding = %i:%02d, Tfinal = %i:%02d.", dest, name, Thold/60, Thold%60, Tfinal/60, Tfinal%60)
|
||||||
local text2=string.format("ATC %s: Number of flights still on final %d.", dest, RAT.ATC.airport[dest].Nonfinal)
|
local text2=string.format("ATC %s: Number of flights still on final %d.", dest, RAT.ATC.airport[dest].Nonfinal)
|
||||||
local text3=string.format("ATC %s: Traffic report: Number of planes landed in total %d. Flights/hour = %3.2f.", dest, RAT.ATC.airport[dest].traffic, TrafficPerHour)
|
local text3=string.format("ATC %s: Traffic report: Number of planes landed in total %d. Flights/hour = %3.2f.", dest, RAT.ATC.airport[dest].traffic, TrafficPerHour)
|
||||||
|
if string.find(name,"#") then
|
||||||
|
name = string.match(name,"^(.+)#")
|
||||||
|
end
|
||||||
local text4=string.format("ATC %s: Flight %s landed. Welcome to %s.", dest, name, dest)
|
local text4=string.format("ATC %s: Flight %s landed. Welcome to %s.", dest, name, dest)
|
||||||
BASE:T(RAT.id..text1)
|
BASE:T(RAT.id..text1)
|
||||||
BASE:T(RAT.id..text2)
|
BASE:T(RAT.id..text2)
|
||||||
|
|||||||
@ -93,6 +93,7 @@
|
|||||||
-- @field #number dTQueueCheck Time interval to check the radio queue. Default 5 sec or 90 sec if SRS is used.
|
-- @field #number dTQueueCheck Time interval to check the radio queue. Default 5 sec or 90 sec if SRS is used.
|
||||||
-- @field #boolean ReportmBar Report mBar/hpa even if not metric, i.e. for Mirage flights
|
-- @field #boolean ReportmBar Report mBar/hpa even if not metric, i.e. for Mirage flights
|
||||||
-- @field #boolean TransmitOnlyWithPlayers For SRS - If true, only transmit if there are alive Players.
|
-- @field #boolean TransmitOnlyWithPlayers For SRS - If true, only transmit if there are alive Players.
|
||||||
|
-- @field #string SRSText Text of the complete SRS message (if done at least once, else nil)
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde
|
--- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde
|
||||||
@ -268,6 +269,8 @@
|
|||||||
-- Unfortunately, it is not possible to determine the duration of the complete transmission. So once the transmission is finished, there might be some radio silence before
|
-- Unfortunately, it is not possible to determine the duration of the complete transmission. So once the transmission is finished, there might be some radio silence before
|
||||||
-- the next iteration begins. You can fine tune the time interval between transmissions with the @{#ATIS.SetQueueUpdateTime}() function. The default interval is 90 seconds.
|
-- the next iteration begins. You can fine tune the time interval between transmissions with the @{#ATIS.SetQueueUpdateTime}() function. The default interval is 90 seconds.
|
||||||
--
|
--
|
||||||
|
-- An SRS Setup-Guide can be found here: [Moose TTS Setup Guide](https://github.com/FlightControl-Master/MOOSE_GUIDES/blob/master/documents/Moose%20TTS%20Setup%20Guide.pdf)
|
||||||
|
--
|
||||||
-- # Examples
|
-- # Examples
|
||||||
--
|
--
|
||||||
-- ## Caucasus: Batumi
|
-- ## Caucasus: Batumi
|
||||||
@ -590,7 +593,7 @@ _ATIS = {}
|
|||||||
|
|
||||||
--- ATIS class version.
|
--- ATIS class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
ATIS.version = "0.9.11"
|
ATIS.version = "0.9.12"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -878,6 +881,13 @@ function ATIS:SetMapMarks( switch )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Return the complete SRS Text block, if at least generated once. Else nil.
|
||||||
|
-- @param #ATIS self
|
||||||
|
-- @return #string SRSText
|
||||||
|
function ATIS:GetSRSText()
|
||||||
|
return self.SRSText
|
||||||
|
end
|
||||||
|
|
||||||
--- Set magnetic runway headings as depicted on the runway, *e.g.* "13" for 130° or "25L" for the left runway with magnetic heading 250°.
|
--- Set magnetic runway headings as depicted on the runway, *e.g.* "13" for 130° or "25L" for the left runway with magnetic heading 250°.
|
||||||
-- @param #ATIS self
|
-- @param #ATIS self
|
||||||
-- @param #table headings Magnetic headings. Inverse (-180°) headings are added automatically. You only need to specify one heading per runway direction. "L"eft and "R" right can also be appended.
|
-- @param #table headings Magnetic headings. Inverse (-180°) headings are added automatically. You only need to specify one heading per runway direction. "L"eft and "R" right can also be appended.
|
||||||
@ -2400,6 +2410,7 @@ function ATIS:onafterReport( From, Event, To, Text )
|
|||||||
local duration = STTS.getSpeechTime(text,0.95)
|
local duration = STTS.getSpeechTime(text,0.95)
|
||||||
self.msrsQ:NewTransmission(text,duration,self.msrs,nil,2)
|
self.msrsQ:NewTransmission(text,duration,self.msrs,nil,2)
|
||||||
--self.msrs:PlayText( text )
|
--self.msrs:PlayText( text )
|
||||||
|
self.SRSText = text
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -6031,7 +6031,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
--end
|
--end
|
||||||
|
|
||||||
-- Create orbit task.
|
-- Create orbit task.
|
||||||
local DCStask=CONTROLLABLE.TaskOrbit(nil, orbitVec2, self.orbitAltitude, self.orbitSpeed, orbitRaceTrack)
|
local DCStask=CONTROLLABLE.TaskOrbit(nil, COORDINATE:NewFromVec2(orbitVec2), self.orbitAltitude, self.orbitSpeed, orbitRaceTrack)
|
||||||
|
|
||||||
-- Add DCS task.
|
-- Add DCS task.
|
||||||
table.insert(DCStasks, DCStask)
|
table.insert(DCStasks, DCStask)
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
-- @module Ops.CTLD
|
-- @module Ops.CTLD
|
||||||
-- @image OPS_CTLD.jpg
|
-- @image OPS_CTLD.jpg
|
||||||
|
|
||||||
-- Last Update October 2022
|
-- Last Update December 2022
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
@ -1078,7 +1078,7 @@ CTLD.UnitTypes = {
|
|||||||
|
|
||||||
--- CTLD class version.
|
--- CTLD class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CTLD.version="1.0.19"
|
CTLD.version="1.0.20"
|
||||||
|
|
||||||
--- Instantiate a new CTLD.
|
--- Instantiate a new CTLD.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@ -3611,6 +3611,7 @@ function CTLD:CheckDroppedBeacons()
|
|||||||
|
|
||||||
for _,_beacon in pairs (self.droppedBeacons) do
|
for _,_beacon in pairs (self.droppedBeacons) do
|
||||||
local beacon = _beacon -- #CTLD.CargoZone
|
local beacon = _beacon -- #CTLD.CargoZone
|
||||||
|
if not beacon.timestamp then beacon.timestamp = timer.getTime() end
|
||||||
local T0 = beacon.timestamp
|
local T0 = beacon.timestamp
|
||||||
if timer.getTime() - T0 > timeout then
|
if timer.getTime() - T0 > timeout then
|
||||||
local name = beacon.name
|
local name = beacon.name
|
||||||
|
|||||||
@ -1409,7 +1409,7 @@ PLAYERTASKCONTROLLER.Messages = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASKCONTROLLER.version="0.1.49"
|
PLAYERTASKCONTROLLER.version="0.1.50"
|
||||||
|
|
||||||
--- Create and run a new TASKCONTROLLER instance.
|
--- Create and run a new TASKCONTROLLER instance.
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
@ -2651,6 +2651,7 @@ end
|
|||||||
--- [User] Add a PLAYERTASK object to the list of (open) tasks
|
--- [User] Add a PLAYERTASK object to the list of (open) tasks
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @param Ops.PlayerTask#PLAYERTASK PlayerTask
|
-- @param Ops.PlayerTask#PLAYERTASK PlayerTask
|
||||||
|
-- @param #boolean Silent If true, make no "has new task" announcement
|
||||||
-- @return #PLAYERTASKCONTROLLER self
|
-- @return #PLAYERTASKCONTROLLER self
|
||||||
-- @usage
|
-- @usage
|
||||||
-- Example to create a PLAYERTASK of type CTLD and give Players 10 minutes to complete:
|
-- Example to create a PLAYERTASK of type CTLD and give Players 10 minutes to complete:
|
||||||
@ -2671,13 +2672,15 @@ end
|
|||||||
-- )
|
-- )
|
||||||
--
|
--
|
||||||
-- taskmanager:AddPlayerTaskToQueue(PlayerTask)
|
-- taskmanager:AddPlayerTaskToQueue(PlayerTask)
|
||||||
function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask)
|
function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask,Silent)
|
||||||
self:T(self.lid.."AddPlayerTaskToQueue")
|
self:T(self.lid.."AddPlayerTaskToQueue")
|
||||||
if PlayerTask and PlayerTask.ClassName and PlayerTask.ClassName == "PLAYERTASK" then
|
if PlayerTask and PlayerTask.ClassName and PlayerTask.ClassName == "PLAYERTASK" then
|
||||||
PlayerTask:_SetController(self)
|
PlayerTask:_SetController(self)
|
||||||
PlayerTask:SetCoalition(self.Coalition)
|
PlayerTask:SetCoalition(self.Coalition)
|
||||||
self.TaskQueue:Push(PlayerTask)
|
self.TaskQueue:Push(PlayerTask)
|
||||||
|
if not Silent then
|
||||||
self:__TaskAdded(10,PlayerTask)
|
self:__TaskAdded(10,PlayerTask)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
self:E(self.lid.."***** NO valid PAYERTASK object sent!")
|
self:E(self.lid.."***** NO valid PAYERTASK object sent!")
|
||||||
end
|
end
|
||||||
|
|||||||
@ -512,7 +512,7 @@ function COMMANDCENTER:AssignTask( TaskGroup )
|
|||||||
|
|
||||||
if Task then
|
if Task then
|
||||||
|
|
||||||
self:I( "Assigning task " .. Task:GetName() .. " using auto assign method " .. self.AutoAssignMethod .. " to " .. TaskGroup:GetName() .. " with task priority " .. AssignPriority )
|
self:T( "Assigning task " .. Task:GetName() .. " using auto assign method " .. self.AutoAssignMethod .. " to " .. TaskGroup:GetName() .. " with task priority " .. AssignPriority )
|
||||||
|
|
||||||
if not self.AutoAcceptTasks == true then
|
if not self.AutoAcceptTasks == true then
|
||||||
Task:SetAutoAssignMethod( ACT_ASSIGN_MENU_ACCEPT:New( Task.TaskBriefing ) )
|
Task:SetAutoAssignMethod( ACT_ASSIGN_MENU_ACCEPT:New( Task.TaskBriefing ) )
|
||||||
|
|||||||
@ -413,7 +413,7 @@ end
|
|||||||
-- @param Wrapper.Group#GROUP PlayerGroup The GROUP of the player joining the Mission.
|
-- @param Wrapper.Group#GROUP PlayerGroup The GROUP of the player joining the Mission.
|
||||||
-- @return #boolean true if Unit is part of a Task in the Mission.
|
-- @return #boolean true if Unit is part of a Task in the Mission.
|
||||||
function MISSION:JoinUnit( PlayerUnit, PlayerGroup )
|
function MISSION:JoinUnit( PlayerUnit, PlayerGroup )
|
||||||
self:I( { Mission = self:GetName(), PlayerUnit = PlayerUnit, PlayerGroup = PlayerGroup } )
|
self:T( { Mission = self:GetName(), PlayerUnit = PlayerUnit, PlayerGroup = PlayerGroup } )
|
||||||
|
|
||||||
local PlayerUnitAdded = false
|
local PlayerUnitAdded = false
|
||||||
|
|
||||||
@ -571,7 +571,7 @@ do -- Group Assignment
|
|||||||
local MissionGroupName = MissionGroup:GetName()
|
local MissionGroupName = MissionGroup:GetName()
|
||||||
|
|
||||||
self.AssignedGroups[MissionGroupName] = MissionGroup
|
self.AssignedGroups[MissionGroupName] = MissionGroup
|
||||||
self:I( string.format( "Mission %s is assigned to %s", MissionName, MissionGroupName ) )
|
self:T( string.format( "Mission %s is assigned to %s", MissionName, MissionGroupName ) )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -698,7 +698,7 @@ end
|
|||||||
function MISSION:AddTask( Task )
|
function MISSION:AddTask( Task )
|
||||||
|
|
||||||
local TaskName = Task:GetTaskName()
|
local TaskName = Task:GetTaskName()
|
||||||
self:I( { "==> Adding TASK ", MissionName = self:GetName(), TaskName = TaskName } )
|
self:T( { "==> Adding TASK ", MissionName = self:GetName(), TaskName = TaskName } )
|
||||||
|
|
||||||
self.Tasks[TaskName] = Task
|
self.Tasks[TaskName] = Task
|
||||||
|
|
||||||
@ -717,7 +717,7 @@ end
|
|||||||
function MISSION:RemoveTask( Task )
|
function MISSION:RemoveTask( Task )
|
||||||
|
|
||||||
local TaskName = Task:GetTaskName()
|
local TaskName = Task:GetTaskName()
|
||||||
self:I( { "<== Removing TASK ", MissionName = self:GetName(), TaskName = TaskName } )
|
self:T( { "<== Removing TASK ", MissionName = self:GetName(), TaskName = TaskName } )
|
||||||
|
|
||||||
self:F( TaskName )
|
self:F( TaskName )
|
||||||
self.Tasks[TaskName] = self.Tasks[TaskName] or { n = 0 }
|
self.Tasks[TaskName] = self.Tasks[TaskName] or { n = 0 }
|
||||||
|
|||||||
@ -1576,6 +1576,8 @@ function UTILS.GMTToLocalTimeDifference()
|
|||||||
return 3 -- Damascus is UTC+3 hours
|
return 3 -- Damascus is UTC+3 hours
|
||||||
elseif theatre==DCSMAP.MarianaIslands then
|
elseif theatre==DCSMAP.MarianaIslands then
|
||||||
return 10 -- Guam is UTC+10 hours.
|
return 10 -- Guam is UTC+10 hours.
|
||||||
|
elseif theatre==DCSMAP.Falklands then
|
||||||
|
return -3 -- Fireland is UTC-3 hours.
|
||||||
else
|
else
|
||||||
BASE:E(string.format("ERROR: Unknown Map %s in UTILS.GMTToLocal function. Returning 0", tostring(theatre)))
|
BASE:E(string.format("ERROR: Unknown Map %s in UTILS.GMTToLocal function. Returning 0", tostring(theatre)))
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@ -1368,7 +1368,7 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius,
|
|||||||
local _nspots=nspots or group:GetSize()
|
local _nspots=nspots or group:GetSize()
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:E(string.format("%s: Looking for %d parking spot(s) for aircraft of size %.1f m (x=%.1f,y=%.1f,z=%.1f) at terminal type %s.", airport, _nspots, _aircraftsize, ax, ay, az, tostring(terminaltype)))
|
self:T(string.format("%s: Looking for %d parking spot(s) for aircraft of size %.1f m (x=%.1f,y=%.1f,z=%.1f) at terminal type %s.", airport, _nspots, _aircraftsize, ax, ay, az, tostring(terminaltype)))
|
||||||
|
|
||||||
-- Table of valid spots.
|
-- Table of valid spots.
|
||||||
local validspots={}
|
local validspots={}
|
||||||
|
|||||||
@ -2395,7 +2395,7 @@ do -- Route methods
|
|||||||
-- @return DCS#Task Task.
|
-- @return DCS#Task Task.
|
||||||
-- @return #boolean If true, path on road is possible. If false, task will route the group directly to its destination.
|
-- @return #boolean If true, path on road is possible. If false, task will route the group directly to its destination.
|
||||||
function CONTROLLABLE:TaskGroundOnRoad( ToCoordinate, Speed, OffRoadFormation, Shortcut, FromCoordinate, WaypointFunction, WaypointFunctionArguments )
|
function CONTROLLABLE:TaskGroundOnRoad( ToCoordinate, Speed, OffRoadFormation, Shortcut, FromCoordinate, WaypointFunction, WaypointFunctionArguments )
|
||||||
self:I( { ToCoordinate = ToCoordinate, Speed = Speed, OffRoadFormation = OffRoadFormation, WaypointFunction = WaypointFunction, Args = WaypointFunctionArguments } )
|
self:T( { ToCoordinate = ToCoordinate, Speed = Speed, OffRoadFormation = OffRoadFormation, WaypointFunction = WaypointFunction, Args = WaypointFunctionArguments } )
|
||||||
|
|
||||||
-- Defaults.
|
-- Defaults.
|
||||||
Speed = Speed or 20
|
Speed = Speed or 20
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user